Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
? getSelection({
state,
windowType: props.parentWindowType,
viewId: props.parentDefaultViewId,
})
: NO_SELECTION,
modal: state.windowHandler.modal,
});
const NO_SELECTION = [];
const NO_VIEW = {};
const PANEL_WIDTHS = ['1', '.2', '4'];
const GEO_PANEL_STATES = ['grid', 'all', 'map'];
// for mobile devices we only want to show either map or grid
if (currentDevice.type === 'mobile' || currentDevice.type === 'tablet') {
GEO_PANEL_STATES.splice(1, 1);
}
const filtersToMap = function(filtersArray) {
let filtersMap = Map();
if (filtersArray && filtersArray.length) {
filtersArray.forEach(filter => {
filtersMap = filtersMap.set(filter.filterId, filter);
});
}
return filtersMap;
};
const doesSelectionExist = function({
data,
constructor(props) {
super(props);
const { defaultViewId, defaultPage, defaultSort } = props;
this.pageLength =
currentDevice.type === 'mobile' || currentDevice.type === 'tablet'
? 9999
: 100;
this.supportAttribute = false;
this.state = {
data: null, // view result (result, firstRow, pageLength etc)
layout: null,
pageColumnInfosByFieldName: null,
toggleWidth: 0,
viewId: defaultViewId,
page: defaultPage || 1,
sort: defaultSort,
filtersActive: Map(),
initialValuesNulled: Map(),
clickOutsideLock: true,
isShowIncluded: false,
constructor(props) {
super(props);
let val = 400;
if (currentDevice.type === 'mobile') {
val = 300;
}
this.width = val;
this.height = val;
}
componentDidMount() {
onClose={val => {
const value = typeof val !== 'undefined' ? val : false;
this.scanBarcode(value);
if (currentDevice.type === 'mobile') {
closeOverlay();
}
}}
/>
modalType,
tabId,
rowId,
isAdvanced,
viewId,
viewDocumentIds,
dataId,
triggerField,
parentViewId,
parentViewSelectedIds,
childViewId,
childViewSelectedIds,
staticModalType
) {
const isMobile =
currentDevice.type === 'mobile' || currentDevice.type === 'tablet';
if (isMobile) {
toggleFullScreen();
}
return {
type: OPEN_MODAL,
windowType: windowId,
tabId: tabId,
rowId: rowId,
viewId: viewId,
dataId: dataId,
title: title,
isAdvanced: isAdvanced,
viewDocumentIds: viewDocumentIds,
triggerField: triggerField,
constructor(props) {
super(props);
this.deviceType = currentDevice.type;
}
export function shouldRenderColumn(column) {
if (
!column.restrictToMediaTypes ||
column.restrictToMediaTypes.length === 0
) {
return true;
}
const deviceType = currentDevice.type;
let mediaType = 'tablet';
if (deviceType === 'mobile') {
mediaType = 'phone';
} else if (deviceType === 'desktop') {
mediaType = 'screen';
}
return column.restrictToMediaTypes.indexOf(mediaType) !== -1;
}