Skip to content

Commit

Permalink
Merge branch 'v24.04'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/modules/contacts/components/contact-popup.vue
#	src/modules/contacts/components/the-contacts.vue
  • Loading branch information
dlohvinov committed Jun 11, 2024
2 parents a64fd6d + ebae918 commit 8c29fb8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crm",
"version": "24.04.0",
"version": "24.04.1",
"private": true,
"scripts": {
"dev": "vite",
Expand Down
17 changes: 9 additions & 8 deletions src/app/router/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { createRouter, createWebHistory } from 'vue-router';
import CrmSections
from '@webitel/ui-sdk/src/enums/WebitelApplications/CrmSections.enum';
import store from '../store';
import TheCrmWorkspace from '../components/the-crm-workspace.vue';
import TheContacts from '../../modules/contacts/components/the-contacts.vue';
import OpenedContact
from '../../modules/contacts/components/opened-contact.vue';
import AccessDenied from '../components/utils/access-denied-component.vue';
import ContactTimeline from '../../modules/contacts/modules/timeline/components/the-timeline.vue';
import { createRouter, createWebHistory } from 'vue-router';
import ContactCommunications
from '../../modules/contacts/components/opened-contact-communications.vue';
import OpenedContact
from '../../modules/contacts/components/opened-contact.vue';
import TheContacts from '../../modules/contacts/components/the-contacts.vue';
import ContactPermissions
from '../../modules/contacts/modules/permissions/components/the-permissions.vue';
import ContactTimeline
from '../../modules/contacts/modules/timeline/components/the-timeline.vue';
import ContactVariables
from '../../modules/contacts/modules/variables/components/the-variables.vue';
import TheCrmWorkspace from '../components/the-crm-workspace.vue';
import AccessDenied from '../components/utils/access-denied-component.vue';
import store from '../store';

const checkAppAccess = (to, from, next) => {
const hasReadAccess = store.getters['userinfo/CHECK_APP_ACCESS'](store.getters['userinfo/THIS_APP']);
Expand Down
17 changes: 11 additions & 6 deletions src/modules/contacts/components/contact-popup.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<wt-popup
class="contact-popup"
v-bind="attrs"
:shown="shown"
size="sm"
@close="close"
>
Expand Down Expand Up @@ -69,8 +69,10 @@
import { computed, onMounted, ref, useAttrs, watch } from 'vue';
import { useVuelidate } from '@vuelidate/core';
import { required } from '@vuelidate/validators';
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useStore } from 'vuex';
import ContactsAPI from '../api/ContactsAPI';
import LabelsAPI from '../api/LabelsAPI';
import TimezonesAPI from '../api/TimezonesAPI';
import UsersAPI from '../api/UsersAPI';
Expand All @@ -81,12 +83,13 @@ const props = defineProps({
// if id is passed, that's an edit
type: [String, null],
},
shown: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['saved', 'close']);
const attrs = useAttrs();
const { t } = useI18n();
const store = useStore();
Expand Down Expand Up @@ -148,8 +151,10 @@ async function loadItem(id = props.id) {
draft.value = await ContactsAPI.get({ itemId: id });
}
if (props.id) loadItem(props.id);
else setDefaultManager();
watch(() => props.shown, () => {
if (props.id) loadItem(props.id);
else setDefaultManager();
});
</script>
<style lang="scss" scoped>
Expand Down
19 changes: 11 additions & 8 deletions src/modules/contacts/components/the-contacts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
>
<template #header>
<contact-popup
:shown="isContactPopup"
:id="editedContactId"
:namespace="baseNamespace"
:shown="isContactPopup"
@close="closeContactPopup"
@saved="saved"
/>
Expand Down Expand Up @@ -53,16 +53,15 @@
<wt-table
:data="dataList"
:headers="headers"
:selected="selected"
sortable
@sort="sort"
@update:selected="setSelected"
>
<template #name="{ item }">
<div class="username-wrapper">
<wt-avatar
:username="item.name.commonName"
size="sm"
:username="item.name.commonName"
/>
<wt-item-link
:link="{ name: `${CrmSections.CONTACTS}-card`, params: { id: item.id } }"
Expand Down Expand Up @@ -104,18 +103,22 @@
</template>
</wt-table>
<filter-pagination
:is-next="isNext"
:namespace="filtersNamespace"
:is-next="isNext"
/>
</div>
</template>
</wt-page-wrapper>
</template>

<script setup>
import { computed, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
import isEmpty from '@webitel/ui-sdk/src/scripts/isEmpty';
import CrmSections from '@webitel/ui-sdk/src/enums/WebitelApplications/CrmSections.enum';
import DeleteConfirmationPopup
from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue';
import FilterPagination from '@webitel/ui-sdk/src/modules/Filters/components/filter-pagination.vue';
import {
useDeleteConfirmationPopup,
} from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup';
Expand Down Expand Up @@ -267,8 +270,8 @@ function edit({ id }) {
}

function saved(id) {
router.push({
name: CrmSections.CONTACTS,
return router.push({
name: `${CrmSections.CONTACTS}-card`,
params: { id },
});
}
Expand Down

0 comments on commit 8c29fb8

Please sign in to comment.