Skip to content

Commit

Permalink
feature: new PasswordRegExp config adding WIP [WTEL-4702]
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirBeria committed Jul 16, 2024
1 parent d3a5748 commit d660339
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"vue-router": "^4.2.5",
"vue2-dropzone": "^3.6.0",
"vuex": "^4.1.0",
"webitel-sdk": "^24.4.7"
"webitel-sdk": "^24.4.13"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@

<script>
import { mapGetters } from 'vuex';
import { EngineSystemSettingName } from 'webitel-sdk';
import PasswordInput from '../../../../../app/components/utils/generate-password-input.vue';
import openedTabComponentMixin from '../../../../../app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin';
import ConfigurationAPI from '../../../../system/modules/configuration/api/configuration.js';
import Qrcode from './_internals/qrcode-two-factor-auth.vue';
export default {
Expand All @@ -68,6 +70,16 @@ export default {
isDisplayQRCode: 'IS_DISPLAY_QR_CODE',
}),
},
methods: {
async checkExportSettings() {
const PasswordRegExp = await ConfigurationAPI.getList({ name: EngineSystemSettingName.PasswordRegExp });
const exportSettingsValue = PasswordRegExp.items[0]?.value;
console.log(exportSettingsValue);
},
},
mounted() {
this.checkExportSettings();
}
};
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/modules/system/modules/configuration/api/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import configuration from '../../../../../app/api/openAPIConfig';
const service = new SystemSettingServiceApiFactory(configuration, '', instance);

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

try {
const response = await service.searchSystemSetting(page, size, search, sort, fields);
const response = await service.searchSystemSetting(page, size, search, sort, fields, name);
const { items, next } = applyTransform(response.data, [
snakeToCamel(),
merge(getDefaultGetListResponse()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
@input="inputHandler"
/>
</div>
<wt-input
v-if="displayedConfigurationType.string"
:label="$tc('vocabulary.values', 1)"
:v="v$.itemInstance.value"
:value="itemInstance.value"
required
@input="setItemProp({ prop: 'value', value: $event })"
/>
</div>
</form>
</template>
Expand Down Expand Up @@ -145,6 +153,14 @@ export default {
};
}
const defaultStringConfig = {
itemInstance: {
value: {
required,
},
},
};
switch (this.itemInstance.name) {
case EngineSystemSettingName.EnableOmnichannel:
return deepmerge(defaults, defaultBooleanConfig);
Expand All @@ -160,6 +176,10 @@ export default {
return deepmerge(defaults, defaultNumberConfig);
case EngineSystemSettingName.ExportSettings:
return deepmerge(defaults, defaultSelectConfig);
case EngineSystemSettingName.PasswordRegExp:
return deepmerge(defaults, defaultStringConfig);
case EngineSystemSettingName.PasswordValidationText:
return deepmerge(defaults, defaultStringConfig);
default:
return defaults;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const ConfigurationValueTypes = Object.freeze({
[EngineSystemSettingName.SchemeVersionLimit]: 'number',
[EngineSystemSettingName.SearchNumberLength]: 'number',
[EngineSystemSettingName.ExportSettings]: 'select',
[EngineSystemSettingName.PasswordRegExp]: 'string',
[EngineSystemSettingName.PasswordValidationText]: 'string',
},
);

Expand Down

0 comments on commit d660339

Please sign in to comment.