Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
SviatoslavBar committed Jul 3, 2024
1 parent cc9512a commit 2b0c8de
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,83 +140,82 @@
</template>

<script>
import { EngineRoutingSchemaType } from 'webitel-sdk';
import openedTabComponentMixin
from '../../../../../app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin';
import BlacklistsAPI from '../../../../lookups/modules/blacklists/api/blacklists';
import CalendarsAPI from '../../../../lookups/modules/calendars/api/calendars';
import MediaAPI from '../../../../lookups/modules/media/api/media';
import RolesAPI from '../../../../permissions/modules/roles/api/roles';
import FlowsAPI from '../../../../routing/modules/flow/api/flow';
import TeamsAPI from '../../teams/api/teams';
import QueuesAPI from '../api/queues';
import QueueTypeProperties from '../lookups/QueueTypeProperties.lookup';
import { StrategyList } from '../store/_internals/enums/Strategy.enum';
export default {
name: 'OpenedQueueGeneral',
mixins: [openedTabComponentMixin],
computed: {
strategy: {
get() {
return this.dropdownOptionsStrategyList.find(
(strategy) => strategy.value === this.itemInstance.strategy,
);
},
set(value) {
this.setItemProp({
prop: 'strategy',
value: value.value,
});
},
},
dropdownOptionsStrategyList() {
return StrategyList.map((strategy) => ({
value: strategy.value,
name: this.$t(`objects.ccenter.queues.queueStrategy.${strategy.value}`),
}));
},
specificControls() {
return QueueTypeProperties[this.itemInstance.type].controls.reduce(
(controls, control) => ({
...controls,
[control]: true,
}),
{},
import { EngineRoutingSchemaType } from 'webitel-sdk';
import openedTabComponentMixin from '../../../../../app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin';
import BlacklistsAPI from '../../../../lookups/modules/blacklists/api/blacklists';
import CalendarsAPI from '../../../../lookups/modules/calendars/api/calendars';
import MediaAPI from '../../../../lookups/modules/media/api/media';
import RolesAPI from '../../../../permissions/modules/roles/api/roles';
import FlowsAPI from '../../../../routing/modules/flow/api/flow';
import TeamsAPI from '../../teams/api/teams';
import QueuesAPI from '../api/queues';
import QueueTypeProperties from '../lookups/QueueTypeProperties.lookup';
import { StrategyList } from '../store/_internals/enums/Strategy.enum';
export default {
name: 'OpenedQueueGeneral',
mixins: [openedTabComponentMixin],
computed: {
strategy: {
get() {
return this.dropdownOptionsStrategyList.find(
(strategy) => strategy.value === this.itemInstance.strategy,
);
},
},
methods: {
loadDropdownOptionsCalendarList(params) {
return CalendarsAPI.getLookup(params);
},
loadDropdownOptionsBlacklistList(params) {
return BlacklistsAPI.getLookup(params);
},
loadDropdownOptionsTeamList(params) {
return TeamsAPI.getLookup(params);
},
loadDropdownOptionsSchemaList(params) {
return FlowsAPI.getLookup(params);
},
loadDropdownOptionsServiceSchemaList(params) {
return FlowsAPI.getLookup({
...params,
type: [EngineRoutingSchemaType.Service],
set(value) {
this.setItemProp({
prop: 'strategy',
value: value.value,
});
},
loadDropdownOptionsMediaList(params) {
return MediaAPI.getLookup(params);
},
loadDropdownOptionsRoleList(params) {
return RolesAPI.getLookup(params);
},
loadQueuesTagOptions: QueuesAPI.getQueuesTags,
},
};
dropdownOptionsStrategyList() {
return StrategyList.map((strategy) => ({
value: strategy.value,
name: this.$t(`objects.ccenter.queues.queueStrategy.${strategy.value}`),
}));
},
specificControls() {
return QueueTypeProperties[this.itemInstance.type].controls.reduce(
(controls, control) => ({
...controls,
[control]: true,
}),
{},
);
},
},
methods: {
loadDropdownOptionsCalendarList(params) {
return CalendarsAPI.getLookup(params);
},
loadDropdownOptionsBlacklistList(params) {
return BlacklistsAPI.getLookup(params);
},
loadDropdownOptionsTeamList(params) {
return TeamsAPI.getLookup(params);
},
loadDropdownOptionsSchemaList(params) {
return FlowsAPI.getLookup(params);
},
loadDropdownOptionsServiceSchemaList(params) {
return FlowsAPI.getLookup({
...params,
type: [EngineRoutingSchemaType.Service],
});
},
loadDropdownOptionsMediaList(params) {
return MediaAPI.getLookup(params);
},
loadDropdownOptionsRoleList(params) {
return RolesAPI.getLookup(params);
},
loadQueuesTagOptions: QueuesAPI.getQueuesTags,
},
};
</script>

<style lang="scss" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,51 +84,50 @@
</template>

<script>
import FilterSearch from '@webitel/ui-sdk/src/modules/QueryFilters/components/filter-search.vue';
import convertDuration from '@webitel/ui-sdk/src/scripts/convertDuration';
import openedObjectTableTabMixin
from '../../../../../../../app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin';
import { useDummy } from '../../../../../../../app/composables/useDummy';
import FilterSearch from '@webitel/ui-sdk/src/modules/QueryFilters/components/filter-search.vue';
import convertDuration from '@webitel/ui-sdk/src/scripts/convertDuration';
import openedObjectTableTabMixin from '../../../../../../../app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin';
import { useDummy } from '../../../../../../../app/composables/useDummy';
const namespace = 'ccenter/queues';
const subNamespace = 'log';
const namespace = 'ccenter/queues';
const subNamespace = 'log';
export default {
name: 'OpenedQueueLogs',
components: { FilterSearch },
mixins: [openedObjectTableTabMixin],
data: () => ({
namespace,
subNamespace,
}),
export default {
name: 'OpenedQueueLogs',
components: { FilterSearch },
mixins: [openedObjectTableTabMixin],
data: () => ({
namespace,
subNamespace,
}),
setup() {
const { dummy } = useDummy({ namespace: `${namespace}/${subNamespace}`, hiddenText: true });
return { dummy };
setup() {
const { dummy } = useDummy({ namespace: `${namespace}/${subNamespace}`, hiddenText: true });
return { dummy };
},
computed: {
filtersNamespace() {
return `${this.namespace}/${this.subNamespace}/filters`;
},
computed: {
filtersNamespace() {
return `${this.namespace}/${this.subNamespace}/filters`;
},
watch: {
'$route.query': {
async handler() {
await this.loadList();
},
},
watch: {
'$route.query': {
async handler() {
await this.loadList();
},
},
},
methods: {
formatDate(value) {
if (!value) return '';
return new Date(+value).toLocaleString();
},
methods: {
formatDate(value) {
if (!value) return '';
return new Date(+value).toLocaleString();
},
calcDuration(item) {
return convertDuration((item.leavingAt - item.joinedAt) / 1000);
},
calcDuration(item) {
return convertDuration((item.leavingAt - item.joinedAt) / 1000);
},
};
},
};
</script>

<style lang="scss" scoped>
Expand Down
Loading

0 comments on commit 2b0c8de

Please sign in to comment.