@intellias/menu 1.0.0 → 1.0.4
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/README.md +40 -11
- package/dist/css/1.css +20 -5
- package/dist/css/main.css +20 -2
- package/dist/index.html +9 -0
- package/dist/js/0.js +27 -27
- package/dist/js/1.js +27 -27
- package/dist/js/2.js +19 -19
- package/dist/js/3.js +16 -16
- package/dist/js/4.js +16 -16
- package/dist/js/5.js +16 -16
- package/dist/js/6.js +5 -5
- package/dist/js/main.js +653 -642
- package/dist/js/vue.js +2 -2
- package/package.json +99 -112
- package/Menu.ts +0 -625
- package/assets/icons/arrow-down.svg +0 -13
- package/assets/icons/arrow-left.svg +0 -3
- package/assets/icons/arrow-submenu.svg +0 -8
- package/assets/icons/close.svg +0 -3
- package/assets/icons/delete.svg +0 -13
- package/assets/icons/faq-new.svg +0 -4
- package/assets/icons/kudos.svg +0 -14
- package/assets/icons/loading-spinner.svg +0 -40
- package/assets/icons/notification.svg +0 -11
- package/assets/icons/notifications/assessment.svg +0 -10
- package/assets/icons/notifications/buddy_program.svg +0 -8
- package/assets/icons/notifications/compensation_packages.svg +0 -10
- package/assets/icons/notifications/dsat.svg +0 -8
- package/assets/icons/notifications/feedback.svg +0 -7
- package/assets/icons/notifications/kudos.svg +0 -4
- package/assets/icons/notifications/overtime_requests.svg +0 -15
- package/assets/icons/notifications/pdu_program.svg +0 -4
- package/assets/icons/notifications/profile_update.svg +0 -6
- package/assets/icons/notifications/recommendation_program.svg +0 -7
- package/assets/icons/notifications/reminders.svg +0 -4
- package/assets/icons/notifications/sick_leaves.svg +0 -5
- package/assets/icons/notifications/smarts.svg +0 -4
- package/assets/icons/notifications/survey.svg +0 -8
- package/assets/icons/notifications/unpaid_leave.svg +0 -4
- package/assets/icons/notifications/vacations.svg +0 -4
- package/assets/icons/pause.svg +0 -13
- package/assets/icons/play.svg +0 -13
- package/assets/icons/smart.svg +0 -14
- package/assets/icons/smarts-kudos.svg +0 -11
- package/assets/icons/spinner-solid.svg +0 -1
- package/assets/icons/vacation.svg +0 -14
- package/assets/icons/visibility.svg +0 -1
- package/assets/intems-logo.svg +0 -3
- package/babel.config.js +0 -6
- package/buses/eventBus.ts +0 -19
- package/buses/events/GiveKudosEvent.ts +0 -7
- package/components/buttons/action-button/ActionButton.scss +0 -133
- package/components/buttons/action-button/ActionButton.ts +0 -57
- package/components/buttons/action-button/ActionButton.vue +0 -50
- package/components/buttons/secondary-button/SecondaryButton.scss +0 -48
- package/components/buttons/secondary-button/SecondaryButton.ts +0 -28
- package/components/buttons/secondary-button/SecondaryButton.vue +0 -27
- package/components/confirm/Confirm.scss +0 -44
- package/components/confirm/Confirm.ts +0 -82
- package/components/confirm/Confirm.vue +0 -64
- package/components/give-kudos-form/GiveKudosForm.scss +0 -114
- package/components/give-kudos-form/GiveKudosForm.ts +0 -159
- package/components/give-kudos-form/GiveKudosForm.vue +0 -131
- package/components/give-kudos-form/mixins/UserSelectMixin.ts +0 -57
- package/components/give-kudos-form/models/KudosShareModel.ts +0 -6
- package/components/give-kudos-form/models/UserListModel.ts +0 -5
- package/components/give-kudos-form/validators/InEnglishValidatorRegex.ts +0 -17
- package/components/give-kudos-form/validators/KudosBalance.ts +0 -10
- package/components/modal/Modal.scss +0 -53
- package/components/modal/Modal.ts +0 -70
- package/components/modal/Modal.vue +0 -28
- package/components/notifications-sidebar/NotificationsSidebar.scss +0 -665
- package/components/notifications-sidebar/NotificationsSidebar.ts +0 -203
- package/components/notifications-sidebar/NotificationsSidebar.vue +0 -171
- package/components/notifications-sidebar/models/BroadcastNotificationPayload.ts +0 -8
- package/components/notifications-sidebar/models/TotalCounter.ts +0 -50
- package/components/notifications-sidebar/notification/Notification.ts +0 -17
- package/components/notifications-sidebar/notification/Notification.vue +0 -87
- package/components/play-pause/PlayPause.scss +0 -33
- package/components/play-pause/PlayPause.ts +0 -156
- package/components/play-pause/PlayPause.vue +0 -36
- package/components/play-pause/PlayPauseStatus.ts +0 -4
- package/components/play-pause/helpers/LatestTrackedTimeDurationHelper.ts +0 -55
- package/components/play-pause/helpers/PauseHelper.ts +0 -55
- package/components/play-pause/helpers/TrackedTimeHelper.ts +0 -80
- package/components/preloader/Preloader.vue +0 -34
- package/components/request-loader/RequestLoader.scss +0 -20
- package/components/request-loader/RequestLoader.ts +0 -80
- package/components/request-loader/RequestLoader.vue +0 -15
- package/components/sub-menu/SubMenu.scss +0 -33
- package/components/sub-menu/SubMenu.ts +0 -38
- package/components/sub-menu/SubMenu.vue +0 -21
- package/components/time-ago/TimeAgo.ts +0 -34
- package/components/time-ago/TimeAgo.vue +0 -9
- package/components/user-picture/UserPicture.scss +0 -62
- package/components/user-picture/UserPicture.ts +0 -105
- package/components/user-picture/UserPicture.vue +0 -23
- package/components/v-select-intems/VSelectIntems.ts +0 -112
- package/components/v-select-intems/VSelectIntems.vue +0 -68
- package/components/v-select-intems/open-indicator/OpenIndicator.vue +0 -3
- package/dist/html/app.html +0 -19
- package/dist/html/styles.html +0 -1
- package/helpers/GeneralHelper.ts +0 -61
- package/helpers/PublisherSubscriber.ts +0 -34
- package/helpers/QueryFilter.ts +0 -204
- package/helpers/TimeHelper.ts +0 -54
- package/helpers/Validations.ts +0 -7
- package/helpers/model/ModelHelper.ts +0 -155
- package/helpers/model/decorators/AsCollection.ts +0 -26
- package/helpers/model/decorators/AsModel.ts +0 -25
- package/helpers/model/decorators/DateTime.ts +0 -26
- package/helpers/model/decorators/TimeDuration.ts +0 -33
- package/helpers/moment/Duration.ts +0 -64
- package/helpers/moment/Moment.ts +0 -17
- package/helpers/moment/index.d.ts +0 -20
- package/helpers/response/AxiosProxy.ts +0 -72
- package/helpers/response/ErrorsToToastHelper.ts +0 -42
- package/helpers/response/ResponseCode.ts +0 -16
- package/helpers/response/ResponseHelper.ts +0 -42
- package/helpers/response/ResponseInterface.ts +0 -34
- package/helpers/response/ResponseState.ts +0 -6
- package/jsconfig.json +0 -19
- package/mixins/IntemsMath.ts +0 -29
- package/mixins/notifications/ActionProcessing.ts +0 -134
- package/mixins/notifications/confirms/AssetRejectionConfirm.vue +0 -59
- package/mixins/notifications/confirms/SickLeaveRejectionConfirm.vue +0 -31
- package/mixins/notifications/confirms/UnpaidLeaveRejectionConfirm.vue +0 -31
- package/mixins/notifications/confirms/VacationRejectionConfirm.vue +0 -31
- package/models/AssetModel.ts +0 -80
- package/models/AssetRequestModel.ts +0 -25
- package/models/ConfigModel.ts +0 -20
- package/models/EmployeeStartEndDateModel.ts +0 -16
- package/models/EmploymentTypeModel.ts +0 -95
- package/models/LogoutModel.ts +0 -3
- package/models/Model.ts +0 -12
- package/models/ModuleOptions.ts +0 -24
- package/models/PublicInfoModel.ts +0 -38
- package/models/PublicLocationModel.ts +0 -36
- package/models/StatusModel.ts +0 -8
- package/models/TrackedTimeModel.ts +0 -32
- package/models/location/PublicLocationModel.ts +0 -36
- package/models/timezones/LocalTimezoneHistoryModel.ts +0 -8
- package/models/timezones/TimezoneModel.ts +0 -9
- package/models/user/ExtendedInfoModel.ts +0 -37
- package/models/user/NotificationActionModel.ts +0 -53
- package/models/user/NotificationModel.ts +0 -84
- package/models/user/PublicInfoModel.ts +0 -38
- package/models/user/WelcomeProgram.ts +0 -4
- package/repositories/BaseRepository.ts +0 -42
- package/repositories/BaseUrl.ts +0 -107
- package/repositories/Repository.ts +0 -291
- package/repositories/ResourceRepository.ts +0 -99
- package/repositories/TrackedTimeRepository.ts +0 -43
- package/repositories/UserRepository.ts +0 -75
- package/repositories/subscribers/CreateSubscribers.ts +0 -28
- package/repositories/subscribers/DefaultSubscribers.ts +0 -82
- package/repositories/subscribers/DeleteSubscribers.ts +0 -28
- package/repositories/subscribers/DownloadSubscribers.ts +0 -28
- package/repositories/subscribers/Subscribers.ts +0 -13
- package/repositories/subscribers/UpdateSubscribers.ts +0 -32
- package/scss/components/_global.scss +0 -66
- package/scss/components/_mixins.scss +0 -31
- package/scss/components/_tooltip.scss +0 -45
- package/scss/components/_utils.scss +0 -26
- package/scss/components/_variables.scss +0 -103
- package/scss/main.scss +0 -7
- package/shims-vue.d.ts +0 -9
- package/tsconfig.json +0 -31
- package/webpack.config.js +0 -126
- package/wrapper.ts +0 -51
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { mapGetters } from "vuex";
|
|
2
|
-
import { AxiosError, AxiosResponse } from "axios";
|
|
3
|
-
import * as moment from "moment-timezone";
|
|
4
|
-
import modal from "../modal/Modal.vue";
|
|
5
|
-
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
6
|
-
import * as Response from "../../helpers/response/ResponseInterface";
|
|
7
|
-
import { Status } from "./PlayPauseStatus";
|
|
8
|
-
import TrackedTimeModel from "../../models/TrackedTimeModel";
|
|
9
|
-
import TrackedTimeRepository, {
|
|
10
|
-
PauseContext,
|
|
11
|
-
PlayContext,
|
|
12
|
-
} from "../../repositories/TrackedTimeRepository";
|
|
13
|
-
import TrackedTimeHelper from "./helpers/TrackedTimeHelper";
|
|
14
|
-
import PauseHelper from "./helpers/PauseHelper";
|
|
15
|
-
import { ResponseCode } from "../../helpers/response/ResponseCode";
|
|
16
|
-
import { DefaultContext } from "../../helpers/response/ResponseHelper";
|
|
17
|
-
import LatestTrackedTimeDurationHelper from "./helpers/LatestTrackedTimeDurationHelper";
|
|
18
|
-
import ActionButton from "../buttons/action-button/ActionButton.vue";
|
|
19
|
-
import SecondaryButton from "../buttons/secondary-button/SecondaryButton.vue";
|
|
20
|
-
import { myOptions } from "../../wrapper";
|
|
21
|
-
import { isMobile } from "mobile-device-detect";
|
|
22
|
-
|
|
23
|
-
const groupedDataEndDate = moment().subtract(2, "days");
|
|
24
|
-
const trackedTimeRepository = new TrackedTimeRepository();
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
name: "playPause",
|
|
28
|
-
inject: ["storeAdapter"],
|
|
29
|
-
components: { modal, ActionButton, SecondaryButton },
|
|
30
|
-
async created(): Promise<void> {
|
|
31
|
-
this.applyRepositorySubscribers();
|
|
32
|
-
await this.getTrackedTimes();
|
|
33
|
-
this.isLoading = false;
|
|
34
|
-
},
|
|
35
|
-
computed: {
|
|
36
|
-
...mapGetters("User", ["getUser"]),
|
|
37
|
-
status(): Status {
|
|
38
|
-
return this.storeAdapter.TrackedTime.getters.status;
|
|
39
|
-
},
|
|
40
|
-
iconClass(): string {
|
|
41
|
-
if (this.isLoading) {
|
|
42
|
-
return "spinner-solid";
|
|
43
|
-
}
|
|
44
|
-
return this.status === Status.Play ? "pause" : "play";
|
|
45
|
-
},
|
|
46
|
-
latestTrackedTime(): TrackedTimeModel {
|
|
47
|
-
return this.storeAdapter.TrackedTime.getters.latest;
|
|
48
|
-
},
|
|
49
|
-
isMobile(): boolean {
|
|
50
|
-
return isMobile;
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
watch: {
|
|
54
|
-
latestTrackedTime(trackedTime): void {
|
|
55
|
-
this.latestTrackedTimeDurationHelper.calculate(
|
|
56
|
-
trackedTime,
|
|
57
|
-
this.getUser.getTimezone()
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
data(): Record<string, unknown> {
|
|
62
|
-
return {
|
|
63
|
-
trackedText: "Default Text",
|
|
64
|
-
duration: undefined,
|
|
65
|
-
isLoading: true,
|
|
66
|
-
latestTrackedTimeDurationHelper: new LatestTrackedTimeDurationHelper(),
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
methods: {
|
|
70
|
-
async addNow(): Promise<void> {
|
|
71
|
-
const timePagePath = myOptions.helperFunctions.getUrlPathByName("Time");
|
|
72
|
-
this.storeAdapter.TimePage.mutations.setAddNowMode(true);
|
|
73
|
-
if (this.$router.currentRoute.path !== timePagePath) {
|
|
74
|
-
await this.$router.replace(timePagePath);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
this.closeModalWindow();
|
|
78
|
-
},
|
|
79
|
-
closeModalWindow(): void {
|
|
80
|
-
this.$modal.hide("modalTracked");
|
|
81
|
-
},
|
|
82
|
-
handlePlayResolved(
|
|
83
|
-
response: AxiosResponse<Response.Read<TrackedTimeModel>>
|
|
84
|
-
): void {
|
|
85
|
-
const trackedTime = new TrackedTimeModel();
|
|
86
|
-
trackedTime.fill(response.data.data);
|
|
87
|
-
this.storeAdapter.TrackedTime.mutations.addTrackedTime(trackedTime);
|
|
88
|
-
this.storeAdapter.Toasts.mutations.addMessage(
|
|
89
|
-
"You have started tracking work time"
|
|
90
|
-
);
|
|
91
|
-
},
|
|
92
|
-
handlePauseResolved(
|
|
93
|
-
response: AxiosResponse<Response.Read<Array<TrackedTimeModel>>>
|
|
94
|
-
): void {
|
|
95
|
-
const trackedTimeHelper = new TrackedTimeHelper(response.data.data);
|
|
96
|
-
const pauseHelper = new PauseHelper(trackedTimeHelper);
|
|
97
|
-
const error = pauseHelper.getError();
|
|
98
|
-
if (error) {
|
|
99
|
-
this.storeAdapter.Toasts.mutations.addError(error);
|
|
100
|
-
this.storeAdapter.TrackedTime.mutations.setLatestTrackedTime(undefined);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
this.duration = trackedTimeHelper.today().duration;
|
|
105
|
-
this.trackedText = pauseHelper.getTrackedText();
|
|
106
|
-
if (pauseHelper.needOpenModalWindow()) {
|
|
107
|
-
this.$modal.show("modalTracked");
|
|
108
|
-
}
|
|
109
|
-
this.storeAdapter.Toasts.mutations.addMessage(pauseHelper.getMessage());
|
|
110
|
-
},
|
|
111
|
-
async handleRejected(error: AxiosError): Promise<void> {
|
|
112
|
-
if (error.response.status === ResponseCode.UnprocessableEntity) {
|
|
113
|
-
const firstError = Object.values(error.response.data.errors)[0];
|
|
114
|
-
this.storeAdapter.Toasts.mutations.addError(firstError[0]);
|
|
115
|
-
|
|
116
|
-
await this.getTrackedTimes();
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
applyRepositorySubscribers(): void {
|
|
120
|
-
const responseHelper = trackedTimeRepository.getResponseHelper();
|
|
121
|
-
responseHelper.subscribe(
|
|
122
|
-
ResponseState.Resolved,
|
|
123
|
-
(result) => this.handlePlayResolved(result),
|
|
124
|
-
PlayContext
|
|
125
|
-
);
|
|
126
|
-
responseHelper.subscribe(
|
|
127
|
-
ResponseState.Resolved,
|
|
128
|
-
(result) => this.handlePauseResolved(result),
|
|
129
|
-
PauseContext
|
|
130
|
-
);
|
|
131
|
-
responseHelper.subscribe(
|
|
132
|
-
ResponseState.Rejected,
|
|
133
|
-
(error) => this.handleRejected(error),
|
|
134
|
-
DefaultContext
|
|
135
|
-
);
|
|
136
|
-
},
|
|
137
|
-
async getTrackedTimes(): Promise<void> {
|
|
138
|
-
await this.storeAdapter.TrackedTime.actions.getTrackedTimes({
|
|
139
|
-
day$gt: groupedDataEndDate.format("YYYY-MM-DD"),
|
|
140
|
-
day$lte: moment.tz(this.getUser.getTimezone()).format("YYYY-MM-DD"),
|
|
141
|
-
});
|
|
142
|
-
if (this.status === undefined) {
|
|
143
|
-
await this.storeAdapter.TrackedTime.actions.getLatestTrackedTime();
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
async toggle(): Promise<void> {
|
|
147
|
-
this.isLoading = true;
|
|
148
|
-
if (this.status === Status.Play) {
|
|
149
|
-
await trackedTimeRepository.pause();
|
|
150
|
-
} else {
|
|
151
|
-
await trackedTimeRepository.play();
|
|
152
|
-
}
|
|
153
|
-
this.isLoading = false;
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="pointer">
|
|
3
|
-
<a
|
|
4
|
-
class="btn play-pause intems maintext"
|
|
5
|
-
v-on:click="toggle()"
|
|
6
|
-
:disabled="isLoading"
|
|
7
|
-
:style="{ 'background-color': '#415464 !important' }"
|
|
8
|
-
>
|
|
9
|
-
<i class="icon" :class="iconClass"></i>
|
|
10
|
-
</a>
|
|
11
|
-
|
|
12
|
-
<modal id="modalTracked" name="modalTracked" :size="isMobile ? 'lg' : 'md'">
|
|
13
|
-
<template slot="header">Tracked time</template>
|
|
14
|
-
<div slot="content" id="tracked-content">
|
|
15
|
-
<span id="span-clock"><i class="icon icon-time huge"></i></span>
|
|
16
|
-
<div v-html="trackedText"></div>
|
|
17
|
-
</div>
|
|
18
|
-
<template slot="footer">
|
|
19
|
-
<secondary-button @click.native="closeModalWindow">
|
|
20
|
-
Later
|
|
21
|
-
</secondary-button>
|
|
22
|
-
<action-button @click.native="addNow">Add now</action-button>
|
|
23
|
-
</template>
|
|
24
|
-
</modal>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
import PlayPause from "./PlayPause";
|
|
30
|
-
|
|
31
|
-
export default PlayPause;
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<style lang="scss">
|
|
35
|
-
@import "./PlayPause.scss";
|
|
36
|
-
</style>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as moment from "moment";
|
|
2
|
-
import TrackedTimeModel from "../../../models/TrackedTimeModel";
|
|
3
|
-
import {
|
|
4
|
-
diffMinutes,
|
|
5
|
-
nextTimeFiveMinutesWillRound,
|
|
6
|
-
} from "../../../helpers/TimeHelper";
|
|
7
|
-
import { myOptions } from "../../../wrapper";
|
|
8
|
-
|
|
9
|
-
export default class LatestTrackedTimeDurationHelper {
|
|
10
|
-
private trackedTime: TrackedTimeModel;
|
|
11
|
-
private scheduledTimeOutId;
|
|
12
|
-
|
|
13
|
-
calculate(trackedTime: TrackedTimeModel, timezone: string) {
|
|
14
|
-
this.trackedTime = trackedTime;
|
|
15
|
-
this.cancelScheduledCalculation();
|
|
16
|
-
if (
|
|
17
|
-
trackedTime &&
|
|
18
|
-
trackedTime.isToday(timezone) &&
|
|
19
|
-
!trackedTime.isFinished()
|
|
20
|
-
) {
|
|
21
|
-
const newDuration = moment.duration(
|
|
22
|
-
diffMinutes(
|
|
23
|
-
moment(trackedTime.start.format("YYYY-MM-DD HH:mm:ss")).tz(timezone),
|
|
24
|
-
moment(moment.tz(timezone).format("YYYY-MM-DD HH:mm:ss"))
|
|
25
|
-
),
|
|
26
|
-
"minutes"
|
|
27
|
-
);
|
|
28
|
-
this.update(newDuration);
|
|
29
|
-
this.scheduleNextCalculation(timezone);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
private update(value) {
|
|
34
|
-
myOptions.storeAdapter.TrackedTime.mutations.updateDuration({
|
|
35
|
-
id: this.trackedTime.id,
|
|
36
|
-
duration: value,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private scheduleNextCalculation(timezone: string) {
|
|
41
|
-
const now = moment(moment.tz(timezone).format("YYYY-MM-DD HH:mm:ss"));
|
|
42
|
-
const next = nextTimeFiveMinutesWillRound(
|
|
43
|
-
moment(this.trackedTime.start.format("YYYY-MM-DD HH:mm:ss")).tz(timezone),
|
|
44
|
-
now
|
|
45
|
-
);
|
|
46
|
-
const milliseconds = next.diff(now, "milliseconds");
|
|
47
|
-
this.scheduledTimeOutId = setTimeout(() => {
|
|
48
|
-
this.calculate(this.trackedTime, timezone);
|
|
49
|
-
}, milliseconds);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
private cancelScheduledCalculation() {
|
|
53
|
-
clearTimeout(this.scheduledTimeOutId);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import TrackedTimeHelper from "./TrackedTimeHelper";
|
|
2
|
-
|
|
3
|
-
export default class PauseHelper {
|
|
4
|
-
private trackedTimeHelper: TrackedTimeHelper;
|
|
5
|
-
constructor(trackedTimeHelper: TrackedTimeHelper) {
|
|
6
|
-
this.trackedTimeHelper = trackedTimeHelper;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
getError() {
|
|
10
|
-
if (this.trackedTimeHelper.today() === null) {
|
|
11
|
-
const latestTrackedTime = this.trackedTimeHelper.latest();
|
|
12
|
-
if (
|
|
13
|
-
latestTrackedTime.duration.asMinutes() === 0 &&
|
|
14
|
-
latestTrackedTime.calculateDuration().asMinutes() > 0
|
|
15
|
-
) {
|
|
16
|
-
return `INTEMS automatically stops tracking work time after a 12-hour period.`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return "";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
getMessage() {
|
|
23
|
-
if (this.trackedTimeHelper.isNightWork()) {
|
|
24
|
-
return "Night work";
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return "You have put work time tracking on pause.";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getTrackedText() {
|
|
31
|
-
if (this.trackedTimeHelper.isNightWork()) {
|
|
32
|
-
return `
|
|
33
|
-
<p>You have been tracking work time since yesterday.</p>
|
|
34
|
-
<p>The total time is ${this.trackedTimeHelper.totalNightWork()}, including ${this.trackedTimeHelper.totalYesterday()} tracked yesterday and ${this.trackedTimeHelper.totalToday()} tracked today.</p>
|
|
35
|
-
<p>Please describe the tasks you have been busy with during this time within 5 business days</p>`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const today = this.trackedTimeHelper.today();
|
|
39
|
-
if (today !== null && today.duration.asMinutes() > 0) {
|
|
40
|
-
return `
|
|
41
|
-
<p>Time tracking has been paused.</p>
|
|
42
|
-
<p>Please describe the tasks you have been busy within 5 business days.</p>`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return "";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
needOpenModalWindow() {
|
|
49
|
-
const today = this.trackedTimeHelper.today();
|
|
50
|
-
return (
|
|
51
|
-
this.trackedTimeHelper.isNightWork() ||
|
|
52
|
-
(today && today.duration.asMinutes() > 0)
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { collect, Collection } from "collect.js";
|
|
2
|
-
import * as moment from "moment";
|
|
3
|
-
import TrackedTimeModel from "../../../models/TrackedTimeModel";
|
|
4
|
-
import { formatDuration } from "../../../helpers/TimeHelper";
|
|
5
|
-
import { myOptions } from "../../../wrapper";
|
|
6
|
-
|
|
7
|
-
export default class TrackedTimeHelper {
|
|
8
|
-
private collection: Collection<TrackedTimeModel>;
|
|
9
|
-
|
|
10
|
-
constructor(responseData: Array<TrackedTimeModel>) {
|
|
11
|
-
this.mapToCollection(responseData);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
today(): TrackedTimeModel {
|
|
15
|
-
const formattedToday = moment().format("YYYY-MM-DD");
|
|
16
|
-
return this.collection.firstWhere("day", formattedToday);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
yesterday(): TrackedTimeModel {
|
|
20
|
-
const formattedYesterday = moment().subtract(1, "day").format("YYYY-MM-DD");
|
|
21
|
-
return this.collection.firstWhere("day", formattedYesterday);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
latest(): TrackedTimeModel {
|
|
25
|
-
return this.collection.sortByDesc("start").first();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
isNightWork() {
|
|
29
|
-
return this.today() && this.yesterday();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
totalToday() {
|
|
33
|
-
const today = this.today();
|
|
34
|
-
const total =
|
|
35
|
-
today instanceof TrackedTimeModel ? today.duration.asMinutes() : 0;
|
|
36
|
-
return formatDuration(total);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
totalYesterday() {
|
|
40
|
-
const yesterday = this.yesterday();
|
|
41
|
-
const total =
|
|
42
|
-
yesterday instanceof TrackedTimeModel
|
|
43
|
-
? yesterday.duration.asMinutes()
|
|
44
|
-
: 0;
|
|
45
|
-
return formatDuration(total);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
totalNightWork() {
|
|
49
|
-
const today = this.today();
|
|
50
|
-
const yesterday = this.yesterday();
|
|
51
|
-
const total =
|
|
52
|
-
today instanceof TrackedTimeModel && yesterday instanceof TrackedTimeModel
|
|
53
|
-
? today.duration.asMinutes() + yesterday.duration.asMinutes()
|
|
54
|
-
: 0;
|
|
55
|
-
return formatDuration(total);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
private mapToCollection(responseData: Array<TrackedTimeModel>) {
|
|
59
|
-
this.collection = collect(
|
|
60
|
-
responseData.map((resource) => {
|
|
61
|
-
const trackedTime = new TrackedTimeModel();
|
|
62
|
-
trackedTime.fill(resource);
|
|
63
|
-
const trackedTimeAlreadyExists =
|
|
64
|
-
myOptions.storeAdapter.TrackedTime.state.collection.firstWhere(
|
|
65
|
-
"id",
|
|
66
|
-
trackedTime.id
|
|
67
|
-
);
|
|
68
|
-
trackedTimeAlreadyExists
|
|
69
|
-
? myOptions.storeAdapter.TrackedTime.mutations.updateTrackedTime(
|
|
70
|
-
trackedTime
|
|
71
|
-
)
|
|
72
|
-
: myOptions.storeAdapter.TrackedTime.mutations.addTrackedTime(
|
|
73
|
-
trackedTime
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
return trackedTime;
|
|
77
|
-
})
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="preloader" :class="[size]">
|
|
3
|
-
<div class="preloader-wrapper active" :class="[size]">
|
|
4
|
-
<div class="spinner-layer">
|
|
5
|
-
<div class="circle-clipper left">
|
|
6
|
-
<div class="circle"></div>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="gap-patch">
|
|
9
|
-
<div class="circle"></div>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="circle-clipper right">
|
|
12
|
-
<div class="circle"></div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
<script lang="ts">
|
|
19
|
-
export default {
|
|
20
|
-
props: {
|
|
21
|
-
size: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: 'big'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
</script>
|
|
28
|
-
<style lang="scss">
|
|
29
|
-
.preloader {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
@import "../../scss/components/variables";
|
|
3
|
-
|
|
4
|
-
.progress {
|
|
5
|
-
margin: 0;
|
|
6
|
-
position: absolute;
|
|
7
|
-
.determinate {
|
|
8
|
-
background-color: map.get($intems-colors, "primary");
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
visibility: hidden;
|
|
12
|
-
opacity: 0;
|
|
13
|
-
transition: opacity 1.5s, visibility 1.5s;
|
|
14
|
-
|
|
15
|
-
&.show {
|
|
16
|
-
visibility: visible;
|
|
17
|
-
opacity: 1;
|
|
18
|
-
transition: visibility 0s;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
created() {
|
|
3
|
-
this.resetRealProgress();
|
|
4
|
-
},
|
|
5
|
-
inject: ["storeAdapter"],
|
|
6
|
-
computed: {
|
|
7
|
-
completed() {
|
|
8
|
-
return this.storeAdapter.Request.state.completed;
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
sent() {
|
|
12
|
-
return this.storeAdapter.Request.state.sent;
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
realProgress() {
|
|
16
|
-
const realProgress = (this.completed / this.sent) * 100;
|
|
17
|
-
return !Number.isNaN(realProgress) ? realProgress : 0;
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
show() {
|
|
21
|
-
return this.sent > 0 && this.completed <= this.sent;
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
watch: {
|
|
25
|
-
realProgress(newValue) {
|
|
26
|
-
this.progress = this.calculateProgress();
|
|
27
|
-
if (newValue === 100) {
|
|
28
|
-
this.resetRealProgress();
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
resetRealProgress() {
|
|
34
|
-
this.storeAdapter.Request.mutations.reset();
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
needResetProgress() {
|
|
38
|
-
return (
|
|
39
|
-
this.progress === 100 &&
|
|
40
|
-
this.realProgress > 0 &&
|
|
41
|
-
this.realProgress !== 100
|
|
42
|
-
);
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
// Progress doesn't changed since last request
|
|
46
|
-
progressDoesntChange() {
|
|
47
|
-
return this.realProgress === this.progress;
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
calculateProgress() {
|
|
51
|
-
if (this.needResetProgress()) {
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (this.progressDoesntChange()) {
|
|
56
|
-
// Add some animation by adding 1% to existing progress
|
|
57
|
-
return this.progress + 1;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let progress =
|
|
61
|
-
this.realProgress > this.progress ? this.realProgress : this.progress;
|
|
62
|
-
if (progress > 100) {
|
|
63
|
-
progress = 100;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return progress;
|
|
67
|
-
},
|
|
68
|
-
transitionEnd(e) {
|
|
69
|
-
// Is progress hidden
|
|
70
|
-
if (e.propertyName === "opacity" && e.target === this.$el) {
|
|
71
|
-
this.progress = 0;
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
data() {
|
|
76
|
-
return {
|
|
77
|
-
progress: 0,
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="progress" :class="{ show: show }" @transitionend="transitionEnd">
|
|
3
|
-
<div class="determinate" :style="{ width: progress + '%' }"></div>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script lang="ts">
|
|
8
|
-
import RequestLoader from './RequestLoader';
|
|
9
|
-
|
|
10
|
-
export default RequestLoader;
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<style scoped lang="scss">
|
|
14
|
-
@import './RequestLoader';
|
|
15
|
-
</style>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
@import "../../scss/components/utils";
|
|
3
|
-
@import "../../scss/components/variables";
|
|
4
|
-
|
|
5
|
-
.sub-menu {
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
background-color: map.get($intems-colors, "white");
|
|
8
|
-
box-shadow: 0 2px 6px 0 rgba(37, 55, 70, 0.1);
|
|
9
|
-
padding-left: 32px;
|
|
10
|
-
|
|
11
|
-
.items {
|
|
12
|
-
width: 100%;
|
|
13
|
-
font-size: $font-size-14;
|
|
14
|
-
font-family: $font-open-sans;
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
a {
|
|
17
|
-
color: map.get($intems-colors, "dark");
|
|
18
|
-
padding: 0 5px 5px;
|
|
19
|
-
margin-right: 15px;
|
|
20
|
-
float: left;
|
|
21
|
-
line-height: 29px;
|
|
22
|
-
height: 29px;
|
|
23
|
-
border-bottom: 3px solid white;
|
|
24
|
-
text-decoration: none;
|
|
25
|
-
box-sizing: content-box;
|
|
26
|
-
&:hover,
|
|
27
|
-
&.router-link-exact-active {
|
|
28
|
-
-webkit-text-stroke: 0.7px map.get($intems-colors, "dark");
|
|
29
|
-
border-bottom: 3px solid map.get($intems-colors, "primary");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { collect } from "collect.js";
|
|
2
|
-
import { ProjectName } from "../../wrapper";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
name: "SubMenu",
|
|
6
|
-
inject: ["storeAdapter", "subMenus", "projectName"],
|
|
7
|
-
computed: {
|
|
8
|
-
intemsConfig() {
|
|
9
|
-
return this.storeAdapter.Config.state.data;
|
|
10
|
-
},
|
|
11
|
-
currentSubMenuGroup() {
|
|
12
|
-
return this.$route.meta.subMenu !== undefined &&
|
|
13
|
-
this.$route.meta.subMenu.group !== undefined
|
|
14
|
-
? this.$route.meta.subMenu.group
|
|
15
|
-
: false;
|
|
16
|
-
},
|
|
17
|
-
currentSubMenuItems() {
|
|
18
|
-
if (this.projectName === ProjectName.Lite) {
|
|
19
|
-
if (this.currentSubMenuGroup) {
|
|
20
|
-
const currentGroup = this.subMenus.subMenuList.getByName(
|
|
21
|
-
this.currentSubMenuGroup
|
|
22
|
-
);
|
|
23
|
-
if (currentGroup) {
|
|
24
|
-
return currentGroup
|
|
25
|
-
.getItems()
|
|
26
|
-
.filter((value) => this.$can("read", value.resource));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return collect([]);
|
|
31
|
-
},
|
|
32
|
-
needToShow() {
|
|
33
|
-
return this.currentSubMenuGroup && this.currentSubMenuItems.count() > 1;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
methods: {},
|
|
38
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="sub-menu" v-if="needToShow">
|
|
3
|
-
<ul class="items">
|
|
4
|
-
<li v-for="(oneSubMenuItem, index) of currentSubMenuItems" :key="index">
|
|
5
|
-
<router-link v-if="!oneSubMenuItem.toMainDomain" :to="{ name: oneSubMenuItem.path }" exactPath>
|
|
6
|
-
{{ oneSubMenuItem.title }}
|
|
7
|
-
</router-link>
|
|
8
|
-
<a v-else :href="intemsConfig.oldSiteUrl + oneSubMenuItem.path">{{ oneSubMenuItem.title }}</a>
|
|
9
|
-
</li>
|
|
10
|
-
</ul>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script lang="ts">
|
|
15
|
-
import SubMenu from './SubMenu';
|
|
16
|
-
|
|
17
|
-
export default SubMenu;
|
|
18
|
-
</script>
|
|
19
|
-
<style lang="scss">
|
|
20
|
-
@import './SubMenu';
|
|
21
|
-
</style>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import moment, { Moment } from "moment";
|
|
2
|
-
import IntemsMath from "../../mixins/IntemsMath";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
props: {
|
|
6
|
-
time: undefined as Moment,
|
|
7
|
-
},
|
|
8
|
-
mixins: [IntemsMath],
|
|
9
|
-
computed: {
|
|
10
|
-
formattedTime(): string {
|
|
11
|
-
const seconds = moment().diff(this.time, "second");
|
|
12
|
-
const minutes = this.round(seconds / 60, 0);
|
|
13
|
-
const hours = this.round(minutes / 60, 0);
|
|
14
|
-
|
|
15
|
-
if (seconds < 5) {
|
|
16
|
-
return "just now";
|
|
17
|
-
}
|
|
18
|
-
if (seconds < 60) {
|
|
19
|
-
return `${seconds} seconds ago`;
|
|
20
|
-
}
|
|
21
|
-
if (seconds < 90) {
|
|
22
|
-
return "about a minute ago";
|
|
23
|
-
}
|
|
24
|
-
if (minutes < 60) {
|
|
25
|
-
return `${minutes} minute${minutes !== 1 ? "s" : ""} ago`;
|
|
26
|
-
}
|
|
27
|
-
if (hours < 24) {
|
|
28
|
-
return `${hours} hour${hours !== 1 ? "s" : ""} ago`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return this.time.format("MMM DD, YYYY");
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
};
|