Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
postCreate(params) {
super.postCreate(params);
this._onToggleMediaConfig = params.onToggleMediaConfig;
this._sectionType = params.sectionType;
if (! params.delayBuilderInit) {
this._initConfigPanel();
}
// listen to when THIS SPECIFIC map gets scanned
this._scanListener = topic.subscribe('scan/maps/' + this._instanceID, lang.hitch(this, this.checkErrors));
this.initBuilderUI();
this._node.find('.media-media').attr('data-builder-invite', i18n.builder.mediaConfig.appearance.mapExtentPrompt);
}
else {
this._initConfigPanel();
//
// Image gallery invite
//
this._node.find('.img-gallery-invite').click(this._onCreateImageGallery.bind(this));
this._node.find('.img-gallery-add').tooltip({
container: 'body',
title: text.imageGallery.addImage
});
}
// we subscribe to the scan change for this SPECIFIC image only (hence the scan/image/imageID pattern).
this._scanListener = topic.subscribe('scan/images/' + this._instanceID, lang.hitch(this, this.checkErrors));
this.initBuilderUI();
}
init(params) {
if (this.inherited(arguments))
return;
if (this.global._plugin) {
this.doInit(params);
} else {
this.global.on("ready", lang.hitch(this, function (evt) {
this.doInit(params);
}));
}
}
requestCodeData: function requestCodeData(picklistName, code, field, entry, name) {
const request = this.createPicklistRequest(picklistName);
request.read({
success: lang.hitch(this, this.onRequestCodeDataSuccess, code, field, entry, name),
failure: this.onRequestCodeDataFailure,
scope: this,
});
},
onRequestCodeDataSuccess: function onRequestCodeDataSuccess(code, field, entry, name, feed) {
_getData: function _getData() {
const queryOptions = this._buildQueryOptions();
const queryExpression = this._buildQueryExpression();
const store = this.get('store');
const queryResults = store.query(queryExpression, queryOptions);
when(queryResults, lang.hitch(this, this._onQuerySuccess, queryResults), lang.hitch(this, this._onQueryError));
},
_onQuerySuccess: function _onQuerySuccess(queryResults) {
setupRightDrawer: function setupRightDrawer() {
const drawer = App.getView('right_drawer');
if (drawer) {
lang.mixin(drawer, this._createActions());
drawer.setLayout(this.createRightDrawerLayout());
drawer.getGroupForEntry = lang.hitch(this, function getGroupForRightDrawerEntry(entry) {
return this.getGroupForRightDrawerEntry(entry);
});
if (this.rebuildWidgets) {
App.viewSettingsModal.element.on('close', () => {
if (this._hasChangedIndexPrefs) {
this.rebuildWidgets();
this._hasChangedIndexPrefs = false;
}
});
}
}
},
unloadRightDrawer: function unloadRightDrawer() {
_getData: function _getData() {
const queryOptions = this._buildQueryOptions();
const queryExpression = this._buildQueryExpression();
const model = App.ModelManager.getModel('RecentlyViewed', MODEL_TYPES.OFFLINE);
const queryResults = model.getEntries(queryExpression, queryOptions);
when(queryResults, lang.hitch(this, this._onQuerySuccessCount, queryResults), lang.hitch(this, this._onQueryError));
},
_onQuerySuccessCount: function _onQuerySuccessCount(results) {
query: function (query, options) {
switch (query.CountBy) {
case "Year":
case "Quarter":
case "Month":
case "Day":
query.Interval = query.CountBy;
query.CountBy = "Date";
break;
}
var deferredResults = new Deferred();
deferredResults.total = new Deferred();
DFUSpace({
request: query
}).then(lang.hitch(this, function (response) {
var data = [];
if (lang.exists("DFUSpaceResponse.DFUSpaceItems.DFUSpaceItem", response)) {
arrayUtil.forEach(response.DFUSpaceResponse.DFUSpaceItems.DFUSpaceItem, function (item, idx) {
data.push(lang.mixin(item, {
__hpcc_id: item.Name
}));
}, this);
}
if (options.sort && options.sort.length) {
data.sort(function (_l, _r) {
var l = _l[options.sort[0].attribute];
var r = _r[options.sort[0].attribute];
if (l === r) {
return 0;
}
switch (options.sort[0].attribute) {
requestData: function requestData() {
$(this.domNode).addClass('list-loading');
const request = this.createRequest();
const entry = this.createSearchEntry();
request.execute(entry, {
success: lang.hitch(this, this.onRequestDataSuccess),
failture: lang.hitch(this, this.onRequestDataFailure),
});
},
navigateToDetailView: function navigateToDetailView(key, type) {