@intellias/menu 1.0.2 → 1.0.5

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 (175) hide show
  1. package/README.md +44 -9
  2. package/dist/css/main.css +155 -2
  3. package/dist/index.html +9 -0
  4. package/dist/js/{1.js → kudosForm.js} +24 -58
  5. package/dist/js/main.js +654 -689
  6. package/dist/js/rejectComponent.js +363 -0
  7. package/dist/js/{6.js → vendors~kudosForm.js} +5 -5
  8. package/dist/js/{0.js → vendors~kudosForm~rejectComponent.js} +27 -27
  9. package/dist/js/vue.js +2 -2
  10. package/package.json +100 -112
  11. package/Menu.ts +0 -625
  12. package/assets/icons/arrow-down.svg +0 -13
  13. package/assets/icons/arrow-left.svg +0 -3
  14. package/assets/icons/arrow-submenu.svg +0 -8
  15. package/assets/icons/close.svg +0 -3
  16. package/assets/icons/delete.svg +0 -13
  17. package/assets/icons/faq-new.svg +0 -4
  18. package/assets/icons/kudos.svg +0 -14
  19. package/assets/icons/loading-spinner.svg +0 -40
  20. package/assets/icons/notification.svg +0 -11
  21. package/assets/icons/notifications/assessment.svg +0 -10
  22. package/assets/icons/notifications/buddy_program.svg +0 -8
  23. package/assets/icons/notifications/compensation_packages.svg +0 -10
  24. package/assets/icons/notifications/dsat.svg +0 -8
  25. package/assets/icons/notifications/feedback.svg +0 -7
  26. package/assets/icons/notifications/kudos.svg +0 -4
  27. package/assets/icons/notifications/overtime_requests.svg +0 -15
  28. package/assets/icons/notifications/pdu_program.svg +0 -4
  29. package/assets/icons/notifications/profile_update.svg +0 -6
  30. package/assets/icons/notifications/recommendation_program.svg +0 -7
  31. package/assets/icons/notifications/reminders.svg +0 -4
  32. package/assets/icons/notifications/sick_leaves.svg +0 -5
  33. package/assets/icons/notifications/smarts.svg +0 -4
  34. package/assets/icons/notifications/survey.svg +0 -8
  35. package/assets/icons/notifications/unpaid_leave.svg +0 -4
  36. package/assets/icons/notifications/vacations.svg +0 -4
  37. package/assets/icons/pause.svg +0 -13
  38. package/assets/icons/play.svg +0 -13
  39. package/assets/icons/smart.svg +0 -14
  40. package/assets/icons/smarts-kudos.svg +0 -11
  41. package/assets/icons/spinner-solid.svg +0 -1
  42. package/assets/icons/vacation.svg +0 -14
  43. package/assets/icons/visibility.svg +0 -1
  44. package/assets/intems-logo.svg +0 -3
  45. package/babel.config.js +0 -6
  46. package/buses/eventBus.ts +0 -19
  47. package/buses/events/GiveKudosEvent.ts +0 -7
  48. package/components/buttons/action-button/ActionButton.scss +0 -133
  49. package/components/buttons/action-button/ActionButton.ts +0 -57
  50. package/components/buttons/action-button/ActionButton.vue +0 -50
  51. package/components/buttons/secondary-button/SecondaryButton.scss +0 -48
  52. package/components/buttons/secondary-button/SecondaryButton.ts +0 -28
  53. package/components/buttons/secondary-button/SecondaryButton.vue +0 -27
  54. package/components/confirm/Confirm.scss +0 -44
  55. package/components/confirm/Confirm.ts +0 -82
  56. package/components/confirm/Confirm.vue +0 -64
  57. package/components/give-kudos-form/GiveKudosForm.scss +0 -114
  58. package/components/give-kudos-form/GiveKudosForm.ts +0 -159
  59. package/components/give-kudos-form/GiveKudosForm.vue +0 -131
  60. package/components/give-kudos-form/mixins/UserSelectMixin.ts +0 -57
  61. package/components/give-kudos-form/models/KudosShareModel.ts +0 -6
  62. package/components/give-kudos-form/models/UserListModel.ts +0 -5
  63. package/components/give-kudos-form/validators/InEnglishValidatorRegex.ts +0 -17
  64. package/components/give-kudos-form/validators/KudosBalance.ts +0 -10
  65. package/components/modal/Modal.scss +0 -53
  66. package/components/modal/Modal.ts +0 -70
  67. package/components/modal/Modal.vue +0 -28
  68. package/components/notifications-sidebar/NotificationsSidebar.scss +0 -665
  69. package/components/notifications-sidebar/NotificationsSidebar.ts +0 -203
  70. package/components/notifications-sidebar/NotificationsSidebar.vue +0 -171
  71. package/components/notifications-sidebar/models/BroadcastNotificationPayload.ts +0 -8
  72. package/components/notifications-sidebar/models/TotalCounter.ts +0 -50
  73. package/components/notifications-sidebar/notification/Notification.ts +0 -17
  74. package/components/notifications-sidebar/notification/Notification.vue +0 -87
  75. package/components/play-pause/PlayPause.scss +0 -33
  76. package/components/play-pause/PlayPause.ts +0 -156
  77. package/components/play-pause/PlayPause.vue +0 -36
  78. package/components/play-pause/PlayPauseStatus.ts +0 -4
  79. package/components/play-pause/helpers/LatestTrackedTimeDurationHelper.ts +0 -55
  80. package/components/play-pause/helpers/PauseHelper.ts +0 -55
  81. package/components/play-pause/helpers/TrackedTimeHelper.ts +0 -80
  82. package/components/preloader/Preloader.vue +0 -34
  83. package/components/request-loader/RequestLoader.scss +0 -20
  84. package/components/request-loader/RequestLoader.ts +0 -80
  85. package/components/request-loader/RequestLoader.vue +0 -15
  86. package/components/sub-menu/SubMenu.scss +0 -33
  87. package/components/sub-menu/SubMenu.ts +0 -38
  88. package/components/sub-menu/SubMenu.vue +0 -21
  89. package/components/time-ago/TimeAgo.ts +0 -34
  90. package/components/time-ago/TimeAgo.vue +0 -9
  91. package/components/user-picture/UserPicture.scss +0 -62
  92. package/components/user-picture/UserPicture.ts +0 -105
  93. package/components/user-picture/UserPicture.vue +0 -23
  94. package/components/v-select-intems/VSelectIntems.ts +0 -112
  95. package/components/v-select-intems/VSelectIntems.vue +0 -68
  96. package/components/v-select-intems/open-indicator/OpenIndicator.vue +0 -3
  97. package/dist/css/1.css +0 -85
  98. package/dist/css/2.css +0 -34
  99. package/dist/css/3.css +0 -34
  100. package/dist/css/4.css +0 -34
  101. package/dist/css/5.css +0 -34
  102. package/dist/html/app.html +0 -19
  103. package/dist/html/styles.html +0 -1
  104. package/dist/js/2.js +0 -217
  105. package/dist/js/3.js +0 -181
  106. package/dist/js/4.js +0 -181
  107. package/dist/js/5.js +0 -181
  108. package/helpers/GeneralHelper.ts +0 -61
  109. package/helpers/PublisherSubscriber.ts +0 -34
  110. package/helpers/QueryFilter.ts +0 -204
  111. package/helpers/TimeHelper.ts +0 -54
  112. package/helpers/Validations.ts +0 -7
  113. package/helpers/model/ModelHelper.ts +0 -155
  114. package/helpers/model/decorators/AsCollection.ts +0 -26
  115. package/helpers/model/decorators/AsModel.ts +0 -25
  116. package/helpers/model/decorators/DateTime.ts +0 -26
  117. package/helpers/model/decorators/TimeDuration.ts +0 -33
  118. package/helpers/moment/Duration.ts +0 -64
  119. package/helpers/moment/Moment.ts +0 -17
  120. package/helpers/moment/index.d.ts +0 -20
  121. package/helpers/response/AxiosProxy.ts +0 -72
  122. package/helpers/response/ErrorsToToastHelper.ts +0 -42
  123. package/helpers/response/ResponseCode.ts +0 -16
  124. package/helpers/response/ResponseHelper.ts +0 -42
  125. package/helpers/response/ResponseInterface.ts +0 -34
  126. package/helpers/response/ResponseState.ts +0 -6
  127. package/jsconfig.json +0 -19
  128. package/mixins/IntemsMath.ts +0 -29
  129. package/mixins/notifications/ActionProcessing.ts +0 -134
  130. package/mixins/notifications/confirms/AssetRejectionConfirm.vue +0 -59
  131. package/mixins/notifications/confirms/SickLeaveRejectionConfirm.vue +0 -31
  132. package/mixins/notifications/confirms/UnpaidLeaveRejectionConfirm.vue +0 -31
  133. package/mixins/notifications/confirms/VacationRejectionConfirm.vue +0 -31
  134. package/models/AssetModel.ts +0 -80
  135. package/models/AssetRequestModel.ts +0 -25
  136. package/models/ConfigModel.ts +0 -20
  137. package/models/EmployeeStartEndDateModel.ts +0 -16
  138. package/models/EmploymentTypeModel.ts +0 -95
  139. package/models/LogoutModel.ts +0 -3
  140. package/models/Model.ts +0 -12
  141. package/models/ModuleOptions.ts +0 -24
  142. package/models/PublicInfoModel.ts +0 -38
  143. package/models/PublicLocationModel.ts +0 -36
  144. package/models/StatusModel.ts +0 -8
  145. package/models/TrackedTimeModel.ts +0 -32
  146. package/models/location/PublicLocationModel.ts +0 -36
  147. package/models/timezones/LocalTimezoneHistoryModel.ts +0 -8
  148. package/models/timezones/TimezoneModel.ts +0 -9
  149. package/models/user/ExtendedInfoModel.ts +0 -37
  150. package/models/user/NotificationActionModel.ts +0 -53
  151. package/models/user/NotificationModel.ts +0 -84
  152. package/models/user/PublicInfoModel.ts +0 -38
  153. package/models/user/WelcomeProgram.ts +0 -4
  154. package/repositories/BaseRepository.ts +0 -42
  155. package/repositories/BaseUrl.ts +0 -107
  156. package/repositories/Repository.ts +0 -291
  157. package/repositories/ResourceRepository.ts +0 -99
  158. package/repositories/TrackedTimeRepository.ts +0 -43
  159. package/repositories/UserRepository.ts +0 -75
  160. package/repositories/subscribers/CreateSubscribers.ts +0 -28
  161. package/repositories/subscribers/DefaultSubscribers.ts +0 -82
  162. package/repositories/subscribers/DeleteSubscribers.ts +0 -28
  163. package/repositories/subscribers/DownloadSubscribers.ts +0 -28
  164. package/repositories/subscribers/Subscribers.ts +0 -13
  165. package/repositories/subscribers/UpdateSubscribers.ts +0 -32
  166. package/scss/components/_global.scss +0 -66
  167. package/scss/components/_mixins.scss +0 -31
  168. package/scss/components/_tooltip.scss +0 -45
  169. package/scss/components/_utils.scss +0 -26
  170. package/scss/components/_variables.scss +0 -103
  171. package/scss/main.scss +0 -7
  172. package/shims-vue.d.ts +0 -9
  173. package/tsconfig.json +0 -31
  174. package/webpack.config.js +0 -126
  175. package/wrapper.ts +0 -51
@@ -1,16 +0,0 @@
1
- import { Moment } from "moment";
2
- import DateTime from "../helpers/model/decorators/DateTime";
3
-
4
- export enum Status {
5
- General = "General",
6
- Freelancer = "Freelancer",
7
- }
8
-
9
- @DateTime("start_date")
10
- @DateTime("end_date")
11
- export default class EmployeeStartEndDateModel {
12
- employee_id = undefined as number;
13
- start_date = undefined as Moment;
14
- end_date = undefined as Moment | null;
15
- status = Status.General;
16
- }
@@ -1,95 +0,0 @@
1
- export const EmploymentTypeLabels = [
2
- {
3
- key: "2,3,4",
4
- name: "Umowa o prace",
5
- },
6
- {
7
- key: 5,
8
- name: "PL: B2B - 20",
9
- },
10
- {
11
- key: 6,
12
- name: "PL: B2B - 26",
13
- },
14
- ];
15
-
16
- export enum EmploymentType {
17
- ua_b2b = "ua_b2b",
18
- pl_umowa_o_prace_20 = "pl_umowa_o_prace_20",
19
- pl_umowa_o_prace_26 = "pl_umowa_o_prace_26",
20
- pl_umowa_o_prace_first_employment = "pl_umowa_o_prace_first_employment",
21
- pl_b2b_20 = "pl_b2b_20",
22
- pl_b2b_26 = "pl_b2b_26",
23
- xx_b2b = "xx_b2b",
24
- ua_b2b_vacation_contract = "ua_b2b_vacation_contract",
25
- pl_b2b_0 = "pl_b2b_0",
26
- hr_employment = "hr_employment",
27
- bg_employment = "bg_employment",
28
- xx_employment = "xx_employment",
29
- es_employment = "es_employment",
30
- pt_b2b = "pt_b2b",
31
- de_employment = "de_employment",
32
- hr_b2b = "hr_b2b",
33
- pt_employment = "pt_employment",
34
- us_employment = "us_employment",
35
- in_employment = "in_employment",
36
- co_employment = "co_employment",
37
- }
38
-
39
- const UNLIMITED = 365;
40
-
41
- export default class EmploymentTypeModel {
42
- id = undefined as string;
43
- name = undefined as string;
44
- machine_name = undefined as EmploymentType;
45
- vacation_per_year = undefined as number;
46
- accrue_vacation = undefined as number;
47
- sickleaves_without_note_per_year = undefined as number;
48
- sickleaves_per_year = undefined as number;
49
- unpaid_leaves_limit = undefined as number;
50
- calendar_id = undefined as number;
51
- country_code = undefined as string;
52
-
53
- get canReportVacation(): boolean {
54
- return this.vacation_per_year !== 0 || this.accrue_vacation !== 0;
55
- }
56
-
57
- get canReportSickness(): boolean {
58
- return this.sickleaves_per_year !== 0;
59
- }
60
-
61
- get isLimitedSickness(): boolean {
62
- return this.canReportSickness && this.sickleaves_per_year !== UNLIMITED;
63
- }
64
-
65
- get canReportSicknessWithoutNote(): boolean {
66
- return this.sickleaves_without_note_per_year !== 0;
67
- }
68
-
69
- get isLimitedSicknessWithoutNote(): boolean {
70
- return (
71
- this.canReportSicknessWithoutNote &&
72
- this.sickleaves_without_note_per_year !== UNLIMITED
73
- );
74
- }
75
-
76
- get canReportSomeSickness(): boolean {
77
- return this.canReportSickness || this.canReportSicknessWithoutNote;
78
- }
79
-
80
- get hasAnySicknessBalance(): boolean {
81
- return this.isLimitedSickness || this.isLimitedSicknessWithoutNote;
82
- }
83
-
84
- get canReportUnpaidLeave(): boolean {
85
- return this.unpaid_leaves_limit > 0;
86
- }
87
-
88
- get canReportAnyLeaves(): boolean {
89
- return (
90
- this.canReportVacation ||
91
- this.canReportSomeSickness ||
92
- this.canReportUnpaidLeave
93
- );
94
- }
95
- }
@@ -1,3 +0,0 @@
1
- export default class LogoutModel {
2
- redirect_url = undefined as string;
3
- }
package/models/Model.ts DELETED
@@ -1,12 +0,0 @@
1
- import * as ModelHelper from "../helpers/model/ModelHelper";
2
-
3
- export default abstract class Model {
4
- fill(source: Partial<this>) {
5
- ModelHelper.updateProperties(this, source);
6
- }
7
- clone(): this {
8
- const cloned = new (<any>this.constructor)();
9
- cloned.fill(this);
10
- return cloned;
11
- }
12
- }
@@ -1,24 +0,0 @@
1
- export enum ProjectName {
2
- Lite = "Lite",
3
- IntelliHub = "IntelliHub",
4
- ManagersPortal = "ManagersPortal",
5
- }
6
-
7
- export interface Submenus {
8
- subMenuList: keyable;
9
- }
10
-
11
- export interface Helpers {
12
- getUrlPathByName: Function;
13
- }
14
-
15
- interface keyable {
16
- [key: string]: any;
17
- }
18
-
19
- export interface MenuOptions {
20
- projectName: ProjectName;
21
- storeAdapter: keyable;
22
- subMenus?: Submenus;
23
- helperFunctions: Helpers;
24
- }
@@ -1,38 +0,0 @@
1
- import PublicLocationModel from "./location/PublicLocationModel";
2
- import AsModel from "../helpers/model/decorators/AsModel";
3
- import EmploymentTypeModel from "./EmploymentTypeModel";
4
- import LocalTimezoneHistoryModel from "./timezones/LocalTimezoneHistoryModel";
5
- import TimezoneModel from "./timezones/TimezoneModel";
6
-
7
- @AsModel("employment_type", EmploymentTypeModel)
8
- @AsModel("location", PublicLocationModel)
9
- export default class PublicInfoModel {
10
- username = undefined as string;
11
- email = undefined as string;
12
- employee_id = undefined as number;
13
- first_name = undefined as string;
14
- last_name = undefined as string;
15
- full_name = undefined as string;
16
- full_name_reversed = undefined as string;
17
- position = null as string;
18
- full_name_with_position = null as string;
19
- location = undefined as PublicLocationModel;
20
- avatar_url = undefined as string;
21
- thumbnail_url = undefined as string;
22
- employment_type_country_id = undefined as number;
23
- timezone = undefined as TimezoneModel;
24
- local_timezone_history = undefined as Array<LocalTimezoneHistoryModel>;
25
- employment_type = undefined as EmploymentTypeModel;
26
-
27
- getFullName(): string {
28
- return `${this.first_name} ${this.last_name}`;
29
- }
30
-
31
- getTimezone(): string {
32
- return this.timezone.iana_identifier;
33
- }
34
-
35
- equals(employee: PublicInfoModel): boolean {
36
- return this.employee_id === employee.employee_id;
37
- }
38
- }
@@ -1,36 +0,0 @@
1
- export default class PublicLocationModel {
2
- city = undefined as string;
3
- office = undefined as string;
4
- floor = undefined as string;
5
- area = undefined as string;
6
- locationImage = undefined as string;
7
- locationLink = undefined as string;
8
-
9
- fullLocation() {
10
- let location: string;
11
-
12
- location = this.city;
13
-
14
- if (this.office) {
15
- location += `, ${this.office}`;
16
- }
17
-
18
- if (this.floor) {
19
- location += `, ${this.floor}`;
20
- }
21
-
22
- if (this.area) {
23
- location += this.area;
24
- }
25
-
26
- return location;
27
- }
28
-
29
- get image(): string | null {
30
- return this.locationImage ? this.locationImage : null;
31
- }
32
-
33
- get link(): string | null {
34
- return this.locationLink ? this.locationLink : null;
35
- }
36
- }
@@ -1,8 +0,0 @@
1
- export enum Statuses {
2
- success = 1,
3
- inactive = 0,
4
- danger = -1,
5
- warning = 2,
6
- secondary = 3,
7
- info = 4,
8
- }
@@ -1,32 +0,0 @@
1
- import * as moment_ from "moment";
2
- import { diffMinutes, moment } from "../helpers/TimeHelper";
3
- import DateTime from "../helpers/model/decorators/DateTime";
4
- import TimeDuration from "../helpers/model/decorators/TimeDuration";
5
- import { Moment, Duration } from "../helpers/moment";
6
- import Model from "./Model";
7
- import TimezoneModel from "./timezones/TimezoneModel";
8
-
9
- @DateTime("start")
10
- @DateTime("end")
11
- @TimeDuration("duration")
12
- export default class TrackedTimeModel extends Model {
13
- readonly id = undefined as number;
14
- day = undefined as string;
15
- employee_id = undefined as number;
16
- start = undefined as Moment;
17
- end = undefined as Moment;
18
- duration = 0 as unknown as Duration;
19
- timezone = undefined as TimezoneModel;
20
-
21
- calculateDuration(): Duration {
22
- return moment.duration(diffMinutes(this.start, this.end), "minutes");
23
- }
24
-
25
- isToday(timezone: string): boolean {
26
- return this.day === moment_.tz(timezone).format("YYYY-MM-DD");
27
- }
28
-
29
- isFinished(): boolean {
30
- return this.end !== null;
31
- }
32
- }
@@ -1,36 +0,0 @@
1
- export default class PublicLocationModel {
2
- city = undefined as string;
3
- office = undefined as string;
4
- floor = undefined as string;
5
- area = undefined as string;
6
- locationImage = undefined as string;
7
- locationLink = undefined as string;
8
-
9
- fullLocation () {
10
- let location: string;
11
-
12
- location = this.city;
13
-
14
- if (this.office) {
15
- location += ', ' + this.office;
16
- }
17
-
18
- if (this.floor) {
19
- location += ', ' + this.floor;
20
- }
21
-
22
- if (this.area) {
23
- location += this.area;
24
- }
25
-
26
- return location;
27
- }
28
-
29
- get image (): string|null {
30
- return this.locationImage ? this.locationImage : null;
31
- }
32
-
33
- get link (): string|null {
34
- return this.locationLink ? this.locationLink : null;
35
- }
36
- }
@@ -1,8 +0,0 @@
1
- import { Moment } from "moment/moment";
2
- import DateTime from "../../helpers/model/decorators/DateTime";
3
-
4
- @DateTime("created_at")
5
- export default class LocalTimezoneHistoryModel {
6
- id = undefined as number;
7
- created_at = undefined as Moment;
8
- }
@@ -1,9 +0,0 @@
1
- export default class TimezoneModel {
2
- id = undefined as number;
3
- iana_identifier = undefined as string;
4
- name = undefined as string;
5
-
6
- getTimezone(): string {
7
- return this.iana_identifier;
8
- }
9
- }
@@ -1,37 +0,0 @@
1
- import { Collection } from "collect.js";
2
- import PublicInfoModel from "./PublicInfoModel";
3
- import EmployeeStartEndDateModel from "../EmployeeStartEndDateModel";
4
- import WelcomeProgram from "./WelcomeProgram";
5
- import AsModel from "../../helpers/model/decorators/AsModel";
6
- import AsCollection from "../../helpers/model/decorators/AsCollection";
7
-
8
- export enum Billable {
9
- Yes = "Yes",
10
- No = "No",
11
- }
12
-
13
- export enum JobFamily {
14
- Management = "Management",
15
- }
16
-
17
- @AsModel("welcomeProgram", WelcomeProgram)
18
- @AsCollection("startEndDates", EmployeeStartEndDateModel)
19
- export default class ExtendedInfoModel extends PublicInfoModel {
20
- // Todo: kudos and other balances should be got by relations
21
- kudos_balance? = undefined as number;
22
- has_unread_notifications? = undefined as boolean;
23
- smart_balance? = undefined as number;
24
- pdu_balance? = undefined as number;
25
- vacation_balance? = undefined as number;
26
- startEndDates = undefined as Collection<EmployeeStartEndDateModel>;
27
- last_day_available_for_report = undefined as string;
28
- welcomeProgram? = undefined as WelcomeProgram;
29
- last_seen_release_notes_version? = undefined as number;
30
- jira_pulse_link = undefined as string;
31
- jira_pulse_survey_sent = undefined as string;
32
- jira_pulse_survey_received = undefined as string;
33
- jira_key = undefined as string;
34
- billable = undefined as Billable | null;
35
- mentorship_learning_path? = undefined as string;
36
- job_family = undefined as string;
37
- }
@@ -1,53 +0,0 @@
1
- import { Moment } from "moment";
2
- import DateTime from "../../helpers/model/decorators/DateTime";
3
-
4
- export enum RequestMethod {
5
- put = "put",
6
- post = "post",
7
- patch = "patch",
8
- }
9
- export enum ActionType {
10
- confirm = "confirm",
11
- reject = "reject",
12
- view = "view",
13
- }
14
-
15
- export enum ProceedTo {
16
- lite = "lite",
17
- old = "old",
18
- career = "career",
19
- remote = "remote",
20
- }
21
-
22
- @DateTime("expired_at")
23
- export default class NotificationActionModel {
24
- method = undefined as RequestMethod;
25
- body = undefined as Record<string, unknown>;
26
- type = undefined as ActionType;
27
- proceedTo = undefined as ProceedTo;
28
- action = undefined as string;
29
- url = undefined as string;
30
- title = undefined as string;
31
- expired_at = undefined as Moment;
32
-
33
- get isReject(): boolean {
34
- return this.type === ActionType.reject;
35
- }
36
-
37
- get isLink(): boolean {
38
- return this.type === ActionType.view;
39
- }
40
-
41
- clone(): NotificationActionModel {
42
- const clone = new NotificationActionModel();
43
-
44
- clone.method = this.method;
45
- clone.body = { ...this.body };
46
- clone.type = this.type;
47
- clone.proceedTo = this.proceedTo;
48
- clone.action = this.action;
49
- clone.title = this.title;
50
-
51
- return clone;
52
- }
53
- }
@@ -1,84 +0,0 @@
1
- import { Moment } from "moment";
2
- import { Collection } from "collect.js";
3
- import DateTime from "../../helpers/model/decorators/DateTime";
4
- import NotificationActionModel from "./NotificationActionModel";
5
- import AsCollection from "../../helpers/model/decorators/AsCollection";
6
-
7
- export enum NotificationCategory {
8
- assessment = "assessment",
9
- buddy_program = "buddy_program",
10
- compensation_packages = "compensation_packages",
11
- dsat = "dsat",
12
- kudos = "kudos",
13
- smarts = "smarts",
14
- overtime_requests = "overtime_requests",
15
- profile_update = "profile_update",
16
- recommendation_program = "recommendation_program",
17
- sick_leaves = "sick_leaves",
18
- unpaid_leave = "unpaid_leave",
19
- vacations = "vacations",
20
- survey = "survey",
21
- reminders = "reminders",
22
- pdu_program = "pdu_program",
23
- }
24
- export interface NotificationRejectionData {
25
- rejectionComponent: Record<string, unknown>;
26
- notification: NotificationModel;
27
- }
28
-
29
- export enum NotificationStatus {
30
- new = "new",
31
- hidden = "hidden",
32
- read = "read",
33
- processed = "processed",
34
- hidden_processed = "hidden_processed",
35
- }
36
- export enum NotificationType {
37
- notice = "notice",
38
- pending_request = "pending_request",
39
- }
40
- export const confirmRejections = [
41
- NotificationCategory.vacations,
42
- NotificationCategory.sick_leaves,
43
- NotificationCategory.unpaid_leave,
44
- NotificationCategory.profile_update,
45
- ];
46
- @DateTime("created_at")
47
- @AsCollection("actions", NotificationActionModel)
48
- export default class NotificationModel {
49
- id = undefined as string;
50
- title = undefined as string;
51
- type = undefined as NotificationType;
52
- description = undefined as string;
53
- actions = undefined as Collection<NotificationActionModel>;
54
- category = undefined as NotificationCategory;
55
- created_at = undefined as Moment;
56
- status = undefined as NotificationStatus;
57
-
58
- get notifiedAt(): string {
59
- return this.created_at ? this.created_at.format("MMM DD, YYYY") : "";
60
- }
61
-
62
- get icon(): string {
63
- return this.category;
64
- }
65
-
66
- get isNew(): boolean {
67
- return this.status === NotificationStatus.new;
68
- }
69
-
70
- get isProcessed(): boolean {
71
- return (
72
- this.status === NotificationStatus.processed ||
73
- this.status === NotificationStatus.hidden_processed
74
- );
75
- }
76
-
77
- setStatus(status: NotificationStatus): void {
78
- if (!this.isNew && status === NotificationStatus.read) {
79
- return;
80
- }
81
-
82
- this.status = status;
83
- }
84
- }
@@ -1,38 +0,0 @@
1
- import PublicLocationModel from "../PublicLocationModel";
2
- import AsModel from "../../helpers/model/decorators/AsModel";
3
- import EmploymentTypeModel from "../EmploymentTypeModel";
4
- import LocalTimezoneHistoryModel from "../timezones/LocalTimezoneHistoryModel";
5
- import TimezoneModel from "../timezones/TimezoneModel";
6
-
7
- @AsModel("employment_type", EmploymentTypeModel)
8
- @AsModel("location", PublicLocationModel)
9
- export default class PublicInfoModel {
10
- username = undefined as string;
11
- email = undefined as string;
12
- employee_id = undefined as number;
13
- first_name = undefined as string;
14
- last_name = undefined as string;
15
- full_name = undefined as string;
16
- full_name_reversed = undefined as string;
17
- position = null as string;
18
- full_name_with_position = null as string;
19
- location = undefined as PublicLocationModel;
20
- avatar_url = undefined as string;
21
- thumbnail_url = undefined as string;
22
- employment_type_country_id = undefined as number;
23
- timezone = undefined as TimezoneModel;
24
- local_timezone_history = undefined as Array<LocalTimezoneHistoryModel>;
25
- employment_type = undefined as EmploymentTypeModel;
26
-
27
- getFullName(): string {
28
- return `${this.first_name} ${this.last_name}`;
29
- }
30
-
31
- getTimezone(): string {
32
- return this.timezone.iana_identifier;
33
- }
34
-
35
- equals(employee: PublicInfoModel): boolean {
36
- return this.employee_id === employee.employee_id;
37
- }
38
- }
@@ -1,4 +0,0 @@
1
- export default class WelcomeProgram {
2
- need_to_show_welcome_modal? = undefined as boolean;
3
- unchecked_welcome_program_questions? = undefined as number;
4
- }
@@ -1,42 +0,0 @@
1
- import { AxiosResponse } from "axios";
2
- import Repository from "./Repository";
3
- import { RequestMethod } from "../models/user/NotificationActionModel";
4
- import { BaseUrl } from "./BaseUrl";
5
-
6
- export default class BaseRepository<
7
- TModel extends new (...args: any) => any
8
- > extends Repository {
9
- protected model: TModel;
10
- constructor(baseUrl: BaseUrl = BaseUrl.Default, model?: TModel) {
11
- super(baseUrl);
12
- this.model = model;
13
- }
14
-
15
- async get<Result>(
16
- parameters?
17
- ): Promise<keyof Result extends never ? InstanceType<TModel> : Result> {
18
- return await this.getResource(this.model, "", parameters);
19
- }
20
-
21
- async post<TData>(data?, parameters?): Promise<TData> {
22
- return this.postData("", data, parameters);
23
- }
24
-
25
- async request(
26
- url: string,
27
- method: RequestMethod,
28
- data: Record<string, unknown>
29
- ): Promise<AxiosResponse> {
30
- if (method === RequestMethod.put) {
31
- return this.putData(url, data);
32
- }
33
- if (method === RequestMethod.post) {
34
- return this.postData(url, data);
35
- }
36
- if (method === RequestMethod.patch) {
37
- return this.patch(url);
38
- }
39
-
40
- return null;
41
- }
42
- }