odant-work 1.0.73 → 1.0.74

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "packageName": "odant-work",
3
- "version": "1.0.73",
3
+ "version": "1.0.74",
4
4
  "createdAt": 1795100682741,
5
- "updatedAt": 1795592417952,
5
+ "updatedAt": 1795595610400,
6
6
  "files": {
7
7
  "run.mjs": "f8918c612e8641e9beee06221be6680aa6fd21f25468451f2ac857fd51772266",
8
- "package.json": "2a708931926d7a975b7c23d93250c0c92d9b7ccca168bf8baeca69dbcc37604f",
9
- "package-lock.json": "747fa6358c40b518d34c586da58a0a7d34393da91f1ada6cc7fc5c06cd9a0ac3",
8
+ "package.json": "264526a0202a39c963e81aa8981b541d1252b99c1106a75982a325ffbbe52350",
9
+ "package-lock.json": "7f04f9b10f0bd9b929718a684444d688cd1bd6eb93133942b8d4142bdbca9998",
10
10
  "sources/client/class.js": "c3fb8f143fc83aaa2df1ddeddd412d2d4dfe88656578095babe2df34fb3b3922",
11
11
  "sources/client/field.js": "ffdd50fa8b6ec515cc42da5fca96658ff2b20e274601a1f926e0031372467a19",
12
12
  "sources/client/file.js": "667101d75fa30840370d5be232e518aaac7c1fd52ca05a12da560eef6c0848b0",
@@ -216,11 +216,11 @@
216
216
  "sources/server/class/scaffold.js": "d51620bf7747ae73cb56a41338caf4b4ef0b94229a0f0157ca27a27392105c2f",
217
217
  "sources/server/class/script.js": "146ef61b5a55201c34f80de4bbfcb116922f03348773548c041bdba0e53aba64",
218
218
  "sources/server/class/search.js": "63bf696ba049ba0b1cd6e4e40fdfe6e84c92b3a9a778369892ed3457d67e839c",
219
- "sources/server/class/security.js": "ced039b5c55a60d9838fc81759aa47f11cb62654e1ec6a6cefb67f9cb3cc323f",
219
+ "sources/server/class/security.js": "d74bb87fbc5f74bdf67183a2711386adedb0550a16c10c998d55deed0256122b",
220
220
  "sources/server/class.js": "f61a0ac4cc5c30cbae9a4dfef47d53246c7711b9d8e047fd85b3754b3b42e81a",
221
221
  "sources/server/external-source.js": "a576a42d380dc2f4688f5c7b0bcb4ca5e0870c55cd8900b34e9ba4d71eb6eb38",
222
222
  "sources/server/file.js": "4ff9c5ff372824a937d4d6782851b0c8ead0c830eb94176e5802bc90fc4ed4a1",
223
- "sources/server/folder.js": "67f0d049f55ccc7d83d817d5c7de9b7395604c1e9b32038a4358c0118fbf4f9f",
223
+ "sources/server/folder.js": "143eaf690b7863ce5bdd00ae66b1d009b7593a6b9c096a0228dced0320a05212",
224
224
  "sources/server/handler.js": "ae40082616e3f00f49d40884bc116a8fb6cb56625ec968fef552694bf1ec41a6",
225
225
  "sources/server/index.js": "d2af9533f9bacdc6fb6c98412cc1e857f0750cca4c0a0560185c6f746f3d0c51",
226
226
  "sources/server/logs.js": "5dc22eaebb004c648aa2891205857af6be3a69996e64c7a986806f7697f5f15e",
@@ -334,7 +334,7 @@
334
334
  "oda/components/editors/markdown/markdown.js": "a3cb65776ba361973ac1beac0f5a07ac1faa9bf8659f1f17b9c7dad958764452",
335
335
  "oda/components/editors/markdown/readme.md": "f2137b0a4283d959f787dfe6fabef578632cb7f74b46d2a66c39be369436560e",
336
336
  "oda/components/editors/readme.md": "bf14338760a8b6979c11714a5f8e66a428abda1dc26e2413ad2d8d36b464fc68",
337
- "oda/components/icon/icon.js": "7afb34dbbca22710c8ef45a51568ed96c5d86e24570c9188ee43d4c47078a6c0",
337
+ "oda/components/icon/icon.js": "07400566f465ffc0a5e7f3aca16b41b6cef564cc330e17726ed35537f78c17a8",
338
338
  "oda/components/icon/index.html": "6e0bbac8023f3dac45e0ab65835f0533f21184469a94c884d175d95a26c94f19",
339
339
  "oda/components/icon/readme.md": "83f6844cdd267109bac1cecf3ec6af6a01d1f6ef8d579bb7c0b867f358b570b9",
340
340
  "oda/components/index.html": "5745066edbed135f5c04d545e277b38e3724a4a76785f3acf5ba073e409dba73",
@@ -600,7 +600,7 @@
600
600
  "$server/$folder/$class/$structure/handlers/pages/data/$handler/class.js": "323d34fb44be111818183df77348ed89ad36d97c000e248adf9f15c94b788737",
601
601
  "$server/$folder/$class/$structure/handlers/pages/data/$handler/data.js": "e9f85021ae35f4c6ee3dc159ae51de1181b57ab47cc18fffe3d30319a0df0684",
602
602
  "$server/$folder/$class/$structure/handlers/pages/explorer/$handler/class.js": "18dde9964e08b916083778faa704f0a8f6ac912017cf2efbe5abf947f33a2458",
603
- "$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js": "149c17936697ae3e3e9d874b3b8da21eea2642062056f9e0a4546bfbd66b43ec",
603
+ "$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js": "c370d0c4e60630556cf4239ca313ca3da8753bfec7d7ee05e35f70535264ae51",
604
604
  "$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js": "e3464e330f77885a9ad959ac3411f8e0474cf827ab906de49a6987f87c5fc813",
605
605
  "$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/class.js": "1dba2c058bf1d8a63a5320ef9bf50e178e5dc5789da4476c24385b7f02085062",
606
606
  "$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/readme.md": "ac84fe45922e135e3579a0e1390f279c1f08ac2b2197714c97d84cf5d021b5f4",
@@ -625,7 +625,7 @@
625
625
  "$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/database.js": "3325286d3d6cfdb82948a809a24f1565baa786bfe9412ed42dc104ce838181b4",
626
626
  "$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/license.js": "331e04fa43103e9e73bbfd7959c39bae8413e79711d5ba4838f3197452ada201",
627
627
  "$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/messengers.js": "9365fe2c42c7216574f266cd5b1e3ca68ca3d910edb77d4149b6a92f4bfcfce5",
628
- "$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff.js": "c9424ef69a056e5993803836fdc7f9011184670d41616084499c36c8fd3e2088",
628
+ "$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff.js": "4d10d574e43f47ead19abaa3ade180e3e95541a95923fc9923ee4c1d993af78d",
629
629
  "$server/$folder/$class/$structure/handlers/pages/site/$handler/class.js": "2651e21b62b4662a03222e01d305c6bbf79ab15acfc6f043967dff2d8e5f1fac",
630
630
  "$server/$folder/$class/$structure/handlers/pages/site/$handler/readme.md": "b5aaa3e3771c31acb7b99d734955f546bde05628990856d2b30aa87a7fd27e39",
631
631
  "$server/$folder/$class/$structure/handlers/pages/site/$handler/site.js": "9338df2c67dea4262681b758484e6c2d267172f4c542c4c1783fca5ba25b03af",
@@ -798,7 +798,7 @@
798
798
  "$server/$folder/lib/email/settings.js": "25e13ecf12b84e5fd6bcac955b1e0dc47bf09b72a98776e8ce1e1f01617aef9d",
799
799
  "$server/$folder/lib/explorer/explorer.js": "96004ccf61f456c1b3118a6e5180d851a268f0e0caa9cf0bc5e9dfa077e6d060",
800
800
  "$server/$folder/lib/file-viewer/file-viewer.js": "b183fd61b72fcc7baba3e44e16ddf3800553596313711a7bc4dd91f3e1e260ab",
801
- "$server/$folder/lib/icon/icon.js": "fdb15cf37421b60d3362f3c47a2a759a2faafe194547841718ad448df36462d0",
801
+ "$server/$folder/lib/icon/icon.js": "59fdfd832f55e6d8e247bb75009d0fea3d389ab8fa17fa99f8661e18ea880f32",
802
802
  "$server/$folder/lib/icon/user/user.js": "481da79de754c244f0151c91d03a503c0452902575e4dc8bc2b3171c0fad3a2e",
803
803
  "$server/$folder/lib/item-data-grid/item-data-grid.js": "c9650e7d09dd8a558e5f288da527d74c65267fa563a7006cf86222dc25198b54",
804
804
  "$server/$folder/lib/item-data-grid/readme.md": "2a9f5703b83945884992120560baf9187aabde045d55026716579212a5930575",
@@ -831,7 +831,7 @@
831
831
  "$server/$folder/lib/tree/link-nodes.js": "e475b4a61d68829d07d5cc57dacfd030c957873429979b40a29a3947805e19af",
832
832
  "$server/$folder/lib/tree/progress.md": "4a9a6aafcb044e3cf2048d46e13be7f9afcb1abc6e5c6b0ff17a82e3491e5c08",
833
833
  "$server/$folder/lib/tree/readme.md": "b5103d0db4232be33f34d2bcc2de7ba93bcd4632982db223abccc8481b328994",
834
- "$server/$folder/lib/tree/tree.js": "08dcc8f1f194cf4a2eecb5013254c63cfe1f8d48aae054b3a1e5e09253f8db93",
834
+ "$server/$folder/lib/tree/tree.js": "bf754a2c8f69e8eab1186a110e450092f0c68e18743c11421e842701a5437629",
835
835
  "$server/$folder/readme.md": "8018008b98854e9f6b2c718032ba85764605fcdb3179a06c11d9a28caa329c0f",
836
836
  "$server/class.js": "11e5d32e975eea2bee2d023380d1fbe4f789da7904ce1ba15441dda3af3988b8",
837
837
  "$server/readme.md": "62c1e8553d7453ce8d2f946e33ab5dbdf4cd903991e8f840040027c27ee33219",
@@ -1080,7 +1080,7 @@
1080
1080
  "SERVICES/Weather/$service/class.js": "52987470a58116df3e57e30418d2e32d7371b9effef34be83a00435c73fa7d2f",
1081
1081
  "SERVICES/Yandex/$service/class.js": "bb2e9c3018bb0ac25e38d9b39e04fd67b9b232bbb33d6969e3a3505cdd98b486",
1082
1082
  "SERVICES/YandexDisk/$service/class.js": "22d57610d7ce8f652fcf330ac4d8731fb70dcf756abae7e1c75c186c8db5986c",
1083
- "USERS/$users/class.js": "be58697c501acedac15826cabdf3ec55ded77960d3712d5a23df906acc23349b",
1083
+ "USERS/$users/class.js": "5427829e621048223f206983882ee3fabcce08bee8a322f937ad054e498d95c1",
1084
1084
  "ORGANIZATIONS/$domain/$folder/$class/$base/$folder/$class/$structure/$base/class.js": "e00de6f0b3ec8066ec9c6c21b512b1c839af937435d68e26dd7675204e978f07",
1085
1085
  "ORGANIZATIONS/$domain/$folder/$class/$base/class.js": "fbccd9f865b56a045dd444c2c0c8af110305324ee5d863f68404f85e3869f626",
1086
1086
  "ORGANIZATIONS/$domain/class.js": "0b5a7cc127162726e8beebe64ad17b09ca501f46fff62e8ab89f36537dd8c74a",
@@ -7,7 +7,7 @@ export default{
7
7
 
8
8
  `,
9
9
  list:[
10
- '/USERS', '/NODES'
10
+ '/NODES'
11
11
  ],
12
12
  get available(){
13
13
  return Promise.all(this.list.map(path => CORE.$item.ITEMS[path] || WORK.get_item(path)))
@@ -144,12 +144,17 @@ export default {
144
144
 
145
145
  <div class="role-row">
146
146
  <span class="role-title">Руководитель (BOSS):</span>
147
- <div class="user-chip" ~for="bossList">
148
- <oda-icon icon="fontawesome:s-user-tie" icon-size="14"></oda-icon>
147
+ <div class="user-chip clickable" ~for="bossList" title="Открыть диалог с руководителем" @tap="openUser($for.item)">
148
+ <oda-icon round :icon="userIcon($for.item)" :icon-color="userColor($for.item)" icon-size="20"></oda-icon>
149
+ <span>{{userLabel($for.item)}}</span>
150
+ <span ~if="canEdit" class="rm" title="Снять руководителя" @tap.stop="removeRoleUser('BOSS', $for.item)">×</span>
151
+ </div>
152
+ <span ~if="!bossList.length && !inheritedBossInfo?.users?.length" class="muted">не назначен (наследуется сверху)</span>
153
+ <span ~if="!bossList.length && inheritedBossInfo?.users?.length" class="muted">не назначен — наследуется от «{{inheritedBossInfo.fromLabel}}»:</span>
154
+ <div ~if="!bossList.length && inheritedBossInfo?.users?.length" class="user-chip clickable" style="opacity:0.85;" ~for="inheritedBossInfo.users" title="Наследуемый руководитель (открыть диалог)" @tap="openUser($for.item)">
155
+ <oda-icon round :icon="userIcon($for.item)" :icon-color="userColor($for.item)" icon-size="20"></oda-icon>
149
156
  <span>{{userLabel($for.item)}}</span>
150
- <span ~if="canEdit" class="rm" title="Снять руководителя" @tap="removeRoleUser('BOSS', $for.item)">×</span>
151
157
  </div>
152
- <span ~if="!bossList.length" class="muted">не назначен (наследуется сверху)</span>
153
158
  <select ~if="canEdit" @change="addRoleUser('BOSS', $event)">
154
159
  <option value="">+ Назначить руководителя…</option>
155
160
  <option ~for="allUsers" :value="$for.item.id">{{$for.item.label}} ({{$for.item.id}})</option>
@@ -278,6 +283,8 @@ export default {
278
283
  security: null,
279
284
  allUsers: [],
280
285
  userMap: {},
286
+ userMetaMap: {},
287
+ inheritedBossInfo: null,
281
288
  availableClasses: [],
282
289
  classMap: {},
283
290
  canEdit: false,
@@ -333,6 +340,21 @@ export default {
333
340
  return '🌐 Все гости (GUESTS)';
334
341
  return this.userMap?.[uid] || uid;
335
342
  },
343
+ userIcon(uid) {
344
+ const meta = this.userMetaMap?.[uid];
345
+ if (meta?.icon)
346
+ return meta.icon;
347
+ const lbl = String(this.userLabel(uid) || uid || '').trim();
348
+ const initials = lbl.split(/\s+/).slice(0, 2).map(s => s[0]).join('').toUpperCase();
349
+ return initials ? ('@:' + initials) : 'icons:person';
350
+ },
351
+ userColor(uid) {
352
+ const meta = this.userMetaMap?.[uid];
353
+ const icon = this.userIcon(uid);
354
+ if (typeof icon === 'string' && icon.startsWith('@'))
355
+ return meta?.iconColor || '#3b82f6';
356
+ return '';
357
+ },
336
358
  classTitle(path) {
337
359
  return this.classMap?.[path] || String(path || '').replace(/^\/(?:ORGANIZATIONS|PROJECTS)\/[^/]+\/MODULES\/[^/]+\//, '');
338
360
  },
@@ -370,6 +392,7 @@ export default {
370
392
  this.availableClasses = [];
371
393
  this.invitesList = [];
372
394
  }
395
+ await this.loadInheritedBoss();
373
396
  }
374
397
  catch (e) {
375
398
  this.error = String(e?.message || e);
@@ -397,18 +420,55 @@ export default {
397
420
  const items = (await uRoot?.items) || [];
398
421
  const list = [];
399
422
  const map = {};
423
+ const metaMap = {};
400
424
  for (const u of items) {
401
425
  if (!u?.id || u.id[0] === '$')
402
426
  continue;
403
427
  const label = u.label || u.DATA?.label || u.id;
404
428
  list.push({ id: u.id, label });
405
429
  map[u.id] = label;
430
+ metaMap[u.id] = {
431
+ icon: u.icon || u.DATA?.icon || '',
432
+ iconColor: u.iconColor || '',
433
+ label,
434
+ };
406
435
  }
407
436
  this.allUsers = list;
408
437
  this.userMap = map;
438
+ this.userMetaMap = metaMap;
409
439
  }
410
440
  catch { /* ignore */ }
411
441
  },
442
+ async loadInheritedBoss() {
443
+ if (this.bossList.length || !this.$item?.path) {
444
+ this.inheritedBossInfo = null;
445
+ return;
446
+ }
447
+ try {
448
+ const segs = String(this.$item.path || '').split('/').filter(Boolean);
449
+ for (let i = segs.length - 1; i >= 0; i--) {
450
+ const pPath = i === 0 ? '/' : '/' + segs.slice(0, i).join('/');
451
+ const anc = CORE?.$item?.ITEMS?.[pPath] || await WORK.get_item(pPath).catch(() => null);
452
+ if (!anc)
453
+ continue;
454
+ let ids = Array.isArray(anc?.DATA?.roleIds?.BOSS) ? anc.DATA.roleIds.BOSS : null;
455
+ if (!ids) {
456
+ const b = await Promise.resolve(anc.bosses).catch(() => []);
457
+ ids = Array.isArray(b) ? b.map(u => u?.id || u).filter(Boolean) : [];
458
+ }
459
+ if (ids.length) {
460
+ this.inheritedBossInfo = {
461
+ fromPath: pPath,
462
+ fromLabel: anc.label || anc.DATA?.label || anc.id || (pPath === '/' ? 'WORK' : pPath),
463
+ users: ids,
464
+ };
465
+ return;
466
+ }
467
+ }
468
+ }
469
+ catch { /* ignore */ }
470
+ this.inheritedBossInfo = null;
471
+ },
412
472
  async loadAvailableClasses() {
413
473
  try {
414
474
  const p = String(this.$item?.path || '');
@@ -452,6 +512,19 @@ export default {
452
512
  this.security = JSON.parse(JSON.stringify(nextSec));
453
513
  this.$item.reset?.();
454
514
  this.$item.fire?.('changed', { value: null });
515
+ await this.loadInheritedBoss();
516
+ try {
517
+ if (window.top && window.top !== window && window.top.CORE?.$item?.ITEMS) {
518
+ const topItems = window.top.CORE.$item.ITEMS;
519
+ const topItem = topItems[this.$item.path] || topItems[this.$item.short];
520
+ if (topItem) {
521
+ await topItem.fetch?.('info').catch(() => {});
522
+ topItem.increaseVersion?.();
523
+ topItem.fire?.('changed', { value: null });
524
+ }
525
+ }
526
+ }
527
+ catch { /* ignore cross-origin */ }
455
528
  this.shadowRoot?.querySelector?.('oda-messenger-settings')?.reload?.();
456
529
  }
457
530
  catch (e) {
@@ -1,3 +1,20 @@
1
+ import { isLinkNode } from '../tree/link-nodes.js';
2
+
3
+ function bossAvatarInfo(u) {
4
+ if (!u)
5
+ return { icon: '', color: '' };
6
+ const lbl = String(u.label || u.DATA?.label || u.id || '').trim();
7
+ let icon = u.icon || u.DATA?.icon || '';
8
+ if (!icon && lbl) {
9
+ const initials = lbl.split(/\s+/).slice(0, 2).map(s => s[0]).join('').toUpperCase();
10
+ if (initials)
11
+ icon = '@:' + initials;
12
+ }
13
+ const isText = typeof icon === 'string' && icon.startsWith('@');
14
+ const color = isText ? (u.iconColor || '#3b82f6') : (icon ? '#ffffff' : '');
15
+ return { icon, color, label: lbl };
16
+ }
17
+
1
18
  export default {
2
19
  imports: 'oda//icon, ~/lib//menu, ~/lib//popover',
3
20
  extends: 'oda-icon',
@@ -34,12 +51,29 @@ export default {
34
51
  return false;
35
52
  }
36
53
  },
54
+ get _bossUsers() {
55
+ const it = this.$item;
56
+ if (!it || this.isUser || isLinkNode(it) || ('isPlace' in Object(it) && it.isPlace))
57
+ return null;
58
+ const t = it.type;
59
+ if (t !== '$base' && t !== '$project' && t !== '$structure' && t !== '$server')
60
+ return null;
61
+ it.__version;
62
+ const bossIds = it.DATA?.roleIds?.BOSS;
63
+ if (!Array.isArray(bossIds) || !bossIds.length || typeof WORK?.usersByIds !== 'function')
64
+ return null;
65
+ return WORK.usersByIds(bossIds)
66
+ .then(list => (Array.isArray(list) ? list.filter(Boolean) : []))
67
+ .catch(() => []);
68
+ },
37
69
  subIcon:{
38
70
  $def: '',
39
71
  get (){
40
72
  if (!this.isUser) {
41
73
  if (this.$item?.type === '$virtual')
42
74
  return 'carbon:filter';
75
+ if (this._bossUsers)
76
+ return this._bossUsers.then(list => bossAvatarInfo(list[0]).icon);
43
77
  return this.$item?.subIcon;
44
78
  }
45
79
  return Promise.resolve(this.online).then(res => res ? 'unicon:check-circle' : '');
@@ -51,11 +85,27 @@ export default {
51
85
  if (!this.isUser) {
52
86
  if (this.$item?.type === '$virtual')
53
87
  return '#ede9fe';
88
+ if (this._bossUsers)
89
+ return this._bossUsers.then(list => bossAvatarInfo(list[0]).color);
54
90
  return '';
55
91
  }
56
92
  return Promise.resolve(this.online).then(res => res ? 'lime' : '');
57
93
  }
58
94
  },
95
+ subTitle: {
96
+ $def: '',
97
+ get() {
98
+ if (this._bossUsers) {
99
+ return this._bossUsers.then(list => {
100
+ if (!list.length)
101
+ return '';
102
+ const names = list.map(u => bossAvatarInfo(u).label).filter(Boolean);
103
+ return names.length ? 'Руководитель: ' + names.join(', ') : '';
104
+ });
105
+ }
106
+ return this.$item?.subTitle || '';
107
+ }
108
+ },
59
109
  fill: {
60
110
  $def: '',
61
111
  get() {
@@ -652,7 +652,6 @@ ODA({is: 'oda-tree-node',
652
652
  <div horizontal flex style="min-width: 0; overflow: hidden; align-items: center;">
653
653
  <oda-icon ~show="showCheckbox" :disabled="!checkboxIcon || (isModule && $item?.DATA?.systemBlocked)" :icon="checkboxIcon" :icon-size="20" :title="moduleCheckboxTitle" @tap.stop="checked = !checked"></oda-icon>
654
654
  <item-node flex style="min-width: 0;" :expanded auto-run :show-users :show-size="showSize && !isCategory" :hide-icon="isCategory" :show-tools="isFocused && showTools" :menu-mode :$item :show-status @tap="setItemFocus">
655
- <item-users ~if="isStructureNode" :$item="$item" role="BOSS" :select-mode="false" :icon-size="20"></item-users>
656
655
  <item-users ~if="isPlace" :$item="$item.owner" :place="$item.trail" :select-mode="false" :icon-size="20"></item-users>
657
656
  <span class="access" ~if="isLinkWrite">A</span>
658
657
  <span class="access" ~if="isLinkRead">R</span>
@@ -1028,12 +1027,15 @@ ODA({is: 'oda-tree-node',
1028
1027
  }
1029
1028
  if (this.$pdp?.cleanStructure && this.$item?.path === '/USERS' && Array.isArray(items) && globalThis.WORK?.uid) {
1030
1029
  try {
1031
- const contacts = await globalThis.WORK.fetch('/', 'visible_contacts').catch(() => null);
1032
- if (Array.isArray(contacts) && contacts.length) {
1033
- const order = new Map(contacts.map((c, idx) => [c.id, idx]));
1034
- items = items
1035
- .filter(u => order.has(u?.id))
1036
- .sort((a, b) => (order.get(a.id) ?? 9999) - (order.get(b.id) ?? 9999));
1030
+ const isAdm = Boolean(WORK?.DEV_MODE || await globalThis.WORK.isAdmin?.catch?.(() => false));
1031
+ if (!isAdm) {
1032
+ const contacts = await globalThis.WORK.fetch('/', 'visible_contacts').catch(() => []);
1033
+ if (Array.isArray(contacts)) {
1034
+ const order = new Map(contacts.map((c, idx) => [c.id, idx]));
1035
+ items = items
1036
+ .filter(u => order.has(u?.id))
1037
+ .sort((a, b) => (order.get(a.id) ?? 9999) - (order.get(b.id) ?? 9999));
1038
+ }
1037
1039
  }
1038
1040
  }
1039
1041
  catch { /* оставляем исходный список */ }
@@ -1,3 +1,4 @@
1
- export default{
2
- icon: 'social:people',
3
- }
1
+ export default {
2
+ label: 'Пользователи',
3
+ icon: 'social:people',
4
+ };
@@ -21,6 +21,7 @@ ODA({is: 'oda-icon',
21
21
  bottom: 0px;
22
22
  border-radius: 50% !important;
23
23
  overflow: hidden;
24
+ box-shadow: 0 0 0 3px var(--content-background, #ffffff);
24
25
  }
25
26
  .subicon .icon{
26
27
  border-radius: 50%;
@@ -90,7 +91,7 @@ ODA({is: 'oda-icon',
90
91
  :icon="subIcon"
91
92
  :default="subDefault"
92
93
  :icon-size
93
- style="transform: scale(.4); transform-origin: bottom right; border-radius: 50% important;"
94
+ style="transform: scale(.4); transform-origin: bottom right; border-radius: 50% !important;"
94
95
  ></oda-icon>
95
96
  `,
96
97
  $public: {
@@ -241,6 +242,10 @@ ODA({is: 'oda-icon',
241
242
  const fontSize = `${(this.iconSize / 2) / Math.sqrt(this._icon.name?.length || 1)}px`;
242
243
  style.fontSize = fontSize;
243
244
  style.transform = `rotate(${this.rotate + this._icon.rotation}deg)`;
245
+ if (this._icon.lib === '@' && this.iconColor) {
246
+ style.color = '#ffffff';
247
+ style.fontWeight = '700';
248
+ }
244
249
  }
245
250
  return style;
246
251
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odant-work",
3
- "version": "1.0.73",
3
+ "version": "1.0.74",
4
4
  "description": "ODANT-WORK — платформа цифровой организации (встроенная система учёта, документооборот, управление процессами и приватный мультимодальный ИИ)",
5
5
  "type": "module",
6
6
  "main": "sources/work.js",
@@ -647,7 +647,51 @@ export const classSecurityMethods = {
647
647
  }
648
648
  },
649
649
 
650
+ /** Есть ли у субъекта хотя бы одна внутренняя роль сотрудника (BOSS или USER), а не только CLIENT. */
651
+ async _hasInternalWorkRole(params = {}) {
652
+ if (DEV_MODE || !params?.session || params.session.$user === globalThis.WORK)
653
+ return true;
654
+ const uid = this.constructor.resolveUid(params);
655
+ if (!uid)
656
+ return false;
657
+ const rootRoles = await globalThis.WORK?.roles?.(params).catch(() => []) || [];
658
+ if (rootRoles.includes('BOSS') || rootRoles.includes('USER'))
659
+ return true;
660
+ const checkContainer = async (domainPath) => {
661
+ const dom = await globalThis.WORK?.get_item?.(domainPath).catch(() => null);
662
+ const roots = dom ? ((await Promise.resolve(dom.items).catch(() => [])) || []).filter(b => b && b.id?.[0] !== '$') : [];
663
+ const stack = roots.map(node => ({ node, depth: 0 }));
664
+ while (stack.length) {
665
+ const { node, depth } = stack.pop();
666
+ const r = await Promise.resolve(node.roles?.(params)).catch(() => []) || [];
667
+ if (r.includes('BOSS') || r.includes('USER'))
668
+ return true;
669
+ if (depth >= 5)
670
+ continue;
671
+ const sub = await Promise.resolve(node.items).catch(() => []) || [];
672
+ for (const s of sub) {
673
+ if (s?.type === '$structure' && s.id?.[0] !== '$')
674
+ stack.push({ node: s, depth: depth + 1 });
675
+ }
676
+ }
677
+ return false;
678
+ };
679
+ if (await checkContainer('/ORGANIZATIONS'))
680
+ return true;
681
+ if (await checkContainer('/PROJECTS'))
682
+ return true;
683
+ return false;
684
+ },
685
+
650
686
  async allowAccess(params) {
687
+ // Раздел /USERS ($users): виден сотрудникам (BOSS/USER) и скрыт от внешних клиентов (CLIENT-only) и гостей
688
+ if (this.type === '$users') {
689
+ if (DEV_MODE || !params?.session || params.session.$user === globalThis.WORK)
690
+ return true;
691
+ if (params?.session?.principal?.kind === 'node')
692
+ return false;
693
+ return this._hasInternalWorkRole(params);
694
+ }
651
695
  let result = await this.canSee(this, params);
652
696
  if (!result) {
653
697
  const items = await this.items;
@@ -2118,7 +2118,7 @@ export class $folder extends $item{
2118
2118
  }
2119
2119
 
2120
2120
  sortItems(files, reverse = false, isType = this.isType) {
2121
- const rootOrder = { ORGANIZATIONS: 0, PROJECTS: 1, MODULES: 2, MODELS: 3, NODES: 4, nodes: 4, SERVICES: 5, USERS: 6 };
2121
+ const rootOrder = { ORGANIZATIONS: 0, PROJECTS: 1, USERS: 2, MODULES: 3, MODELS: 4, NODES: 5, nodes: 5, SERVICES: 6 };
2122
2122
  const typeGroup = (t) => {
2123
2123
  if (t === '$catalog' || t === '$virtual' || t === '$struct' || t === '$operation' || t === '$register' || t === '$account')
2124
2124
  return 0;