@interopio/iocd-cli 0.0.52 → 0.0.54
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/dist/cli.js +20 -15
- package/dist/cli.js.map +1 -1
- package/dist/schemas/iocd.cli.config.schema.json +6 -6
- package/dist/services/app.service.js +1 -1
- package/dist/services/app.service.js.map +1 -1
- package/dist/services/components/component.config.js +1 -1
- package/dist/services/components/component.config.js.map +1 -1
- package/dist/services/components/components.registry.js +17 -17
- package/dist/services/components/components.registry.js.map +1 -1
- package/dist/services/components/components.service.js +16 -15
- package/dist/services/components/components.service.js.map +1 -1
- package/dist/services/components/file.helper.js +7 -7
- package/dist/services/components/file.helper.js.map +1 -1
- package/dist/services/components/platform.utils.js +39 -34
- package/dist/services/components/platform.utils.js.map +1 -1
- package/dist/services/components/stores/github.store.js +52 -34
- package/dist/services/components/stores/github.store.js.map +1 -1
- package/dist/services/components/stores/local.store.js +19 -18
- package/dist/services/components/stores/local.store.js.map +1 -1
- package/dist/services/components/stores/s3.store.js +63 -56
- package/dist/services/components/stores/s3.store.js.map +1 -1
- package/dist/services/components/version.selector.js +3 -3
- package/dist/services/components/version.selector.js.map +1 -1
- package/dist/services/config/config.service.js +84 -45
- package/dist/services/config/config.service.js.map +1 -1
- package/dist/services/installer/electronForge.js +44 -44
- package/dist/services/installer/electronForge.js.map +1 -1
- package/dist/services/installer/installer.service.js +24 -24
- package/dist/services/installer/installer.service.js.map +1 -1
- package/dist/services/installer/macOS.helper.js +135 -77
- package/dist/services/installer/macOS.helper.js.map +1 -1
- package/dist/services/installer/prerequisites.js +10 -10
- package/dist/services/installer/windows.helper.js +53 -53
- package/dist/services/modifications/macOS.helper.js +28 -24
- package/dist/services/modifications/macOS.helper.js.map +1 -1
- package/dist/services/modifications/modifications.service.js +57 -57
- package/dist/services/modifications/windows.helper.js +54 -14
- package/dist/services/modifications/windows.helper.js.map +1 -1
- package/dist/templates/groups/apps/groups/src/App.tsx +3 -3
- package/dist/templates/groups/apps/groups/src/index.tsx +15 -13
- package/dist/templates/groups/apps/groups/vite.config.ts +4 -4
- package/dist/templates/launchpad/apps/launchpad/src/app/app.tsx +34 -29
- package/dist/templates/launchpad/apps/launchpad/src/app/constants.ts +20 -20
- package/dist/templates/launchpad/apps/launchpad/src/components/logo.tsx +5 -5
- package/dist/templates/launchpad/apps/launchpad/src/components/main-context-menu.tsx +195 -145
- package/dist/templates/launchpad/apps/launchpad/src/components/notifications-button.tsx +41 -34
- package/dist/templates/launchpad/apps/launchpad/src/main.tsx +3 -1
- package/dist/templates/launchpad/apps/launchpad/vite.config.ts +6 -7
- package/dist/templates/tests/tests/tests/sample.spec.ts +16 -16
- package/dist/templates/tests/tests/wdio.config.ts +9 -9
- package/dist/templates/workspaces/apps/workspaces/src/AddWindowButton.tsx +40 -33
- package/dist/templates/workspaces/apps/workspaces/src/AfterTabs.tsx +40 -27
- package/dist/templates/workspaces/apps/workspaces/src/App.tsx +93 -88
- package/dist/templates/workspaces/apps/workspaces/src/GroupHeaderButtons.tsx +11 -9
- package/dist/templates/workspaces/apps/workspaces/src/index.tsx +19 -14
- package/dist/templates/workspaces/apps/workspaces/src/reportWebVitals.ts +4 -4
- package/dist/templates/workspaces/apps/workspaces/src/setupTests.ts +1 -1
- package/dist/templates/workspaces/apps/workspaces/src/useAddWindowButtonVisible.tsx +36 -30
- package/dist/templates/workspaces/apps/workspaces/vite.config.ts +4 -4
- package/dist/utils/proxy.js +68 -0
- package/dist/utils/proxy.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,162 +1,212 @@
|
|
|
1
1
|
import { useCallback, useContext, useMemo } from "react";
|
|
2
2
|
import { IOConnectDesktop } from "@interopio/desktop";
|
|
3
3
|
import { IOConnectContext } from "@interopio/react-hooks";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Dropdown,
|
|
6
|
+
Icon,
|
|
7
|
+
IconProps,
|
|
8
|
+
Separator,
|
|
9
|
+
} from "@interopio/components-react";
|
|
5
10
|
|
|
6
11
|
const PLATFORM_UTILITY_PAGES = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
ABOUT: "about",
|
|
13
|
+
HOTKEYS: "hotkeys",
|
|
14
|
+
FEEDBACK: "feedback",
|
|
10
15
|
} as const;
|
|
11
16
|
|
|
12
17
|
const PLATFORM_APPS = {
|
|
13
|
-
|
|
18
|
+
DOWNLOAD_MANAGER: "io-connect-download-manager",
|
|
14
19
|
} as const;
|
|
15
20
|
|
|
16
21
|
type PageKey = keyof typeof PLATFORM_UTILITY_PAGES;
|
|
17
|
-
type PageName = typeof PLATFORM_UTILITY_PAGES[PageKey];
|
|
22
|
+
type PageName = (typeof PLATFORM_UTILITY_PAGES)[PageKey];
|
|
18
23
|
type AppKey = keyof typeof PLATFORM_APPS;
|
|
19
|
-
type AppName = typeof PLATFORM_APPS[AppKey];
|
|
24
|
+
type AppName = (typeof PLATFORM_APPS)[AppKey];
|
|
20
25
|
|
|
21
26
|
function MainContextMenu() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}, [io]);
|
|
56
|
-
|
|
57
|
-
const openDownloads = useCallback(() => {
|
|
58
|
-
startApp(PLATFORM_APPS.DOWNLOAD_MANAGER);
|
|
59
|
-
}, [startApp]);
|
|
60
|
-
|
|
61
|
-
const openFeedback = useCallback(() => {
|
|
62
|
-
startPage(PLATFORM_UTILITY_PAGES.FEEDBACK);
|
|
63
|
-
}, [startPage]);
|
|
64
|
-
|
|
65
|
-
const openHotkeys = useCallback(() => {
|
|
66
|
-
startPage(PLATFORM_UTILITY_PAGES.HOTKEYS);
|
|
67
|
-
}, [startPage]);
|
|
68
|
-
|
|
69
|
-
const handleMinimize = useCallback(async () => {
|
|
70
|
-
if (!io) {
|
|
71
|
-
console.warn("IOConnectContext not available");
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const myWindow = io.windows.my();
|
|
76
|
-
|
|
77
|
-
if (!myWindow) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
try {
|
|
82
|
-
await myWindow.minimize();
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.error("Failed to minimize window", error);
|
|
85
|
-
}
|
|
86
|
-
}, [io]);
|
|
87
|
-
|
|
88
|
-
const handleRestart = useCallback(async () => {
|
|
89
|
-
if (!io) {
|
|
90
|
-
console.warn("IOConnectContext not available");
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
await io.appManager.restart({
|
|
96
|
-
autoSave: true,
|
|
97
|
-
showDialog: true,
|
|
98
|
-
});
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.error("Failed to restart io.Connect Desktop", error);
|
|
101
|
-
}
|
|
102
|
-
}, [io]);
|
|
103
|
-
|
|
104
|
-
const handleShutdown = useCallback(async () => {
|
|
105
|
-
if (!io) {
|
|
106
|
-
console.warn("IOConnectContext not available");
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
await io.appManager.exit({
|
|
112
|
-
autoSave: true,
|
|
113
|
-
showDialog: true,
|
|
114
|
-
});
|
|
115
|
-
} catch (error) {
|
|
116
|
-
console.error("Failed to shutdown io.Connect Desktop", error);
|
|
27
|
+
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
28
|
+
|
|
29
|
+
const startPage = useCallback(
|
|
30
|
+
async (pageName: PageName) => {
|
|
31
|
+
if (!io) {
|
|
32
|
+
console.warn("IOConnectContext not available");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
await io.interop.invoke("T42.GD.Execute", {
|
|
38
|
+
command: "open-utility-page",
|
|
39
|
+
args: { name: pageName },
|
|
40
|
+
});
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.warn("Failed to open utility page", pageName, error);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
[io]
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const startApp = useCallback(
|
|
49
|
+
async (appName: AppName) => {
|
|
50
|
+
if (!io) {
|
|
51
|
+
console.warn("IOConnectContext not available");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const app = io.appManager.application(appName);
|
|
57
|
+
if (!app) {
|
|
58
|
+
throw new Error(`Cannot find app with name "${appName}"`);
|
|
117
59
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
60
|
+
await app.start();
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.warn("Failed to start app", appName, error);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
[io]
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const openDownloads = useCallback(() => {
|
|
69
|
+
startApp(PLATFORM_APPS.DOWNLOAD_MANAGER);
|
|
70
|
+
}, [startApp]);
|
|
71
|
+
|
|
72
|
+
const openFeedback = useCallback(() => {
|
|
73
|
+
startPage(PLATFORM_UTILITY_PAGES.FEEDBACK);
|
|
74
|
+
}, [startPage]);
|
|
75
|
+
|
|
76
|
+
const openHotkeys = useCallback(() => {
|
|
77
|
+
startPage(PLATFORM_UTILITY_PAGES.HOTKEYS);
|
|
78
|
+
}, [startPage]);
|
|
79
|
+
|
|
80
|
+
const handleMinimize = useCallback(async () => {
|
|
81
|
+
if (!io) {
|
|
82
|
+
console.warn("IOConnectContext not available");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const myWindow = io.windows.my();
|
|
87
|
+
|
|
88
|
+
if (!myWindow) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
await myWindow.minimize();
|
|
94
|
+
} catch (error) {
|
|
95
|
+
console.error("Failed to minimize window", error);
|
|
96
|
+
}
|
|
97
|
+
}, [io]);
|
|
98
|
+
|
|
99
|
+
const handleRestart = useCallback(async () => {
|
|
100
|
+
if (!io) {
|
|
101
|
+
console.warn("IOConnectContext not available");
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
await io.appManager.restart({
|
|
107
|
+
autoSave: true,
|
|
108
|
+
showDialog: true,
|
|
109
|
+
});
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error("Failed to restart io.Connect Desktop", error);
|
|
112
|
+
}
|
|
113
|
+
}, [io]);
|
|
114
|
+
|
|
115
|
+
const handleShutdown = useCallback(async () => {
|
|
116
|
+
if (!io) {
|
|
117
|
+
console.warn("IOConnectContext not available");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
await io.appManager.exit({
|
|
123
|
+
autoSave: true,
|
|
124
|
+
showDialog: true,
|
|
125
|
+
});
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.error("Failed to shutdown io.Connect Desktop", error);
|
|
128
|
+
}
|
|
129
|
+
}, [io]);
|
|
130
|
+
|
|
131
|
+
const menuItems = useMemo(
|
|
132
|
+
() => [
|
|
133
|
+
{
|
|
134
|
+
label: "Pin Launchpad",
|
|
135
|
+
icon: "pin",
|
|
136
|
+
onClick: () => null,
|
|
137
|
+
disabled: true,
|
|
138
|
+
},
|
|
139
|
+
{ label: "Dock Launchpad", onClick: () => null, disabled: true },
|
|
140
|
+
{ separator: true },
|
|
141
|
+
{
|
|
142
|
+
label: "Platform Preferences",
|
|
143
|
+
icon: "cog",
|
|
144
|
+
onClick: () => null,
|
|
145
|
+
disabled: true,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: "Notification Settings",
|
|
149
|
+
icon: "bell",
|
|
150
|
+
onClick: () => null,
|
|
151
|
+
disabled: true,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: "Intent Resolver Settings",
|
|
155
|
+
icon: "list-ul",
|
|
156
|
+
onClick: () => null,
|
|
157
|
+
disabled: true,
|
|
158
|
+
},
|
|
159
|
+
{ separator: true },
|
|
160
|
+
{ label: "Profile", icon: "user", onClick: () => null, disabled: true },
|
|
161
|
+
{ separator: true },
|
|
162
|
+
{ label: "Downloads", onClick: openDownloads },
|
|
163
|
+
{ separator: true },
|
|
164
|
+
{ label: "Feedback", icon: "feedback", onClick: openFeedback },
|
|
165
|
+
{ label: "Keyboard Shortcuts", icon: "keyboard", onClick: openHotkeys },
|
|
166
|
+
{ separator: true },
|
|
167
|
+
{ label: "Minimize", icon: "minimize-down", onClick: handleMinimize },
|
|
168
|
+
{ label: "Restart", icon: "rotate-right", onClick: handleRestart },
|
|
169
|
+
{ label: "Shut Down", icon: "power-off", onClick: handleShutdown },
|
|
170
|
+
],
|
|
171
|
+
[
|
|
172
|
+
openDownloads,
|
|
173
|
+
openFeedback,
|
|
174
|
+
openHotkeys,
|
|
175
|
+
handleMinimize,
|
|
176
|
+
handleRestart,
|
|
177
|
+
handleShutdown,
|
|
178
|
+
]
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<div className="launchpad-header-actions">
|
|
183
|
+
<Dropdown>
|
|
184
|
+
<Dropdown.ButtonIcon
|
|
185
|
+
variant="circle"
|
|
186
|
+
icon="ellipsis-vertical"
|
|
187
|
+
title="More"
|
|
188
|
+
/>
|
|
189
|
+
<Dropdown.Content>
|
|
190
|
+
<Dropdown.List>
|
|
191
|
+
{menuItems.map((item, idx) =>
|
|
192
|
+
item.separator ? (
|
|
193
|
+
<Separator key={`sep-${idx}`} />
|
|
194
|
+
) : (
|
|
195
|
+
<Dropdown.Item
|
|
196
|
+
key={item.label}
|
|
197
|
+
prepend={<Icon variant={item.icon as IconProps["variant"]} />}
|
|
198
|
+
onClick={item.onClick}
|
|
199
|
+
disabled={item.disabled}
|
|
200
|
+
>
|
|
201
|
+
{item.label}
|
|
202
|
+
</Dropdown.Item>
|
|
203
|
+
)
|
|
204
|
+
)}
|
|
205
|
+
</Dropdown.List>
|
|
206
|
+
</Dropdown.Content>
|
|
207
|
+
</Dropdown>
|
|
208
|
+
</div>
|
|
209
|
+
);
|
|
160
210
|
}
|
|
161
211
|
|
|
162
|
-
export default MainContextMenu;
|
|
212
|
+
export default MainContextMenu;
|
|
@@ -4,41 +4,48 @@ import { IOConnectContext } from "@interopio/react-hooks";
|
|
|
4
4
|
import { Badge, ButtonIcon } from "@interopio/components-react";
|
|
5
5
|
|
|
6
6
|
function NotificationsButton() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return () => {
|
|
28
|
-
unCounterChanged();
|
|
29
|
-
};
|
|
30
|
-
}, [io]);
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div className="launchpad-header-notifications-button">
|
|
34
|
-
{notificationsCount > 0 && (
|
|
35
|
-
<Badge variant="primary">
|
|
36
|
-
{notificationsCount > 99 ? "99+" : notificationsCount}
|
|
37
|
-
</Badge>
|
|
38
|
-
)}
|
|
39
|
-
<ButtonIcon variant="circle" icon="bell" size='32' onClick={openNotificationPanel} />
|
|
40
|
-
</div>
|
|
7
|
+
const io = useContext(IOConnectContext) as IOConnectDesktop.API;
|
|
8
|
+
const [notificationsCount, setNotificationsCount] = useState(0);
|
|
9
|
+
|
|
10
|
+
const openNotificationPanel = useCallback(async () => {
|
|
11
|
+
const isPanelVisible = await io.notifications.panel.isVisible();
|
|
12
|
+
|
|
13
|
+
if (isPanelVisible) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
await io.notifications.panel.show();
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error("Failed to open notifications panel.", error);
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const unCounterChanged = io.notifications.onCounterChanged(info =>
|
|
26
|
+
setNotificationsCount(info.count)
|
|
41
27
|
);
|
|
28
|
+
|
|
29
|
+
return () => {
|
|
30
|
+
unCounterChanged();
|
|
31
|
+
};
|
|
32
|
+
}, [io]);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="launchpad-header-notifications-button">
|
|
36
|
+
{notificationsCount > 0 && (
|
|
37
|
+
<Badge variant="primary">
|
|
38
|
+
{notificationsCount > 99 ? "99+" : notificationsCount}
|
|
39
|
+
</Badge>
|
|
40
|
+
)}
|
|
41
|
+
<ButtonIcon
|
|
42
|
+
variant="circle"
|
|
43
|
+
icon="bell"
|
|
44
|
+
size="32"
|
|
45
|
+
onClick={openNotificationPanel}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
export default NotificationsButton;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as ReactDOM from "react-dom/client";
|
|
2
2
|
import App from "./app/app";
|
|
3
3
|
|
|
4
|
-
const root = ReactDOM.createRoot(
|
|
4
|
+
const root = ReactDOM.createRoot(
|
|
5
|
+
document.getElementById("root") as HTMLElement
|
|
6
|
+
);
|
|
5
7
|
|
|
6
8
|
root.render(<App />);
|
|
@@ -3,11 +3,10 @@ import react from "@vitejs/plugin-react";
|
|
|
3
3
|
import EnvironmentPlugin from "vite-plugin-environment";
|
|
4
4
|
|
|
5
5
|
export default defineConfig({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
server: {
|
|
7
|
+
port: 5178,
|
|
8
|
+
host: "localhost",
|
|
9
|
+
},
|
|
10
|
+
base: "./",
|
|
11
|
+
plugins: [react(), EnvironmentPlugin("all")],
|
|
12
12
|
});
|
|
13
|
-
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
describe(
|
|
2
|
-
it(
|
|
1
|
+
describe("Example usage of @interopio/wdio-iocd-service", () => {
|
|
2
|
+
it("should have access to browser.io()", async () => {
|
|
3
3
|
// A fully working io.Connect Desktop client
|
|
4
4
|
const io = await browser.io();
|
|
5
5
|
|
|
6
|
-
expect(io).toHaveAttribute(
|
|
7
|
-
expect(io).toHaveAttribute(
|
|
8
|
-
expect(io).toHaveAttribute(
|
|
6
|
+
expect(io).toHaveAttribute("appManager");
|
|
7
|
+
expect(io).toHaveAttribute("contexts");
|
|
8
|
+
expect(io).toHaveAttribute("channels");
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
it(
|
|
11
|
+
it("should raise a test notifications, and then navigate to notifications panel", async () => {
|
|
12
12
|
const io = await browser.io();
|
|
13
13
|
await io.notifications.configure({ enable: true });
|
|
14
14
|
await io.notifications.raise({
|
|
15
|
-
title:
|
|
16
|
-
body:
|
|
15
|
+
title: "Test Notification title",
|
|
16
|
+
body: "Test Notification body",
|
|
17
17
|
toastExpiry: 999999,
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
await browser.switchToLaunchpad();
|
|
21
|
-
await browser.$(
|
|
21
|
+
await browser.$(".notifications-button button").waitAndClick();
|
|
22
22
|
await browser.switchToNotificationPanel();
|
|
23
23
|
await browser.pause(2000);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
it(
|
|
26
|
+
it("should allow using the desktop-client prefs API", async () => {
|
|
27
27
|
const io = await browser.io();
|
|
28
28
|
|
|
29
|
-
const sampleApp =
|
|
29
|
+
const sampleApp = "ExampleApplication";
|
|
30
30
|
const mockedAppPrefs = { lazyLoadAssets: true };
|
|
31
31
|
|
|
32
32
|
// used to store the "update" for app prefs
|
|
@@ -41,12 +41,12 @@ describe('Example usage of @interopio/wdio-iocd-service', () => {
|
|
|
41
41
|
expect(expectedSetPrefs).toMatchObject(mockedAppPrefs);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
it(
|
|
44
|
+
it("should allow opening apps from the appManager API", async () => {
|
|
45
45
|
const io = await browser.io();
|
|
46
46
|
|
|
47
47
|
// Start the client list app
|
|
48
48
|
const instanceClientList = await io.appManager
|
|
49
|
-
.application(
|
|
49
|
+
.application("channelsclientlist")
|
|
50
50
|
.start();
|
|
51
51
|
|
|
52
52
|
// Switch to the client list window
|
|
@@ -54,12 +54,12 @@ describe('Example usage of @interopio/wdio-iocd-service', () => {
|
|
|
54
54
|
await browser.switchById(clientListWindow.id);
|
|
55
55
|
|
|
56
56
|
// Check that the app-client-list element exists in DOM
|
|
57
|
-
const appClientListElement = await $(
|
|
57
|
+
const appClientListElement = await $("app-client-list");
|
|
58
58
|
await expect(appClientListElement).toBeExisting();
|
|
59
59
|
|
|
60
60
|
// Start the client portfolio app
|
|
61
61
|
const instancePortfolio = await io.appManager
|
|
62
|
-
.application(
|
|
62
|
+
.application("channelsclientportfolio")
|
|
63
63
|
.start();
|
|
64
64
|
|
|
65
65
|
// Switch to the client portfolio window
|
|
@@ -67,7 +67,7 @@ describe('Example usage of @interopio/wdio-iocd-service', () => {
|
|
|
67
67
|
await browser.switchById(clientPortfolioList.id);
|
|
68
68
|
|
|
69
69
|
// Check that the app-client-portfolio element exists in DOM
|
|
70
|
-
const clientPortfolioElement = await $(
|
|
70
|
+
const clientPortfolioElement = await $("app-client-portfolio");
|
|
71
71
|
await expect(clientPortfolioElement).toBeExisting();
|
|
72
72
|
});
|
|
73
73
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IOCDBaseConfiguration,
|
|
3
3
|
IOCDService,
|
|
4
|
-
} from
|
|
4
|
+
} from "@interopio/wdio-iocd-service";
|
|
5
5
|
|
|
6
6
|
export const config: WebdriverIO.Config = {
|
|
7
7
|
...IOCDBaseConfiguration,
|
|
@@ -12,25 +12,25 @@ export const config: WebdriverIO.Config = {
|
|
|
12
12
|
// Capabilities
|
|
13
13
|
capabilities: [
|
|
14
14
|
{
|
|
15
|
-
browserName:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
binary:
|
|
15
|
+
browserName: "iocd",
|
|
16
|
+
"wdio:specs": ["./tests/**/*.spec.ts"],
|
|
17
|
+
"iocd:options": {
|
|
18
|
+
binary: "%BINARY_PATH%",
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
|
|
23
23
|
// WDIO Options
|
|
24
|
-
logLevel:
|
|
25
|
-
framework:
|
|
26
|
-
reporters: [
|
|
24
|
+
logLevel: "warn",
|
|
25
|
+
framework: "mocha",
|
|
26
|
+
reporters: ["spec"],
|
|
27
27
|
|
|
28
28
|
// TypeScript Autocompile
|
|
29
29
|
autoCompileOpts: {
|
|
30
30
|
autoCompile: true,
|
|
31
31
|
tsNodeOpts: {
|
|
32
32
|
transpileOnly: true,
|
|
33
|
-
project:
|
|
33
|
+
project: "./tsconfig.json",
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
};
|
|
@@ -1,33 +1,40 @@
|
|
|
1
|
-
import { AddWindowButtonProps } from "@interopio/workspaces-ui-react";
|
|
2
|
-
import React, { useEffect, useRef } from "react";
|
|
3
|
-
|
|
4
|
-
// TODO forward the ref in the new version of workspaces-ui-react
|
|
5
|
-
const AddWindowButton: React.FC<AddWindowButtonProps> = ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { AddWindowButtonProps } from "@interopio/workspaces-ui-react";
|
|
2
|
+
import React, { useEffect, useRef } from "react";
|
|
3
|
+
|
|
4
|
+
// TODO forward the ref in the new version of workspaces-ui-react
|
|
5
|
+
const AddWindowButton: React.FC<AddWindowButtonProps> = ({
|
|
6
|
+
children,
|
|
7
|
+
visible,
|
|
8
|
+
showPopup,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
const ref = useRef<HTMLLIElement>(null);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!ref.current) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const onClick = (e: MouseEvent) => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
|
|
21
|
+
const rawBounds = ref.current!.getBoundingClientRect();
|
|
22
|
+
|
|
23
|
+
showPopup({
|
|
24
|
+
left: rawBounds.left,
|
|
25
|
+
top: rawBounds.bottom,
|
|
26
|
+
width: rawBounds.width,
|
|
27
|
+
height: rawBounds.height,
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
ref.current.addEventListener("click", onClick);
|
|
32
|
+
}, [ref, showPopup]);
|
|
33
|
+
return (
|
|
34
|
+
<li className={"lm_add_button"} ref={ref} {...props}>
|
|
35
|
+
{children}
|
|
36
|
+
</li>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default AddWindowButton;
|