@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,159 @@
|
|
|
1
|
+
import { collect, Collection } from "collect.js";
|
|
2
|
+
import { AxiosError } from "axios";
|
|
3
|
+
import { maxLength, numeric, required } from "vuelidate/lib/validators";
|
|
4
|
+
import BaseRepository from "../../repositories/BaseRepository";
|
|
5
|
+
import { BaseUrl } from "../../repositories/BaseUrl";
|
|
6
|
+
import KudosShareModel from "./models/KudosShareModel";
|
|
7
|
+
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
8
|
+
import { DefaultContext } from "../../helpers/response/ResponseHelper";
|
|
9
|
+
import ErrorsToToastHelper from "../../helpers/response/ErrorsToToastHelper";
|
|
10
|
+
import UserPublicInfoModel from "../../models/user/PublicInfoModel";
|
|
11
|
+
import UserExtendedInfoModel from "../../models/user/ExtendedInfoModel";
|
|
12
|
+
import { KudosBalance } from "./validators/KudosBalance";
|
|
13
|
+
import UserListModel from "./models/UserListModel";
|
|
14
|
+
import { InEnglishValidatorRegex } from "./validators/InEnglishValidatorRegex";
|
|
15
|
+
import { EventBus } from "../../buses/eventBus";
|
|
16
|
+
import GiveKudosEvent from "../../buses/events/GiveKudosEvent";
|
|
17
|
+
import UserSelectMixin from "./mixins/UserSelectMixin";
|
|
18
|
+
import Modal from "../modal/Modal.vue";
|
|
19
|
+
import VSelectIntems from "../v-select-intems/VSelectIntems.vue";
|
|
20
|
+
import ActionButton from "../buttons/action-button/ActionButton.vue";
|
|
21
|
+
import SecondaryButton from "../buttons/secondary-button/SecondaryButton.vue";
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
mixins: [UserSelectMixin],
|
|
25
|
+
inject: ["storeAdapter"],
|
|
26
|
+
components: { Modal, ActionButton, SecondaryButton, VSelectIntems },
|
|
27
|
+
async beforeMount(): Promise<void> {
|
|
28
|
+
this.users = await this.repository.get();
|
|
29
|
+
},
|
|
30
|
+
mounted(): void {
|
|
31
|
+
this.openModalForm();
|
|
32
|
+
},
|
|
33
|
+
validations: {
|
|
34
|
+
kudosShare: {
|
|
35
|
+
points_amount: { required, numeric, between: KudosBalance },
|
|
36
|
+
comment: { regex: InEnglishValidatorRegex, maxLength: maxLength(500) },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
allUsers(): [] {
|
|
41
|
+
return this.users
|
|
42
|
+
.filter(
|
|
43
|
+
(employee) => employee.employee_id !== this.userData.employee_id
|
|
44
|
+
)
|
|
45
|
+
.all();
|
|
46
|
+
},
|
|
47
|
+
isDisabledSubmit(): boolean {
|
|
48
|
+
return (
|
|
49
|
+
!this.kudosShare.employee_id ||
|
|
50
|
+
this.kudosShare.points_amount <= 0 ||
|
|
51
|
+
this.kudosShare.share_reason === undefined ||
|
|
52
|
+
!this.kudosShare.comment ||
|
|
53
|
+
this.isLoadingSubmit
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
userData(): UserPublicInfoModel | UserExtendedInfoModel {
|
|
57
|
+
return this.storeAdapter.User.state.data;
|
|
58
|
+
},
|
|
59
|
+
employee: {
|
|
60
|
+
get(): number {
|
|
61
|
+
return this.kudosShare.employee_id;
|
|
62
|
+
},
|
|
63
|
+
set(val): void {
|
|
64
|
+
this.kudosShare.employee_id = val;
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
async submit(): Promise<void> {
|
|
70
|
+
this.$v.$touch();
|
|
71
|
+
if (!this.$v.$invalid) {
|
|
72
|
+
this.isLoadingSubmit = true;
|
|
73
|
+
const repository = new BaseRepository(
|
|
74
|
+
BaseUrl.GiveKudos,
|
|
75
|
+
KudosShareModel
|
|
76
|
+
);
|
|
77
|
+
repository
|
|
78
|
+
.getResponseHelper()
|
|
79
|
+
.subscribe(
|
|
80
|
+
ResponseState.Resolved,
|
|
81
|
+
this.handleSuccess,
|
|
82
|
+
DefaultContext
|
|
83
|
+
);
|
|
84
|
+
repository
|
|
85
|
+
.getResponseHelper()
|
|
86
|
+
.subscribe(
|
|
87
|
+
ResponseState.Rejected,
|
|
88
|
+
(error) => this.handleError(error),
|
|
89
|
+
DefaultContext
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const kudosShare = {
|
|
93
|
+
employee_id: this.employee.employee_id,
|
|
94
|
+
points_amount: this.kudosShare.points_amount,
|
|
95
|
+
share_reason: this.kudosShare.share_reason,
|
|
96
|
+
comment: this.kudosShare.comment,
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
await repository.post(kudosShare);
|
|
100
|
+
|
|
101
|
+
this.isLoadingSubmit = false;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
handleError(error: AxiosError): void {
|
|
105
|
+
this.formDisabled = false;
|
|
106
|
+
ErrorsToToastHelper.showErrors(error);
|
|
107
|
+
},
|
|
108
|
+
handleSuccess(): void {
|
|
109
|
+
this.storeAdapter.Toasts.mutations.addMessage(
|
|
110
|
+
"You have given kudos successfully"
|
|
111
|
+
);
|
|
112
|
+
EventBus.dispatch(new GiveKudosEvent());
|
|
113
|
+
this.$modal.hide("giveKudos");
|
|
114
|
+
},
|
|
115
|
+
openModalForm(): void {
|
|
116
|
+
this.$v.$reset();
|
|
117
|
+
this.kudosShare = new KudosShareModel();
|
|
118
|
+
this.$modal.show("giveKudos");
|
|
119
|
+
},
|
|
120
|
+
closeModalForm(): void {
|
|
121
|
+
this.$emit("closed");
|
|
122
|
+
this.$modal.hide("giveKudos");
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
data(): Record<string, unknown> {
|
|
126
|
+
return {
|
|
127
|
+
repository: new BaseRepository(BaseUrl.GiveKudosUsersList, UserListModel),
|
|
128
|
+
users: collect() as Collection<UserListModel>,
|
|
129
|
+
kudosShare: new KudosShareModel(),
|
|
130
|
+
isLoadingSubmit: false,
|
|
131
|
+
kudosCategoryList: [
|
|
132
|
+
{
|
|
133
|
+
label: "One Team",
|
|
134
|
+
value: 5,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: "Getting Things Done Humanly",
|
|
138
|
+
value: 6,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: "Growth Mindset",
|
|
142
|
+
value: 7,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: "Focus on Value",
|
|
146
|
+
value: 8,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: "Equity, Diversity, Inclusivity",
|
|
150
|
+
value: 9,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: "Welcome to Intellias",
|
|
154
|
+
value: 10,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="give-kudos">
|
|
3
|
+
<modal name="giveKudos" size="md">
|
|
4
|
+
<template slot="header">Give kudos</template>
|
|
5
|
+
<template slot="content">
|
|
6
|
+
<div class="subtitle">
|
|
7
|
+
<span>
|
|
8
|
+
Reward your colleagues with kudos to express gratitude for their
|
|
9
|
+
good work, expertise, friendship and support.
|
|
10
|
+
</span>
|
|
11
|
+
<br />
|
|
12
|
+
<a
|
|
13
|
+
href="https://confluence.intellias.com/pages/viewpage.action?pageId=46334516"
|
|
14
|
+
target="_blank"
|
|
15
|
+
rel="noopener"
|
|
16
|
+
>More details</a
|
|
17
|
+
>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="form">
|
|
20
|
+
<div class="user">
|
|
21
|
+
<label for="user">Receiver’s name</label>
|
|
22
|
+
<v-select-intems
|
|
23
|
+
id="user"
|
|
24
|
+
v-model="employee"
|
|
25
|
+
v-bind:data="{
|
|
26
|
+
class: { 'select-with-avatars': true },
|
|
27
|
+
clearable: false,
|
|
28
|
+
options: userSelectOptions(allUsers),
|
|
29
|
+
label: userSelect.label,
|
|
30
|
+
filterBy: userSelect.filterBy,
|
|
31
|
+
placeholder: 'Select employee',
|
|
32
|
+
}"
|
|
33
|
+
@open="userSelectOnOpen"
|
|
34
|
+
@close="userSelectOnClose"
|
|
35
|
+
@search="userSelectOnSearch"
|
|
36
|
+
>
|
|
37
|
+
<template #list-footer>
|
|
38
|
+
<li
|
|
39
|
+
v-show="userSelectHasNextPage"
|
|
40
|
+
ref="loadUsers"
|
|
41
|
+
class="loader"
|
|
42
|
+
></li>
|
|
43
|
+
</template>
|
|
44
|
+
</v-select-intems>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="block-kudos-category">
|
|
47
|
+
<label for="kudos-category">Kudos category</label>
|
|
48
|
+
<v-select-intems
|
|
49
|
+
id="kudos-category"
|
|
50
|
+
v-model="kudosShare.share_reason"
|
|
51
|
+
v-bind:data="{
|
|
52
|
+
clearable: false,
|
|
53
|
+
placeholder: 'Select category',
|
|
54
|
+
options: kudosCategoryList,
|
|
55
|
+
label: 'label',
|
|
56
|
+
reduce: (category) => category.value,
|
|
57
|
+
}"
|
|
58
|
+
></v-select-intems>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="block-kudos-quantity">
|
|
61
|
+
<label for="kudos-quantity">Kudos quantity</label>
|
|
62
|
+
<input
|
|
63
|
+
class="kudos-quantity"
|
|
64
|
+
id="kudos-quantity"
|
|
65
|
+
type="number"
|
|
66
|
+
v-model="kudosShare.points_amount"
|
|
67
|
+
min="1"
|
|
68
|
+
:max="userData.kudos_balance"
|
|
69
|
+
:class="{ 'error-field': $v.kudosShare.points_amount.$error }"
|
|
70
|
+
/>
|
|
71
|
+
<div v-if="$v.kudosShare.points_amount.$error">
|
|
72
|
+
<div class="error" v-if="!$v.kudosShare.points_amount.numeric">
|
|
73
|
+
Should be be positive integer
|
|
74
|
+
</div>
|
|
75
|
+
<div
|
|
76
|
+
class="error"
|
|
77
|
+
v-if="!$v.kudosShare.points_amount.kudosBalance"
|
|
78
|
+
>
|
|
79
|
+
Your kudos balance is insufficient
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div class="description">
|
|
85
|
+
<label for="description">Comment</label>
|
|
86
|
+
<textarea
|
|
87
|
+
id="description"
|
|
88
|
+
placeholder="Describe what you are grateful for"
|
|
89
|
+
name="description"
|
|
90
|
+
v-model="kudosShare.comment"
|
|
91
|
+
:class="{ 'error-field': $v.kudosShare.comment.$error }"
|
|
92
|
+
></textarea>
|
|
93
|
+
<div v-if="$v.kudosShare.comment.$error">
|
|
94
|
+
<div class="error" v-if="!$v.kudosShare.comment.regex">
|
|
95
|
+
Only Latin letters allowed
|
|
96
|
+
</div>
|
|
97
|
+
<div class="error" v-if="!$v.kudosShare.comment.maxLength">
|
|
98
|
+
Maximum length of this field is 500 symbols
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</template>
|
|
104
|
+
<template slot="footer">
|
|
105
|
+
<secondary-button
|
|
106
|
+
:disabled="isLoadingSubmit"
|
|
107
|
+
@click.native="closeModalForm"
|
|
108
|
+
>Cancel</secondary-button
|
|
109
|
+
>
|
|
110
|
+
<action-button
|
|
111
|
+
class="btn-primary"
|
|
112
|
+
@click.native="submit()"
|
|
113
|
+
:is-disabled="isDisabledSubmit"
|
|
114
|
+
:is-loading="isLoadingSubmit"
|
|
115
|
+
>
|
|
116
|
+
Submit
|
|
117
|
+
</action-button>
|
|
118
|
+
</template>
|
|
119
|
+
</modal>
|
|
120
|
+
</div>
|
|
121
|
+
</template>
|
|
122
|
+
|
|
123
|
+
<script>
|
|
124
|
+
import GiveKudosForm from "./GiveKudosForm";
|
|
125
|
+
|
|
126
|
+
export default GiveKudosForm;
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<style lang="scss">
|
|
130
|
+
@import "GiveKudosForm";
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import PublicInfoModel from "../../../models/user/PublicInfoModel";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
methods: {
|
|
5
|
+
filteredOptions(options: Array<PublicInfoModel>): Array<PublicInfoModel> {
|
|
6
|
+
return options.filter((option) => {
|
|
7
|
+
return this.userSelect.filterBy.some((filterKey) => {
|
|
8
|
+
return option[filterKey]
|
|
9
|
+
.toLowerCase()
|
|
10
|
+
.includes(this.userSelect.search.toLowerCase());
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
userSelectOptions(options: Array<PublicInfoModel>): Array<PublicInfoModel> {
|
|
15
|
+
return this.filteredOptions(options).slice(0, this.userSelect.limit);
|
|
16
|
+
},
|
|
17
|
+
userSelectHasNextPage(): boolean {
|
|
18
|
+
return this.userSelectOptions().length < this.filteredOptions().length;
|
|
19
|
+
},
|
|
20
|
+
async userSelectOnOpen(): Promise<void> {
|
|
21
|
+
if (this.userSelectHasNextPage) {
|
|
22
|
+
this.userSelect.observer = new IntersectionObserver(
|
|
23
|
+
this.infiniteScroll
|
|
24
|
+
);
|
|
25
|
+
await this.$nextTick();
|
|
26
|
+
this.userSelect.observer.observe(this.$refs.loadUsers);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
userSelectOnClose(): void {
|
|
30
|
+
this.userSelect.search = "";
|
|
31
|
+
this.userSelect.observer.disconnect();
|
|
32
|
+
},
|
|
33
|
+
userSelectOnSearch(optionName: string): void {
|
|
34
|
+
this.userSelect.search = optionName;
|
|
35
|
+
},
|
|
36
|
+
async infiniteScroll([{ isIntersecting, target }]): Promise<void> {
|
|
37
|
+
if (isIntersecting) {
|
|
38
|
+
const ul = target.offsetParent;
|
|
39
|
+
const { scrollTop } = target.offsetParent;
|
|
40
|
+
this.userSelect.limit += 10;
|
|
41
|
+
await this.$nextTick();
|
|
42
|
+
ul.scrollTop = scrollTop;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
data(): Record<string, unknown> {
|
|
47
|
+
return {
|
|
48
|
+
userSelect: {
|
|
49
|
+
label: "full_name",
|
|
50
|
+
filterBy: ["full_name", "full_name_reversed", "username"],
|
|
51
|
+
observer: null,
|
|
52
|
+
limit: 10 as number,
|
|
53
|
+
search: "" as string,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const InEnglishValidatorRegex = (value: string) => {
|
|
2
|
+
if (!value) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
return !/[^\x00-\x7F]+/.test(value);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const InEnglishWithoutSymbolsRegex = (value: string) => {
|
|
10
|
+
if (!value) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return /^[a-zA-Z0-9\s.,\n]*$/.test(value);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { InEnglishValidatorRegex, InEnglishWithoutSymbolsRegex };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import UserExtendedInfoModel from "../../../models/user/ExtendedInfoModel";
|
|
2
|
+
import { myOptions } from "../../../wrapper";
|
|
3
|
+
|
|
4
|
+
const KudosBalance = (value: number) =>
|
|
5
|
+
value > 0 &&
|
|
6
|
+
value <=
|
|
7
|
+
(myOptions.storeAdapter.User.state.data as UserExtendedInfoModel)
|
|
8
|
+
.kudos_balance;
|
|
9
|
+
|
|
10
|
+
export { KudosBalance };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@import "../../scss/components/utils";
|
|
3
|
+
@import "../../scss/components/variables";
|
|
4
|
+
|
|
5
|
+
.modal {
|
|
6
|
+
&-wrapper {
|
|
7
|
+
padding-bottom: 1rem;
|
|
8
|
+
border-radius: 6px !important;
|
|
9
|
+
background-color: map.get($intems-colors, "surface-primary") !important;
|
|
10
|
+
box-shadow: 0 15px 30px rgba(37, 55, 70, 0.202715);
|
|
11
|
+
color: map.get($intems-colors, "text-primary");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-header {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
padding: 2rem 2rem 1rem 2rem;
|
|
18
|
+
font-size: 1.25rem;
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
|
|
21
|
+
i.icon:before {
|
|
22
|
+
background-color: map.get($intems-colors, "text-primary") !important;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-content {
|
|
27
|
+
padding: 1rem 2rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-close {
|
|
31
|
+
width: 15px !important;
|
|
32
|
+
min-width: 15px;
|
|
33
|
+
height: 15px !important;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&-footer {
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
padding: 1rem 2rem;
|
|
41
|
+
|
|
42
|
+
.btn {
|
|
43
|
+
&:not(:first-child) {
|
|
44
|
+
margin-left: 1rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.vm--overlay {
|
|
51
|
+
background-color: rgba(37, 55, 70, 0.55) !important;
|
|
52
|
+
transition: 0.3s !important;
|
|
53
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { isMobile } from "mobile-device-detect";
|
|
2
|
+
|
|
3
|
+
enum ModalSize {
|
|
4
|
+
mobile = "85%",
|
|
5
|
+
sm = "500px",
|
|
6
|
+
md = "780px",
|
|
7
|
+
lg = "968px",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
enum ModalSizeName {
|
|
11
|
+
sm = "sm",
|
|
12
|
+
md = "md",
|
|
13
|
+
lg = "lg",
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const modalSizeToName = new Map([
|
|
17
|
+
[ModalSizeName.sm, ModalSize.sm],
|
|
18
|
+
[ModalSizeName.md, ModalSize.md],
|
|
19
|
+
[ModalSizeName.lg, ModalSize.lg],
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
props: {
|
|
24
|
+
name: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ModalSizeName.sm,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
open(): void {
|
|
35
|
+
this.$modal.show(this.name);
|
|
36
|
+
},
|
|
37
|
+
close(): void {
|
|
38
|
+
this.$modal.hide(this.name);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
modalWidth(): string {
|
|
43
|
+
switch (this.size) {
|
|
44
|
+
case ModalSizeName.sm:
|
|
45
|
+
return !isMobile
|
|
46
|
+
? modalSizeToName.get(ModalSizeName.sm)
|
|
47
|
+
: ModalSize.mobile;
|
|
48
|
+
case ModalSizeName.md:
|
|
49
|
+
return !isMobile
|
|
50
|
+
? modalSizeToName.get(ModalSizeName.md)
|
|
51
|
+
: ModalSize.mobile;
|
|
52
|
+
case ModalSizeName.lg:
|
|
53
|
+
return !isMobile
|
|
54
|
+
? modalSizeToName.get(ModalSizeName.lg)
|
|
55
|
+
: ModalSize.mobile;
|
|
56
|
+
default:
|
|
57
|
+
return ModalSize.mobile;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
modalOptions(): Record<string, unknown> {
|
|
61
|
+
return {
|
|
62
|
+
classes: ["modal-wrapper"],
|
|
63
|
+
width: this.modalWidth,
|
|
64
|
+
height: "auto",
|
|
65
|
+
clickToClose: false,
|
|
66
|
+
scrollable: true,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<modal :name="name" v-bind="modalOptions">
|
|
3
|
+
<div class="modal-header">
|
|
4
|
+
<slot name="header">
|
|
5
|
+
<span>
|
|
6
|
+
<slot name="header"></slot>
|
|
7
|
+
</span>
|
|
8
|
+
</slot>
|
|
9
|
+
<i class="modal-close icon close" @click="close"></i>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-if="!!$slots.content" class="modal-content">
|
|
12
|
+
<slot name="content"></slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-if="!!$slots.footer" class="modal-footer">
|
|
15
|
+
<slot name="footer"></slot>
|
|
16
|
+
</div>
|
|
17
|
+
</modal>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import Modal from "./Modal";
|
|
22
|
+
|
|
23
|
+
export default Modal;
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style lang="scss">
|
|
27
|
+
@import "Modal";
|
|
28
|
+
</style>
|