@intellias/menu 1.0.2 → 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.
Files changed (170) hide show
  1. package/README.md +38 -9
  2. package/dist/css/1.css +20 -5
  3. package/dist/css/main.css +20 -2
  4. package/dist/index.html +9 -0
  5. package/dist/js/0.js +27 -27
  6. package/dist/js/1.js +27 -27
  7. package/dist/js/2.js +19 -19
  8. package/dist/js/3.js +16 -16
  9. package/dist/js/4.js +16 -16
  10. package/dist/js/5.js +16 -16
  11. package/dist/js/6.js +5 -5
  12. package/dist/js/main.js +653 -642
  13. package/dist/js/vue.js +2 -2
  14. package/package.json +99 -112
  15. package/Menu.ts +0 -625
  16. package/assets/icons/arrow-down.svg +0 -13
  17. package/assets/icons/arrow-left.svg +0 -3
  18. package/assets/icons/arrow-submenu.svg +0 -8
  19. package/assets/icons/close.svg +0 -3
  20. package/assets/icons/delete.svg +0 -13
  21. package/assets/icons/faq-new.svg +0 -4
  22. package/assets/icons/kudos.svg +0 -14
  23. package/assets/icons/loading-spinner.svg +0 -40
  24. package/assets/icons/notification.svg +0 -11
  25. package/assets/icons/notifications/assessment.svg +0 -10
  26. package/assets/icons/notifications/buddy_program.svg +0 -8
  27. package/assets/icons/notifications/compensation_packages.svg +0 -10
  28. package/assets/icons/notifications/dsat.svg +0 -8
  29. package/assets/icons/notifications/feedback.svg +0 -7
  30. package/assets/icons/notifications/kudos.svg +0 -4
  31. package/assets/icons/notifications/overtime_requests.svg +0 -15
  32. package/assets/icons/notifications/pdu_program.svg +0 -4
  33. package/assets/icons/notifications/profile_update.svg +0 -6
  34. package/assets/icons/notifications/recommendation_program.svg +0 -7
  35. package/assets/icons/notifications/reminders.svg +0 -4
  36. package/assets/icons/notifications/sick_leaves.svg +0 -5
  37. package/assets/icons/notifications/smarts.svg +0 -4
  38. package/assets/icons/notifications/survey.svg +0 -8
  39. package/assets/icons/notifications/unpaid_leave.svg +0 -4
  40. package/assets/icons/notifications/vacations.svg +0 -4
  41. package/assets/icons/pause.svg +0 -13
  42. package/assets/icons/play.svg +0 -13
  43. package/assets/icons/smart.svg +0 -14
  44. package/assets/icons/smarts-kudos.svg +0 -11
  45. package/assets/icons/spinner-solid.svg +0 -1
  46. package/assets/icons/vacation.svg +0 -14
  47. package/assets/icons/visibility.svg +0 -1
  48. package/assets/intems-logo.svg +0 -3
  49. package/babel.config.js +0 -6
  50. package/buses/eventBus.ts +0 -19
  51. package/buses/events/GiveKudosEvent.ts +0 -7
  52. package/components/buttons/action-button/ActionButton.scss +0 -133
  53. package/components/buttons/action-button/ActionButton.ts +0 -57
  54. package/components/buttons/action-button/ActionButton.vue +0 -50
  55. package/components/buttons/secondary-button/SecondaryButton.scss +0 -48
  56. package/components/buttons/secondary-button/SecondaryButton.ts +0 -28
  57. package/components/buttons/secondary-button/SecondaryButton.vue +0 -27
  58. package/components/confirm/Confirm.scss +0 -44
  59. package/components/confirm/Confirm.ts +0 -82
  60. package/components/confirm/Confirm.vue +0 -64
  61. package/components/give-kudos-form/GiveKudosForm.scss +0 -114
  62. package/components/give-kudos-form/GiveKudosForm.ts +0 -159
  63. package/components/give-kudos-form/GiveKudosForm.vue +0 -131
  64. package/components/give-kudos-form/mixins/UserSelectMixin.ts +0 -57
  65. package/components/give-kudos-form/models/KudosShareModel.ts +0 -6
  66. package/components/give-kudos-form/models/UserListModel.ts +0 -5
  67. package/components/give-kudos-form/validators/InEnglishValidatorRegex.ts +0 -17
  68. package/components/give-kudos-form/validators/KudosBalance.ts +0 -10
  69. package/components/modal/Modal.scss +0 -53
  70. package/components/modal/Modal.ts +0 -70
  71. package/components/modal/Modal.vue +0 -28
  72. package/components/notifications-sidebar/NotificationsSidebar.scss +0 -665
  73. package/components/notifications-sidebar/NotificationsSidebar.ts +0 -203
  74. package/components/notifications-sidebar/NotificationsSidebar.vue +0 -171
  75. package/components/notifications-sidebar/models/BroadcastNotificationPayload.ts +0 -8
  76. package/components/notifications-sidebar/models/TotalCounter.ts +0 -50
  77. package/components/notifications-sidebar/notification/Notification.ts +0 -17
  78. package/components/notifications-sidebar/notification/Notification.vue +0 -87
  79. package/components/play-pause/PlayPause.scss +0 -33
  80. package/components/play-pause/PlayPause.ts +0 -156
  81. package/components/play-pause/PlayPause.vue +0 -36
  82. package/components/play-pause/PlayPauseStatus.ts +0 -4
  83. package/components/play-pause/helpers/LatestTrackedTimeDurationHelper.ts +0 -55
  84. package/components/play-pause/helpers/PauseHelper.ts +0 -55
  85. package/components/play-pause/helpers/TrackedTimeHelper.ts +0 -80
  86. package/components/preloader/Preloader.vue +0 -34
  87. package/components/request-loader/RequestLoader.scss +0 -20
  88. package/components/request-loader/RequestLoader.ts +0 -80
  89. package/components/request-loader/RequestLoader.vue +0 -15
  90. package/components/sub-menu/SubMenu.scss +0 -33
  91. package/components/sub-menu/SubMenu.ts +0 -38
  92. package/components/sub-menu/SubMenu.vue +0 -21
  93. package/components/time-ago/TimeAgo.ts +0 -34
  94. package/components/time-ago/TimeAgo.vue +0 -9
  95. package/components/user-picture/UserPicture.scss +0 -62
  96. package/components/user-picture/UserPicture.ts +0 -105
  97. package/components/user-picture/UserPicture.vue +0 -23
  98. package/components/v-select-intems/VSelectIntems.ts +0 -112
  99. package/components/v-select-intems/VSelectIntems.vue +0 -68
  100. package/components/v-select-intems/open-indicator/OpenIndicator.vue +0 -3
  101. package/dist/html/app.html +0 -19
  102. package/dist/html/styles.html +0 -1
  103. package/helpers/GeneralHelper.ts +0 -61
  104. package/helpers/PublisherSubscriber.ts +0 -34
  105. package/helpers/QueryFilter.ts +0 -204
  106. package/helpers/TimeHelper.ts +0 -54
  107. package/helpers/Validations.ts +0 -7
  108. package/helpers/model/ModelHelper.ts +0 -155
  109. package/helpers/model/decorators/AsCollection.ts +0 -26
  110. package/helpers/model/decorators/AsModel.ts +0 -25
  111. package/helpers/model/decorators/DateTime.ts +0 -26
  112. package/helpers/model/decorators/TimeDuration.ts +0 -33
  113. package/helpers/moment/Duration.ts +0 -64
  114. package/helpers/moment/Moment.ts +0 -17
  115. package/helpers/moment/index.d.ts +0 -20
  116. package/helpers/response/AxiosProxy.ts +0 -72
  117. package/helpers/response/ErrorsToToastHelper.ts +0 -42
  118. package/helpers/response/ResponseCode.ts +0 -16
  119. package/helpers/response/ResponseHelper.ts +0 -42
  120. package/helpers/response/ResponseInterface.ts +0 -34
  121. package/helpers/response/ResponseState.ts +0 -6
  122. package/jsconfig.json +0 -19
  123. package/mixins/IntemsMath.ts +0 -29
  124. package/mixins/notifications/ActionProcessing.ts +0 -134
  125. package/mixins/notifications/confirms/AssetRejectionConfirm.vue +0 -59
  126. package/mixins/notifications/confirms/SickLeaveRejectionConfirm.vue +0 -31
  127. package/mixins/notifications/confirms/UnpaidLeaveRejectionConfirm.vue +0 -31
  128. package/mixins/notifications/confirms/VacationRejectionConfirm.vue +0 -31
  129. package/models/AssetModel.ts +0 -80
  130. package/models/AssetRequestModel.ts +0 -25
  131. package/models/ConfigModel.ts +0 -20
  132. package/models/EmployeeStartEndDateModel.ts +0 -16
  133. package/models/EmploymentTypeModel.ts +0 -95
  134. package/models/LogoutModel.ts +0 -3
  135. package/models/Model.ts +0 -12
  136. package/models/ModuleOptions.ts +0 -24
  137. package/models/PublicInfoModel.ts +0 -38
  138. package/models/PublicLocationModel.ts +0 -36
  139. package/models/StatusModel.ts +0 -8
  140. package/models/TrackedTimeModel.ts +0 -32
  141. package/models/location/PublicLocationModel.ts +0 -36
  142. package/models/timezones/LocalTimezoneHistoryModel.ts +0 -8
  143. package/models/timezones/TimezoneModel.ts +0 -9
  144. package/models/user/ExtendedInfoModel.ts +0 -37
  145. package/models/user/NotificationActionModel.ts +0 -53
  146. package/models/user/NotificationModel.ts +0 -84
  147. package/models/user/PublicInfoModel.ts +0 -38
  148. package/models/user/WelcomeProgram.ts +0 -4
  149. package/repositories/BaseRepository.ts +0 -42
  150. package/repositories/BaseUrl.ts +0 -107
  151. package/repositories/Repository.ts +0 -291
  152. package/repositories/ResourceRepository.ts +0 -99
  153. package/repositories/TrackedTimeRepository.ts +0 -43
  154. package/repositories/UserRepository.ts +0 -75
  155. package/repositories/subscribers/CreateSubscribers.ts +0 -28
  156. package/repositories/subscribers/DefaultSubscribers.ts +0 -82
  157. package/repositories/subscribers/DeleteSubscribers.ts +0 -28
  158. package/repositories/subscribers/DownloadSubscribers.ts +0 -28
  159. package/repositories/subscribers/Subscribers.ts +0 -13
  160. package/repositories/subscribers/UpdateSubscribers.ts +0 -32
  161. package/scss/components/_global.scss +0 -66
  162. package/scss/components/_mixins.scss +0 -31
  163. package/scss/components/_tooltip.scss +0 -45
  164. package/scss/components/_utils.scss +0 -26
  165. package/scss/components/_variables.scss +0 -103
  166. package/scss/main.scss +0 -7
  167. package/shims-vue.d.ts +0 -9
  168. package/tsconfig.json +0 -31
  169. package/webpack.config.js +0 -126
  170. package/wrapper.ts +0 -51
@@ -1,48 +0,0 @@
1
- @use "sass:map";
2
- @import "../../../scss/components/utils";
3
- @import "../../../scss/components/variables";
4
-
5
- .secondary-button {
6
- position: relative;
7
- text-overflow: ellipsis;
8
- overflow: hidden;
9
- white-space: nowrap;
10
- color: map.get($intems-colors, "text-primary");
11
- text-transform: initial;
12
- border-radius: 4px;
13
- font-weight: 600;
14
- line-height: 38px;
15
-
16
- i.icon {
17
- vertical-align: middle;
18
- }
19
-
20
- .spinner-solid {
21
- color: map.get($intems-colors, "text-primary");
22
- animation: spin 2s linear infinite;
23
- vertical-align: middle;
24
- transition: width 300ms, height 300ms;
25
- margin-left: 8px;
26
- }
27
-
28
- .left-icon {
29
- margin-right: 4px;
30
- }
31
-
32
- &.disabled,
33
- &.btn-secondary:disabled,
34
- &.btn[disabled] {
35
- background-color: map.get($intems-colors, "disable") !important;
36
- color: map.get($intems-colors, "text-disable");
37
-
38
- .spinner-solid {
39
- color: map.get($intems-colors, "text-disable") !important;
40
- }
41
- }
42
- }
43
-
44
- @keyframes spin {
45
- 100% {
46
- transform: rotate(360deg);
47
- }
48
- }
@@ -1,28 +0,0 @@
1
- import VueRouter from "vue-router";
2
-
3
- export default {
4
- name: "SecondaryButton",
5
- props: {
6
- isDisabled: {
7
- type: Boolean,
8
- default: false,
9
- },
10
- mini: {
11
- type: Boolean,
12
- default: false,
13
- },
14
- large: {
15
- type: Boolean,
16
- default: false,
17
- },
18
- isLoading: {
19
- type: Boolean,
20
- default: false,
21
- },
22
- iconLeft: {
23
- type: String,
24
- default: "",
25
- },
26
- to: undefined as VueRouter,
27
- },
28
- };
@@ -1,27 +0,0 @@
1
- <template>
2
- <router-link class="btn btn-secondary secondary-button waves-effect" v-if="to" :to="to">
3
- <slot></slot>
4
- </router-link>
5
- <button
6
- v-else
7
- type="button"
8
- class="btn btn-secondary secondary-button waves-effect"
9
- :class="{ 'btn-mini': mini, 'btn-large': large }"
10
- :disabled="isDisabled"
11
- >
12
- <i v-if="iconLeft" class="left-icon icon icon-small" :class="iconLeft"></i>
13
- <span class="span-text">
14
- <slot>Click me</slot>
15
- </span>
16
- <i v-show="isLoading" class="icon icon-small spinner-solid loading"></i>
17
- </button>
18
- </template>
19
-
20
- <script lang="ts">
21
- import SecondaryButton from './SecondaryButton.ts';
22
-
23
- export default SecondaryButton;
24
- </script>
25
- <style lang="scss">
26
- @import 'SecondaryButton';
27
- </style>
@@ -1,44 +0,0 @@
1
- @use "sass:map";
2
- @import "../../scss/components/utils";
3
- @import "../../scss/components/variables";
4
-
5
- .modal.confirm {
6
- box-sizing: border-box;
7
- min-width: 280px;
8
- min-height: 150px;
9
- flex-direction: column;
10
- background-color: map.get($intems-colors, "text-on-color");
11
- position: fixed;
12
-
13
- &.open {
14
- display: flex !important;
15
- }
16
-
17
- .header {
18
- padding-bottom: 10px;
19
-
20
- i.modal-close {
21
- float: right;
22
- height: 24px;
23
- line-height: 24px;
24
- }
25
-
26
- h3 {
27
- color: map.get($intems-colors, "text-primary");
28
- }
29
-
30
- + .modal-footer {
31
- padding-top: 30px;
32
- }
33
- }
34
-
35
- .modal-content {
36
- white-space: normal;
37
- color: map.get($intems-colors, "text-primary");
38
- overflow: initial;
39
- font-weight: normal;
40
- line-height: normal;
41
- margin-right: 0;
42
- padding-right: 0;
43
- }
44
- }
@@ -1,82 +0,0 @@
1
- import Modal from "../modal/Modal.vue";
2
- import ActionButton from "../../components/buttons/action-button/ActionButton.vue";
3
- import SecondaryButton from "../../components/buttons/secondary-button/SecondaryButton.vue";
4
- import { required, maxLength } from "vuelidate/lib/validators";
5
- import { onlyLatin } from "../../helpers/Validations";
6
-
7
- export type Comment = {
8
- placeholder?: string;
9
- description?: string;
10
- required?: boolean;
11
- };
12
-
13
- type Form = {
14
- comment?: string;
15
- };
16
-
17
- export default {
18
- components: { Modal, SecondaryButton, ActionButton },
19
- props: {
20
- title: String,
21
- description: String,
22
- submitBtn: {
23
- type: String,
24
- default: "Yes",
25
- },
26
- rejectBtn: {
27
- type: String,
28
- default: "No",
29
- },
30
- comment: undefined as Comment,
31
- },
32
- validations: {
33
- form: {
34
- comment: { required, maxLength: maxLength(300), onlyLatin },
35
- },
36
- },
37
- methods: {
38
- open(payload?: unknown): void {
39
- this.payload = payload;
40
- this.$modal.show("confirm");
41
- },
42
- confirm(): void {
43
- this.$emit(
44
- "confirmed",
45
- Object.keys(this.form).length ? this.form : this.payload
46
- );
47
- this.$modal.hide("confirm");
48
- this.reset();
49
- },
50
- confirmWithValidation(): void {
51
- this.$v.$touch();
52
- if (!this.$v.$invalid) {
53
- this.confirm();
54
- }
55
- },
56
- reject(): void {
57
- this.$modal.hide("confirm");
58
- this.reset();
59
-
60
- this.$emit("rejected", this.payload);
61
- },
62
- reset(): void {
63
- this.$v.$reset();
64
- this.form = {};
65
- },
66
- },
67
- computed: {
68
- hasForm(): boolean {
69
- return this.comment;
70
- },
71
- hasDefaultSlot() {
72
- return !!this.$slots.default;
73
- },
74
- },
75
- data(): Record<string, unknown> {
76
- return {
77
- payload: undefined,
78
- options: { dismissible: false },
79
- form: {} as Form,
80
- };
81
- },
82
- };
@@ -1,64 +0,0 @@
1
- <template>
2
- <div class="confirm">
3
- <modal name="confirm" size="md">
4
- <template slot="header">
5
- {{ title ? title : "Confirm?" }}
6
- </template>
7
- <template slot="content">
8
- <p>{{ description ? description : "" }}</p>
9
- <form class="intems-form p-t-10" v-if="hasForm">
10
- <div :class="{ 'form-group--error': $v.form.comment.$error }">
11
- <div class="form-group">
12
- <label v-if="comment.description" class="form__label">{{
13
- comment.description
14
- }}</label>
15
- <textarea
16
- ref="comment"
17
- id="comment"
18
- class="form__input"
19
- spellcheck="false"
20
- v-model="form.comment"
21
- :placeholder="comment.placeholder"
22
- @keydown.stop=""
23
- ></textarea>
24
- <div v-if="$v.form.comment.$error">
25
- <div class="error" v-if="!$v.form.comment.required">
26
- Comment is required
27
- </div>
28
- <div class="error" v-if="!$v.form.comment.maxLength">
29
- Maximum length of this field is 300 symbols
30
- </div>
31
- <div class="error" v-if="!$v.form.comment.onlyLatin">
32
- Only Latin letters allowed
33
- </div>
34
- </div>
35
- </div>
36
- </div>
37
- </form>
38
- <slot name="confirm-content"></slot>
39
- </template>
40
- <template slot="footer">
41
- <slot name="footer-description"></slot>
42
-
43
- <secondary-button @click.native="reject">
44
- {{ rejectBtn }}
45
- </secondary-button>
46
- <action-button
47
- @click.native="hasForm ? confirmWithValidation() : confirm()"
48
- >
49
- {{ submitBtn }}
50
- </action-button>
51
- </template>
52
- </modal>
53
- </div>
54
- </template>
55
-
56
- <script>
57
- import Confirm from "./Confirm";
58
-
59
- export default Confirm;
60
- </script>
61
-
62
- <style lang="scss">
63
- @import "./Confirm";
64
- </style>
@@ -1,114 +0,0 @@
1
- @use "sass:map";
2
- @import "../../scss/components/variables";
3
-
4
- .give-kudos {
5
- .user {
6
- ul {
7
- max-height: 200px;
8
- }
9
- }
10
-
11
- a {
12
- font-weight: bold;
13
- }
14
-
15
- .subtitle {
16
- padding: 0px 0 30px 0;
17
- }
18
-
19
- .form {
20
- .vs__selected-options {
21
- span.vs__selected {
22
- white-space: nowrap;
23
- }
24
-
25
- flex-wrap: nowrap;
26
- }
27
-
28
- display: grid;
29
- grid-template-columns: auto 207px;
30
- grid-gap: 15px;
31
-
32
- .kudos-quantity {
33
- height: 38px;
34
- margin: 0;
35
- border: solid 1px map.get($intems-colors, "border");
36
- background-color: map.get($intems-colors, "surface-primary");
37
- padding: 0 15px;
38
- width: 175px;
39
- }
40
-
41
- input.kudos-quantity:focus {
42
- border: solid 1px map.get($intems-colors, "primary");
43
- box-shadow: none;
44
- }
45
-
46
- /* Chrome, Safari, Edge, Opera */
47
- input::-webkit-outer-spin-button,
48
- input::-webkit-inner-spin-button {
49
- -webkit-appearance: none;
50
- margin: 0;
51
- }
52
-
53
- /* Firefox */
54
- input[type="number"] {
55
- -moz-appearance: textfield;
56
- }
57
-
58
- .user {
59
- grid-column: span 2;
60
- margin-right: 1px;
61
- }
62
-
63
- .block-kudos-quantity {
64
- width: 190px;
65
- }
66
-
67
- .block-kudos-category {
68
- margin-right: 5px;
69
- }
70
-
71
- .description {
72
- grid-column: span 2;
73
-
74
- textarea {
75
- resize: none;
76
- min-height: 100px;
77
- max-height: 300px;
78
- min-width: 100%;
79
- max-width: 100%;
80
- border-radius: 2px;
81
- border: solid 1px map.get($intems-colors, "border");
82
- outline: none;
83
- padding: 10px;
84
- }
85
-
86
- margin-right: 1px;
87
- }
88
-
89
- label {
90
- display: flex;
91
- font-size: $font-size-14;
92
- margin-bottom: 10px;
93
- color: map.get($intems-colors, "text-primary");
94
- }
95
-
96
- .error {
97
- font-size: $font-size-12;
98
- }
99
-
100
- .error-field {
101
- border: solid 1px map.get($intems-colors, "error");
102
- }
103
- }
104
-
105
- button.btn-large[disabled] {
106
- background-color: map.get($intems-colors, "primary-container-tag") !important;
107
- }
108
-
109
- .vs__clear {
110
- svg {
111
- display: none;
112
- }
113
- }
114
- }
@@ -1,159 +0,0 @@
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
- };
@@ -1,131 +0,0 @@
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>