@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,75 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import { Collection } from "collect.js";
|
|
3
|
+
import { BaseUrl } from "./BaseUrl";
|
|
4
|
+
import BaseRepository from "./BaseRepository";
|
|
5
|
+
import ExtendedInfoModel from "../models/user/ExtendedInfoModel";
|
|
6
|
+
import NotificationModel from "../models/user/NotificationModel";
|
|
7
|
+
import QueryFilter from "../helpers/QueryFilter";
|
|
8
|
+
import { DefaultContext } from "../helpers/response/ResponseHelper";
|
|
9
|
+
import { UpdateContext } from "./ResourceRepository";
|
|
10
|
+
import { NotificationTotal } from "../components/notifications-sidebar/models/TotalCounter";
|
|
11
|
+
import { ResponseCode } from "../helpers/response/ResponseCode";
|
|
12
|
+
import { Meta } from "../helpers/response/ResponseInterface";
|
|
13
|
+
|
|
14
|
+
// Todo: maybe rename or what, because this repository is only to get logged in user data
|
|
15
|
+
export default class UserRepository extends BaseRepository<
|
|
16
|
+
typeof ExtendedInfoModel
|
|
17
|
+
> {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(BaseUrl.LoggedInUser, ExtendedInfoModel);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async notifications(filter: QueryFilter, model = undefined) {
|
|
23
|
+
const response = await this.axiosProxy.get<{
|
|
24
|
+
data: { data: Record<string, unknown> };
|
|
25
|
+
total_unread: NotificationTotal;
|
|
26
|
+
total: number;
|
|
27
|
+
meta: Meta;
|
|
28
|
+
}>(
|
|
29
|
+
this.getUrl(`/notifications`),
|
|
30
|
+
{ params: filter.toObject() },
|
|
31
|
+
DefaultContext
|
|
32
|
+
);
|
|
33
|
+
if (response.status < ResponseCode.BadRequest) {
|
|
34
|
+
return {
|
|
35
|
+
collection: this.map(
|
|
36
|
+
model !== undefined ? model : NotificationModel,
|
|
37
|
+
response.data.data
|
|
38
|
+
),
|
|
39
|
+
total: response.data.total_unread,
|
|
40
|
+
meta: response.data.meta,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async readNotifications(
|
|
48
|
+
notifications?: Collection<NotificationModel>
|
|
49
|
+
): Promise<AxiosResponse> {
|
|
50
|
+
let data = {};
|
|
51
|
+
if (notifications) {
|
|
52
|
+
data = { notifications: notifications.pluck("id").all() };
|
|
53
|
+
}
|
|
54
|
+
return this.putData(`/notifications/read-all`, data, {}, UpdateContext);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async dismissNotifications(
|
|
58
|
+
notification?: NotificationModel
|
|
59
|
+
): Promise<AxiosResponse> {
|
|
60
|
+
return this.patch(
|
|
61
|
+
`/notifications/dismiss-all${notification ? `/${notification.id}` : ""}`,
|
|
62
|
+
UpdateContext
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async processNotifications(
|
|
67
|
+
notification?: NotificationModel
|
|
68
|
+
): Promise<AxiosResponse> {
|
|
69
|
+
return this.patch(
|
|
70
|
+
`/notifications/process/${notification.id}`,
|
|
71
|
+
UpdateContext
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
3
|
+
import { ResponseCode } from "../../helpers/response/ResponseCode";
|
|
4
|
+
import { Subscribers, SubscribersEvents } from "./Subscribers";
|
|
5
|
+
import { myOptions } from "../../wrapper";
|
|
6
|
+
|
|
7
|
+
export default class CreateSubscribers implements Subscribers {
|
|
8
|
+
private readonly resourceName: string;
|
|
9
|
+
constructor(resourceName = "Item") {
|
|
10
|
+
this.resourceName = resourceName;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
generate(): SubscribersEvents {
|
|
14
|
+
return {
|
|
15
|
+
[ResponseState.Resolved]: (result: AxiosResponse) => {
|
|
16
|
+
if (result.status === ResponseCode.Created) {
|
|
17
|
+
myOptions.storeAdapter.Toasts.mutations.addMessage(
|
|
18
|
+
`${this.resourceName} was successfully created`
|
|
19
|
+
);
|
|
20
|
+
} else if (result.status !== ResponseCode.Ok) {
|
|
21
|
+
myOptions.storeAdapter.Toasts.mutations.addError(
|
|
22
|
+
`Unable to create ${this.resourceName}`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AxiosError } from "axios";
|
|
2
|
+
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
3
|
+
import { Subscribers, SubscribersEvents } from "./Subscribers";
|
|
4
|
+
import { ResponseCode } from "../../helpers/response/ResponseCode";
|
|
5
|
+
import { myOptions } from "../../wrapper";
|
|
6
|
+
|
|
7
|
+
const laravelDefault403Error1 = "Unauthenticated.";
|
|
8
|
+
const laravelDefault403Error2 = "This action is unauthorized.";
|
|
9
|
+
|
|
10
|
+
export default class DefaultSubscribers implements Subscribers {
|
|
11
|
+
protected errors;
|
|
12
|
+
constructor() {
|
|
13
|
+
this.errors = new Map([
|
|
14
|
+
[ResponseCode.BadRequest, "Bad request"],
|
|
15
|
+
[ResponseCode.Unauthorized, "Unauthorized error"],
|
|
16
|
+
[ResponseCode.Forbidden, "Unauthorized action"],
|
|
17
|
+
[ResponseCode.NotFound, "Resource is not found"],
|
|
18
|
+
[ResponseCode.PageExpired, "Page is expired. Please reload the page"],
|
|
19
|
+
[ResponseCode.UnprocessableEntity, "Data is not valid"],
|
|
20
|
+
[ResponseCode.ServerError, "Server error"],
|
|
21
|
+
[ResponseCode.ServiceUnavailable, "Service unavailable"],
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private getErrorMessageByCode(statusCode: number) {
|
|
26
|
+
const errorMessage = this.errors.get(statusCode);
|
|
27
|
+
return errorMessage !== undefined ? errorMessage : "Unknown error";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private generateError(error: AxiosError) {
|
|
31
|
+
if (error.response.status === ResponseCode.UnprocessableEntity) {
|
|
32
|
+
const { response } = error;
|
|
33
|
+
|
|
34
|
+
// if there are error messages return false, because it will be shown by another handlers
|
|
35
|
+
if (typeof response.data.errors !== "undefined") {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return response.data.message;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (
|
|
42
|
+
error.response.data.message &&
|
|
43
|
+
error.response.status === ResponseCode.Forbidden &&
|
|
44
|
+
error.response.data.message !== "" &&
|
|
45
|
+
error.response.data.message !== laravelDefault403Error1 &&
|
|
46
|
+
error.response.data.message !== laravelDefault403Error2
|
|
47
|
+
) {
|
|
48
|
+
return error.response.data.message;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return this.getErrorMessageByCode(error.response.status);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private async getMessageFromBlob(data: Blob) {
|
|
55
|
+
await data.text().then((text) => {
|
|
56
|
+
return JSON.parse(text);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
generate(): SubscribersEvents {
|
|
61
|
+
return {
|
|
62
|
+
[ResponseState.Pending]: () => {
|
|
63
|
+
myOptions.storeAdapter.Request.mutations.incrementSent();
|
|
64
|
+
},
|
|
65
|
+
[ResponseState.Rejected]: (error: AxiosError) => {
|
|
66
|
+
if (error.config.method === "head") {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const errorMessage = this.generateError(error);
|
|
71
|
+
if (!errorMessage) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
myOptions.storeAdapter.Toasts.mutations.addError(errorMessage);
|
|
75
|
+
},
|
|
76
|
+
[ResponseState.Done]: () => {
|
|
77
|
+
myOptions.storeAdapter.Request.mutations.incrementCompleted();
|
|
78
|
+
myOptions.storeAdapter.Toasts.mutations.showAll();
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import { Subscribers, SubscribersEvents } from "./Subscribers";
|
|
3
|
+
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
4
|
+
import { ResponseCode } from "../../helpers/response/ResponseCode";
|
|
5
|
+
import { myOptions } from "../../wrapper";
|
|
6
|
+
|
|
7
|
+
export default class DeleteSubscribers implements Subscribers {
|
|
8
|
+
private readonly resourceName: string;
|
|
9
|
+
constructor(resourceName = "Item") {
|
|
10
|
+
this.resourceName = resourceName;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
generate(): SubscribersEvents {
|
|
14
|
+
return {
|
|
15
|
+
[ResponseState.Resolved]: (result: AxiosResponse) => {
|
|
16
|
+
if (result.status === ResponseCode.NoContent) {
|
|
17
|
+
myOptions.storeAdapter.Toasts.mutations.addMessage(
|
|
18
|
+
`${this.resourceName} was successfully deleted`
|
|
19
|
+
);
|
|
20
|
+
} else {
|
|
21
|
+
myOptions.storeAdapter.Toasts.mutations.addError(
|
|
22
|
+
`Unable to delete ${this.resourceName}`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import { Subscribers, SubscribersEvents } from "./Subscribers";
|
|
3
|
+
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
4
|
+
import { ResponseCode } from "../../helpers/response/ResponseCode";
|
|
5
|
+
import { myOptions } from "../../wrapper";
|
|
6
|
+
|
|
7
|
+
export default class DownloadSubscribers implements Subscribers {
|
|
8
|
+
private readonly resourceName: string;
|
|
9
|
+
constructor(resourceName = "File") {
|
|
10
|
+
this.resourceName = resourceName;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
generate(): SubscribersEvents {
|
|
14
|
+
return {
|
|
15
|
+
[ResponseState.Resolved]: (result: AxiosResponse) => {
|
|
16
|
+
if (result.status === ResponseCode.Ok) {
|
|
17
|
+
myOptions.storeAdapter.Toasts.mutations.addMessage(
|
|
18
|
+
`${this.resourceName} was successfully downloaded`
|
|
19
|
+
);
|
|
20
|
+
} else {
|
|
21
|
+
myOptions.storeAdapter.Toasts.mutations.addError(
|
|
22
|
+
`Unable to download ${this.resourceName}`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse } from "axios";
|
|
2
|
+
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
3
|
+
|
|
4
|
+
export interface SubscribersEvents {
|
|
5
|
+
[ResponseState.Pending]?: () => void;
|
|
6
|
+
[ResponseState.Resolved]?: (result: AxiosResponse) => void;
|
|
7
|
+
[ResponseState.Rejected]?: (error: AxiosError) => void;
|
|
8
|
+
[ResponseState.Done]?: () => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Subscribers {
|
|
12
|
+
generate(): SubscribersEvents;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import { Subscribers, SubscribersEvents } from "./Subscribers";
|
|
3
|
+
import { ResponseState } from "../../helpers/response/ResponseState";
|
|
4
|
+
import { ResponseCode } from "../../helpers/response/ResponseCode";
|
|
5
|
+
import { myOptions } from "../../wrapper";
|
|
6
|
+
|
|
7
|
+
export default class UpdateSubscribers implements Subscribers {
|
|
8
|
+
private readonly resourceName: string;
|
|
9
|
+
private readonly successMessage: string;
|
|
10
|
+
constructor(resourceName = "Record", successMessage?: string) {
|
|
11
|
+
this.resourceName = resourceName;
|
|
12
|
+
this.successMessage = successMessage;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
generate(): SubscribersEvents {
|
|
16
|
+
return {
|
|
17
|
+
[ResponseState.Resolved]: (result: AxiosResponse) => {
|
|
18
|
+
if (result.status === ResponseCode.Ok) {
|
|
19
|
+
myOptions.storeAdapter.Toasts.mutations.addMessage(
|
|
20
|
+
this.successMessage
|
|
21
|
+
? this.successMessage
|
|
22
|
+
: `${this.resourceName} was successfully updated`
|
|
23
|
+
);
|
|
24
|
+
} else {
|
|
25
|
+
myOptions.storeAdapter.Toasts.mutations.addError(
|
|
26
|
+
`Unable to update ${this.resourceName}`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@import "./utils";
|
|
3
|
+
@import "./variables";
|
|
4
|
+
|
|
5
|
+
main {
|
|
6
|
+
overflow: auto;
|
|
7
|
+
position: relative;
|
|
8
|
+
flex: 1 1 auto;
|
|
9
|
+
}
|
|
10
|
+
//helpers.
|
|
11
|
+
.bold {
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.margin-top-5 {
|
|
16
|
+
margin-top: 5px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.margin-top-10 {
|
|
20
|
+
margin-top: 10px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.padding-top-15 {
|
|
24
|
+
padding-top: 15px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.margin-top-15 {
|
|
28
|
+
margin-top: 15px;
|
|
29
|
+
}
|
|
30
|
+
.margin-top-25 {
|
|
31
|
+
margin-top: 25px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.margin-top-50 {
|
|
35
|
+
margin-top: 50px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.title-row {
|
|
39
|
+
margin: 30px 0 40px;
|
|
40
|
+
|
|
41
|
+
.page-title {
|
|
42
|
+
margin: 0;
|
|
43
|
+
align-self: center;
|
|
44
|
+
justify-self: flex-start;
|
|
45
|
+
}
|
|
46
|
+
button {
|
|
47
|
+
order: 2;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.center {
|
|
52
|
+
text-align: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
}
|
|
55
|
+
.wide {
|
|
56
|
+
width: 100%;
|
|
57
|
+
}
|
|
58
|
+
.pointer {
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
a,
|
|
63
|
+
a:hover {
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
color: map.get($intems-colors, "primary-hover");
|
|
66
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// PLACEHOLDERS
|
|
2
|
+
%clear-default-button-styles {
|
|
3
|
+
padding: 0;
|
|
4
|
+
border: 0;
|
|
5
|
+
background: transparent;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// MIXINS
|
|
10
|
+
// Inject icon path to element css styles
|
|
11
|
+
@mixin icon($name) {
|
|
12
|
+
background-image: url('~@/assets/icons/#{$name}.svg');
|
|
13
|
+
mask-image: url('~@/assets/icons/#{$name}.svg');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin margin-x($side, $attr-count: 15, $attr-steps: 5, $unit: 'px') {
|
|
17
|
+
@for $i from 0 through $attr-count {
|
|
18
|
+
$attr-value: $attr-steps * $i;
|
|
19
|
+
|
|
20
|
+
.margin-#{$side}-#{$attr-value} {
|
|
21
|
+
margin-#{$side}: #{$attr-value}#{$unit};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mixin scale($scale, $speed: 0.4s) {
|
|
27
|
+
transform: scale($scale);
|
|
28
|
+
-webkit-transition: transform $speed ease-in-out;
|
|
29
|
+
-moz-transition:transform $speed ease-in-out;
|
|
30
|
+
-ms-transition:transform $speed ease-in-out;
|
|
31
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@import "./variables";
|
|
3
|
+
|
|
4
|
+
.tooltip {
|
|
5
|
+
display: block !important;
|
|
6
|
+
z-index: 10000;
|
|
7
|
+
|
|
8
|
+
.tooltip-inner {
|
|
9
|
+
max-width: 300px;
|
|
10
|
+
padding: 6px 8px;
|
|
11
|
+
background: map.get($intems-colors, "background-top-menu");
|
|
12
|
+
border-radius: 6px;
|
|
13
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
14
|
+
color: map.get($intems-colors, "text-on-color");
|
|
15
|
+
font-size: $font-size-12;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&[x-placement^="top"] {
|
|
19
|
+
margin-bottom: 5px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&[x-placement^="bottom"] {
|
|
23
|
+
margin-top: 5px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&[x-placement^="right"] {
|
|
27
|
+
margin-left: 5px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&[x-placement^="left"] {
|
|
31
|
+
margin-right: 5px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&[aria-hidden="true"] {
|
|
35
|
+
visibility: hidden;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transition: opacity 0.15s, visibility 0.15s;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[aria-hidden="false"] {
|
|
41
|
+
visibility: visible;
|
|
42
|
+
opacity: 1;
|
|
43
|
+
transition: opacity 0.15s;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Carousel
|
|
2
|
+
// ==========================================================================
|
|
3
|
+
|
|
4
|
+
$carousel-height: 400px !default;
|
|
5
|
+
$carousel-item-height: calc(#{$carousel-height} / 2) !default;
|
|
6
|
+
$carousel-item-width: $carousel-item-height !default;
|
|
7
|
+
|
|
8
|
+
// Media Query Ranges
|
|
9
|
+
// ==========================================================================
|
|
10
|
+
|
|
11
|
+
$small-screen: 600px !default;
|
|
12
|
+
$large-screen: 1200px !default;
|
|
13
|
+
|
|
14
|
+
// Grid
|
|
15
|
+
// ==========================================================================
|
|
16
|
+
|
|
17
|
+
$gutter-width: 1.5rem !default;
|
|
18
|
+
$element-top-margin: calc(#{$gutter-width} / 3) !default;
|
|
19
|
+
$element-bottom-margin: calc(#{$gutter-width} * 2) / 3 !default;
|
|
20
|
+
|
|
21
|
+
// Flow Text
|
|
22
|
+
// ==========================================================================
|
|
23
|
+
|
|
24
|
+
$range : calc(#{$large-screen} - #{$small-screen}) !default;
|
|
25
|
+
$intervals: 20 !default;
|
|
26
|
+
$interval-size: calc(#{$range} / #{$intervals}) !default;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
$intems-colors: (
|
|
2
|
+
"white": #ffffff,
|
|
3
|
+
"black": #000000,
|
|
4
|
+
"orangish": #ff8041,
|
|
5
|
+
"dark": #253746,
|
|
6
|
+
"maintext": #415464,
|
|
7
|
+
|
|
8
|
+
// primary colors
|
|
9
|
+
"primary": #00a58e,
|
|
10
|
+
"primary-hover": #008c79,
|
|
11
|
+
"primary-container-tag": #c2e9e4,
|
|
12
|
+
|
|
13
|
+
// new colors
|
|
14
|
+
// background start
|
|
15
|
+
"background": #f8fafc,
|
|
16
|
+
"overlay": #253746,
|
|
17
|
+
"tooltip": #253746,
|
|
18
|
+
// background end
|
|
19
|
+
//surface start
|
|
20
|
+
"surface-primary": #ffffff,
|
|
21
|
+
"surface-tertiary": #e2e8f0,
|
|
22
|
+
// surface end
|
|
23
|
+
// character start
|
|
24
|
+
"select": #f1f5f9,
|
|
25
|
+
"border": #cbd5e1,
|
|
26
|
+
"icon": #94a3b8,
|
|
27
|
+
"disable": #f1f5f9,
|
|
28
|
+
"hover": #e2e8f0,
|
|
29
|
+
// character end
|
|
30
|
+
// text start
|
|
31
|
+
"text-primary": #1a2732,
|
|
32
|
+
"text-secondary": #475569,
|
|
33
|
+
"text-disable": #94a3b8,
|
|
34
|
+
"text-on-color": #ffffff,
|
|
35
|
+
"text-tertiary": #64748b,
|
|
36
|
+
// text end
|
|
37
|
+
// functional start
|
|
38
|
+
"information": #186ade,
|
|
39
|
+
"information-container": #f0f4fa,
|
|
40
|
+
"success-container": #ebf7ed,
|
|
41
|
+
"warning-container": #faf6cf,
|
|
42
|
+
"error-container": #fff1f1,
|
|
43
|
+
"information-hover": #0d4ea6,
|
|
44
|
+
"success": #16a163,
|
|
45
|
+
"warning": #f5c518,
|
|
46
|
+
"warning-text": #8f3415,
|
|
47
|
+
"error": #da1e28,
|
|
48
|
+
|
|
49
|
+
// status colors
|
|
50
|
+
"error-container-tag": #ffd7d9,
|
|
51
|
+
"error-hover": #a2191f,
|
|
52
|
+
"information-container-tag": #d4e4fa,
|
|
53
|
+
"warning-container-tag": #fcddc7,
|
|
54
|
+
|
|
55
|
+
// accent
|
|
56
|
+
"accent": #ff8041,
|
|
57
|
+
|
|
58
|
+
// additional colors
|
|
59
|
+
"success-container-tag": #c7ebd1,
|
|
60
|
+
"green-70": #075e45,
|
|
61
|
+
|
|
62
|
+
//top menu
|
|
63
|
+
"background-top-menu": #253746,
|
|
64
|
+
"text-top-menu": #f8fafc,
|
|
65
|
+
"active-top-menu": #45d6ad,
|
|
66
|
+
"icon-top-menu": #45d6ad,
|
|
67
|
+
"accent-top-menu": #ff8041,
|
|
68
|
+
"intellihub-user-top-menu": #3b4d5d,
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
$font-open-sans: "open sans", sans-serif;
|
|
72
|
+
$font-play: play, sans-serif;
|
|
73
|
+
|
|
74
|
+
$font-size-10: 0.67rem;
|
|
75
|
+
$font-size-12: 0.8rem;
|
|
76
|
+
$font-size-14: 0.94rem;
|
|
77
|
+
$font-size-16: 1.07rem;
|
|
78
|
+
$font-size-18: 1.2rem;
|
|
79
|
+
$font-size-20: 1.3rem;
|
|
80
|
+
$font-size-24: 1.6rem;
|
|
81
|
+
$font-size-28: 1.75rem;
|
|
82
|
+
$font-size-36: 2.4rem;
|
|
83
|
+
$font-size-40: 2.5rem;
|
|
84
|
+
$font-size-50: 3.34rem;
|
|
85
|
+
$font-size-80: 5.34rem;
|
|
86
|
+
|
|
87
|
+
// Media Query Ranges
|
|
88
|
+
$small-screen-up: 601px !default;
|
|
89
|
+
$medium-screen-up: 993px !default;
|
|
90
|
+
$large-screen-up: 1201px !default;
|
|
91
|
+
$small-screen: 600px !default;
|
|
92
|
+
$medium-screen: 992px !default;
|
|
93
|
+
$large-screen: 1200px !default;
|
|
94
|
+
|
|
95
|
+
$medium-and-up: "only screen and (min-width : #{$small-screen-up})" !default;
|
|
96
|
+
$large-and-up: "only screen and (min-width : #{$medium-screen-up})" !default;
|
|
97
|
+
$extra-large-and-up: "only screen and (min-width : #{$large-screen-up})" !default;
|
|
98
|
+
$small-and-down: "only screen and (max-width : #{$small-screen})" !default;
|
|
99
|
+
$medium-and-down: "only screen and (max-width : #{$medium-screen})" !default;
|
|
100
|
+
$medium-only: "only screen and (min-width : #{$small-screen-up}) and (max-width : #{$medium-screen})" !default;
|
|
101
|
+
|
|
102
|
+
$spaceamounts: (5, 7, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 80, 100);
|
|
103
|
+
$sides: (top, bottom, left, right);
|
package/scss/main.scss
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Fonts
|
|
2
|
+
@import url("https://fonts.googleapis.com/css?family=Play:400,700&display=swap");
|
|
3
|
+
@import url("https://fonts.googleapis.com/css?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap");
|
|
4
|
+
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&display=swap");
|
|
5
|
+
|
|
6
|
+
@import "components/tooltip";
|
|
7
|
+
@import "components/global";
|
package/shims-vue.d.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "esnext",
|
|
4
|
+
"target": "es6",
|
|
5
|
+
"lib": [
|
|
6
|
+
"dom",
|
|
7
|
+
"es6",
|
|
8
|
+
"es2015.iterable",
|
|
9
|
+
"es2017.object",
|
|
10
|
+
"es2021"
|
|
11
|
+
],
|
|
12
|
+
"downlevelIteration": true,
|
|
13
|
+
"experimentalDecorators": true,
|
|
14
|
+
"moduleResolution": "node",
|
|
15
|
+
"baseUrl": "./",
|
|
16
|
+
"paths": {
|
|
17
|
+
"@/*": ["./*"],
|
|
18
|
+
},
|
|
19
|
+
"allowSyntheticDefaultImports": true
|
|
20
|
+
},
|
|
21
|
+
"include": [
|
|
22
|
+
"**/*.ts"
|
|
23
|
+
],
|
|
24
|
+
"exclude": [
|
|
25
|
+
"node_modules",
|
|
26
|
+
"**/*.spec.ts"
|
|
27
|
+
],
|
|
28
|
+
"files": [
|
|
29
|
+
"./shims-vue.d.ts"
|
|
30
|
+
]
|
|
31
|
+
}
|