Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
del (key) {
objectpath.del(this.data, key)
this.handler.changed([key])
}
// tests path existence
export default function reducer (state = initialState, action) {
state = Object.assign({}, state);
const { id, data } = action;
switch (action.type) {
case PDR:
set(state, ['map', id, 'inflight'], false);
set(state, ['map', id, 'data'], assignDate(data));
// https://github.com/nasa/cumulus-dashboard/issues/284
del(state, ['deleted', id]);
break;
case PDR_INFLIGHT:
set(state, ['map', id, 'inflight'], true);
break;
case PDR_ERROR:
set(state, ['map', id, 'inflight'], false);
set(state, ['map', id, 'error'], action.error);
break;
case PDRS:
set(state, ['list', 'data'], data.results);
set(state, ['list', 'meta'], assignDate(data.meta));
set(state, ['list', 'inflight'], false);
set(state, ['list', 'error'], false);
break;
case PDRS_INFLIGHT:
export default function reducer (state = initialState, action) {
state = Object.assign({}, state);
const { id, data } = action;
switch (action.type) {
case COLLECTION:
const colName = id.split('___');
const collection = data.results.find(function (element) {
return element.name === colName[0];
});
set(state, ['map', id, 'inflight'], false);
set(state, ['map', id, 'data'], assignDate(collection));
del(state, ['deleted', id]);
break;
case COLLECTION_INFLIGHT:
set(state, ['map', id, 'inflight'], true);
break;
case COLLECTION_ERROR:
set(state, ['map', id, 'inflight'], false);
set(state, ['map', id, 'error'], action.error);
break;
case COLLECTION_APPLYWORKFLOW:
set(state, ['executed', id, 'status'], 'success');
set(state, ['executed', id, 'error'], null);
break;
case COLLECTION_APPLYWORKFLOW_INFLIGHT:
set(state, ['executed', id, 'status'], 'inflight');
break;
unregister(id = '') {
const path = Array.isArray(id) ? id : id.split('.');
op.del(this.handles, path);
this._update();
}
this.removeConfigParam = function*(param) {
if(!!param) {
objectPath.del(config, param);
yield this.writeConfigToDb('coontiConfiguration', config);
yield coonti.fireEvent('Coonti-Config-Changed');
return true;
}
return false;
};
this.setState((prev) => {
OPath.del(prev.fieldsValues, fieldName)
this.removeFieldStatus(prev, fieldName, removeChildStatus)
return { ...prev }
}, () => {
this.updateFormStatus().then(() => resolve())
? Object.keys(objectCacheData[ROOT]).forEach(key => del(objectCacheData, [ROOT, key]))
: del(objectCacheData, path)
.forEach(path => path.length === 1 && path[0] === ROOT
? Object.keys(objectCacheData[ROOT]).forEach(key => del(objectCacheData, [ROOT, key]))
: del(objectCacheData, path)
)
static remove(key) {
debug('remove %s', key)
var currentConfig = this.get();
objectPath.del(currentConfig, key);
fs.writeFileSync(this.getFilename(), JSON.stringify(currentConfig, null, 4));
}
}
function removeAllEvents (entityId) {
keypath.del(handlers, [entityId])
}