Skip to content

Commit

Permalink
feature: add check license wfm in calendar page[WTEL-5157]
Browse files Browse the repository at this point in the history
  • Loading branch information
Lera24 committed Oct 1, 2024
1 parent 4c5139c commit 3985816
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<script>
import { useVuelidate } from '@vuelidate/core';
import { helpers, required } from '@vuelidate/validators';
import { mapState } from 'vuex';
import openedObjectMixin from '../../../../../app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin';
import { timerangeNotIntersect, timerangeStartLessThanEnd } from '../../../../../app/utils/validators';
import RouteNames from '../../../../../app/router/_internals/RouteNames.enum.js';
Expand Down Expand Up @@ -81,14 +82,23 @@ export default {
},
computed: {
...mapState('userinfo', {
license: (state) => state.license,
}),
hasLicenseOnWfm() {
return this.license?.some((item) => item.prod === 'WFM');
},
tabs() {
const tabs = [
{ value: 'general', text: this.$t('objects.general'), pathName: CalendarRouteNames.GENERAL },
{ value: 'work-week', text: this.$t('objects.lookups.calendars.workWeek'), pathName: CalendarRouteNames.WORKING_WEEK },
{ value: 'holidays', text: this.$tc('objects.lookups.calendars.holidays', 2), pathName: CalendarRouteNames.HOLIDAYS },
{ value: 'special-time', text: this.$t('objects.lookups.calendars.specialTime'), pathName: CalendarRouteNames.SPECIAL_TIME },
];
const specialTime = { value: 'special-time', text: this.$t('objects.lookups.calendars.specialTime'), pathName: CalendarRouteNames.SPECIAL_TIME };
if (this.hasLicenseOnWfm) tabs.push(specialTime);
if (this.id) tabs.push(this.permissionsTab);
return tabs;
},
Expand Down

0 comments on commit 3985816

Please sign in to comment.