@crowdin/app-project-module 1.7.0 → 1.7.2

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.
@@ -18,6 +18,7 @@ export declare enum ContextOptionsLocations {
18
18
  GLOSSARY = "glossary",
19
19
  LANGUAGE = "language",
20
20
  SCREENSHOT = "screenshot",
21
+ STYLE_GUIDE = "style_guide",
21
22
  SOURCE_FILE = "source_file",
22
23
  TRANSLATED_FILE = "translated_file"
23
24
  }
@@ -7,6 +7,7 @@ var ContextOptionsLocations;
7
7
  ContextOptionsLocations["GLOSSARY"] = "glossary";
8
8
  ContextOptionsLocations["LANGUAGE"] = "language";
9
9
  ContextOptionsLocations["SCREENSHOT"] = "screenshot";
10
+ ContextOptionsLocations["STYLE_GUIDE"] = "style_guide";
10
11
  ContextOptionsLocations["SOURCE_FILE"] = "source_file";
11
12
  ContextOptionsLocations["TRANSLATED_FILE"] = "translated_file";
12
13
  })(ContextOptionsLocations || (exports.ContextOptionsLocations = ContextOptionsLocations = {}));
@@ -1416,15 +1416,19 @@
1416
1416
  new Promise((resolve) => {
1417
1417
  AP.getUsers((res) => {
1418
1418
  const users = Object.values(res).filter((user) => user.id !== Number(userId));
1419
- resolve(users
1420
- .map((user) => `<option value="${user.id}">${sanitizeHTML(getUserFullName(user))}</option>`)
1421
- .join(''));
1419
+ resolve(users);
1422
1420
  });
1423
1421
  }),
1424
1422
  ])
1425
1423
  .then(([managers, users]) => {
1426
- select.innerHTML = users;
1427
- select.value = managers;
1424
+ const parsedManagers = (JSON.parse(managers) || []);
1425
+ const availableUsers = users;
1426
+ const validUserIds = new Set(availableUsers.map((user) => `${user.id}`));
1427
+ const filteredManagers = parsedManagers.filter((id) => validUserIds.has(id));
1428
+ select.innerHTML = availableUsers
1429
+ .map((user) => `<option value="${user.id}">${sanitizeHTML(getUserFullName(user))}</option>`)
1430
+ .join('');
1431
+ select.value = JSON.stringify(filteredManagers);
1428
1432
  })
1429
1433
  .catch((e) => catchRejection(e, "Can't fetch users"))
1430
1434
  .finally(() => unsetLoader('#permissions-modal'));