Skip to content

Commit

Permalink
fix: small refactor - add stelys, fix api param[WTEL-4883](https://we…
Browse files Browse the repository at this point in the history
  • Loading branch information
Lera24 committed Nov 14, 2024
1 parent 2734a89 commit 7836ec4
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import applyTransform, {
notify,
sanitize,
snakeToCamel,
starToSearch,
} from '@webitel/ui-sdk/src/api/transformers/index.js';
import deepCopy from 'deep-copy';
import ConvertDuration from '@webitel/ui-sdk/src/scripts/convertDuration.js';
Expand All @@ -19,13 +20,14 @@ const instance = getDefaultInstance();

const baseUrl = '/cases/slas';

const fieldsToSend = ['name', 'description', 'validFrom', 'validTo', 'calendar', 'reactionTime', 'resolutionTime'];
const fieldsToSend = ['name', 'description', 'valid_from', 'valid_to', 'calendar', 'reaction_time', 'resolution_time'];

const getSlasList = async (params) => {
const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id'];

const url = applyTransform(params, [
merge(getDefaultGetParams()),
starToSearch('search'),
(params) => ({ ...params, q: params.search }),
sanitize(fieldsToSend),
camelToSnake(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<section>
<header class="content-header">
<h3 class="content-title">
<section class="opened-sla-general">
<header class="opened-card-header">
<h3 class="opened-card-header__title">
{{ t('reusable.generalInfo') }}
</h3>
</header>
<div class="object-input-grid">
<div class="opened-card-input-grid">
<wt-input
:disabled="disableUserInput"
:label="t('reusable.name')"
Expand All @@ -25,7 +25,7 @@
@input="setItemProp({ prop: 'calendar', value: $event })"
/>

<wt-input
<wt-textarea
:disabled="disableUserInput"
:label="t('vocabulary.description')"
:value="itemInstance.description"
Expand All @@ -52,7 +52,7 @@
/>
</div>

<div>
<div class="opened-sla-general__wrapper">
<wt-datepicker
:disabled="disableUserInput"
:label="$t('lookups.slas.validFrom')"
Expand Down Expand Up @@ -102,4 +102,8 @@ function loadCalendarsList(search) {
</script>

<style lang="scss" scoped>
.opened-sla-general__wrapper {
display: flex;
gap: var(--spacing-sm);
}
</style>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<wt-page-wrapper
class="table-page slas"
:actions-panel="false"
class="slas"
>
<template #header>
<wt-page-header
Expand All @@ -12,23 +12,27 @@
</wt-page-header>
</template>
<template #main>
<header class="content-header">
<h3 class="content-title">
{{ t('lookups.slas.slas') }}
</h3>
<wt-actions-bar
mode="table"
:actions="[IconAction.ADD, IconAction.REFRESH, IconAction.DELETE]"
@click:add="router.push({ name: `${CrmSections.SLAS}-card`, params: { id: 'new' }})"
>
<template #search-bar>
<filter-search
:namespace="filtersNamespace"
name="search"
/>
</template>
</wt-actions-bar>
</header>
<section class="table-section">
<header class="table-title">
<h3 class="table-title__title">
{{ t('lookups.slas.slas') }}
</h3>
<wt-actions-bar
mode="table"
:actions="[IconAction.ADD, IconAction.REFRESH, IconAction.DELETE]"
@click:add="router.push({ name: `${CrmSections.SLAS}-card`, params: { id: 'new' }})"
@click:refresh="loadData"
>
<template #search-bar>
<filter-search
:namespace="filtersNamespace"
name="search"
/>
</template>
</wt-actions-bar>
</header>
</section>



<wt-loader v-show="isLoading" />
Expand Down Expand Up @@ -66,10 +70,12 @@
</template>
<template #actions="{ item }">
<wt-icon-action
v-if="hasEditAccess"
action="edit"
@click="edit(item)"
/>
<wt-icon-action
v-if="hasDeleteAccess"
action="delete"
@click="askDeleteConfirmation({
deleted: [item],
Expand All @@ -91,7 +97,7 @@
import { useClose } from '@webitel/ui-sdk/src/composables/useClose/useClose.js';
import IconAction from '@webitel/ui-sdk/src/enums/IconAction/IconAction.enum.js';
import WtActionsBar from '@webitel/ui-sdk/src/components/wt-action-bar/wt-action-bar.vue';
import WtEmpty from '@webitel/ui-sdk/src/components/wt-empty/wt-empty.vue';
import { useAccessControl } from '@webitel/ui-sdk/src/composables/useAccessControl/useAccessControl.js';
import CrmSections from '@webitel/ui-sdk/src/enums/WebitelApplications/CrmSections.enum.js';
import {
Expand All @@ -115,6 +121,8 @@ const router = useRouter();
const store = useStore();
const { hasCreateAccess, hasEditAccess, hasDeleteAccess } = useAccessControl();
const {
isVisible: isDeleteConfirmationPopup,
deleteCount,
Expand Down

0 comments on commit 7836ec4

Please sign in to comment.