@atlaskit/teams-public 0.70.7 → 0.70.9
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/CHANGELOG.md +12 -0
- package/dist/cjs/common/utils/spaceInviteScheduler.js +53 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/ui/team-containers/main.js +4 -0
- package/dist/es2019/common/utils/spaceInviteScheduler.js +45 -0
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/team-containers/main.js +4 -0
- package/dist/esm/common/utils/spaceInviteScheduler.js +47 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/team-containers/main.js +4 -0
- package/dist/types/common/utils/spaceInviteScheduler.d.ts +13 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types-ts4.5/common/utils/spaceInviteScheduler.d.ts +13 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/package.json +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.spaceInviteScheduler = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* FE debounce mechanism to avoid spamming invites when users consecutively
|
|
9
|
+
* link and unlink teams from containers in quick succession. We'll log the
|
|
10
|
+
* frequency of this occurring and decide whether to move debouncing to the
|
|
11
|
+
* BE as a productionisation task.
|
|
12
|
+
*
|
|
13
|
+
* Uses module-level state rather than a globalThis singleton to avoid polluting
|
|
14
|
+
* the global scope — a simple in-memory workaround is sufficient here.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var DEBOUNCE_MS = 30000;
|
|
18
|
+
var pending = new Map();
|
|
19
|
+
|
|
20
|
+
// Callers pass IDs in different formats — the teams package passes full ARIs
|
|
21
|
+
// (e.g. "ari:cloud:identity::team/uuid") while teams-public passes bare IDs
|
|
22
|
+
// (e.g. "uuid"). Normalize to just the resource ID after the last "/" so both
|
|
23
|
+
// formats produce the same map key.
|
|
24
|
+
var extractId = function extractId(ari) {
|
|
25
|
+
var lastSlash = ari.lastIndexOf('/');
|
|
26
|
+
return lastSlash === -1 ? ari : ari.substring(lastSlash + 1);
|
|
27
|
+
};
|
|
28
|
+
var getKey = function getKey(teamId, containerId) {
|
|
29
|
+
return "".concat(extractId(teamId), ":").concat(extractId(containerId));
|
|
30
|
+
};
|
|
31
|
+
var spaceInviteScheduler = exports.spaceInviteScheduler = {
|
|
32
|
+
scheduleInvite: function scheduleInvite(teamId, containerId, callback) {
|
|
33
|
+
var key = getKey(teamId, containerId);
|
|
34
|
+
var existing = pending.get(key);
|
|
35
|
+
if (existing) {
|
|
36
|
+
clearTimeout(existing.timeoutId);
|
|
37
|
+
}
|
|
38
|
+
pending.set(key, {
|
|
39
|
+
timeoutId: setTimeout(function () {
|
|
40
|
+
pending.delete(key);
|
|
41
|
+
callback();
|
|
42
|
+
}, DEBOUNCE_MS)
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
cancelInvite: function cancelInvite(teamId, containerId) {
|
|
46
|
+
var key = getKey(teamId, containerId);
|
|
47
|
+
var existing = pending.get(key);
|
|
48
|
+
if (existing) {
|
|
49
|
+
clearTimeout(existing.timeoutId);
|
|
50
|
+
pending.delete(key);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -63,6 +63,12 @@ Object.defineProperty(exports, "hasProductPermission", {
|
|
|
63
63
|
return _utils.hasProductPermission;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "spaceInviteScheduler", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _spaceInviteScheduler.spaceInviteScheduler;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
66
72
|
Object.defineProperty(exports, "useConnectedTeams", {
|
|
67
73
|
enumerable: true,
|
|
68
74
|
get: function get() {
|
|
@@ -117,4 +123,5 @@ var _utils = require("./controllers/product-permission/utils");
|
|
|
117
123
|
var _getContainerProperties = require("./common/utils/get-container-properties");
|
|
118
124
|
var _assets = require("./common/assets");
|
|
119
125
|
var _separator = require("./common/ui/separator");
|
|
120
|
-
var _getIsExperimentEnabled = require("./common/utils/get-is-experiment-enabled");
|
|
126
|
+
var _getIsExperimentEnabled = require("./common/utils/get-is-experiment-enabled");
|
|
127
|
+
var _spaceInviteScheduler = require("./common/utils/spaceInviteScheduler");
|
|
@@ -20,6 +20,7 @@ var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics
|
|
|
20
20
|
var _teamsAppInternalProductPermissions = require("@atlaskit/teams-app-internal-product-permissions");
|
|
21
21
|
var _colors = require("@atlaskit/theme/colors");
|
|
22
22
|
var _teamContainersSkeleton = require("../../common/ui/team-containers-skeleton");
|
|
23
|
+
var _spaceInviteScheduler = require("../../common/utils/spaceInviteScheduler");
|
|
23
24
|
var _controllers = require("../../controllers");
|
|
24
25
|
var _useCreateContainers3 = require("../../controllers/hooks/use-create-containers");
|
|
25
26
|
var _useProductPermission3 = require("../../controllers/hooks/use-product-permission");
|
|
@@ -218,6 +219,9 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
218
219
|
if (unlinkError) {
|
|
219
220
|
fireEvent('track.teamContainerUnlinked.failed', {});
|
|
220
221
|
} else {
|
|
222
|
+
if ((0, _platformFeatureFlags.fg)('space-team_linking_invites_fg')) {
|
|
223
|
+
_spaceInviteScheduler.spaceInviteScheduler.cancelInvite(teamId, containerId);
|
|
224
|
+
}
|
|
221
225
|
fireEvent('track.teamContainerUnlinked.succeeded', {
|
|
222
226
|
containerRemoved: {
|
|
223
227
|
containerId: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.id,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FE debounce mechanism to avoid spamming invites when users consecutively
|
|
3
|
+
* link and unlink teams from containers in quick succession. We'll log the
|
|
4
|
+
* frequency of this occurring and decide whether to move debouncing to the
|
|
5
|
+
* BE as a productionisation task.
|
|
6
|
+
*
|
|
7
|
+
* Uses module-level state rather than a globalThis singleton to avoid polluting
|
|
8
|
+
* the global scope — a simple in-memory workaround is sufficient here.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const DEBOUNCE_MS = 30_000;
|
|
12
|
+
const pending = new Map();
|
|
13
|
+
|
|
14
|
+
// Callers pass IDs in different formats — the teams package passes full ARIs
|
|
15
|
+
// (e.g. "ari:cloud:identity::team/uuid") while teams-public passes bare IDs
|
|
16
|
+
// (e.g. "uuid"). Normalize to just the resource ID after the last "/" so both
|
|
17
|
+
// formats produce the same map key.
|
|
18
|
+
const extractId = ari => {
|
|
19
|
+
const lastSlash = ari.lastIndexOf('/');
|
|
20
|
+
return lastSlash === -1 ? ari : ari.substring(lastSlash + 1);
|
|
21
|
+
};
|
|
22
|
+
const getKey = (teamId, containerId) => `${extractId(teamId)}:${extractId(containerId)}`;
|
|
23
|
+
export const spaceInviteScheduler = {
|
|
24
|
+
scheduleInvite: (teamId, containerId, callback) => {
|
|
25
|
+
const key = getKey(teamId, containerId);
|
|
26
|
+
const existing = pending.get(key);
|
|
27
|
+
if (existing) {
|
|
28
|
+
clearTimeout(existing.timeoutId);
|
|
29
|
+
}
|
|
30
|
+
pending.set(key, {
|
|
31
|
+
timeoutId: setTimeout(() => {
|
|
32
|
+
pending.delete(key);
|
|
33
|
+
callback();
|
|
34
|
+
}, DEBOUNCE_MS)
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
cancelInvite: (teamId, containerId) => {
|
|
38
|
+
const key = getKey(teamId, containerId);
|
|
39
|
+
const existing = pending.get(key);
|
|
40
|
+
if (existing) {
|
|
41
|
+
clearTimeout(existing.timeoutId);
|
|
42
|
+
pending.delete(key);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
package/dist/es2019/index.js
CHANGED
|
@@ -10,4 +10,5 @@ export { hasProductPermission } from './controllers/product-permission/utils';
|
|
|
10
10
|
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
11
11
|
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
12
12
|
export { Separator } from './common/ui/separator';
|
|
13
|
-
export { getIsExperimentEnabled } from './common/utils/get-is-experiment-enabled';
|
|
13
|
+
export { getIsExperimentEnabled } from './common/utils/get-is-experiment-enabled';
|
|
14
|
+
export { spaceInviteScheduler } from './common/utils/spaceInviteScheduler';
|
|
@@ -10,6 +10,7 @@ import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
|
10
10
|
import { hasProductPermission, useProductPermissions } from '@atlaskit/teams-app-internal-product-permissions';
|
|
11
11
|
import { N0, N90 } from '@atlaskit/theme/colors';
|
|
12
12
|
import { TeamContainersSkeleton } from '../../common/ui/team-containers-skeleton';
|
|
13
|
+
import { spaceInviteScheduler } from '../../common/utils/spaceInviteScheduler';
|
|
13
14
|
import { hasProductPermission as hasProductPermissionOld } from '../../controllers';
|
|
14
15
|
import { useCreateContainers } from '../../controllers/hooks/use-create-containers';
|
|
15
16
|
import { useProductPermissions as useProductPermissionsOld } from '../../controllers/hooks/use-product-permission';
|
|
@@ -169,6 +170,9 @@ export const TeamContainers = ({
|
|
|
169
170
|
if (unlinkError) {
|
|
170
171
|
fireEvent('track.teamContainerUnlinked.failed', {});
|
|
171
172
|
} else {
|
|
173
|
+
if (fg('space-team_linking_invites_fg')) {
|
|
174
|
+
spaceInviteScheduler.cancelInvite(teamId, containerId);
|
|
175
|
+
}
|
|
172
176
|
fireEvent('track.teamContainerUnlinked.succeeded', {
|
|
173
177
|
containerRemoved: {
|
|
174
178
|
containerId: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.id,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FE debounce mechanism to avoid spamming invites when users consecutively
|
|
3
|
+
* link and unlink teams from containers in quick succession. We'll log the
|
|
4
|
+
* frequency of this occurring and decide whether to move debouncing to the
|
|
5
|
+
* BE as a productionisation task.
|
|
6
|
+
*
|
|
7
|
+
* Uses module-level state rather than a globalThis singleton to avoid polluting
|
|
8
|
+
* the global scope — a simple in-memory workaround is sufficient here.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
var DEBOUNCE_MS = 30000;
|
|
12
|
+
var pending = new Map();
|
|
13
|
+
|
|
14
|
+
// Callers pass IDs in different formats — the teams package passes full ARIs
|
|
15
|
+
// (e.g. "ari:cloud:identity::team/uuid") while teams-public passes bare IDs
|
|
16
|
+
// (e.g. "uuid"). Normalize to just the resource ID after the last "/" so both
|
|
17
|
+
// formats produce the same map key.
|
|
18
|
+
var extractId = function extractId(ari) {
|
|
19
|
+
var lastSlash = ari.lastIndexOf('/');
|
|
20
|
+
return lastSlash === -1 ? ari : ari.substring(lastSlash + 1);
|
|
21
|
+
};
|
|
22
|
+
var getKey = function getKey(teamId, containerId) {
|
|
23
|
+
return "".concat(extractId(teamId), ":").concat(extractId(containerId));
|
|
24
|
+
};
|
|
25
|
+
export var spaceInviteScheduler = {
|
|
26
|
+
scheduleInvite: function scheduleInvite(teamId, containerId, callback) {
|
|
27
|
+
var key = getKey(teamId, containerId);
|
|
28
|
+
var existing = pending.get(key);
|
|
29
|
+
if (existing) {
|
|
30
|
+
clearTimeout(existing.timeoutId);
|
|
31
|
+
}
|
|
32
|
+
pending.set(key, {
|
|
33
|
+
timeoutId: setTimeout(function () {
|
|
34
|
+
pending.delete(key);
|
|
35
|
+
callback();
|
|
36
|
+
}, DEBOUNCE_MS)
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
cancelInvite: function cancelInvite(teamId, containerId) {
|
|
40
|
+
var key = getKey(teamId, containerId);
|
|
41
|
+
var existing = pending.get(key);
|
|
42
|
+
if (existing) {
|
|
43
|
+
clearTimeout(existing.timeoutId);
|
|
44
|
+
pending.delete(key);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -10,4 +10,5 @@ export { hasProductPermission } from './controllers/product-permission/utils';
|
|
|
10
10
|
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
11
11
|
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
12
12
|
export { Separator } from './common/ui/separator';
|
|
13
|
-
export { getIsExperimentEnabled } from './common/utils/get-is-experiment-enabled';
|
|
13
|
+
export { getIsExperimentEnabled } from './common/utils/get-is-experiment-enabled';
|
|
14
|
+
export { spaceInviteScheduler } from './common/utils/spaceInviteScheduler';
|
|
@@ -13,6 +13,7 @@ import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
|
13
13
|
import { hasProductPermission, useProductPermissions } from '@atlaskit/teams-app-internal-product-permissions';
|
|
14
14
|
import { N0, N90 } from '@atlaskit/theme/colors';
|
|
15
15
|
import { TeamContainersSkeleton } from '../../common/ui/team-containers-skeleton';
|
|
16
|
+
import { spaceInviteScheduler } from '../../common/utils/spaceInviteScheduler';
|
|
16
17
|
import { hasProductPermission as hasProductPermissionOld } from '../../controllers';
|
|
17
18
|
import { useCreateContainers } from '../../controllers/hooks/use-create-containers';
|
|
18
19
|
import { useProductPermissions as useProductPermissionsOld } from '../../controllers/hooks/use-product-permission';
|
|
@@ -208,6 +209,9 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
208
209
|
if (unlinkError) {
|
|
209
210
|
fireEvent('track.teamContainerUnlinked.failed', {});
|
|
210
211
|
} else {
|
|
212
|
+
if (fg('space-team_linking_invites_fg')) {
|
|
213
|
+
spaceInviteScheduler.cancelInvite(teamId, containerId);
|
|
214
|
+
}
|
|
211
215
|
fireEvent('track.teamContainerUnlinked.succeeded', {
|
|
212
216
|
containerRemoved: {
|
|
213
217
|
containerId: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.id,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FE debounce mechanism to avoid spamming invites when users consecutively
|
|
3
|
+
* link and unlink teams from containers in quick succession. We'll log the
|
|
4
|
+
* frequency of this occurring and decide whether to move debouncing to the
|
|
5
|
+
* BE as a productionisation task.
|
|
6
|
+
*
|
|
7
|
+
* Uses module-level state rather than a globalThis singleton to avoid polluting
|
|
8
|
+
* the global scope — a simple in-memory workaround is sufficient here.
|
|
9
|
+
*/
|
|
10
|
+
export declare const spaceInviteScheduler: {
|
|
11
|
+
scheduleInvite: (teamId: string, containerId: string, callback: () => void) => void;
|
|
12
|
+
cancelInvite: (teamId: string, containerId: string) => void;
|
|
13
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { getContainerProperties } from './common/utils/get-container-properties'
|
|
|
16
16
|
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
17
17
|
export { Separator } from './common/ui/separator';
|
|
18
18
|
export { getIsExperimentEnabled } from './common/utils/get-is-experiment-enabled';
|
|
19
|
+
export { spaceInviteScheduler } from './common/utils/spaceInviteScheduler';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FE debounce mechanism to avoid spamming invites when users consecutively
|
|
3
|
+
* link and unlink teams from containers in quick succession. We'll log the
|
|
4
|
+
* frequency of this occurring and decide whether to move debouncing to the
|
|
5
|
+
* BE as a productionisation task.
|
|
6
|
+
*
|
|
7
|
+
* Uses module-level state rather than a globalThis singleton to avoid polluting
|
|
8
|
+
* the global scope — a simple in-memory workaround is sufficient here.
|
|
9
|
+
*/
|
|
10
|
+
export declare const spaceInviteScheduler: {
|
|
11
|
+
scheduleInvite: (teamId: string, containerId: string, callback: () => void) => void;
|
|
12
|
+
cancelInvite: (teamId: string, containerId: string) => void;
|
|
13
|
+
};
|
|
@@ -16,3 +16,4 @@ export { getContainerProperties } from './common/utils/get-container-properties'
|
|
|
16
16
|
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
17
17
|
export { Separator } from './common/ui/separator';
|
|
18
18
|
export { getIsExperimentEnabled } from './common/utils/get-is-experiment-enabled';
|
|
19
|
+
export { spaceInviteScheduler } from './common/utils/spaceInviteScheduler';
|
package/package.json
CHANGED
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/afm-i18n-platform-people-and-teams-teams-public": "2.39.0",
|
|
28
28
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
29
|
-
"@atlaskit/avatar": "^25.
|
|
29
|
+
"@atlaskit/avatar": "^25.10.0",
|
|
30
30
|
"@atlaskit/button": "^23.10.0",
|
|
31
31
|
"@atlaskit/css": "^0.19.0",
|
|
32
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
32
|
+
"@atlaskit/dropdown-menu": "^16.7.0",
|
|
33
33
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
34
34
|
"@atlaskit/heading": "^5.3.0",
|
|
35
|
-
"@atlaskit/icon": "^
|
|
35
|
+
"@atlaskit/icon": "^33.0.0",
|
|
36
36
|
"@atlaskit/image": "^3.0.0",
|
|
37
37
|
"@atlaskit/link": "^3.3.0",
|
|
38
38
|
"@atlaskit/modal-dialog": "^14.11.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@atlaskit/teams-app-internal-product-permissions": "^1.2.0",
|
|
45
45
|
"@atlaskit/teams-client": "^4.30.0",
|
|
46
46
|
"@atlaskit/theme": "^22.0.0",
|
|
47
|
-
"@atlaskit/tokens": "^11.
|
|
48
|
-
"@atlaskit/tooltip": "^
|
|
47
|
+
"@atlaskit/tokens": "^11.1.0",
|
|
48
|
+
"@atlaskit/tooltip": "^21.0.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@compiled/react": "^0.20.0",
|
|
51
51
|
"@types/string-hash": "^1.1.3",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@af/integration-testing": "workspace:^",
|
|
65
65
|
"@af/visual-regression": "workspace:^",
|
|
66
66
|
"@atlaskit/ssr": "workspace:^",
|
|
67
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
67
|
+
"@atlassian/a11y-jest-testing": "^0.10.0",
|
|
68
68
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
69
69
|
"@atlassian/ptc-test-utils": "^0.12.0",
|
|
70
70
|
"@atlassian/testing-library": "^0.4.0",
|
|
@@ -82,7 +82,6 @@
|
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
"@repo/internal": {
|
|
85
|
-
"dom-events": "use-bind-event-listener",
|
|
86
85
|
"analytics": [
|
|
87
86
|
"analytics-next"
|
|
88
87
|
],
|
|
@@ -108,7 +107,7 @@
|
|
|
108
107
|
}
|
|
109
108
|
},
|
|
110
109
|
"name": "@atlaskit/teams-public",
|
|
111
|
-
"version": "0.70.
|
|
110
|
+
"version": "0.70.9",
|
|
112
111
|
"description": "Public components related to teams",
|
|
113
112
|
"author": "Atlassian Pty Ltd",
|
|
114
113
|
"license": "Apache-2.0",
|
|
@@ -140,6 +139,9 @@
|
|
|
140
139
|
},
|
|
141
140
|
"ptc-missed-analytics-migration-events": {
|
|
142
141
|
"type": "boolean"
|
|
142
|
+
},
|
|
143
|
+
"space-team_linking_invites_fg": {
|
|
144
|
+
"type": "boolean"
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
147
|
}
|