architwin 1.14.9 → 1.14.10
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/lib/atwinui/components/toolbar/i18n.js +1 -1
- package/lib/atwinui/components/toolbar/tagIotFormPane.d.ts +1 -0
- package/lib/atwinui/components/toolbar/tagIotFormPane.js +163 -96
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.d.ts +1 -0
- package/lib/atwinui/components/toolbar/viewingRemoteSpace.js +6 -0
- package/lib/atwinui/events.js +2 -1
- package/lib/types.d.ts +1 -0
- package/lib/types.js +1 -0
- package/package.json +1 -1
- package/static/atwinui.css +2 -1
|
@@ -219,7 +219,7 @@ i18n
|
|
|
219
219
|
"ViewingInstructions": "During a remote space sharing session, you cannot navigate around the space, only your host has control during the session",
|
|
220
220
|
"Pending": "Pending",
|
|
221
221
|
"NowSharing": "Now Sharing",
|
|
222
|
-
"ConfirmLeaveSession": "
|
|
222
|
+
"ConfirmLeaveSession": "Do you want to leave sharing session?",
|
|
223
223
|
"ConfirmLeaveSessionReminder": "",
|
|
224
224
|
"InSession": "In Session",
|
|
225
225
|
"Leave": "Leave",
|
|
@@ -4,6 +4,7 @@ export declare let selectedIoTSystem: string;
|
|
|
4
4
|
export declare let selectedIotTag: any;
|
|
5
5
|
export declare function renderTagIOTFormPane(): HTMLDivElement;
|
|
6
6
|
export declare function setIotCategoryOptions(): void;
|
|
7
|
+
export declare function getIotCategoryOption(): ITagIOTCategory;
|
|
7
8
|
export declare function toggleIoTCategoryOptions(): void;
|
|
8
9
|
export declare function toggleIoTDevicesOptions(): void;
|
|
9
10
|
/**
|
|
@@ -11,17 +11,20 @@ import { IOT_LINKED_SYSTEMS, SPACE_EVENTS, TAG_TYPE } from '../../../types';
|
|
|
11
11
|
import log from 'loglevel';
|
|
12
12
|
import i18n from './i18n';
|
|
13
13
|
import { dispatchSpaceEvent, _tagIotCategoryTypes, _tagIotDevices, _tags } from '../../../architwin';
|
|
14
|
-
import { stringContains } from "../../../utils";
|
|
14
|
+
import { stringContains, generateUUID } from "../../../utils";
|
|
15
15
|
import { batchAddEventListenerByClassName } from '../../events';
|
|
16
|
+
import { toggleModal, setModalAction } from "./modal";
|
|
17
|
+
import { Notyf } from 'notyf';
|
|
16
18
|
let selectedIoTCatOption;
|
|
17
19
|
let selectedIoTDeviceOption;
|
|
18
20
|
export let iotTagFormMode = "ADD" /* FORM_MODE.ADD */;
|
|
19
21
|
export let selectedIoTSystem = '';
|
|
20
22
|
export let selectedIotTag = undefined;
|
|
21
23
|
let tagIotName, iotModelName, iotSerialNumber, iotMfrName, iotSystemLink;
|
|
22
|
-
let
|
|
24
|
+
let selectedIoTCat;
|
|
23
25
|
let linkedDevicesArray = [];
|
|
24
26
|
let iotCategoryIconList = ['mdi-power', 'mdi-thermometer', 'mdi-water-percent', 'mdi-gauge', 'mdi-leak', 'mdi-water', 'mdi-lightbulb-on', 'mdi-gas-cylinder', 'mdi-flask', 'mdi-meter-electric', 'mdi-information-symbol', 'mdi-sine-wave'];
|
|
27
|
+
let notify = new Notyf({ position: { x: 'left', y: 'bottom' } });
|
|
25
28
|
export function renderTagIOTFormPane() {
|
|
26
29
|
const element = document.createElement('div');
|
|
27
30
|
element.classList.add('at_container');
|
|
@@ -34,7 +37,7 @@ export function renderTagIOTFormPane() {
|
|
|
34
37
|
</div>
|
|
35
38
|
|
|
36
39
|
<div class="at_form_container at_scrollable_container at_h-min-70">
|
|
37
|
-
<label for="">${i18n.t('
|
|
40
|
+
<label for="">${i18n.t('LinkedSystems')}</label>
|
|
38
41
|
<div class="at_gap_2" style="display: inline-flex">
|
|
39
42
|
<label class="at_flex at_align_center at_text_xs at_gap_1">
|
|
40
43
|
<input type="radio" id="at-linked-radio-bemac" name="iot-link-system" checked value=${IOT_LINKED_SYSTEMS.BEMAC} selected />
|
|
@@ -46,7 +49,7 @@ export function renderTagIOTFormPane() {
|
|
|
46
49
|
</label>
|
|
47
50
|
<label class="at_flex at_align_center at_text_xs at_gap_1">
|
|
48
51
|
<input type="radio" id="at-linked-radio-link" name="iot-link-system" value=${IOT_LINKED_SYSTEMS.URL_LINK} />
|
|
49
|
-
${i18n.t("
|
|
52
|
+
${i18n.t("URLLink")}
|
|
50
53
|
</label>
|
|
51
54
|
</div>
|
|
52
55
|
|
|
@@ -73,22 +76,22 @@ export function renderTagIOTFormPane() {
|
|
|
73
76
|
</div>
|
|
74
77
|
|
|
75
78
|
<div class="at-field at_flex_row at_justify_between">
|
|
76
|
-
<label for="">${i18n.t('
|
|
79
|
+
<label for="">${i18n.t('ModelName')}</label>
|
|
77
80
|
<input class="at_field_input at_w-full" type="text" name="model_name" id="at-iot-model-input" data-cy="at-iot-model-input" />
|
|
78
81
|
</div>
|
|
79
82
|
|
|
80
83
|
<div class="at-field at_flex_row at_justify_between">
|
|
81
|
-
<label for="">${i18n.t('
|
|
84
|
+
<label for="">${i18n.t('SerialNumber')}</label>
|
|
82
85
|
<input class="at_field_input at_w-full" type="text" name="serial_name" id="at-iot-serial-input" data-cy="at-iot-serial-input" />
|
|
83
86
|
</div>
|
|
84
87
|
|
|
85
88
|
<div class="at-field at_flex_row at_justify_between">
|
|
86
|
-
<label for="">${i18n.t('
|
|
89
|
+
<label for="">${i18n.t('ManufacturerSite')}</label>
|
|
87
90
|
<input class="at_field_input at_w-full" type="text" name="manufacturer_site" id="at-iot-manufacturer-input" data-cy="at-iot-manufacturer-input" />
|
|
88
91
|
</div>
|
|
89
92
|
|
|
90
93
|
<div class="at-field at_flex_row at_justify_between" id="at-iot-system-link-container" style="display: none">
|
|
91
|
-
<label for="">${i18n.t('
|
|
94
|
+
<label for="">${i18n.t('SystemLink')}</label>
|
|
92
95
|
<input class="at_field_input at_w-full" type="text" name="system_link" id="at-iot-system-link-input" data-cy="at-iot-system-link-input" />
|
|
93
96
|
</div>
|
|
94
97
|
|
|
@@ -98,9 +101,9 @@ export function renderTagIOTFormPane() {
|
|
|
98
101
|
</div>
|
|
99
102
|
|
|
100
103
|
<div class="at_field at_flex_column" id="at-iot-device-main-container">
|
|
101
|
-
<label for="">${i18n.t('
|
|
102
|
-
<div id="at-iot-devices-dropdown" data-cy="at-iot-devices-dropdown">
|
|
103
|
-
<div id="at-
|
|
104
|
+
<label for="">${i18n.t('IoTDevices')}</label>
|
|
105
|
+
<div id="at-iot-devices-dropdown" data-cy="at-iot-devices-dropdown" class="at-device-dropdown">
|
|
106
|
+
<div id="at-iot-devices-filter-dropdown" class="at_dropdown at_flex at_flex_row at_space_between">
|
|
104
107
|
<div class="at_dropdown_toggle" id="at-iot-selected-device" data-cy="at-iot-selected-device">${i18n.t(selectedIoTDeviceOption)}</div>
|
|
105
108
|
<span class="mdi mdi-chevron-down at_chevron" id="at-iot-cat-filter-chevron" data-cy="at-iot-cat-filter-chevron"></span>
|
|
106
109
|
</div>
|
|
@@ -112,17 +115,19 @@ export function renderTagIOTFormPane() {
|
|
|
112
115
|
</div>
|
|
113
116
|
</div>
|
|
114
117
|
|
|
115
|
-
<div class="
|
|
118
|
+
<div class="at_iot_list_container at_h-min-40" id="at-iot-device-list-container" data-cy="at-iot-device-list-container">
|
|
116
119
|
|
|
117
|
-
<div class="
|
|
120
|
+
<div class="at_section at_iot_item_container at_scrollable_container" id="at-linked-device-container" data-cy="at-linked-device-container">
|
|
118
121
|
|
|
119
|
-
<div class="
|
|
122
|
+
<div class="at_title" style="padding-left: 20px !important;">
|
|
120
123
|
<div> </div>
|
|
121
|
-
<label for="">${i18n.t('
|
|
124
|
+
<label for="">${i18n.t('LinkedIoTDevices')}</label>
|
|
122
125
|
<div> </div>
|
|
123
126
|
</div>
|
|
124
127
|
|
|
125
|
-
<div
|
|
128
|
+
<div>
|
|
129
|
+
<div class="at_body at_linked_device_container" id="at-device-item-container">
|
|
130
|
+
</div>
|
|
126
131
|
</div>
|
|
127
132
|
|
|
128
133
|
</div>
|
|
@@ -155,19 +160,24 @@ function displayFormTitle() {
|
|
|
155
160
|
title.innerHTML = '';
|
|
156
161
|
const span = document.createElement('span');
|
|
157
162
|
span.textContent = iotTagFormMode === "ADD" /* FORM_MODE.ADD */
|
|
158
|
-
? i18n.t('
|
|
159
|
-
: i18n.t('
|
|
163
|
+
? i18n.t('AddIoTTag')
|
|
164
|
+
: i18n.t('EditIoTTag');
|
|
160
165
|
title.appendChild(span);
|
|
161
166
|
}
|
|
167
|
+
// displays selected Category in the dropdown
|
|
162
168
|
function setSelectedIoTCat(payload) {
|
|
163
169
|
log.info('setSelectedIoTCat()', payload);
|
|
164
170
|
const selectedOption = document.getElementById('at-iot-selected-cat');
|
|
165
|
-
selectedOption.innerText = payload;
|
|
171
|
+
selectedOption.innerText = i18n.t(payload.name);
|
|
166
172
|
}
|
|
173
|
+
// displays selected Device in the dropdown
|
|
167
174
|
function setSelectedIoTDevice(payload) {
|
|
168
175
|
log.info('setSelectedIoTDevice()', payload);
|
|
169
176
|
const selectedDevice = document.getElementById('at-iot-selected-device');
|
|
170
|
-
selectedDevice.innerText =
|
|
177
|
+
selectedDevice.innerText = '';
|
|
178
|
+
if (payload) {
|
|
179
|
+
selectedDevice.innerText = payload;
|
|
180
|
+
}
|
|
171
181
|
}
|
|
172
182
|
function setInputFields() {
|
|
173
183
|
log.info('setInputFields()');
|
|
@@ -180,17 +190,37 @@ function setInputFields() {
|
|
|
180
190
|
export function setIotCategoryOptions() {
|
|
181
191
|
log.info('setIotCategoryOptions()');
|
|
182
192
|
dispatchSpaceEvent(SPACE_EVENTS.GET_IOT_CATEGORIES, { payload: 'hello from library' });
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
if (_tagIotCategoryTypes) {
|
|
194
|
+
renderIotCategoryDropdownOptions('at-iot-category-options', _tagIotCategoryTypes);
|
|
195
|
+
batchAddEventListenerByClassName('at_iot_cat_option', (event) => {
|
|
196
|
+
//@ts-ignore
|
|
197
|
+
const selectedCat = event.target;
|
|
198
|
+
const catUUID = selectedCat.getAttribute('iot-category-uuid');
|
|
199
|
+
const getCatName = _tagIotCategoryTypes.find(cat => cat.uuid === catUUID);
|
|
200
|
+
if (getCatName) {
|
|
201
|
+
selectedIoTCat = { uuid: catUUID, name: getCatName.name };
|
|
202
|
+
setSelectedIoTCat(selectedIoTCat);
|
|
203
|
+
log.info('cat id: ', selectedIoTCat);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
// gets selected Category and returns the object
|
|
209
|
+
export function getIotCategoryOption() {
|
|
210
|
+
log.info('getIotCategoryOption()');
|
|
211
|
+
let foundCat = {};
|
|
212
|
+
if (linkedDevicesArray.length > 1) {
|
|
213
|
+
foundCat = _tagIotCategoryTypes.find((cat) => {
|
|
214
|
+
return i18n.t(cat.name) === 'Multiple';
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
foundCat = _tagIotCategoryTypes.find((cat) => {
|
|
219
|
+
return i18n.t(cat.uuid) === selectedIoTCat.uuid;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
log.info('foundCat: ', foundCat);
|
|
223
|
+
return foundCat;
|
|
194
224
|
}
|
|
195
225
|
export function toggleIoTCategoryOptions() {
|
|
196
226
|
log.info('toggleIoTCategoryOptions');
|
|
@@ -250,7 +280,7 @@ export function clearIoTDropdowns() {
|
|
|
250
280
|
const catDropdown = document.getElementById('at-iot-selected-cat');
|
|
251
281
|
const devicesDropdown = document.getElementById('at-iot-selected-device');
|
|
252
282
|
catDropdown.innerText = i18n.t('NoSelection');
|
|
253
|
-
devicesDropdown.innerText = i18n.t('
|
|
283
|
+
devicesDropdown.innerText = i18n.t('SelectDevice');
|
|
254
284
|
}
|
|
255
285
|
/**
|
|
256
286
|
* Initializes Form Data
|
|
@@ -260,12 +290,14 @@ export function clearIoTDropdowns() {
|
|
|
260
290
|
export function initIoTFormData(tagId) {
|
|
261
291
|
log.info('initIoTFormData()');
|
|
262
292
|
displayFormTitle();
|
|
293
|
+
const iotSave = document.getElementById('at-save-iot-btn');
|
|
294
|
+
iotSave.classList.remove('at_disabled');
|
|
263
295
|
// Add Mode
|
|
264
296
|
if (!tagId) {
|
|
265
|
-
|
|
297
|
+
clearIoTDropdowns();
|
|
298
|
+
clearIotFields();
|
|
266
299
|
if (iotTagFormMode == "ADD" /* FORM_MODE.ADD */) {
|
|
267
300
|
if (tagIotName === null || tagIotName == undefined) {
|
|
268
|
-
log.info('initIoTFormData() tagname check', tagIotName);
|
|
269
301
|
setInputFields();
|
|
270
302
|
}
|
|
271
303
|
tagIotName.value = '';
|
|
@@ -273,11 +305,12 @@ export function initIoTFormData(tagId) {
|
|
|
273
305
|
iotSerialNumber.value = '';
|
|
274
306
|
iotMfrName.value = '';
|
|
275
307
|
iotSystemLink.value = '';
|
|
308
|
+
linkedDevicesArray = [];
|
|
309
|
+
setIotDeviceOptions();
|
|
276
310
|
}
|
|
277
311
|
}
|
|
278
312
|
else {
|
|
279
313
|
const foundTag = _tags.find(tag => tag.json_data.id === tagId);
|
|
280
|
-
log.info('initIoTFormData() foundTag: ', foundTag, _tags);
|
|
281
314
|
if (foundTag) {
|
|
282
315
|
selectedIotTag = foundTag;
|
|
283
316
|
if (tagIotName === null || tagIotName == undefined) {
|
|
@@ -299,23 +332,25 @@ export function initIoTFormData(tagId) {
|
|
|
299
332
|
setSelectedIoTSystemRadio(IOT_LINKED_SYSTEMS.BEMAC);
|
|
300
333
|
}
|
|
301
334
|
if (iotData.iot_category) {
|
|
302
|
-
|
|
335
|
+
log.info('found cat 1: ', i18n.t(iotData.iot_category), iotData.iot_category, _tagIotCategoryTypes);
|
|
336
|
+
const cat = _tagIotCategoryTypes.find(cat => i18n.t(cat.name.toLocaleLowerCase()) === iotData.iot_category.toLocaleLowerCase());
|
|
303
337
|
if (cat) {
|
|
304
|
-
|
|
305
|
-
|
|
338
|
+
log.info('found cat: ', cat);
|
|
339
|
+
setSelectedIoTCat({ uuid: cat.uuid, name: cat.name });
|
|
340
|
+
selectedIoTCat = { uuid: cat.uuid, name: cat.name };
|
|
306
341
|
}
|
|
307
342
|
else {
|
|
308
343
|
// for the Dummy data from App Side
|
|
309
|
-
setSelectedIoTCat(i18n.t('NoSelection'));
|
|
344
|
+
setSelectedIoTCat({ uuid: generateUUID(), name: i18n.t('NoSelection') });
|
|
310
345
|
renderIotCategoryDropdownOptions('at-iot-category-options', _tagIotCategoryTypes);
|
|
311
346
|
}
|
|
312
347
|
}
|
|
313
348
|
log.info("iotData.linked_devices: ", iotData.linked_devices);
|
|
314
349
|
if (iotData.linked_devices && iotData.linked_devices.length > 0) {
|
|
350
|
+
setIotDeviceOptions();
|
|
315
351
|
// renderIotDeviceDropdownOptions('at-iot-device-options', _tagIotDevices)
|
|
316
352
|
setSelectedIoTDevice(iotData.linked_devices[0].name);
|
|
317
353
|
linkedDevicesArray = iotData.linked_devices;
|
|
318
|
-
log.info("EDIT linkedDevicesArray: ", linkedDevicesArray);
|
|
319
354
|
renderLinkedDevices(linkedDevicesArray);
|
|
320
355
|
}
|
|
321
356
|
else {
|
|
@@ -328,7 +363,7 @@ export function initIoTFormData(tagId) {
|
|
|
328
363
|
// this is due to selecting the tags created from James
|
|
329
364
|
log.info('initIoTFormData()', iotData);
|
|
330
365
|
setSelectedIoTSystemRadio(IOT_LINKED_SYSTEMS.BEMAC);
|
|
331
|
-
setSelectedIoTCat(
|
|
366
|
+
setSelectedIoTCat({ uuid: generateUUID(), name: i18n.t('NoSelection') });
|
|
332
367
|
renderIotCategoryDropdownOptions('at-iot-category-options', _tagIotCategoryTypes);
|
|
333
368
|
renderIotDeviceDropdownOptions('at-iot-device-options', _tagIotDevices);
|
|
334
369
|
}
|
|
@@ -370,8 +405,10 @@ export function renderIotCategoryDropdownOptions(elementId, items) {
|
|
|
370
405
|
return;
|
|
371
406
|
}
|
|
372
407
|
items.forEach((item, index) => {
|
|
373
|
-
|
|
374
|
-
|
|
408
|
+
if (item.name != 'Multiple') {
|
|
409
|
+
const option = createCatOptionElement(item, 'iotcategory', index);
|
|
410
|
+
element.appendChild(option);
|
|
411
|
+
}
|
|
375
412
|
});
|
|
376
413
|
}
|
|
377
414
|
function createCatOptionElement(item, dropdownType, index) {
|
|
@@ -394,28 +431,33 @@ function createCatOptionElement(item, dropdownType, index) {
|
|
|
394
431
|
return option;
|
|
395
432
|
}
|
|
396
433
|
function selectCatOption(option, elementId) {
|
|
397
|
-
|
|
434
|
+
dispatchSpaceEvent(SPACE_EVENTS.GET_IOT_CAT_ICON, { payload: option });
|
|
398
435
|
}
|
|
436
|
+
// selects Devices from Arrayat-device-item-container
|
|
399
437
|
export function setIotDeviceOptions() {
|
|
400
438
|
log.info('setIotDeviceOptions()');
|
|
401
439
|
dispatchSpaceEvent(SPACE_EVENTS.GET_IOT_DEVICES, { payload: 'hello from library' });
|
|
402
440
|
renderIotDeviceDropdownOptions('at-iot-device-options', _tagIotDevices);
|
|
403
|
-
batchAddEventListenerByClassName('
|
|
441
|
+
batchAddEventListenerByClassName('at_option', (event) => {
|
|
404
442
|
//@ts-ignore
|
|
405
|
-
const selectedDev = event.target;
|
|
406
|
-
const parent = selectedDev.
|
|
407
|
-
log.info('@caroline parent: ', parent);
|
|
443
|
+
const selectedDev = document.getElementById(event.target.id);
|
|
444
|
+
const parent = selectedDev.closest('div');
|
|
408
445
|
const deviceId = parent.getAttribute('iot-device-uuid');
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
446
|
+
// adds selected device to array
|
|
447
|
+
const devFound = _tagIotDevices.find(device => device.id === deviceId);
|
|
448
|
+
if (devFound) {
|
|
449
|
+
selectedDev.setAttribute('disabled', 'true');
|
|
450
|
+
setSelectedIoTDevice(selectedDev.innerText);
|
|
451
|
+
linkedDevicesArray.push(devFound);
|
|
452
|
+
//hides the selected device in dropdown
|
|
453
|
+
parent.style.display = 'none'; //hides
|
|
454
|
+
renderDeviceRow(devFound);
|
|
455
|
+
selectedDev.setAttribute('disabled', 'false');
|
|
456
|
+
}
|
|
415
457
|
});
|
|
416
458
|
}
|
|
417
459
|
export function renderIotDeviceDropdownOptions(elementId, items) {
|
|
418
|
-
log.info("renderIotDeviceDropdownOptions: "
|
|
460
|
+
log.info("renderIotDeviceDropdownOptions: ");
|
|
419
461
|
const element = document.getElementById(elementId);
|
|
420
462
|
if (!element) {
|
|
421
463
|
console.error("Parameter element is undefined");
|
|
@@ -430,19 +472,19 @@ export function renderIotDeviceDropdownOptions(elementId, items) {
|
|
|
430
472
|
element.innerHTML = ``;
|
|
431
473
|
const selectedIotDeviceOption = document.getElementById(isFilterDropdown ? 'at-iot-device-filter-dropdown-toggle' : 'at-iot-device-dropdown-toggle');
|
|
432
474
|
if (selectedIotDeviceOption) {
|
|
433
|
-
selectedIotDeviceOption.textContent = `${i18n.t('
|
|
475
|
+
selectedIotDeviceOption.textContent = `${i18n.t('SelectDevice')}`;
|
|
434
476
|
selectedIoTDeviceOption = undefined;
|
|
435
477
|
}
|
|
436
478
|
//Add the no selection option
|
|
437
479
|
const selectDevice = document.createElement('div');
|
|
438
|
-
selectDevice.classList.add('
|
|
480
|
+
selectDevice.classList.add('at_option');
|
|
439
481
|
selectDevice.setAttribute('iot-device-uuid', '');
|
|
440
482
|
selectDevice.setAttribute('dropdown-type', 'iotdevice');
|
|
441
483
|
selectDevice.innerHTML = `
|
|
442
|
-
<span></span> ${i18n.t('
|
|
484
|
+
<span></span> ${i18n.t('SelectDevice')}
|
|
443
485
|
`;
|
|
444
486
|
selectDevice.onclick = () => {
|
|
445
|
-
log.info('
|
|
487
|
+
log.info('item selected: ', selectDevice, linkedDevicesArray);
|
|
446
488
|
selectDeviceOption(selectDevice, isFilterDropdown ? 'at-iot-device-filter-dropdown-toggle' : 'at-iot-device-filter-dropdown-toggle');
|
|
447
489
|
};
|
|
448
490
|
element.appendChild(selectDevice);
|
|
@@ -466,21 +508,23 @@ function createDeviceOptionElement(item, dropdownType) {
|
|
|
466
508
|
option.style.justifyContent = 'left';
|
|
467
509
|
option.style.alignItems = 'center';
|
|
468
510
|
option.style.gap = '2px';
|
|
511
|
+
// option.classList.add('at_option')
|
|
469
512
|
option.classList.add('at_option');
|
|
470
|
-
option.classList.add('at_iot_dev_option');
|
|
471
513
|
option.setAttribute('iot-device-uuid', item.id);
|
|
472
514
|
option.setAttribute('dropdown-type', dropdownType);
|
|
473
515
|
option.setAttribute('data-cy', `at-iot-category-option-${item.id}`);
|
|
474
|
-
if (dropdownType == 'category') {
|
|
475
|
-
option.innerHTML = `
|
|
476
|
-
<span class="at_colored-indicator"></span>
|
|
477
|
-
${item.name}
|
|
478
|
-
`;
|
|
479
|
-
return option;
|
|
480
|
-
}
|
|
481
516
|
option.innerHTML = `
|
|
482
|
-
<span>${item.name}</span>
|
|
517
|
+
<span style="width: 100%; display: block; padding: 4px 8px; cursor: pointer" id="${item.id}">${item.name}</span>
|
|
483
518
|
`;
|
|
519
|
+
if (selectedIotTag) {
|
|
520
|
+
const iotTag = selectedIotTag.iot_tag;
|
|
521
|
+
const hideOption = iotTag.linked_devices.find((dev) => {
|
|
522
|
+
return dev.id === item.id;
|
|
523
|
+
});
|
|
524
|
+
if (hideOption != undefined) {
|
|
525
|
+
option.style.setProperty('display', 'none', 'important');
|
|
526
|
+
}
|
|
527
|
+
}
|
|
484
528
|
return option;
|
|
485
529
|
}
|
|
486
530
|
/**
|
|
@@ -499,7 +543,8 @@ export function getIotTagFormData() {
|
|
|
499
543
|
modelName: iotModelName.value,
|
|
500
544
|
serialNumber: iotSerialNumber.value,
|
|
501
545
|
tagMf: iotMfrName.value,
|
|
502
|
-
tagCategoryId:
|
|
546
|
+
// tagCategoryId: selectedIoTCat.uuid,
|
|
547
|
+
tagCategoryId: selectedIoTCat.name,
|
|
503
548
|
systemLink: iotSystemLink.value,
|
|
504
549
|
linkedDevices: linkedDevicesArray,
|
|
505
550
|
iotSystem: selectedIoTSystem,
|
|
@@ -508,55 +553,78 @@ export function getIotTagFormData() {
|
|
|
508
553
|
return formData;
|
|
509
554
|
}
|
|
510
555
|
function renderLinkedDevices(linkedDevices) {
|
|
511
|
-
log.info('renderLinkedDevices()'
|
|
556
|
+
log.info('renderLinkedDevices()');
|
|
512
557
|
if (linkedDevices) {
|
|
513
|
-
const devicesContainer = document.getElementById('at-
|
|
558
|
+
// const devicesContainer = document.getElementById('at-device-item-container')
|
|
514
559
|
if (linkedDevices.length > 0) {
|
|
515
|
-
devicesContainer.innerHTML = ``;
|
|
516
560
|
linkedDevices.forEach(device => {
|
|
517
|
-
log.info("@caroline device: ", device);
|
|
518
561
|
renderDeviceRow(device);
|
|
519
562
|
});
|
|
520
563
|
}
|
|
521
564
|
}
|
|
522
565
|
}
|
|
523
566
|
function renderDeviceRow(payload) {
|
|
524
|
-
log.info('renderDeviceRow()'
|
|
525
|
-
const devicesContainer = document.getElementById('at-
|
|
567
|
+
log.info('renderDeviceRow()');
|
|
568
|
+
const devicesContainer = document.getElementById('at-device-item-container');
|
|
526
569
|
if (payload) {
|
|
527
570
|
const deviceRow = document.createElement('div');
|
|
528
571
|
deviceRow.classList.add('at_flex_row');
|
|
529
|
-
deviceRow.classList.add('
|
|
572
|
+
deviceRow.classList.add('at_item');
|
|
530
573
|
deviceRow.innerHTML = `
|
|
531
|
-
<div class="
|
|
574
|
+
<div class="at_subitem_left">
|
|
532
575
|
<span class="mdi mdi-cube-outline"></span>
|
|
533
576
|
</div>
|
|
534
577
|
|
|
535
|
-
<div class="
|
|
578
|
+
<div class="at_name">
|
|
536
579
|
<div></div>
|
|
537
580
|
<label for="">${payload.name}</label>
|
|
538
581
|
<div></div>
|
|
539
582
|
</div>
|
|
540
|
-
<div class="
|
|
541
|
-
<span class="mdi mdi-delete-outline at_delete_device_btn" id="at-delete-device-${payload.
|
|
583
|
+
<div class="at_subitem_right">
|
|
584
|
+
<span class="mdi mdi-delete-outline at_delete_device_btn" id="at-delete-device-${payload.id}"></span>
|
|
542
585
|
</div>
|
|
543
586
|
`;
|
|
544
587
|
devicesContainer.appendChild(deviceRow);
|
|
545
588
|
batchAddEventListenerByClassName('at_delete_device_btn', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
546
|
-
log.info('deleteSelectedLinkedDevice is clicked', event);
|
|
547
589
|
//@ts-ignore
|
|
548
|
-
const selectedDevice =
|
|
590
|
+
const selectedDevice = event.target;
|
|
549
591
|
if (selectedDevice) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
592
|
+
toggleModal();
|
|
593
|
+
setModalAction({
|
|
594
|
+
title: `${i18n.t('DeleteDevice')}`,
|
|
595
|
+
description: `${i18n.t('ConfirmDeleteDevice')}`,
|
|
596
|
+
buttonLabel: `${i18n.t('YesDelete')}`
|
|
597
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
598
|
+
// gets the device id
|
|
599
|
+
const devId = selectedDevice.id.split('at-delete-device-')[1];
|
|
600
|
+
// finds the index of the selected device
|
|
601
|
+
const findDevice = linkedDevicesArray.findIndex(dev => dev.id === devId);
|
|
602
|
+
if (findDevice > -1) {
|
|
603
|
+
selectedDevice.setAttribute('disabled', 'true');
|
|
604
|
+
const parent = selectedDevice.closest('.at_partition_item');
|
|
605
|
+
if (parent) {
|
|
606
|
+
// displays delete Device back in Dropdown List
|
|
607
|
+
const findHideDev = document.querySelector(`div[iot-device-uuid="${devId}"]`);
|
|
608
|
+
const devicesDropdown = document.getElementById('at-iot-selected-device');
|
|
609
|
+
if (findHideDev) {
|
|
610
|
+
findHideDev.style.display = "block";
|
|
611
|
+
parent.style.display = 'none';
|
|
612
|
+
linkedDevicesArray.splice(findDevice, 1);
|
|
613
|
+
}
|
|
614
|
+
if (linkedDevicesArray.length === 0) {
|
|
615
|
+
devicesDropdown.innerText = i18n.t('SelectDevice');
|
|
616
|
+
setIotDeviceOptions();
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
toggleModal(false);
|
|
620
|
+
notify.success(`${i18n.t('SuccessDeleteDevice')}`);
|
|
621
|
+
selectedDevice.setAttribute('disabled', 'false');
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
toggleModal(false);
|
|
625
|
+
notify.error("Tag id not found!");
|
|
626
|
+
}
|
|
627
|
+
}));
|
|
560
628
|
}
|
|
561
629
|
}));
|
|
562
630
|
return;
|
|
@@ -573,7 +641,7 @@ export function clearIotFields() {
|
|
|
573
641
|
iotSerialNumber = document.getElementById('at-iot-serial-input');
|
|
574
642
|
iotMfrName = document.getElementById('at-iot-manufacturer-input');
|
|
575
643
|
iotSystemLink = document.getElementById('at-iot-system-link-input');
|
|
576
|
-
const deviceContainer = document.getElementById(
|
|
644
|
+
const deviceContainer = document.getElementById('at-device-item-container');
|
|
577
645
|
tagIotName.innerText = '';
|
|
578
646
|
iotModelName.innerText = '';
|
|
579
647
|
iotSerialNumber.innerText = '';
|
|
@@ -582,10 +650,9 @@ export function clearIotFields() {
|
|
|
582
650
|
linkedDevicesArray = [];
|
|
583
651
|
selectedIoTSystem = '';
|
|
584
652
|
setSelectedIoTSystemRadio(IOT_LINKED_SYSTEMS.BEMAC);
|
|
585
|
-
|
|
586
|
-
deviceContainer.innerHTML = '';
|
|
587
|
-
}
|
|
653
|
+
deviceContainer.innerHTML = '';
|
|
588
654
|
iotTagFormMode = "ADD" /* FORM_MODE.ADD */;
|
|
655
|
+
selectedIotTag = undefined;
|
|
589
656
|
}
|
|
590
657
|
/**
|
|
591
658
|
* Sets the form mode for the IOT form.
|
|
@@ -6,3 +6,4 @@ export declare function renderViewingRemoteSpace(): HTMLElement;
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function renderRemoteSpaceViewing(user: ScreenShareUser): void;
|
|
8
8
|
export declare function handleRemoteViewResponsiveChanges(): void;
|
|
9
|
+
export declare function handleScreenShareRemoteEndSessionEvent(): void;
|
|
@@ -100,3 +100,9 @@ export function handleRemoteViewResponsiveChanges() {
|
|
|
100
100
|
container.classList.toggle("at_display_flex_end", isMobile);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
+
export function handleScreenShareRemoteEndSessionEvent() {
|
|
104
|
+
const element = document.getElementById("at-viewing-remote-space-pane");
|
|
105
|
+
if (element) {
|
|
106
|
+
element.style.display = 'none';
|
|
107
|
+
}
|
|
108
|
+
}
|
package/lib/atwinui/events.js
CHANGED
|
@@ -30,7 +30,7 @@ import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordin
|
|
|
30
30
|
import { toggleGeneralMapOptions, initGeneralSelectedMap, getSelectedMapOption } from './components/toolbar/generalSettingsMenuPane';
|
|
31
31
|
import { searchTagList, setSearchTagTerm, searchClearfield, getSearchTagTerm, sortTags, updateSelectedTagSortOption, resetSelectedTagSortOption } from './components/toolbar/tagListPane';
|
|
32
32
|
import { renderUserRows } from "./components/toolbar/spaceUserListPane";
|
|
33
|
-
import { handleRemoteViewResponsiveChanges, renderRemoteSpaceViewing } from "./components/toolbar/viewingRemoteSpace";
|
|
33
|
+
import { handleRemoteViewResponsiveChanges, handleScreenShareRemoteEndSessionEvent, renderRemoteSpaceViewing } from "./components/toolbar/viewingRemoteSpace";
|
|
34
34
|
import { PipeList } from "./components/toolbar/pipeListPane";
|
|
35
35
|
import { PipeForm } from "./components/toolbar/pipeFormPane";
|
|
36
36
|
import { unsendComment, timedoutComment, getTheseTagMessages } from './components/toolbar/tagMessagingPane';
|
|
@@ -1439,6 +1439,7 @@ function setupSpaceEventSubscriptions() {
|
|
|
1439
1439
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_HOST_END_SESSION, handleScreenShareEndSessionEvent);
|
|
1440
1440
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_ACCEPT_REQUEST, handleScreenShareAcceptRequest);
|
|
1441
1441
|
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_BACK_USER_LIST_PANE, handleScreenShareBackUserListPane);
|
|
1442
|
+
subscribeSpaceEvent(SPACE_EVENTS.SCREEN_SHARE_TERMINATED, handleScreenShareRemoteEndSessionEvent);
|
|
1442
1443
|
}
|
|
1443
1444
|
function handlePartitionColiderClickSelected(payload) {
|
|
1444
1445
|
return __awaiter(this, void 0, void 0, function* () {
|
package/lib/types.d.ts
CHANGED
|
@@ -762,6 +762,7 @@ export declare enum SPACE_EVENTS {
|
|
|
762
762
|
SCREEN_SHARE_HOST_END_SESSION = "SCREEN_SHARE_HOST_END_SESSION",
|
|
763
763
|
SCREEN_SHARE_GUEST_LEAVE_SESSION = "SCREEN_SHARE_GUEST_LEAVE_SESSION",
|
|
764
764
|
SCREEN_SHARE_BACK_USER_LIST_PANE = "SCREEN_SHARE_BACK_USER_LIST_PANE",
|
|
765
|
+
SCREEN_SHARE_TERMINATED = "SCREEN_SHARE_TERMINATED",
|
|
765
766
|
PIPE_INIT = "PIPE_INIT",
|
|
766
767
|
PIPE_CATEGORY_REMOVED = "PIPE_CATEGORY_REMOVED",
|
|
767
768
|
PIPE_CATEGORY_SAVED = "PIPE_CATEGORY_SAVED",
|
package/lib/types.js
CHANGED
|
@@ -124,6 +124,7 @@ export var SPACE_EVENTS;
|
|
|
124
124
|
SPACE_EVENTS["SCREEN_SHARE_HOST_END_SESSION"] = "SCREEN_SHARE_HOST_END_SESSION";
|
|
125
125
|
SPACE_EVENTS["SCREEN_SHARE_GUEST_LEAVE_SESSION"] = "SCREEN_SHARE_GUEST_LEAVE_SESSION";
|
|
126
126
|
SPACE_EVENTS["SCREEN_SHARE_BACK_USER_LIST_PANE"] = "SCREEN_SHARE_BACK_USER_LIST_PANE";
|
|
127
|
+
SPACE_EVENTS["SCREEN_SHARE_TERMINATED"] = "SCREEN_SHARE_TERMINATED";
|
|
127
128
|
// PIPE
|
|
128
129
|
SPACE_EVENTS["PIPE_INIT"] = "PIPE_INIT";
|
|
129
130
|
SPACE_EVENTS["PIPE_CATEGORY_REMOVED"] = "PIPE_CATEGORY_REMOVED";
|
package/package.json
CHANGED
package/static/atwinui.css
CHANGED
|
@@ -2054,7 +2054,8 @@ dialog#at-screen-share-request-modal::backdrop {
|
|
|
2054
2054
|
|
|
2055
2055
|
.at_screen_share_request_message {
|
|
2056
2056
|
font-size: 24px;
|
|
2057
|
-
font-weight:
|
|
2057
|
+
font-weight: 700;
|
|
2058
|
+
color: #263646ef !important;
|
|
2058
2059
|
padding: none !important;
|
|
2059
2060
|
margin: none !important;
|
|
2060
2061
|
}
|