Skip to content

Commit

Permalink
Merge pull request #568 from webitel/fix/change-method-in-configurati…
Browse files Browse the repository at this point in the history
…on-popup

fix: change search method in configuration popup[WTEL-3982]
  • Loading branch information
dlohvinov authored Dec 8, 2023
2 parents 2a3dbc8 + f69ef10 commit 937b633
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 24 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@vuelidate/validators": "^2.0.0",
"@vueuse/core": "^10.3.0",
"@webitel/flow-ui-sdk": "^0.1.14",
"@webitel/ui-sdk": "^23.12.92",
"@webitel/ui-sdk": "^23.12.101",
"axios": "^0.27.1",
"clipboard-copy": "^4.0.1",
"cron-validator": "^1.3.1",
Expand All @@ -36,7 +36,7 @@
"vue-router": "^4.2.5",
"vue2-dropzone": "^3.6.0",
"vuex": "^4.1.0",
"webitel-sdk": "^23.9.8"
"webitel-sdk": "^23.12.8"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.4.0",
Expand Down
36 changes: 36 additions & 0 deletions src/modules/system/modules/configuration/api/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,49 @@ const deleteItem = async ({ id }) => {
}
};

const getObjectsList = async (params) => {
const {
page,
size,
search,
sort,
fields,
} = applyTransform(params, [
merge(getDefaultGetParams()),
starToSearch('search'),
]);

try {
const response = await service.searchAvailableSystemSetting(
page,
size,
search,
sort,
fields,
);
const { items, next } = applyTransform(response.data, [
snakeToCamel(),
merge(getDefaultGetListResponse()),
]);
return {
items,
next,
};
} catch (err) {
throw applyTransform(err, [
notify,
]);
}
};

const ConfigurationAPI = {
getList,
get,
add,
update,
delete: deleteItem,
getLookup,
getObjectsList,
};

export default ConfigurationAPI;
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,10 @@ export default {
this.$emit('close');
},
async loadParameterList(params) {
const response = await ConfigurationAPI.getLookup({ ...params, size: 5000 });
response.items = Object.values(EngineSystemSettingName)
.filter((name) => (
response.items.every((item) => item.name !== name)
));
return response;
return await ConfigurationAPI.getObjectsList({ ...params, size: 5000 });
},
setParameterName(event) {
this.setItemProp({ prop: 'name', value: event });
this.setItemProp({ prop: 'name', value: event.name });
if (this.valueType === 'boolean') this.setItemProp({ prop: 'value', value: false });
if (this.valueType === 'number') this.setItemProp({ prop: 'value', value: 0 });
},
Expand Down

0 comments on commit 937b633

Please sign in to comment.