@intellias/menu 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Menu.ts +625 -0
- package/README.md +121 -0
- package/assets/icons/arrow-down.svg +13 -0
- package/assets/icons/arrow-left.svg +3 -0
- package/assets/icons/arrow-submenu.svg +8 -0
- package/assets/icons/close.svg +3 -0
- package/assets/icons/delete.svg +13 -0
- package/assets/icons/faq-new.svg +4 -0
- package/assets/icons/kudos.svg +14 -0
- package/assets/icons/loading-spinner.svg +40 -0
- package/assets/icons/notification.svg +11 -0
- package/assets/icons/notifications/assessment.svg +10 -0
- package/assets/icons/notifications/buddy_program.svg +8 -0
- package/assets/icons/notifications/compensation_packages.svg +10 -0
- package/assets/icons/notifications/dsat.svg +8 -0
- package/assets/icons/notifications/feedback.svg +7 -0
- package/assets/icons/notifications/kudos.svg +4 -0
- package/assets/icons/notifications/overtime_requests.svg +15 -0
- package/assets/icons/notifications/pdu_program.svg +4 -0
- package/assets/icons/notifications/profile_update.svg +6 -0
- package/assets/icons/notifications/recommendation_program.svg +7 -0
- package/assets/icons/notifications/reminders.svg +4 -0
- package/assets/icons/notifications/sick_leaves.svg +5 -0
- package/assets/icons/notifications/smarts.svg +4 -0
- package/assets/icons/notifications/survey.svg +8 -0
- package/assets/icons/notifications/unpaid_leave.svg +4 -0
- package/assets/icons/notifications/vacations.svg +4 -0
- package/assets/icons/pause.svg +13 -0
- package/assets/icons/play.svg +13 -0
- package/assets/icons/smart.svg +14 -0
- package/assets/icons/smarts-kudos.svg +11 -0
- package/assets/icons/spinner-solid.svg +1 -0
- package/assets/icons/vacation.svg +14 -0
- package/assets/icons/visibility.svg +1 -0
- package/assets/intems-logo.svg +3 -0
- package/babel.config.js +6 -0
- package/buses/eventBus.ts +19 -0
- package/buses/events/GiveKudosEvent.ts +7 -0
- package/components/buttons/action-button/ActionButton.scss +133 -0
- package/components/buttons/action-button/ActionButton.ts +57 -0
- package/components/buttons/action-button/ActionButton.vue +50 -0
- package/components/buttons/secondary-button/SecondaryButton.scss +48 -0
- package/components/buttons/secondary-button/SecondaryButton.ts +28 -0
- package/components/buttons/secondary-button/SecondaryButton.vue +27 -0
- package/components/confirm/Confirm.scss +44 -0
- package/components/confirm/Confirm.ts +82 -0
- package/components/confirm/Confirm.vue +64 -0
- package/components/give-kudos-form/GiveKudosForm.scss +114 -0
- package/components/give-kudos-form/GiveKudosForm.ts +159 -0
- package/components/give-kudos-form/GiveKudosForm.vue +131 -0
- package/components/give-kudos-form/mixins/UserSelectMixin.ts +57 -0
- package/components/give-kudos-form/models/KudosShareModel.ts +6 -0
- package/components/give-kudos-form/models/UserListModel.ts +5 -0
- package/components/give-kudos-form/validators/InEnglishValidatorRegex.ts +17 -0
- package/components/give-kudos-form/validators/KudosBalance.ts +10 -0
- package/components/modal/Modal.scss +53 -0
- package/components/modal/Modal.ts +70 -0
- package/components/modal/Modal.vue +28 -0
- package/components/notifications-sidebar/NotificationsSidebar.scss +665 -0
- package/components/notifications-sidebar/NotificationsSidebar.ts +203 -0
- package/components/notifications-sidebar/NotificationsSidebar.vue +171 -0
- package/components/notifications-sidebar/models/BroadcastNotificationPayload.ts +8 -0
- package/components/notifications-sidebar/models/TotalCounter.ts +50 -0
- package/components/notifications-sidebar/notification/Notification.ts +17 -0
- package/components/notifications-sidebar/notification/Notification.vue +87 -0
- package/components/play-pause/PlayPause.scss +33 -0
- package/components/play-pause/PlayPause.ts +156 -0
- package/components/play-pause/PlayPause.vue +36 -0
- package/components/play-pause/PlayPauseStatus.ts +4 -0
- package/components/play-pause/helpers/LatestTrackedTimeDurationHelper.ts +55 -0
- package/components/play-pause/helpers/PauseHelper.ts +55 -0
- package/components/play-pause/helpers/TrackedTimeHelper.ts +80 -0
- package/components/preloader/Preloader.vue +34 -0
- package/components/request-loader/RequestLoader.scss +20 -0
- package/components/request-loader/RequestLoader.ts +80 -0
- package/components/request-loader/RequestLoader.vue +15 -0
- package/components/sub-menu/SubMenu.scss +33 -0
- package/components/sub-menu/SubMenu.ts +38 -0
- package/components/sub-menu/SubMenu.vue +21 -0
- package/components/time-ago/TimeAgo.ts +34 -0
- package/components/time-ago/TimeAgo.vue +9 -0
- package/components/user-picture/UserPicture.scss +62 -0
- package/components/user-picture/UserPicture.ts +105 -0
- package/components/user-picture/UserPicture.vue +23 -0
- package/components/v-select-intems/VSelectIntems.ts +112 -0
- package/components/v-select-intems/VSelectIntems.vue +68 -0
- package/components/v-select-intems/open-indicator/OpenIndicator.vue +3 -0
- package/dist/css/1.css +85 -0
- package/dist/css/2.css +34 -0
- package/dist/css/3.css +34 -0
- package/dist/css/4.css +34 -0
- package/dist/css/5.css +34 -0
- package/dist/css/main.css +1564 -0
- package/dist/html/app.html +19 -0
- package/dist/html/styles.html +1 -0
- package/dist/images/intems-logo.svg +3 -0
- package/dist/js/0.js +315 -0
- package/dist/js/1.js +313 -0
- package/dist/js/2.js +217 -0
- package/dist/js/3.js +181 -0
- package/dist/js/4.js +181 -0
- package/dist/js/5.js +181 -0
- package/dist/js/6.js +47 -0
- package/dist/js/main.js +7465 -0
- package/dist/js/vue.js +15 -0
- package/helpers/GeneralHelper.ts +61 -0
- package/helpers/PublisherSubscriber.ts +34 -0
- package/helpers/QueryFilter.ts +204 -0
- package/helpers/TimeHelper.ts +54 -0
- package/helpers/Validations.ts +7 -0
- package/helpers/model/ModelHelper.ts +155 -0
- package/helpers/model/decorators/AsCollection.ts +26 -0
- package/helpers/model/decorators/AsModel.ts +25 -0
- package/helpers/model/decorators/DateTime.ts +26 -0
- package/helpers/model/decorators/TimeDuration.ts +33 -0
- package/helpers/moment/Duration.ts +64 -0
- package/helpers/moment/Moment.ts +17 -0
- package/helpers/moment/index.d.ts +20 -0
- package/helpers/response/AxiosProxy.ts +72 -0
- package/helpers/response/ErrorsToToastHelper.ts +42 -0
- package/helpers/response/ResponseCode.ts +16 -0
- package/helpers/response/ResponseHelper.ts +42 -0
- package/helpers/response/ResponseInterface.ts +34 -0
- package/helpers/response/ResponseState.ts +6 -0
- package/jsconfig.json +19 -0
- package/mixins/IntemsMath.ts +29 -0
- package/mixins/notifications/ActionProcessing.ts +134 -0
- package/mixins/notifications/confirms/AssetRejectionConfirm.vue +59 -0
- package/mixins/notifications/confirms/SickLeaveRejectionConfirm.vue +31 -0
- package/mixins/notifications/confirms/UnpaidLeaveRejectionConfirm.vue +31 -0
- package/mixins/notifications/confirms/VacationRejectionConfirm.vue +31 -0
- package/models/AssetModel.ts +80 -0
- package/models/AssetRequestModel.ts +25 -0
- package/models/ConfigModel.ts +20 -0
- package/models/EmployeeStartEndDateModel.ts +16 -0
- package/models/EmploymentTypeModel.ts +95 -0
- package/models/LogoutModel.ts +3 -0
- package/models/Model.ts +12 -0
- package/models/ModuleOptions.ts +24 -0
- package/models/PublicInfoModel.ts +38 -0
- package/models/PublicLocationModel.ts +36 -0
- package/models/StatusModel.ts +8 -0
- package/models/TrackedTimeModel.ts +32 -0
- package/models/location/PublicLocationModel.ts +36 -0
- package/models/timezones/LocalTimezoneHistoryModel.ts +8 -0
- package/models/timezones/TimezoneModel.ts +9 -0
- package/models/user/ExtendedInfoModel.ts +37 -0
- package/models/user/NotificationActionModel.ts +53 -0
- package/models/user/NotificationModel.ts +84 -0
- package/models/user/PublicInfoModel.ts +38 -0
- package/models/user/WelcomeProgram.ts +4 -0
- package/package.json +117 -0
- package/repositories/BaseRepository.ts +42 -0
- package/repositories/BaseUrl.ts +107 -0
- package/repositories/Repository.ts +291 -0
- package/repositories/ResourceRepository.ts +99 -0
- package/repositories/TrackedTimeRepository.ts +43 -0
- package/repositories/UserRepository.ts +75 -0
- package/repositories/subscribers/CreateSubscribers.ts +28 -0
- package/repositories/subscribers/DefaultSubscribers.ts +82 -0
- package/repositories/subscribers/DeleteSubscribers.ts +28 -0
- package/repositories/subscribers/DownloadSubscribers.ts +28 -0
- package/repositories/subscribers/Subscribers.ts +13 -0
- package/repositories/subscribers/UpdateSubscribers.ts +32 -0
- package/scss/components/_global.scss +66 -0
- package/scss/components/_mixins.scss +31 -0
- package/scss/components/_tooltip.scss +45 -0
- package/scss/components/_utils.scss +26 -0
- package/scss/components/_variables.scss +103 -0
- package/scss/main.scss +7 -0
- package/shims-vue.d.ts +9 -0
- package/tsconfig.json +31 -0
- package/webpack.config.js +126 -0
- package/wrapper.ts +51 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { mapGetters, mapActions, mapMutations } from "vuex";
|
|
2
|
+
import VueCustomScrollbar from "vue-custom-scrollbar";
|
|
3
|
+
import QueryFilter from "../../helpers/QueryFilter";
|
|
4
|
+
import {
|
|
5
|
+
NotificationRejectionData,
|
|
6
|
+
NotificationStatus,
|
|
7
|
+
NotificationType,
|
|
8
|
+
} from "../../models/user/NotificationModel";
|
|
9
|
+
import Notification from "./notification/Notification.vue";
|
|
10
|
+
import ActionButton from "../buttons/action-button/ActionButton.vue";
|
|
11
|
+
import RequestLoader from "../request-loader/RequestLoader.vue";
|
|
12
|
+
import Preloader from "../preloader/Preloader.vue";
|
|
13
|
+
import { map } from "../../helpers/model/ModelHelper";
|
|
14
|
+
import BroadcastNotificationPayload from "./models/BroadcastNotificationPayload";
|
|
15
|
+
import ConfigModel from "../../models/ConfigModel";
|
|
16
|
+
import DropdownMenu from "v-dropdown-menu/vue2";
|
|
17
|
+
import "v-dropdown-menu/dist/vue2/v-dropdown-menu.css";
|
|
18
|
+
import Tabs from "vue-tabs-with-active-line";
|
|
19
|
+
import { ProjectName } from "../../wrapper";
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
components: {
|
|
23
|
+
Preloader,
|
|
24
|
+
RequestLoader,
|
|
25
|
+
ActionButton,
|
|
26
|
+
Notification,
|
|
27
|
+
VueCustomScrollbar,
|
|
28
|
+
DropdownMenu,
|
|
29
|
+
Tabs,
|
|
30
|
+
},
|
|
31
|
+
inject: ["projectName", "storeAdapter"],
|
|
32
|
+
mounted(): void {
|
|
33
|
+
this.initListener();
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
...mapActions("User/Notifications", [
|
|
37
|
+
"readAll",
|
|
38
|
+
"newNotification",
|
|
39
|
+
"markAsProcessed",
|
|
40
|
+
]),
|
|
41
|
+
...mapActions("User/Notifications/SidebarModule", [
|
|
42
|
+
"fetchSidebarNotifications",
|
|
43
|
+
"dismissAll",
|
|
44
|
+
]),
|
|
45
|
+
...mapMutations("User/Notifications/SidebarModule", [
|
|
46
|
+
"unsetNotifications",
|
|
47
|
+
"changeStatus",
|
|
48
|
+
]),
|
|
49
|
+
initListener(): void {
|
|
50
|
+
this.$echo
|
|
51
|
+
.private(`employee.${this.getUser.employee_id}`)
|
|
52
|
+
.notification((payload) => {
|
|
53
|
+
this.newNotification(map(BroadcastNotificationPayload, payload));
|
|
54
|
+
if (localStorage.activeBrowserTab === "false") {
|
|
55
|
+
localStorage.pendingAnimation = true;
|
|
56
|
+
} else {
|
|
57
|
+
this.bellAnimation();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
this.$echo
|
|
61
|
+
.private(`employee.${this.getUser.employee_id}`)
|
|
62
|
+
.listen("NotificationProcessed", (payload) => {
|
|
63
|
+
const notification = this.find(payload.notification_id);
|
|
64
|
+
if (
|
|
65
|
+
notification &&
|
|
66
|
+
notification.status !== NotificationStatus.processed
|
|
67
|
+
) {
|
|
68
|
+
this.markAsProcessed(notification);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
localStorage.activeBrowserTab = true;
|
|
72
|
+
document.addEventListener("visibilitychange", () => {
|
|
73
|
+
localStorage.activeBrowserTab = !document.hidden;
|
|
74
|
+
if (
|
|
75
|
+
localStorage.activeBrowserTab === "true" &&
|
|
76
|
+
localStorage.pendingAnimation === "true"
|
|
77
|
+
) {
|
|
78
|
+
this.bellAnimation();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
async initData(): void {
|
|
83
|
+
Promise.all([
|
|
84
|
+
this.unsetNotifications(),
|
|
85
|
+
this.fetchSidebarNotifications(this.queryAll.unsetPagination()),
|
|
86
|
+
this.fetchSidebarNotifications(this.queryPending.unsetPagination()),
|
|
87
|
+
]).then(() => {
|
|
88
|
+
this.updateScrollbar();
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
loadAllNotifications(): void {
|
|
92
|
+
if (!this.dropDownOpen || this.currentTab !== "all") {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.fetchSidebarNotifications(
|
|
96
|
+
this.queryAll.offset(this.notices.count())
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
loadPendingRequests(): void {
|
|
100
|
+
if (!this.dropDownOpen || this.currentTab !== "pending_approval") {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.fetchSidebarNotifications(
|
|
104
|
+
this.queryPending.offset(this.pendingRequests.count())
|
|
105
|
+
);
|
|
106
|
+
},
|
|
107
|
+
changeActiveTab(newTab): void {
|
|
108
|
+
this.currentTab = newTab;
|
|
109
|
+
},
|
|
110
|
+
bellAnimation(): void {
|
|
111
|
+
this.displayAnimation = true;
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
this.displayAnimation = false;
|
|
114
|
+
}, 5600);
|
|
115
|
+
|
|
116
|
+
localStorage.pendingAnimation = false;
|
|
117
|
+
},
|
|
118
|
+
closeSidebar(): void {
|
|
119
|
+
this.dropDownOpen = false;
|
|
120
|
+
},
|
|
121
|
+
updateScrollbar(): void {
|
|
122
|
+
this.$refs.scrollBar.update();
|
|
123
|
+
},
|
|
124
|
+
emitRejectionComponent(rejectionData: NotificationRejectionData): void {
|
|
125
|
+
this.$emit("rejection-component", rejectionData);
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
computed: {
|
|
129
|
+
...mapGetters("User", ["getUser"]),
|
|
130
|
+
...mapGetters("User/Notifications/SidebarModule", [
|
|
131
|
+
"notices",
|
|
132
|
+
"pendingRequests",
|
|
133
|
+
"find",
|
|
134
|
+
]),
|
|
135
|
+
...mapGetters("User/Notifications", ["hasUnread", "totalUnread"]),
|
|
136
|
+
hasUnreadNotifications(): boolean {
|
|
137
|
+
return this.hasUnread !== undefined
|
|
138
|
+
? this.hasUnread
|
|
139
|
+
: this.getUser.has_unread_notifications;
|
|
140
|
+
},
|
|
141
|
+
isLiteDomain(): boolean {
|
|
142
|
+
return this.projectName === ProjectName.Lite;
|
|
143
|
+
},
|
|
144
|
+
intemsConfig(): ConfigModel {
|
|
145
|
+
return this.storeAdapter.Config.state.data;
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
watch: {
|
|
149
|
+
"totalUnread.notice": {
|
|
150
|
+
handler(notice: number): void {
|
|
151
|
+
const tab = this.$refs.tabs.$el.children[0];
|
|
152
|
+
if (this.totalUnread.notice) {
|
|
153
|
+
tab.innerHTML = `All
|
|
154
|
+
<span class="counter" >${notice}</span>`;
|
|
155
|
+
} else {
|
|
156
|
+
tab.innerHTML = "All";
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
"totalUnread.pending_request": {
|
|
161
|
+
handler(request: number): void {
|
|
162
|
+
const tab = this.$refs.tabs.$el.children[1];
|
|
163
|
+
if (this.totalUnread.pending_request) {
|
|
164
|
+
tab.innerHTML = `Pending approval
|
|
165
|
+
<span class="counter" >${request}</span>`;
|
|
166
|
+
} else {
|
|
167
|
+
tab.innerHTML = "Pending approval";
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
data(): Record<string, unknown> {
|
|
173
|
+
return {
|
|
174
|
+
queryAll: new QueryFilter()
|
|
175
|
+
.notIn("status", [
|
|
176
|
+
NotificationStatus.hidden,
|
|
177
|
+
NotificationStatus.hidden_processed,
|
|
178
|
+
])
|
|
179
|
+
.scope("type", NotificationType.notice),
|
|
180
|
+
queryPending: new QueryFilter()
|
|
181
|
+
.notIn("status", [
|
|
182
|
+
NotificationStatus.hidden,
|
|
183
|
+
NotificationStatus.hidden_processed,
|
|
184
|
+
])
|
|
185
|
+
.scope("type", NotificationType.pending_request),
|
|
186
|
+
dropDownOpen: false,
|
|
187
|
+
tabs: [
|
|
188
|
+
{
|
|
189
|
+
title: "All",
|
|
190
|
+
value: "all",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
title: "Pending approval",
|
|
194
|
+
value: "pending_approval",
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
currentTab: "all",
|
|
198
|
+
preloaderSize: "small",
|
|
199
|
+
scrollBarSettings: { suppressScrollX: true, minScrollbarLength: 50 },
|
|
200
|
+
displayAnimation: false,
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="notifications-sidebar dropdown-menu">
|
|
3
|
+
<dropdown-menu
|
|
4
|
+
direction="center"
|
|
5
|
+
:overlay="false"
|
|
6
|
+
:isOpen="dropDownOpen"
|
|
7
|
+
@opened="initData"
|
|
8
|
+
>
|
|
9
|
+
<template #trigger>
|
|
10
|
+
<a class="notification-href pointer" ref="notifications_sidebar">
|
|
11
|
+
<i
|
|
12
|
+
class="icon notification"
|
|
13
|
+
:class="{ 'bell-animation': displayAnimation }"
|
|
14
|
+
></i>
|
|
15
|
+
<transition name="fade" :duration="{ enter: 4000, leave: 1 }">
|
|
16
|
+
<span v-show="hasUnreadNotifications" class="has-unread"></span>
|
|
17
|
+
</transition>
|
|
18
|
+
</a>
|
|
19
|
+
</template>
|
|
20
|
+
<template #header>
|
|
21
|
+
<div class="row note-title-row">
|
|
22
|
+
<div class="col s10">
|
|
23
|
+
<span class="primary-text">Notifications</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="col s2">
|
|
26
|
+
<dropdown-menu direction="left" :overlay="false">
|
|
27
|
+
<template #trigger>
|
|
28
|
+
<a
|
|
29
|
+
class="pointer"
|
|
30
|
+
ref="manage_dropdown"
|
|
31
|
+
:data-target="`manage_dropdown_${_uid}`"
|
|
32
|
+
>
|
|
33
|
+
<div
|
|
34
|
+
class="overflowed-menu-toggler notification-manage-toggler"
|
|
35
|
+
>
|
|
36
|
+
<span></span>
|
|
37
|
+
<span></span>
|
|
38
|
+
<span></span>
|
|
39
|
+
</div>
|
|
40
|
+
</a>
|
|
41
|
+
</template>
|
|
42
|
+
<template #body>
|
|
43
|
+
<ul class="sub-menu">
|
|
44
|
+
<li>
|
|
45
|
+
<a
|
|
46
|
+
@click="readAll"
|
|
47
|
+
:class="{
|
|
48
|
+
'is-disabled':
|
|
49
|
+
!totalUnread.notice && !totalUnread.pending_request,
|
|
50
|
+
}"
|
|
51
|
+
>
|
|
52
|
+
Mark all as read
|
|
53
|
+
</a>
|
|
54
|
+
</li>
|
|
55
|
+
<li>
|
|
56
|
+
<a
|
|
57
|
+
@click="dismissAll"
|
|
58
|
+
:class="{
|
|
59
|
+
'is-disabled':
|
|
60
|
+
!notices.count() && !pendingRequests.count(),
|
|
61
|
+
}"
|
|
62
|
+
>
|
|
63
|
+
Dismiss all
|
|
64
|
+
</a>
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
</template>
|
|
68
|
+
</dropdown-menu>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
72
|
+
<template #body>
|
|
73
|
+
<div class="main-dropdown">
|
|
74
|
+
<div class="row">
|
|
75
|
+
<tabs
|
|
76
|
+
:tabs="tabs"
|
|
77
|
+
:currentTab="currentTab"
|
|
78
|
+
:wrapper-class="'default-tabs'"
|
|
79
|
+
:tab-class="'tab'"
|
|
80
|
+
:tab-active-class="'active'"
|
|
81
|
+
:line-class="'indicator'"
|
|
82
|
+
@onClick="changeActiveTab"
|
|
83
|
+
ref="tabs"
|
|
84
|
+
/>
|
|
85
|
+
<div class="notification-content">
|
|
86
|
+
<div class="row notifications-list" v-show="currentTab === 'all'">
|
|
87
|
+
<vue-custom-scrollbar
|
|
88
|
+
ref="scrollBar"
|
|
89
|
+
class="col tab-content"
|
|
90
|
+
:options="scrollBarSettings"
|
|
91
|
+
@ps-y-reach-end="loadAllNotifications"
|
|
92
|
+
>
|
|
93
|
+
<notification
|
|
94
|
+
v-for="notification in notices"
|
|
95
|
+
@rejection-component="emitRejectionComponent"
|
|
96
|
+
:key="notification.id"
|
|
97
|
+
:notification="notification"
|
|
98
|
+
></notification>
|
|
99
|
+
<preloader
|
|
100
|
+
v-if="queryAll.loading"
|
|
101
|
+
:size="preloaderSize"
|
|
102
|
+
></preloader>
|
|
103
|
+
<div
|
|
104
|
+
v-else-if="!notices.count()"
|
|
105
|
+
class="main-text margin-top-50 align-center"
|
|
106
|
+
>
|
|
107
|
+
You have no new notifications
|
|
108
|
+
</div>
|
|
109
|
+
</vue-custom-scrollbar>
|
|
110
|
+
</div>
|
|
111
|
+
<div
|
|
112
|
+
class="row notifications-list"
|
|
113
|
+
v-show="currentTab === 'pending_approval'"
|
|
114
|
+
>
|
|
115
|
+
<vue-custom-scrollbar
|
|
116
|
+
class="col tab-content"
|
|
117
|
+
:options="scrollBarSettings"
|
|
118
|
+
@ps-y-reach-end="loadPendingRequests"
|
|
119
|
+
>
|
|
120
|
+
<notification
|
|
121
|
+
v-for="notification in pendingRequests"
|
|
122
|
+
@rejection-component="emitRejectionComponent"
|
|
123
|
+
:key="notification.id"
|
|
124
|
+
:notification="notification"
|
|
125
|
+
></notification>
|
|
126
|
+
<preloader
|
|
127
|
+
v-if="queryAll.loading"
|
|
128
|
+
:size="preloaderSize"
|
|
129
|
+
></preloader>
|
|
130
|
+
<div
|
|
131
|
+
v-else-if="!pendingRequests.count()"
|
|
132
|
+
class="main-text margin-top-50 align-center"
|
|
133
|
+
>
|
|
134
|
+
You have no pending requests
|
|
135
|
+
</div>
|
|
136
|
+
</vue-custom-scrollbar>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<div class="row view-all-row align-center">
|
|
141
|
+
<action-button
|
|
142
|
+
v-if="isLiteDomain"
|
|
143
|
+
:to="{ name: 'Employee Notifications' }"
|
|
144
|
+
is-link
|
|
145
|
+
@click.native="closeSidebar"
|
|
146
|
+
>
|
|
147
|
+
View all
|
|
148
|
+
</action-button>
|
|
149
|
+
<action-button
|
|
150
|
+
v-else
|
|
151
|
+
:href="`${intemsConfig.liteSiteUrl}`"
|
|
152
|
+
is-link
|
|
153
|
+
@click.native="closeSidebar"
|
|
154
|
+
>
|
|
155
|
+
View all
|
|
156
|
+
</action-button>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</template>
|
|
160
|
+
</dropdown-menu>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
|
|
164
|
+
<script>
|
|
165
|
+
import NotificationsSidebar from "./NotificationsSidebar";
|
|
166
|
+
|
|
167
|
+
export default NotificationsSidebar;
|
|
168
|
+
</script>
|
|
169
|
+
<style lang="scss">
|
|
170
|
+
@import "NotificationsSidebar";
|
|
171
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { NotificationType } from "../../../models/user/NotificationModel";
|
|
2
|
+
|
|
3
|
+
export type NotificationTotal = {
|
|
4
|
+
notification: number;
|
|
5
|
+
pending_request: number;
|
|
6
|
+
};
|
|
7
|
+
export default class {
|
|
8
|
+
notice = 0 as number;
|
|
9
|
+
pending_request = 0 as number;
|
|
10
|
+
private has_unread = undefined;
|
|
11
|
+
|
|
12
|
+
constructor(total?: NotificationTotal) {
|
|
13
|
+
if (!total) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
this.notice = total.notification;
|
|
17
|
+
this.pending_request = total.pending_request;
|
|
18
|
+
this.checkHasUnread();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
decrement(type: NotificationType): this {
|
|
22
|
+
this[type.toString()] = this[type.toString()] - 1;
|
|
23
|
+
this.checkHasUnread();
|
|
24
|
+
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
increment(type: NotificationType | string): this {
|
|
29
|
+
this[type.toString()] = this[type.toString()] + 1;
|
|
30
|
+
this.checkHasUnread();
|
|
31
|
+
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private checkHasUnread(): void {
|
|
36
|
+
this.has_unread = this.notice > 0 || this.pending_request > 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get hasUnread(): boolean {
|
|
40
|
+
return this.has_unread;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
readAll(): this {
|
|
44
|
+
this.notice = 0;
|
|
45
|
+
this.pending_request = 0;
|
|
46
|
+
this.checkHasUnread();
|
|
47
|
+
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { mapActions } from "vuex";
|
|
2
|
+
import ActionButton from "../../buttons/action-button/ActionButton.vue";
|
|
3
|
+
import ActionProcessing from "../../../mixins/notifications/ActionProcessing";
|
|
4
|
+
import TimeAgo from "../../time-ago/TimeAgo.vue";
|
|
5
|
+
import NotificationModel from "../../../models/user/NotificationModel";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
components: { TimeAgo, ActionButton },
|
|
9
|
+
props: {
|
|
10
|
+
notification: NotificationModel,
|
|
11
|
+
},
|
|
12
|
+
mixins: [ActionProcessing],
|
|
13
|
+
methods: {
|
|
14
|
+
...mapActions("User/Notifications", ["read"]),
|
|
15
|
+
...mapActions("User/Notifications/SidebarModule", ["dismiss"]),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="note" :class="{ read: !notification.isNew }">
|
|
3
|
+
<div class="row">
|
|
4
|
+
<div class="col s2 margin-top-5">
|
|
5
|
+
<i class="icon category-icon" :class="notification.icon"></i>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="col s8 note-title-col">
|
|
8
|
+
<span class="primary-text" v-html="notification.title"></span><br />
|
|
9
|
+
<span class="text-muted"
|
|
10
|
+
><time-ago :time="notification.created_at"></time-ago
|
|
11
|
+
></span>
|
|
12
|
+
</div>
|
|
13
|
+
<span class="manage-notification">
|
|
14
|
+
<a
|
|
15
|
+
v-if="notification.isNew && !actionProcessing"
|
|
16
|
+
@click="read(notification)"
|
|
17
|
+
class="pointer"
|
|
18
|
+
title="Mark as read"
|
|
19
|
+
>
|
|
20
|
+
<i class="icon icon-small visibility"></i>
|
|
21
|
+
</a>
|
|
22
|
+
<a
|
|
23
|
+
v-if="!actionProcessing"
|
|
24
|
+
@click="dismiss(notification)"
|
|
25
|
+
class="margin-left-10 pointer"
|
|
26
|
+
>
|
|
27
|
+
<i class="icon icon-small delete" title="Dismiss"></i>
|
|
28
|
+
</a>
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="row margin-top-15">
|
|
32
|
+
<div
|
|
33
|
+
class="col semi-primary-text"
|
|
34
|
+
v-html="notification.description"
|
|
35
|
+
></div>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="row margin-top-15" v-if="notification.actions.count()">
|
|
38
|
+
<div class="col s10 action-buttons">
|
|
39
|
+
<template v-for="(action, index) in notification.actions">
|
|
40
|
+
<action-button
|
|
41
|
+
v-if="
|
|
42
|
+
!notification.isProcessed && !action.isLink && !actionProcessing
|
|
43
|
+
"
|
|
44
|
+
:key="index"
|
|
45
|
+
class="margin-right-10"
|
|
46
|
+
:class="{ 'reject-color': action.isReject }"
|
|
47
|
+
btn-link
|
|
48
|
+
@click.native="submitAction(action)"
|
|
49
|
+
>
|
|
50
|
+
{{ title(action) }}
|
|
51
|
+
</action-button>
|
|
52
|
+
<action-button
|
|
53
|
+
v-else-if="action.isLink"
|
|
54
|
+
:key="index"
|
|
55
|
+
:is-disabled="isExpired(action)"
|
|
56
|
+
btn-link
|
|
57
|
+
class="margin-right-10"
|
|
58
|
+
@click.native="proceedToView(action)"
|
|
59
|
+
>
|
|
60
|
+
{{ title(action) }}
|
|
61
|
+
</action-button>
|
|
62
|
+
<action-button
|
|
63
|
+
v-else
|
|
64
|
+
is-disabled
|
|
65
|
+
btn-link
|
|
66
|
+
class="margin-right-10"
|
|
67
|
+
:key="index"
|
|
68
|
+
>
|
|
69
|
+
{{ title(action) }}
|
|
70
|
+
</action-button>
|
|
71
|
+
</template>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="col s2 align-right">
|
|
74
|
+
<i
|
|
75
|
+
v-show="actionProcessing"
|
|
76
|
+
class="icon icon-small2 loading-spinner loading"
|
|
77
|
+
></i>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script>
|
|
84
|
+
import Notification from "./Notification";
|
|
85
|
+
|
|
86
|
+
export default Notification;
|
|
87
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@import "../../scss/components/variables";
|
|
3
|
+
|
|
4
|
+
#modalTracked {
|
|
5
|
+
color: map.get($intems-colors, "dark");
|
|
6
|
+
.modal-content {
|
|
7
|
+
#tracked-content {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
p {
|
|
11
|
+
margin: 0;
|
|
12
|
+
line-height: initial;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
#span-clock {
|
|
16
|
+
margin-right: 10px;
|
|
17
|
+
i {
|
|
18
|
+
font-size: 54px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
.play-pause {
|
|
24
|
+
display: flex;
|
|
25
|
+
i.spinner-solid {
|
|
26
|
+
animation: spin 1s linear infinite;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
@keyframes spin {
|
|
30
|
+
100% {
|
|
31
|
+
transform: rotate(360deg);
|
|
32
|
+
}
|
|
33
|
+
}
|