Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.handleSelectChange = newOptions => {
const item = find(newOptions, option => {
return option.isSelected;
});
if (!this.opts.onchange) {
return;
}
// this.opts.valを空にする。
let ret = {};
ret[anyOfKey] = item.value;
// 値がundefinedのkeyを削除する。
forOwn(ret, (val, key) => {
if (isUndefined(val)) {
delete ret[key];
}
});
if (!size(ret)) {
ret = undefined;
const target = find(this.columns, column => {
return (column.key === key);
});
if (!!target) {
target.isSelected = newIsSelected;
}
// 全て未選択の時はボタン非活性化。
if (!find(this.columns, column => {
return column.isSelected;
})) {
this.isApplyButtonDisabled = true;
} else {
this.isApplyButtonDisabled = false;
}
// 全て選択されている時は全選択ボタン活性化。
if (find(this.columns, column => {
return !column.isSelected;
})) {
this.isAllSelected = false;
} else {
this.isAllSelected = true;
}
this.update();
};
this.handleItemChange = (newIsSelected, key) => {
const target = find(this.columns, column => {
return (column.key === key);
});
if (!!target) {
target.isSelected = newIsSelected;
}
// 全て未選択の時はボタン非活性化。
if (!find(this.columns, column => {
return column.isSelected;
})) {
this.isApplyButtonDisabled = true;
} else {
this.isApplyButtonDisabled = false;
}
// 全て選択されている時は全選択ボタン活性化。
if (find(this.columns, column => {
return !column.isSelected;
all: (state, viron) => {
// メニューのカテゴライズ。下位互換のため、dashboardとmanageは必須項目とする。
if (!!viron) {
viron.sections = viron.sections || [];
if (!find(viron.sections, section => {
return (section.id === 'manage');
})) {
viron.sections = combine([{ id: 'manage', label: i18n.t('word.manage') }], viron.sections);
}
if (!find(viron.sections, section => {
return (section.id === 'dashboard');
})) {
viron.sections = combine([{ id: 'dashboard', label: i18n.t('word.dashboard') }], viron.sections);
}
}
state.viron = viron;
return ['viron'];
}
});
all: (state, viron) => {
// メニューのカテゴライズ。下位互換のため、dashboardとmanageは必須項目とする。
if (!!viron) {
viron.sections = viron.sections || [];
if (!find(viron.sections, section => {
return (section.id === 'manage');
})) {
viron.sections = combine([{ id: 'manage', label: i18n.t('word.manage') }], viron.sections);
}
if (!find(viron.sections, section => {
return (section.id === 'dashboard');
})) {
viron.sections = combine([{ id: 'dashboard', label: i18n.t('word.dashboard') }], viron.sections);
}
}
state.viron = viron;
return ['viron'];
}
});
forEach(pages, page => {
const targetSection = find(menu, section => {
return (section.id === page.section);
});
const groupName = page.group;
const isIndependent = !groupName;
if (isIndependent) {
targetSection.groups.push({
pages: [{
name: page.name,
id: page.id
}],
isIndependent
});
} else {
if (!find(targetSection.groups, group => {
return (group.name === groupName);
})) {
targetSection.groups.push({
name: groupName,
pages: [],
isIndependent
});
}
const targetGroup = find(targetSection.groups, group => {
return (group.name === groupName);
});
targetGroup.pages.push({
name: page.name,
id: page.id
});
}
this.listen(states.PAGE, () => {
const pageId = store.getter(getters.PAGE_ID);
if (!!find(this.opts.group.list, item => {
return (item.id === pageId);
})) {
this.isOpened = true;
}
map(this.opts.group.list, item => {
if (item.id === pageId) {
item.isSelected = true;
} else {
item.isSelected = false;
}
return item;
});
this.update();
});
forEach(pages, page => {
const targetSection = find(menu, section => {
return (section.id === page.section);
});
const groupName = page.group;
const isIndependent = !groupName;
if (isIndependent) {
targetSection.groups.push({
pages: [{
name: page.name,
id: page.id
}],
isIndependent
});
} else {
if (!find(targetSection.groups, group => {
return (group.name === groupName);
})) {
this.handleActionButtonClick = (operationId, rowIdx) => {
const operationObject = find(this.opts.rowactions, operationObject => {
return (operationObject.operationId === operationId);
});
const method = store.getter(getters.OAS_PATH_ITEM_OBJECT_METHOD_NAME_BY_OPERATION_ID, operationObject.operationId);
const rowData = this.opts.response[rowIdx];
const initialParameters = createInitialQueries(operationObject, rowData);
store.action(actions.DRAWERS_ADD, 'viron-component-operation', {
title: operationObject.summary || operationObject.operationId,
description: operationObject.description,
method,
primaryKey: this.opts.primarykey,
operationObject,
parameterObjects: operationObject.parameters,
initialParameters,
onComplete: () => {
this.opts.updater();
}
name: page.name,
id: page.id
}],
isIndependent
});
} else {
if (!find(targetSection.groups, group => {
return (group.name === groupName);
})) {
targetSection.groups.push({
name: groupName,
pages: [],
isIndependent
});
}
const targetGroup = find(targetSection.groups, group => {
return (group.name === groupName);
});
targetGroup.pages.push({
name: page.name,
id: page.id
});
}
});
return menu;