@finsemble/finsemble-ui 7.2.1 → 7.3.1
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/package.json +14 -14
- package/react/assets/css/button.css +34 -6
- package/react/assets/css/contextMenu.css +118 -0
- package/react/assets/css/notificationsCenter.css +3 -214
- package/react/assets/css/userPreferences.css +2 -2
- package/react/components/common/Checkbox.d.ts +3 -2
- package/react/components/common/Checkbox.js +5 -21
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/ContextMenu.d.ts +13 -0
- package/react/components/common/ContextMenu.js +69 -0
- package/react/components/common/ContextMenu.js.map +1 -0
- package/react/components/common/DropdownButton.d.ts +0 -4
- package/react/components/common/DropdownButton.js +39 -10
- package/react/components/common/DropdownButton.js.map +1 -1
- package/react/components/common/css/FinsembleToggle.css +0 -1
- package/react/components/common/css/application-edit-page.css +3 -4
- package/react/components/common/css/checkbox.css +60 -21
- package/react/components/common/css/icon.css +2 -2
- package/react/components/common/css/toggle.css +4 -1
- package/react/components/common/helpers.js +9 -0
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/ContextMenu.stories.d.ts +38 -0
- package/react/components/common/stories/ContextMenu.stories.js +70 -0
- package/react/components/common/stories/ContextMenu.stories.js.map +1 -0
- package/react/components/common/stories/DropdownButton.stories.d.ts +3 -3
- package/react/components/common/stories/DropdownButton.stories.js +11 -10
- package/react/components/common/stories/DropdownButton.stories.js.map +1 -1
- package/react/components/common/tests/Checkbox.spec.js +10 -12
- package/react/components/common/tests/Checkbox.spec.js.map +1 -1
- package/react/components/common/tests/ContextMenu.spec.d.ts +1 -0
- package/react/components/common/tests/ContextMenu.spec.js +108 -0
- package/react/components/common/tests/ContextMenu.spec.js.map +1 -0
- package/react/components/common/tests/DropdownButton.spec.d.ts +1 -0
- package/react/components/common/tests/DropdownButton.spec.js +32 -0
- package/react/components/common/tests/DropdownButton.spec.js.map +1 -0
- package/react/components/notifications/components/drawer/DrawerHeader.js +3 -3
- package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +1 -0
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +2 -0
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/IconButton.js +2 -1
- package/react/components/notifications/components/shared/IconButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +2 -0
- package/react/components/notifications/components/shared/NotificationCardShell.js +55 -49
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js +2 -3
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +4 -0
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js +92 -13
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/views/ListView.js +5 -9
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/css/notification-card.css +165 -0
- package/react/components/notifications/stories/NotificationCardShell.stories.d.ts +14 -0
- package/react/components/notifications/stories/NotificationCardShell.stories.js +108 -0
- package/react/components/notifications/stories/NotificationCardShell.stories.js.map +1 -0
- package/react/components/notifications/tests/NotificationCardShell.spec.d.ts +1 -0
- package/react/components/notifications/tests/NotificationCardShell.spec.js +91 -0
- package/react/components/notifications/tests/NotificationCardShell.spec.js.map +1 -0
- package/react/components/notifications/types.d.ts +4 -2
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/sdd/AddApp.d.ts +3 -3
- package/react/components/sdd/AddApp.js +29 -21
- package/react/components/sdd/AddApp.js.map +1 -1
- package/react/components/sdd/AppEditPage.js +1 -8
- package/react/components/sdd/AppEditPage.js.map +1 -1
- package/react/components/sdd/Appearance.css +2 -1
- package/react/components/sdd/Applications.js +7 -7
- package/react/components/sdd/Applications.js.map +1 -1
- package/react/components/sdd/Navigation.js +2 -4
- package/react/components/sdd/Navigation.js.map +1 -1
- package/react/components/sdd/common/views.js +1 -14
- package/react/components/sdd/common/views.js.map +1 -1
- package/react/components/sdd/css/addApp.css +64 -1
- package/react/components/sdd/css/nav.css +50 -29
- package/react/components/sdd/fixtures/views.js +1 -14
- package/react/components/sdd/fixtures/views.js.map +1 -1
- package/react/components/sdd/tests/AddApp.spec.js +2 -2
- package/react/components/sdd/tests/AddApp.spec.js.map +1 -1
- package/react/components/sdd/tests/AppEditPage.spec.js +5 -8
- package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/sdd/tests/Export.spec.js +11 -11
- package/react/components/sdd/tests/Export.spec.js.map +1 -1
- package/react/components/sdd/tests/ExportZip.spec.js +3 -3
- package/react/components/sdd/tests/ExportZip.spec.js.map +1 -1
- package/react/components/sdd/tests/Navigation.spec.js +3 -2
- package/react/components/sdd/tests/Navigation.spec.js.map +1 -1
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js +1 -2
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +18 -14
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +9 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +35 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +3 -1
- package/react/components/userPreferences/components/content/Workspaces.js +20 -3
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +1 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +3 -2
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js +12 -9
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
- package/react/components/userPreferences/tests/UserPreferencesBase.spec.js +2 -0
- package/react/components/userPreferences/tests/UserPreferencesBase.spec.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +99 -26
- package/react/components/windowTitleBar/WindowTitleBarShell.js +204 -131
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js +30 -21
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/hooks/useNotifications.js +8 -7
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/tsconfig.tsbuildinfo +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +0 -16
- package/react/components/notifications/components/shared/OverflowMenu.js +0 -114
- package/react/components/notifications/components/shared/OverflowMenu.js.map +0 -1
- package/react/components/sdd/GettingStarted.d.ts +0 -8
- package/react/components/sdd/GettingStarted.js +0 -25
- package/react/components/sdd/GettingStarted.js.map +0 -1
- package/react/components/sdd/stories/GettingStarted.stories.d.ts +0 -11
- package/react/components/sdd/stories/GettingStarted.stories.js +0 -18
- package/react/components/sdd/stories/GettingStarted.stories.js.map +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* Notification card and views */
|
|
2
|
+
.notification-card {
|
|
3
|
+
background-color: var(--core-primary);
|
|
4
|
+
box-shadow: 0 0 8px 0 rgb(0 0 0 / 50%);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
font-family: var(--notification-font-family);
|
|
8
|
+
min-height: 120px;
|
|
9
|
+
padding: 8px 10px;
|
|
10
|
+
margin: 0 5px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.notification-card.new {
|
|
14
|
+
box-shadow: 0 0 9px 0 var(--notification-highlight-border-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.notification-card.read {
|
|
18
|
+
background-color: var(--core-primary-opacity);
|
|
19
|
+
color: var(--font-shadow-light);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.notification-day {
|
|
23
|
+
color: var(--font-shadow-light);
|
|
24
|
+
font-size: var(--font-size);
|
|
25
|
+
font-weight: bold;
|
|
26
|
+
margin: 10px auto;
|
|
27
|
+
padding: 0 0 0 5px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.notification-card__header {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: 25px auto minmax(80px, auto);
|
|
33
|
+
grid-template-rows: 30px;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.notification-card__title {
|
|
38
|
+
display: block;
|
|
39
|
+
font-size: var(--font-size-large);
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
text-overflow: ellipsis;
|
|
42
|
+
white-space: nowrap;
|
|
43
|
+
margin-right: auto;
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.notification-card__more-options__no-toggle,
|
|
48
|
+
.notification-card__more-options__toggle {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
display: grid;
|
|
52
|
+
grid-template-rows: 30px;
|
|
53
|
+
align-items: center;
|
|
54
|
+
grid-template-columns: minmax(80px, auto);
|
|
55
|
+
justify-items: end;
|
|
56
|
+
margin-left: 2px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.js-toasts .notification-card__more-options__no-toggle,
|
|
60
|
+
.js-toasts .notification-card__more-options__toggle {
|
|
61
|
+
grid-template-columns: 25px 20px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.notification-card__more-options__toggle .notification-card_context_menu,
|
|
65
|
+
.notification-card__more-options__toggle:hover .notification-card_timestamp {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.notification-card__more-options__no-toggle .notification-card_context_menu,
|
|
70
|
+
.notification-card__more-options__toggle:hover .notification-card_context_menu {
|
|
71
|
+
display: flex;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.notification-card__dismiss.finsemble-icon__btn i {
|
|
75
|
+
font-size: var(--titleBar-icon-font-size);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.notification-card__more-options__no-toggle .notification-card__dismiss:hover {
|
|
79
|
+
color: var(--titleBar-button-hover-negative-color);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.notification-card__body {
|
|
83
|
+
gap: 10px;
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: row;
|
|
86
|
+
font-size: var(--font-size-large);
|
|
87
|
+
margin-top: 8px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.notification-card__body_text {
|
|
91
|
+
display: -webkit-box; /* stylelint-disable-line */
|
|
92
|
+
-webkit-box-orient: vertical;
|
|
93
|
+
-webkit-line-clamp: 4;
|
|
94
|
+
color: var(--core-primary-5);
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.notification-card__body_img_container {
|
|
99
|
+
width: 50px;
|
|
100
|
+
height: 50px;
|
|
101
|
+
padding-bottom: 5px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.notification-card__body_img_container img {
|
|
105
|
+
width: inherit;
|
|
106
|
+
height: inherit;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.notification-card.read .notification-card__body_text {
|
|
110
|
+
color: var(--font-color-1-shadow);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.actions-panel {
|
|
114
|
+
max-width: 120px;
|
|
115
|
+
align-items: flex-end;
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
margin-left: auto;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.actions-panel__btn:hover {
|
|
122
|
+
opacity: 0.75;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.notification-card .overflow-menu__container,
|
|
126
|
+
.notification-card.read .overflow-menu__container {
|
|
127
|
+
color: var(--font-color);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.notification-card__header img {
|
|
131
|
+
object-fit: contain;
|
|
132
|
+
margin-right: 8px;
|
|
133
|
+
max-width: 18px;
|
|
134
|
+
max-height: 18px;
|
|
135
|
+
width: auto;
|
|
136
|
+
height: auto;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.js-toasts .notification-card__header {
|
|
140
|
+
grid-template-columns: 25px auto 45px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.finsemble-icon__btn {
|
|
144
|
+
align-items: center;
|
|
145
|
+
color: var(--core-primary-5);
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
display: flex;
|
|
148
|
+
height: 24px;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
position: relative;
|
|
151
|
+
width: 24px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.finsemble-icon__btn.active {
|
|
155
|
+
color: var(--accent-primary);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.finsemble-icon__btn:hover:not(.no-hover) {
|
|
159
|
+
background: var(--menu-actions-hover-color);
|
|
160
|
+
border-radius: 50%;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.finsemble-icon__btn i {
|
|
164
|
+
font-size: var(--font-size-large);
|
|
165
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Story } from "@storybook/react/types-6-0";
|
|
3
|
+
import { NotificationCardPropType } from "../components/shared/NotificationCardShell";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.FunctionComponent<NotificationCardPropType>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const AllFields: Story<NotificationCardPropType>;
|
|
10
|
+
export declare const AllFieldsToasts: Story<NotificationCardPropType>;
|
|
11
|
+
export declare const NoLogos: Story<NotificationCardPropType>;
|
|
12
|
+
export declare const NoActionsNoLogos: Story<NotificationCardPropType>;
|
|
13
|
+
export declare const VeryLongActionName: Story<NotificationCardPropType>;
|
|
14
|
+
export declare const ALotOfDetailsText: Story<NotificationCardPropType>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { initFSBL } from "../../common/helpers";
|
|
3
|
+
import { NotificationCardShell } from "../components/shared/NotificationCardShell";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Notifications/NotificationCard",
|
|
6
|
+
component: NotificationCardShell,
|
|
7
|
+
};
|
|
8
|
+
const Template = (args) => {
|
|
9
|
+
initFSBL(window);
|
|
10
|
+
return (React.createElement("div", { style: { maxWidth: "408px", background: "#171a20", padding: "20px" } },
|
|
11
|
+
React.createElement(NotificationCardShell, Object.assign({}, args))));
|
|
12
|
+
};
|
|
13
|
+
const notification = {
|
|
14
|
+
headerLogo: "https://assets.finsemble.com/sales-demo-assets/appD/IQ-icon.png",
|
|
15
|
+
type: "type",
|
|
16
|
+
timeout: 5000,
|
|
17
|
+
source: "source-name",
|
|
18
|
+
headerText: "I am header text",
|
|
19
|
+
cssClassName: "css-class-name",
|
|
20
|
+
contentLogo: "https://assets.finsemble.com/sales-demo-assets/appD/IQ-icon.png",
|
|
21
|
+
isRead: false,
|
|
22
|
+
issuedAt: new Date().toISOString(),
|
|
23
|
+
title: "Title",
|
|
24
|
+
details: "A reasonable amount of text. One or two lines.",
|
|
25
|
+
isMuted: false,
|
|
26
|
+
isSnoozed: false,
|
|
27
|
+
isDeleted: false,
|
|
28
|
+
stateHistory: [],
|
|
29
|
+
actions: [
|
|
30
|
+
[
|
|
31
|
+
{
|
|
32
|
+
type: "SNOOZE",
|
|
33
|
+
buttonText: "Default Snooze",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: "SNOOZE",
|
|
37
|
+
buttonText: "Snooze With Longer Text",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: "SNOOZE",
|
|
41
|
+
buttonText: "Small Snooze",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
{
|
|
45
|
+
type: "SNOOZE",
|
|
46
|
+
buttonText: "Longer text",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "SNOOZE",
|
|
50
|
+
buttonText: "Much longer text",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
export const AllFields = Template.bind({});
|
|
55
|
+
AllFields.args = {
|
|
56
|
+
notification: notification,
|
|
57
|
+
uiContext: "center",
|
|
58
|
+
};
|
|
59
|
+
export const AllFieldsToasts = Template.bind({});
|
|
60
|
+
AllFieldsToasts.args = {
|
|
61
|
+
notification: notification,
|
|
62
|
+
uiContext: "toasts",
|
|
63
|
+
};
|
|
64
|
+
const noLogoNotification = Object.assign({}, notification);
|
|
65
|
+
delete noLogoNotification.headerLogo;
|
|
66
|
+
delete noLogoNotification.contentLogo;
|
|
67
|
+
noLogoNotification.contentLogo;
|
|
68
|
+
export const NoLogos = Template.bind({});
|
|
69
|
+
NoLogos.args = {
|
|
70
|
+
notification: noLogoNotification,
|
|
71
|
+
};
|
|
72
|
+
const noActionsNoLogosNotification = Object.assign({}, notification);
|
|
73
|
+
delete noActionsNoLogosNotification.headerLogo;
|
|
74
|
+
delete noActionsNoLogosNotification.contentLogo;
|
|
75
|
+
delete noActionsNoLogosNotification.actions;
|
|
76
|
+
export const NoActionsNoLogos = Template.bind({});
|
|
77
|
+
NoActionsNoLogos.args = {
|
|
78
|
+
notification: noActionsNoLogosNotification,
|
|
79
|
+
};
|
|
80
|
+
const veryLongActionNameNotification = Object.assign({}, notification);
|
|
81
|
+
veryLongActionNameNotification.actions = [
|
|
82
|
+
{
|
|
83
|
+
buttonText: "This is a very long action name. How long can we go?",
|
|
84
|
+
type: "DISMISS",
|
|
85
|
+
},
|
|
86
|
+
[
|
|
87
|
+
{
|
|
88
|
+
buttonText: "This is a very long action name. How long can we go?",
|
|
89
|
+
type: "DISMISS",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
buttonText: "This is a very long action name. How long can we go?",
|
|
93
|
+
type: "DISMISS",
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
];
|
|
97
|
+
export const VeryLongActionName = Template.bind({});
|
|
98
|
+
VeryLongActionName.args = {
|
|
99
|
+
notification: veryLongActionNameNotification,
|
|
100
|
+
};
|
|
101
|
+
const aLotOfDetailsTextNotification = Object.assign({}, notification);
|
|
102
|
+
aLotOfDetailsTextNotification.details =
|
|
103
|
+
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took . galley of type and scrambled it to make . type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.";
|
|
104
|
+
export const ALotOfDetailsText = Template.bind({});
|
|
105
|
+
ALotOfDetailsText.args = {
|
|
106
|
+
notification: aLotOfDetailsTextNotification,
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=NotificationCardShell.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationCardShell.stories.js","sourceRoot":"","sources":["../../../../src/components/notifications/stories/NotificationCardShell.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAA4B,MAAM,4CAA4C,CAAC;AAI7G,eAAe;IACd,KAAK,EAAE,gCAAgC;IACvC,SAAS,EAAE,qBAAqB;CAChC,CAAC;AAEF,MAAM,QAAQ,GAAoC,CAAC,IAA8B,EAAE,EAAE;IACp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G;IACzB,YAAY,EAAE,8BAA8B;CAC5C,CAAC;AAEF,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;AACtE,6BAA6B,CAAC,OAAO;IACpC,gXAAgX,CAAC;AAElX,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnD,iBAAiB,CAAC,IAAI,GAAG;IACxB,YAAY,EAAE,6BAA6B;CAC3C,CAAC","sourcesContent":["import React from \"react\";\nimport { initFSBL } from \"../../common/helpers\";\nimport { Story } from \"@storybook/react/types-6-0\";\nimport { NotificationCardShell, NotificationCardPropType } from \"../components/shared/NotificationCardShell\";\nimport { services } from \"@finsemble/finsemble-api\";\ntype INotification = services.notification.types.INotification;\n\nexport default {\n\ttitle: \"Notifications/NotificationCard\",\n\tcomponent: NotificationCardShell,\n};\n\nconst Template: Story<NotificationCardPropType> = (args: NotificationCardPropType) => {\n\tinitFSBL(window);\n\treturn (\n\t\t<div style={{ maxWidth: \"408px\", background: \"#171a20\", padding: \"20px\" }}>\n\t\t\t<NotificationCardShell {...args} />\n\t\t</div>\n\t);\n};\n\nconst notification: INotification = {\n\theaderLogo: \"https://assets.finsemble.com/sales-demo-assets/appD/IQ-icon.png\",\n\ttype: \"type\",\n\ttimeout: 5000,\n\tsource: \"source-name\",\n\theaderText: \"I am header text\",\n\tcssClassName: \"css-class-name\",\n\tcontentLogo: \"https://assets.finsemble.com/sales-demo-assets/appD/IQ-icon.png\",\n\tisRead: false,\n\tissuedAt: new Date().toISOString(),\n\ttitle: \"Title\",\n\tdetails: \"A reasonable amount of text. One or two lines.\",\n\tisMuted: false,\n\tisSnoozed: false,\n\tisDeleted: false,\n\tstateHistory: [],\n\tactions: [\n\t\t[\n\t\t\t{\n\t\t\t\ttype: \"SNOOZE\",\n\t\t\t\tbuttonText: \"Default Snooze\",\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"SNOOZE\",\n\t\t\t\tbuttonText: \"Snooze With Longer Text\",\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: \"SNOOZE\",\n\t\t\t\tbuttonText: \"Small Snooze\",\n\t\t\t},\n\t\t],\n\t\t{\n\t\t\ttype: \"SNOOZE\",\n\t\t\tbuttonText: \"Longer text\",\n\t\t},\n\t\t{\n\t\t\ttype: \"SNOOZE\",\n\t\t\tbuttonText: \"Much longer text\",\n\t\t},\n\t],\n};\n\nexport const AllFields = Template.bind({});\nAllFields.args = {\n\tnotification: notification,\n\tuiContext: \"center\",\n};\nexport const AllFieldsToasts = Template.bind({});\nAllFieldsToasts.args = {\n\tnotification: notification,\n\tuiContext: \"toasts\",\n};\n\nconst noLogoNotification = Object.assign({}, notification);\n\ndelete noLogoNotification.headerLogo;\ndelete noLogoNotification.contentLogo;\nnoLogoNotification.contentLogo;\n\nexport const NoLogos = Template.bind({});\nNoLogos.args = {\n\tnotification: noLogoNotification,\n};\n\nconst noActionsNoLogosNotification = Object.assign({}, notification);\ndelete noActionsNoLogosNotification.headerLogo;\ndelete noActionsNoLogosNotification.contentLogo;\ndelete noActionsNoLogosNotification.actions;\n\nexport const NoActionsNoLogos = Template.bind({});\nNoActionsNoLogos.args = {\n\tnotification: noActionsNoLogosNotification,\n};\n\nconst veryLongActionNameNotification = Object.assign({}, notification);\nveryLongActionNameNotification.actions = [\n\t{\n\t\tbuttonText: \"This is a very long action name. How long can we go?\",\n\t\ttype: \"DISMISS\",\n\t},\n\t[\n\t\t{\n\t\t\tbuttonText: \"This is a very long action name. How long can we go?\",\n\t\t\ttype: \"DISMISS\",\n\t\t},\n\t\t{\n\t\t\tbuttonText: \"This is a very long action name. How long can we go?\",\n\t\t\ttype: \"DISMISS\",\n\t\t},\n\t],\n];\n\nexport const VeryLongActionName = Template.bind({});\nVeryLongActionName.args = {\n\tnotification: veryLongActionNameNotification,\n};\n\nconst aLotOfDetailsTextNotification = Object.assign({}, notification);\naLotOfDetailsTextNotification.details =\n\t\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took . galley of type and scrambled it to make . type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.\";\n\nexport const ALotOfDetailsText = Template.bind({});\nALotOfDetailsText.args = {\n\tnotification: aLotOfDetailsTextNotification,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { mount } from "enzyme";
|
|
3
|
+
import { afterEach, describe, it } from "mocha";
|
|
4
|
+
import { expect } from "chai";
|
|
5
|
+
import { NoActionsNoLogos, NoLogos, AllFields, AllFieldsToasts } from "../stories/NotificationCardShell.stories";
|
|
6
|
+
import { accessibilityAssessor } from "../../sdd/tests/a11y_helper";
|
|
7
|
+
import { waitTime } from "../../sdd/sdd_helpers";
|
|
8
|
+
import sinon from "sinon";
|
|
9
|
+
describe("<NotificationCardShell />", () => {
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
sinon.restore();
|
|
12
|
+
});
|
|
13
|
+
it("should pass accessibility scans when in the notification center", async () => {
|
|
14
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, AllFields.args)));
|
|
15
|
+
expect(await accessibilityAssessor(wrapper)).to.be.true;
|
|
16
|
+
}).timeout(10e3);
|
|
17
|
+
it("should pass accessibility scans when in the notification toasts", async () => {
|
|
18
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, AllFields.args, { uiContext: "toasts" })));
|
|
19
|
+
expect(await accessibilityAssessor(wrapper)).to.be.true;
|
|
20
|
+
}).timeout(10e3);
|
|
21
|
+
const testHalo = (args, expected) => async () => {
|
|
22
|
+
const { notification } = args;
|
|
23
|
+
// Refresh the issued at date as this tests behaviour based on the passage of time
|
|
24
|
+
notification.issuedAt = new Date().toISOString();
|
|
25
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, args, { notification: notification })));
|
|
26
|
+
await waitTime(0);
|
|
27
|
+
wrapper.update();
|
|
28
|
+
expect(wrapper.find(".notification-card.new").exists()).to.equal(expected);
|
|
29
|
+
expect(wrapper.find(".notification-card.read").exists(), "card should not be marked as read").to.equal(false);
|
|
30
|
+
};
|
|
31
|
+
it("should show a halo when the notification is new", testHalo(Object.assign(Object.assign({}, AllFields.args), { uiContext: "center" }), true)).timeout(10e3);
|
|
32
|
+
it("should not show a halo when a toast", testHalo(Object.assign(Object.assign({}, AllFields.args), { uiContext: "toasts" }), false)).timeout(10e3);
|
|
33
|
+
// Skipped because it fails when running the whole suite. Passes when run on its own.
|
|
34
|
+
// Also couldn't get sinon.useFakeTimers() to work
|
|
35
|
+
it("should hide the new halo after 3 seconds of time (3s comes from preferences)", async () => {
|
|
36
|
+
const { notification } = AllFields.args;
|
|
37
|
+
notification.issuedAt = new Date().toISOString();
|
|
38
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, AllFields.args, { notification: notification })));
|
|
39
|
+
await waitTime(0);
|
|
40
|
+
wrapper.update();
|
|
41
|
+
expect(wrapper.find(".notification-card.new").exists(), "Card is new").to.be.true;
|
|
42
|
+
await waitTime(2000);
|
|
43
|
+
wrapper.update();
|
|
44
|
+
expect(wrapper.find(".notification-card.new").exists(), "Card is still new").to.be.true;
|
|
45
|
+
await waitTime(1500);
|
|
46
|
+
wrapper.update();
|
|
47
|
+
expect(wrapper.find(".notification-card.new").exists(), "Card is no longer new").to.be.false;
|
|
48
|
+
}).timeout(10e3);
|
|
49
|
+
it("should be read", () => {
|
|
50
|
+
const { notification } = AllFields.args;
|
|
51
|
+
notification.isRead = true;
|
|
52
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, AllFields.args, { notification: notification })));
|
|
53
|
+
expect(wrapper.find(".notification-card.read").exists(), "card should be marked as read").to.equal(true);
|
|
54
|
+
});
|
|
55
|
+
it("should have a close button when a toast", () => {
|
|
56
|
+
const wrapper = mount(React.createElement(AllFieldsToasts, Object.assign({}, AllFieldsToasts.args, { uiContext: "toasts" })));
|
|
57
|
+
expect(wrapper.find(".notification-card__dismiss").exists(), "Toasts should have a dismiss button (x top right corner)").to.equal(true);
|
|
58
|
+
});
|
|
59
|
+
it("SHOULD have icons", () => {
|
|
60
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, AllFields.args)));
|
|
61
|
+
const imageExists = wrapper.find(".notification-card__header img").exists();
|
|
62
|
+
const defaultImageExists = wrapper.find(".notification-card__header .default-img").exists();
|
|
63
|
+
expect(imageExists && !defaultImageExists, "Title icon exists and default icon does not").to.equal(true);
|
|
64
|
+
expect(wrapper.find(".notification-card__body_img_container img").exists(), "Content icon exists").to.equal(true);
|
|
65
|
+
});
|
|
66
|
+
it("SHOULD NOT have icons", () => {
|
|
67
|
+
const wrapper = mount(React.createElement(NoLogos, Object.assign({}, NoLogos.args)));
|
|
68
|
+
const defaultImageExists = wrapper.find(".notification-card__header .default-img").exists();
|
|
69
|
+
expect(defaultImageExists, "Default title icon exists").to.equal(true);
|
|
70
|
+
expect(wrapper.find(".notification-card__body_img_container img").exists(), "Content icon exists").to.equal(true);
|
|
71
|
+
});
|
|
72
|
+
it("should have cssClass value as css class", () => {
|
|
73
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, AllFields.args)));
|
|
74
|
+
expect(wrapper.find(".notification-card.css-class-name").exists()).to.be.true;
|
|
75
|
+
});
|
|
76
|
+
it("SHOULD have actions", () => {
|
|
77
|
+
const wrapper = mount(React.createElement(AllFields, Object.assign({}, AllFields.args)));
|
|
78
|
+
expect(wrapper.find(".finsemble-dropdown-action__btn-container").exists(), "One grouped action should exist").to.be
|
|
79
|
+
.true;
|
|
80
|
+
const actions = wrapper.find(".actions-panel .finsemble__btn");
|
|
81
|
+
expect(actions.length, "Two single actions should exist").to.equal(2);
|
|
82
|
+
const spy = sinon.spy(FSBL.Clients.NotificationClient, "performAction");
|
|
83
|
+
actions.at(0).simulate("click");
|
|
84
|
+
expect(spy.calledOnce, "action is performed").to.be.true;
|
|
85
|
+
});
|
|
86
|
+
it("SHOULD NOT have actions", () => {
|
|
87
|
+
const wrapper = mount(React.createElement(NoActionsNoLogos, Object.assign({}, NoActionsNoLogos.args)));
|
|
88
|
+
expect(wrapper.find(".actions-panel").exists()).to.be.false;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=NotificationCardShell.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationCardShell.spec.js","sourceRoot":"","sources":["../../../../src/components/notifications/tests/NotificationCardShell.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEjH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IAC1C,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,KAAK,IAAI,EAAE;QAChF,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,SAAS,oBAAM,SAAS,CAAC,IAAiC,EAAI,CAAC,CAAC;QACvF,MAAM,CAAC,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACz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AC;QAC/D,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,iCAAiC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;QACxE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QAClC,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,gBAAgB,oBAAM,gBAAgB,CAAC,IAAiC,EAAI,CAAC,CAAC;QACrG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAC7D,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { afterEach, describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport { NoActionsNoLogos, NoLogos, AllFields, AllFieldsToasts } from \"../stories/NotificationCardShell.stories\";\nimport { NotificationCardPropType } from \"../components/shared/NotificationCardShell\";\nimport { accessibilityAssessor } from \"../../sdd/tests/a11y_helper\";\nimport { waitTime } from \"../../sdd/sdd_helpers\";\nimport sinon from \"sinon\";\n\ndescribe(\"<NotificationCardShell />\", () => {\n\tafterEach(() => {\n\t\tsinon.restore();\n\t});\n\n\tit(\"should pass accessibility scans when in the notification center\", async () => {\n\t\tconst wrapper = mount(<AllFields {...(AllFields.args as NotificationCardPropType)} />);\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t}).timeout(10e3);\n\n\tit(\"should pass accessibility scans when in the notification toasts\", async () => {\n\t\tconst wrapper = mount(<AllFields {...(AllFields.args as NotificationCardPropType)} uiContext=\"toasts\" />);\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t}).timeout(10e3);\n\n\tconst testHalo = (args: NotificationCardPropType, expected: any) => async () => {\n\t\tconst { notification } = args;\n\t\t// Refresh the issued at date as this tests behaviour based on the passage of time\n\t\tnotification.issuedAt = new Date().toISOString();\n\t\tconst wrapper = mount(<AllFields {...(args as NotificationCardPropType)} notification={notification} />);\n\t\tawait waitTime(0);\n\t\twrapper.update();\n\t\texpect(wrapper.find(\".notification-card.new\").exists()).to.equal(expected);\n\t\texpect(wrapper.find(\".notification-card.read\").exists(), \"card should not be marked as read\").to.equal(false);\n\t};\n\n\tit(\n\t\t\"should show a halo when the notification is new\",\n\t\ttestHalo({ ...AllFields.args, uiContext: \"center\" } as NotificationCardPropType, true)\n\t).timeout(10e3);\n\n\tit(\n\t\t\"should not show a halo when a toast\",\n\t\ttestHalo({ ...AllFields.args, uiContext: \"toasts\" } as NotificationCardPropType, false)\n\t).timeout(10e3);\n\n\t// Skipped because it fails when running the whole suite. Passes when run on its own.\n\t// Also couldn't get sinon.useFakeTimers() to work\n\tit(\"should hide the new halo after 3 seconds of time (3s comes from preferences)\", async () => {\n\t\tconst { notification } = AllFields.args as NotificationCardPropType;\n\t\tnotification.issuedAt = new Date().toISOString();\n\t\tconst wrapper = mount(<AllFields {...(AllFields.args as NotificationCardPropType)} notification={notification} />);\n\t\tawait waitTime(0);\n\t\twrapper.update();\n\t\texpect(wrapper.find(\".notification-card.new\").exists(), \"Card is new\").to.be.true;\n\t\tawait waitTime(2000);\n\t\twrapper.update();\n\t\texpect(wrapper.find(\".notification-card.new\").exists(), \"Card is still new\").to.be.true;\n\t\tawait waitTime(1500);\n\t\twrapper.update();\n\t\texpect(wrapper.find(\".notification-card.new\").exists(), \"Card is no longer new\").to.be.false;\n\t}).timeout(10e3);\n\n\tit(\"should be read\", () => {\n\t\tconst { notification } = AllFields.args as NotificationCardPropType;\n\t\tnotification.isRead = true;\n\t\tconst wrapper = mount(<AllFields {...(AllFields.args as NotificationCardPropType)} notification={notification} />);\n\t\texpect(wrapper.find(\".notification-card.read\").exists(), \"card should be marked as read\").to.equal(true);\n\t});\n\n\tit(\"should have a close button when a toast\", () => {\n\t\tconst wrapper = mount(\n\t\t\t<AllFieldsToasts {...(AllFieldsToasts.args as NotificationCardPropType)} uiContext=\"toasts\" />\n\t\t);\n\t\texpect(\n\t\t\twrapper.find(\".notification-card__dismiss\").exists(),\n\t\t\t\"Toasts should have a dismiss button (x top right corner)\"\n\t\t).to.equal(true);\n\t});\n\n\tit(\"SHOULD have icons\", () => {\n\t\tconst wrapper = mount(<AllFields {...(AllFields.args as NotificationCardPropType)} />);\n\t\tconst imageExists = wrapper.find(\".notification-card__header img\").exists();\n\t\tconst defaultImageExists = wrapper.find(\".notification-card__header .default-img\").exists();\n\t\texpect(imageExists && !defaultImageExists, \"Title icon exists and default icon does not\").to.equal(true);\n\n\t\texpect(wrapper.find(\".notification-card__body_img_container img\").exists(), \"Content icon exists\").to.equal(true);\n\t});\n\n\tit(\"SHOULD NOT have icons\", () => {\n\t\tconst wrapper = mount(<NoLogos {...(NoLogos.args as NotificationCardPropType)} />);\n\t\tconst defaultImageExists = wrapper.find(\".notification-card__header .default-img\").exists();\n\t\texpect(defaultImageExists, \"Default title icon exists\").to.equal(true);\n\t\texpect(wrapper.find(\".notification-card__body_img_container img\").exists(), \"Content icon exists\").to.equal(true);\n\t});\n\n\tit(\"should have cssClass value as css class\", () => {\n\t\tconst wrapper = mount(<AllFields {...(AllFields.args as NotificationCardPropType)} />);\n\t\texpect(wrapper.find(\".notification-card.css-class-name\").exists()).to.be.true;\n\t});\n\n\tit(\"SHOULD have actions\", () => {\n\t\tconst wrapper = mount(<AllFields {...(AllFields.args as NotificationCardPropType)} />);\n\t\texpect(wrapper.find(\".finsemble-dropdown-action__btn-container\").exists(), \"One grouped action should exist\").to.be\n\t\t\t.true;\n\t\tconst actions = wrapper.find(\".actions-panel .finsemble__btn\");\n\t\texpect(actions.length, \"Two single actions should exist\").to.equal(2);\n\t\tconst spy = sinon.spy(FSBL.Clients.NotificationClient, \"performAction\");\n\t\tactions.at(0).simulate(\"click\");\n\t\texpect(spy.calledOnce, \"action is performed\").to.be.true;\n\t});\n\n\tit(\"SHOULD NOT have actions\", () => {\n\t\tconst wrapper = mount(<NoActionsNoLogos {...(NoActionsNoLogos.args as NotificationCardPropType)} />);\n\t\texpect(wrapper.find(\".actions-panel\").exists()).to.be.false;\n\t});\n});\n"]}
|
|
@@ -82,10 +82,12 @@ export interface NotificationsConfig {
|
|
|
82
82
|
export interface WindowConfig {
|
|
83
83
|
window: SpawnParams & NotificationsConfig;
|
|
84
84
|
}
|
|
85
|
-
export declare type
|
|
85
|
+
export declare type ContextMenuAction = {
|
|
86
|
+
id?: string;
|
|
86
87
|
name: string;
|
|
87
88
|
icon: React.ReactElement;
|
|
88
|
-
action
|
|
89
|
+
action?: (name: any) => void;
|
|
89
90
|
label: string;
|
|
91
|
+
display: boolean;
|
|
90
92
|
};
|
|
91
93
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/notifications/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Notification types\n */\nimport React from \"react\";\nimport { ViewMode, SelectionMode } from \"./constants\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;\ntype IMuteFilter = services.notification.types.IMuteFilter;\ntype IFilter = services.notification.types.IFilter;\ntype SpawnParams = services.window.types.SpawnParams;\n\nexport interface Control {\n\taction: string;\n\tlabel: string;\n\trun?: Function;\n}\n\nexport interface NotificationCenterControlsProps {\n\tcontrols: Array<Control>;\n\tactive?: Control[\"action\"];\n}\n\nexport interface INotificationCenterProps {\n\tcontrols?: NotificationCenterControlsProps;\n\tnotificationCard?: React.ComponentType<any>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n\tnotificationListRow?: React.ComponentType<any>;\n}\n\nexport interface INotificationToastsProps {\n\tnotificationCard?: React.ComponentType<any>;\n}\n\nexport interface INotificationDetailProps {\n\tnotification: INotification;\n}\n\nexport type NotificationListViewProps = {\n\tnotifications: INotification[];\n\tnotificationListRow?: React.ComponentType<INotificationDetailProps>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n};\n\nexport type NotificationCardViewProps = {\n\tnotifications: INotification[];\n\tnotificationCard?: React.ComponentType<any>; // A custom component used to render a notification\n};\n\nexport type NotificationsContextType = {\n\tviewMode: ViewMode;\n\tsetViewMode: React.Dispatch<React.SetStateAction<ViewMode>>;\n\tselectionMode: SelectionMode;\n\tsetSelectionMode: React.Dispatch<React.SetStateAction<SelectionMode>>;\n\tisSelectAll: boolean;\n\tsetSelectAll: React.Dispatch<React.SetStateAction<boolean>>;\n\tdrawerControlProps: NotificationCenterControlsProps;\n\tsetDrawerControlProps: React.Dispatch<React.SetStateAction<NotificationCenterControlsProps>>;\n\tselectedNotification: INotification | null;\n\tsetSelectedNotification: React.Dispatch<React.SetStateAction<INotification | null>>;\n\tsearchString: string;\n\tsetSearchString: React.Dispatch<React.SetStateAction<string>>;\n\tfilteredNotifications: INotification[];\n\tcheckedNotifications: INotification[];\n\tsetCheckedNotifications: React.Dispatch<React.SetStateAction<INotification[]>>;\n\tsetFilteredNotifications: React.Dispatch<React.SetStateAction<INotification[]>>;\n\tmuteFilters: IMuteFilter[];\n\tsetMuteFilters: React.Dispatch<React.SetStateAction<IMuteFilter[]>>;\n};\n\nexport interface NotificationsConfig {\n\tfilter?: {\n\t\tinclude?: [];\n\t\texclude?: [];\n\t};\n\tposition?: {};\n\tanimation?: {\n\t\tdisplayDuration: number;\n\t\tanimateIn: string;\n\t\tanimateOut: string;\n\t};\n\tisTransparent?: boolean;\n\tnotificationsHistory?: { since?: string; filter?: IFilter; options?: INotificationHistoryOptions } | boolean;\n\tapplyMuteFilters?: boolean;\n\twindowName: string;\n}\n\nexport interface WindowConfig {\n\twindow: SpawnParams & NotificationsConfig;\n}\n\nexport type
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/notifications/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Notification types\n */\nimport React from \"react\";\nimport { ViewMode, SelectionMode } from \"./constants\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;\ntype IMuteFilter = services.notification.types.IMuteFilter;\ntype IFilter = services.notification.types.IFilter;\ntype SpawnParams = services.window.types.SpawnParams;\n\nexport interface Control {\n\taction: string;\n\tlabel: string;\n\trun?: Function;\n}\n\nexport interface NotificationCenterControlsProps {\n\tcontrols: Array<Control>;\n\tactive?: Control[\"action\"];\n}\n\nexport interface INotificationCenterProps {\n\tcontrols?: NotificationCenterControlsProps;\n\tnotificationCard?: React.ComponentType<any>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n\tnotificationListRow?: React.ComponentType<any>;\n}\n\nexport interface INotificationToastsProps {\n\tnotificationCard?: React.ComponentType<any>;\n}\n\nexport interface INotificationDetailProps {\n\tnotification: INotification;\n}\n\nexport type NotificationListViewProps = {\n\tnotifications: INotification[];\n\tnotificationListRow?: React.ComponentType<INotificationDetailProps>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n};\n\nexport type NotificationCardViewProps = {\n\tnotifications: INotification[];\n\tnotificationCard?: React.ComponentType<any>; // A custom component used to render a notification\n};\n\nexport type NotificationsContextType = {\n\tviewMode: ViewMode;\n\tsetViewMode: React.Dispatch<React.SetStateAction<ViewMode>>;\n\tselectionMode: SelectionMode;\n\tsetSelectionMode: React.Dispatch<React.SetStateAction<SelectionMode>>;\n\tisSelectAll: boolean;\n\tsetSelectAll: React.Dispatch<React.SetStateAction<boolean>>;\n\tdrawerControlProps: NotificationCenterControlsProps;\n\tsetDrawerControlProps: React.Dispatch<React.SetStateAction<NotificationCenterControlsProps>>;\n\tselectedNotification: INotification | null;\n\tsetSelectedNotification: React.Dispatch<React.SetStateAction<INotification | null>>;\n\tsearchString: string;\n\tsetSearchString: React.Dispatch<React.SetStateAction<string>>;\n\tfilteredNotifications: INotification[];\n\tcheckedNotifications: INotification[];\n\tsetCheckedNotifications: React.Dispatch<React.SetStateAction<INotification[]>>;\n\tsetFilteredNotifications: React.Dispatch<React.SetStateAction<INotification[]>>;\n\tmuteFilters: IMuteFilter[];\n\tsetMuteFilters: React.Dispatch<React.SetStateAction<IMuteFilter[]>>;\n};\n\nexport interface NotificationsConfig {\n\tfilter?: {\n\t\tinclude?: [];\n\t\texclude?: [];\n\t};\n\tposition?: {};\n\tanimation?: {\n\t\tdisplayDuration: number;\n\t\tanimateIn: string;\n\t\tanimateOut: string;\n\t};\n\tisTransparent?: boolean;\n\tnotificationsHistory?: { since?: string; filter?: IFilter; options?: INotificationHistoryOptions } | boolean;\n\tapplyMuteFilters?: boolean;\n\twindowName: string;\n}\n\nexport interface WindowConfig {\n\twindow: SpawnParams & NotificationsConfig;\n}\n\nexport type ContextMenuAction = {\n\tid?: string;\n\tname: string;\n\ticon: React.ReactElement;\n\taction?: (name: any) => void;\n\tlabel: string;\n\tdisplay: boolean;\n};\n"]}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import "./css/addApp.css";
|
|
7
7
|
export declare type AddAppProps = {
|
|
8
8
|
checkValidURL: (url: string) => boolean;
|
|
9
|
-
addAppByUrl: (url: string, name: string) => void;
|
|
10
|
-
addAppByPath: (path: string, name: string, apiAccess: boolean) => void;
|
|
9
|
+
addAppByUrl: (url: string, name: string, appId?: string) => void;
|
|
10
|
+
addAppByPath: (path: string, name: string, apiAccess: boolean, appId?: string) => void;
|
|
11
11
|
close: () => void;
|
|
12
12
|
show: boolean;
|
|
13
|
-
addAppCitrix?: (alias: string, name: string) => void;
|
|
13
|
+
addAppCitrix?: (alias: string, name: string, appId?: string) => void;
|
|
14
14
|
includeCitrix?: boolean;
|
|
15
15
|
idKey?: string;
|
|
16
16
|
};
|
|
@@ -10,6 +10,7 @@ import { VALID_APP_EXTENSIONS } from "../common/file_helpers";
|
|
|
10
10
|
import { FinsembleIcon } from "../common/FinsembleIcon";
|
|
11
11
|
import { FinsembleToggleButtonBar } from "../common/FinsembleToggleButtonBar";
|
|
12
12
|
import { Tooltip } from "../common/Tooltip";
|
|
13
|
+
import { Checkbox } from "../common/Checkbox";
|
|
13
14
|
import { getDefaultName } from "./sdd_helpers";
|
|
14
15
|
import "./css/addApp.css";
|
|
15
16
|
const isValid = ({ visible, appUrl, appPath, appCitrix, webAppName, pathAppName, citrixAppName, }) => {
|
|
@@ -38,6 +39,8 @@ export const AddApp = ({ checkValidURL, addAppByPath, addAppByUrl, addAppCitrix
|
|
|
38
39
|
const [citrixAppName, setCitrixAppName] = useState("");
|
|
39
40
|
const [apiAccess, setApiAccess] = useState(true);
|
|
40
41
|
const [urlUserInput, setUrlUserInput] = useState(false);
|
|
42
|
+
const [autoGenerateWeb, setAutoGenerateWeb] = useState(true);
|
|
43
|
+
const [appId, setAppId] = useState("");
|
|
41
44
|
const isAppUrlValid = checkValidURL(appUrl);
|
|
42
45
|
const clearAll = () => {
|
|
43
46
|
setAppUrl("");
|
|
@@ -47,6 +50,8 @@ export const AddApp = ({ checkValidURL, addAppByPath, addAppByUrl, addAppCitrix
|
|
|
47
50
|
setPathAppName("");
|
|
48
51
|
setCitrixAppName("");
|
|
49
52
|
setApiAccess(true);
|
|
53
|
+
setAutoGenerateWeb(true);
|
|
54
|
+
setAppId("");
|
|
50
55
|
};
|
|
51
56
|
const closeBox = () => {
|
|
52
57
|
clearAll();
|
|
@@ -91,20 +96,20 @@ export const AddApp = ({ checkValidURL, addAppByPath, addAppByUrl, addAppCitrix
|
|
|
91
96
|
},
|
|
92
97
|
]
|
|
93
98
|
: []);
|
|
94
|
-
return (React.createElement("div", { className: `quick-add-app${show ? "" : " collapsed"}`,
|
|
99
|
+
return (React.createElement("div", { className: `quick-add-app${show ? "" : " collapsed"}`, "aria-hidden": !show },
|
|
95
100
|
React.createElement(ButtonIcon, { icon: "times", onClick: closeBox, text: "Close", className: "quick-add-close" }),
|
|
96
101
|
React.createElement(FinsembleToggleButtonBar, { selected: visible, onChange: setVisible, options: toggleButtonOptions }),
|
|
97
|
-
React.createElement("table", { role: "presentation",
|
|
102
|
+
React.createElement("table", { role: "presentation", "data-section": visible },
|
|
98
103
|
visible === "web" && (React.createElement("tbody", null,
|
|
99
104
|
React.createElement("tr", { className: "quick-add-url" },
|
|
100
|
-
React.createElement("td",
|
|
105
|
+
React.createElement("td", null,
|
|
101
106
|
React.createElement("label", { htmlFor: `app-url-${idKey}` }, "App URL")),
|
|
102
107
|
React.createElement("td", null,
|
|
103
108
|
React.createElement("input", { type: "text", placeholder: "https://...", id: `app-url-${idKey}`, value: appUrl, "aria-invalid": !isAppUrlValid, "aria-errormessage": `app-url-error-message-${idKey}`, onChange: (e) => {
|
|
104
109
|
changeUrlContent(e.target.value);
|
|
105
110
|
}, onKeyUp: (e) => {
|
|
106
111
|
changeUrlContent(e.currentTarget.value);
|
|
107
|
-
}
|
|
112
|
+
} }),
|
|
108
113
|
!isAppUrlValid && (React.createElement("div", { id: `app-url-error-message-${idKey}`, className: "invalid-message" }, "URL must be valid (e.g., https://cosaic.io/). Only http and https prototcols are supported.")))),
|
|
109
114
|
React.createElement("tr", null,
|
|
110
115
|
React.createElement("td", null,
|
|
@@ -113,7 +118,7 @@ export const AddApp = ({ checkValidURL, addAppByPath, addAppByUrl, addAppCitrix
|
|
|
113
118
|
React.createElement("input", { type: "text", id: `url-app-name-${idKey}`, value: webAppName, onChange: (e) => {
|
|
114
119
|
setWebAppName(e.target.value);
|
|
115
120
|
setUrlUserInput(true);
|
|
116
|
-
}
|
|
121
|
+
} }))))),
|
|
117
122
|
visible === "native" && (React.createElement("tbody", null,
|
|
118
123
|
React.createElement("tr", { className: "quick-add-url" },
|
|
119
124
|
React.createElement("td", { colSpan: 2 },
|
|
@@ -126,19 +131,10 @@ export const AddApp = ({ checkValidURL, addAppByPath, addAppByUrl, addAppCitrix
|
|
|
126
131
|
React.createElement("td", null,
|
|
127
132
|
React.createElement("input", { type: "text", id: `path-app-name-${idKey}`, value: pathAppName, onChange: (e) => {
|
|
128
133
|
setPathAppName(e.target.value);
|
|
129
|
-
}
|
|
130
|
-
React.createElement("tr", null,
|
|
131
|
-
React.createElement("td", null,
|
|
132
|
-
React.createElement("label", { htmlFor: `api-access-${idKey}` }, "API access")),
|
|
133
|
-
React.createElement("td", null,
|
|
134
|
-
React.createElement("input", { type: "checkbox", id: `api-access-${idKey}`, checked: apiAccess, onChange: (e) => {
|
|
135
|
-
setApiAccess(e.target.checked);
|
|
136
|
-
} })),
|
|
137
|
-
React.createElement("td", null,
|
|
138
|
-
React.createElement(Tooltip, { position: "left" }, "Specify if your app needs to access Finsemble API. Your app must be built with the Finsemble native integration library (see Finsemble documentation for details)."))))),
|
|
134
|
+
} }))))),
|
|
139
135
|
visible === "citrix" && (React.createElement("tbody", null,
|
|
140
136
|
React.createElement("tr", { className: "quick-add-citrix" },
|
|
141
|
-
React.createElement("td",
|
|
137
|
+
React.createElement("td", null,
|
|
142
138
|
React.createElement("label", { htmlFor: `app-citrix-${idKey}` }, "Virtual app name")),
|
|
143
139
|
React.createElement("td", null,
|
|
144
140
|
React.createElement("input", { type: "text", placeholder: "", id: `app-citrix-${idKey}`, value: appCitrix, onChange: (e) => {
|
|
@@ -146,24 +142,36 @@ export const AddApp = ({ checkValidURL, addAppByPath, addAppByUrl, addAppCitrix
|
|
|
146
142
|
setCitrixAppName(e.target.value);
|
|
147
143
|
}
|
|
148
144
|
setAppCitrix(e.target.value);
|
|
149
|
-
}
|
|
145
|
+
} }))),
|
|
150
146
|
React.createElement("tr", null,
|
|
151
147
|
React.createElement("td", null,
|
|
152
148
|
React.createElement("label", { htmlFor: `citrix-display-name-${idKey}` }, "Display name")),
|
|
153
149
|
React.createElement("td", null,
|
|
154
150
|
React.createElement("input", { type: "text", id: `citrix-display-name-${idKey}`, value: citrixAppName, onChange: (e) => {
|
|
155
151
|
setCitrixAppName(e.target.value);
|
|
156
|
-
}
|
|
152
|
+
} })))))),
|
|
153
|
+
React.createElement("div", { className: "autogenerate" },
|
|
154
|
+
React.createElement(Checkbox, { label: "Autogenerate ID", checked: autoGenerateWeb, onClick: () => {
|
|
155
|
+
setAutoGenerateWeb(!autoGenerateWeb);
|
|
156
|
+
} }),
|
|
157
|
+
!autoGenerateWeb && (React.createElement("input", { type: "text", id: "appId_web", value: appId, onChange: (e) => {
|
|
158
|
+
setAppId(e.target.value);
|
|
159
|
+
} }))),
|
|
160
|
+
visible === "native" && (React.createElement("div", { className: "apiAccessRow" },
|
|
161
|
+
React.createElement(Checkbox, { id: `api-access-${idKey}`, label: "API access", checked: apiAccess, onClick: (e) => {
|
|
162
|
+
setApiAccess(e.target.checked);
|
|
163
|
+
} }),
|
|
164
|
+
React.createElement(Tooltip, null, "Specify if your app needs to access Finsemble API. Your app must be built with the Finsemble native integration library (see Finsemble documentation for details)."))),
|
|
157
165
|
React.createElement("div", { className: "save-button-container" },
|
|
158
166
|
React.createElement(Button, { fashion: "secondary", className: "quick-add-save", onClick: () => {
|
|
159
167
|
if (visible === "web") {
|
|
160
|
-
addAppByUrl(appUrl, webAppName);
|
|
168
|
+
addAppByUrl(appUrl, webAppName, appId);
|
|
161
169
|
}
|
|
162
170
|
else if (visible === "native") {
|
|
163
|
-
addAppByPath(appPath, pathAppName, apiAccess);
|
|
171
|
+
addAppByPath(appPath, pathAppName, apiAccess, appId);
|
|
164
172
|
}
|
|
165
173
|
else if (visible === "citrix") {
|
|
166
|
-
addAppCitrix(appCitrix, citrixAppName);
|
|
174
|
+
addAppCitrix(appCitrix, citrixAppName, appId);
|
|
167
175
|
}
|
|
168
176
|
}, text: "Save", disabled: !isEnabledFlag }))));
|
|
169
177
|
};
|