@atlaskit/teams-public 0.2.0 → 0.3.1
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 +20 -0
- package/dist/cjs/common/utils/error/index.js +120 -0
- package/dist/cjs/common/utils/get-container-properties.js +2 -12
- package/dist/cjs/common/utils/http.js +119 -0
- package/dist/cjs/common/utils/status-code-handlers-provider.js +30 -0
- package/dist/cjs/common/utils/team-id-to-ari.js +10 -0
- package/dist/cjs/controllers/hooks/use-team-containers/index.js +79 -0
- package/dist/cjs/controllers/index.js +12 -0
- package/dist/cjs/services/agg-client/index.js +79 -0
- package/dist/cjs/services/agg-client/mocks/index.js +52 -0
- package/dist/cjs/services/agg-client/utils/queries/team-containers-query.js +12 -0
- package/dist/cjs/services/base-client/index.js +92 -0
- package/dist/cjs/services/constants.js +9 -0
- package/dist/cjs/services/graphql-client/index.js +12 -0
- package/dist/cjs/services/graphql-client/main.js +69 -0
- package/dist/cjs/services/graphql-client/types.js +5 -0
- package/dist/cjs/services/graphql-client/utils/index.js +157 -0
- package/dist/cjs/services/index.js +18 -0
- package/dist/cjs/services/main.js +72 -0
- package/dist/cjs/services/types.js +5 -0
- package/dist/cjs/ui/team-containers/add-container-card/index.compiled.css +0 -2
- package/dist/cjs/ui/team-containers/add-container-card/index.js +30 -12
- package/dist/cjs/ui/team-containers/linked-container-card/index.compiled.css +1 -2
- package/dist/cjs/ui/team-containers/linked-container-card/index.js +45 -15
- package/dist/cjs/ui/team-containers/main.js +94 -16
- package/dist/cjs/ui/team-containers/team-containers-skeleton/index.compiled.css +4 -0
- package/dist/cjs/ui/team-containers/team-containers-skeleton/index.js +36 -0
- package/dist/cjs/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.compiled.css +14 -0
- package/dist/cjs/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.js +38 -0
- package/dist/es2019/common/utils/error/index.js +87 -0
- package/dist/es2019/common/utils/get-container-properties.js +3 -13
- package/dist/es2019/common/utils/http.js +82 -0
- package/dist/es2019/common/utils/status-code-handlers-provider.js +25 -0
- package/dist/es2019/common/utils/team-id-to-ari.js +2 -0
- package/dist/es2019/controllers/hooks/use-team-containers/index.js +45 -0
- package/dist/es2019/controllers/index.js +1 -0
- package/dist/es2019/services/agg-client/index.js +36 -0
- package/dist/es2019/services/agg-client/mocks/index.js +46 -0
- package/dist/es2019/services/agg-client/utils/queries/team-containers-query.js +46 -0
- package/dist/es2019/services/base-client/index.js +64 -0
- package/dist/es2019/services/constants.js +3 -0
- package/dist/es2019/services/graphql-client/index.js +1 -0
- package/dist/es2019/services/graphql-client/main.js +23 -0
- package/dist/es2019/services/graphql-client/types.js +1 -0
- package/dist/es2019/services/graphql-client/utils/index.js +76 -0
- package/dist/es2019/services/index.js +1 -0
- package/dist/es2019/services/main.js +39 -0
- package/dist/es2019/services/types.js +1 -0
- package/dist/es2019/ui/team-containers/add-container-card/index.compiled.css +0 -2
- package/dist/es2019/ui/team-containers/add-container-card/index.js +15 -7
- package/dist/es2019/ui/team-containers/linked-container-card/index.compiled.css +1 -2
- package/dist/es2019/ui/team-containers/linked-container-card/index.js +28 -9
- package/dist/es2019/ui/team-containers/main.js +79 -16
- package/dist/es2019/ui/team-containers/team-containers-skeleton/index.compiled.css +4 -0
- package/dist/es2019/ui/team-containers/team-containers-skeleton/index.js +27 -0
- package/dist/es2019/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.compiled.css +14 -0
- package/dist/es2019/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.js +31 -0
- package/dist/esm/common/utils/error/index.js +117 -0
- package/dist/esm/common/utils/get-container-properties.js +3 -13
- package/dist/esm/common/utils/http.js +109 -0
- package/dist/esm/common/utils/status-code-handlers-provider.js +23 -0
- package/dist/esm/common/utils/team-id-to-ari.js +4 -0
- package/dist/esm/controllers/hooks/use-team-containers/index.js +72 -0
- package/dist/esm/controllers/index.js +1 -0
- package/dist/esm/services/agg-client/index.js +72 -0
- package/dist/esm/services/agg-client/mocks/index.js +46 -0
- package/dist/esm/services/agg-client/utils/queries/team-containers-query.js +5 -0
- package/dist/esm/services/base-client/index.js +85 -0
- package/dist/esm/services/constants.js +3 -0
- package/dist/esm/services/graphql-client/index.js +1 -0
- package/dist/esm/services/graphql-client/main.js +62 -0
- package/dist/esm/services/graphql-client/types.js +1 -0
- package/dist/esm/services/graphql-client/utils/index.js +149 -0
- package/dist/esm/services/index.js +1 -0
- package/dist/esm/services/main.js +65 -0
- package/dist/esm/services/types.js +1 -0
- package/dist/esm/ui/team-containers/add-container-card/index.compiled.css +0 -2
- package/dist/esm/ui/team-containers/add-container-card/index.js +25 -7
- package/dist/esm/ui/team-containers/linked-container-card/index.compiled.css +1 -2
- package/dist/esm/ui/team-containers/linked-container-card/index.js +39 -9
- package/dist/esm/ui/team-containers/main.js +91 -16
- package/dist/esm/ui/team-containers/team-containers-skeleton/index.compiled.css +4 -0
- package/dist/esm/ui/team-containers/team-containers-skeleton/index.js +29 -0
- package/dist/esm/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.compiled.css +14 -0
- package/dist/esm/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.js +31 -0
- package/dist/types/common/types.d.ts +1 -1
- package/dist/types/common/utils/error/index.d.ts +59 -0
- package/dist/types/common/utils/http.d.ts +31 -0
- package/dist/types/common/utils/status-code-handlers-provider.d.ts +17 -0
- package/dist/types/common/utils/team-id-to-ari.d.ts +2 -0
- package/dist/types/controllers/hooks/use-team-containers/index.d.ts +12 -0
- package/dist/types/controllers/index.d.ts +1 -0
- package/dist/types/services/agg-client/index.d.ts +15 -0
- package/dist/types/services/agg-client/mocks/index.d.ts +55 -0
- package/dist/types/services/agg-client/utils/queries/team-containers-query.d.ts +44 -0
- package/dist/types/services/base-client/index.d.ts +37 -0
- package/dist/types/services/constants.d.ts +4 -0
- package/dist/types/services/graphql-client/index.d.ts +1 -0
- package/dist/types/services/graphql-client/main.d.ts +8 -0
- package/dist/types/services/graphql-client/types.d.ts +19 -0
- package/dist/types/services/graphql-client/utils/index.d.ts +3 -0
- package/dist/types/services/index.d.ts +1 -0
- package/dist/types/services/main.d.ts +25 -0
- package/dist/types/services/types.d.ts +19 -0
- package/dist/types/ui/team-containers/add-container-card/index.d.ts +3 -2
- package/dist/types/ui/team-containers/linked-container-card/index.d.ts +3 -6
- package/dist/types/ui/team-containers/main.d.ts +3 -1
- package/dist/types/ui/team-containers/team-containers-skeleton/index.d.ts +6 -0
- package/dist/types/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.d.ts +2 -0
- package/dist/types/ui/team-containers/types.d.ts +5 -0
- package/dist/types-ts4.5/common/types.d.ts +1 -1
- package/dist/types-ts4.5/common/utils/error/index.d.ts +59 -0
- package/dist/types-ts4.5/common/utils/http.d.ts +31 -0
- package/dist/types-ts4.5/common/utils/status-code-handlers-provider.d.ts +17 -0
- package/dist/types-ts4.5/common/utils/team-id-to-ari.d.ts +2 -0
- package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +12 -0
- package/dist/types-ts4.5/controllers/index.d.ts +1 -0
- package/dist/types-ts4.5/services/agg-client/index.d.ts +15 -0
- package/dist/types-ts4.5/services/agg-client/mocks/index.d.ts +55 -0
- package/dist/types-ts4.5/services/agg-client/utils/queries/team-containers-query.d.ts +44 -0
- package/dist/types-ts4.5/services/base-client/index.d.ts +37 -0
- package/dist/types-ts4.5/services/constants.d.ts +4 -0
- package/dist/types-ts4.5/services/graphql-client/index.d.ts +1 -0
- package/dist/types-ts4.5/services/graphql-client/main.d.ts +8 -0
- package/dist/types-ts4.5/services/graphql-client/types.d.ts +19 -0
- package/dist/types-ts4.5/services/graphql-client/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/services/index.d.ts +1 -0
- package/dist/types-ts4.5/services/main.d.ts +25 -0
- package/dist/types-ts4.5/services/types.d.ts +19 -0
- package/dist/types-ts4.5/ui/team-containers/add-container-card/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/team-containers/linked-container-card/index.d.ts +3 -6
- package/dist/types-ts4.5/ui/team-containers/main.d.ts +3 -1
- package/dist/types-ts4.5/ui/team-containers/team-containers-skeleton/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/team-containers/team-containers-skeleton/linked-container-card-skeleton/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/team-containers/types.d.ts +5 -0
- package/package.json +13 -9
- package/dist/cjs/ui/team-containers/constants.js +0 -7
- package/dist/es2019/ui/team-containers/constants.js +0 -1
- package/dist/esm/ui/team-containers/constants.js +0 -1
- package/dist/types/ui/team-containers/constants.d.ts +0 -1
- package/dist/types-ts4.5/ui/team-containers/constants.d.ts +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ClientContext, type ClientContextProps } from '../types';
|
|
2
|
+
type NestedContext = {
|
|
3
|
+
[key: string]: string | number | boolean | NestedContext;
|
|
4
|
+
};
|
|
5
|
+
export type LogExceptionFN = (ex: unknown | Error, name: string, context?: NestedContext & {
|
|
6
|
+
tags?: Record<string, string>;
|
|
7
|
+
}) => void;
|
|
8
|
+
export type ClientConfig = {
|
|
9
|
+
logException: LogExceptionFN;
|
|
10
|
+
};
|
|
11
|
+
export declare class BaseClient {
|
|
12
|
+
private config;
|
|
13
|
+
private context;
|
|
14
|
+
private cache;
|
|
15
|
+
constructor(config: ClientConfig);
|
|
16
|
+
setContext(context: ClientContextProps): void;
|
|
17
|
+
getContext(): ClientContext;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param localValue is used for backwards compatibility
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
getOrgId(localValue?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param localValue is used for backwards compatibility
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
getCloudId(localValue?: string): string | null | undefined;
|
|
30
|
+
logException: (ex: unknown | Error, name: string, context?: NestedContext & {
|
|
31
|
+
tags?: Record<string, string>;
|
|
32
|
+
}) => void;
|
|
33
|
+
private keyWithContext;
|
|
34
|
+
cacheValue<T>(key: string, value: T, expiryMs?: number): void;
|
|
35
|
+
getCachedValue<T>(key: string): T | undefined;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BaseGraphQlClient } from './main';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseClient, type ClientConfig } from '../base-client';
|
|
2
|
+
import { type Body, type Options, type ResultResponse } from './types';
|
|
3
|
+
export declare class BaseGraphQlClient extends BaseClient {
|
|
4
|
+
private serviceUrl;
|
|
5
|
+
constructor(serviceUrl: string, config: ClientConfig);
|
|
6
|
+
setServiceUrl(serviceUrl: string): void;
|
|
7
|
+
makeGraphQLRequest<Key extends string, Data = unknown, Variables = unknown>(body: Body<Variables>, options?: Options): Promise<ResultResponse<Key, Data>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ErrorData } from '../../common/utils/error';
|
|
2
|
+
export interface Options {
|
|
3
|
+
operationName?: string;
|
|
4
|
+
errorPolicy?: 'none' | 'all' | 'ignore';
|
|
5
|
+
}
|
|
6
|
+
export type InnerResponse<T> = {
|
|
7
|
+
data: T;
|
|
8
|
+
errors?: ErrorData[];
|
|
9
|
+
};
|
|
10
|
+
export type ResultResponse<Key extends string, Data> = {
|
|
11
|
+
[name in Key]: Data;
|
|
12
|
+
};
|
|
13
|
+
export type Body<Variables> = {
|
|
14
|
+
query: string;
|
|
15
|
+
variables?: Variables;
|
|
16
|
+
};
|
|
17
|
+
export type GraphQLRequestDataResponse<Data> = Data | {
|
|
18
|
+
response: Response;
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type Body, type GraphQLRequestDataResponse, type Options, type ResultResponse } from '../types';
|
|
2
|
+
export declare function makeGraphQLRequestWithoutRetries<Data, Variables>(serviceUrl: string, body: Body<Variables>, options?: Options): Promise<GraphQLRequestDataResponse<Data>>;
|
|
3
|
+
export declare function handleGraphQLRequest<Key extends string, Data = unknown, Variables = unknown>(serviceUrl: string, body: Body<Variables>, options?: Options): Promise<ResultResponse<Key, Data>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { teamsClient, TeamsClient } from './main';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ClientContextProps, type TeamContainers } from './types';
|
|
2
|
+
export declare class TeamsClient {
|
|
3
|
+
private readonly _aggClient;
|
|
4
|
+
constructor(
|
|
5
|
+
/**
|
|
6
|
+
* @param {ClientContextProps} context - Context including CloudId & OrgId to be used for all requests
|
|
7
|
+
*/
|
|
8
|
+
context?: ClientContextProps);
|
|
9
|
+
/**
|
|
10
|
+
* Sets the base URL to be used in the client requests
|
|
11
|
+
* @param {string} baseUrl - The new base URL
|
|
12
|
+
*/
|
|
13
|
+
setBaseUrl(baseUrl: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Sets context including CloudId & OrgId to be used for all requests
|
|
16
|
+
*/
|
|
17
|
+
setContext(context: ClientContextProps): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get the containers for a given team
|
|
20
|
+
* @param {string} teamId
|
|
21
|
+
* @returns {Promise<TeamContainers>}
|
|
22
|
+
*/
|
|
23
|
+
getTeamContainers(teamId: string): Promise<TeamContainers>;
|
|
24
|
+
}
|
|
25
|
+
export declare const teamsClient: TeamsClient;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ContainerTypes } from '../common/types';
|
|
2
|
+
export type ClientContext = {
|
|
3
|
+
cloudId?: string | null;
|
|
4
|
+
orgId?: string;
|
|
5
|
+
userId?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ClientContextProps = {
|
|
8
|
+
cloudId?: string | null;
|
|
9
|
+
orgId?: string;
|
|
10
|
+
userId?: string;
|
|
11
|
+
};
|
|
12
|
+
export type TeamContainers = Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
type: ContainerTypes;
|
|
15
|
+
name: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
createdDate: Date;
|
|
18
|
+
link: string;
|
|
19
|
+
}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type ContainerTypes } from '../../../common/types';
|
|
3
3
|
interface AddContainerCardProps {
|
|
4
4
|
containerType: ContainerTypes;
|
|
5
|
+
onAddAContainerClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
6
|
}
|
|
6
|
-
export declare const AddContainerCard: ({ containerType }: AddContainerCardProps) => JSX.Element;
|
|
7
|
+
export declare const AddContainerCard: ({ containerType, onAddAContainerClick, }: AddContainerCardProps) => React.JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
1
|
+
import React from 'react';
|
|
6
2
|
import { type ContainerTypes } from '../../../common/types';
|
|
7
3
|
interface LinkedContainerCardProps {
|
|
8
4
|
containerType: ContainerTypes;
|
|
9
5
|
title: string;
|
|
10
6
|
containerIcon: string;
|
|
7
|
+
link: string;
|
|
11
8
|
}
|
|
12
|
-
export declare const LinkedContainerCard: ({ containerType, title, containerIcon, }: LinkedContainerCardProps) => JSX.Element;
|
|
9
|
+
export declare const LinkedContainerCard: ({ containerType, title, containerIcon, link, }: LinkedContainerCardProps) => React.JSX.Element;
|
|
13
10
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type TeamContainerProps } from './types';
|
|
2
3
|
export declare const ICON_BACKGROUND: "var(--ds-icon-inverse)";
|
|
3
4
|
export declare const ICON_COLOR: "var(--ds-icon-subtle)";
|
|
4
|
-
export declare const
|
|
5
|
+
export declare const MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
|
|
6
|
+
export declare const TeamContainers: ({ teamId, onAddAContainerClick }: TeamContainerProps) => React.JSX.Element;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface TeamContainerProps {
|
|
2
3
|
/**
|
|
3
4
|
* The team id to fetch the team container for
|
|
4
5
|
*/
|
|
5
6
|
teamId: string;
|
|
7
|
+
/**
|
|
8
|
+
* The function to call when the add a container button is clicked
|
|
9
|
+
*/
|
|
10
|
+
onAddAContainerClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
11
|
}
|
package/package.json
CHANGED
|
@@ -30,19 +30,22 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/button": "^20.4.0",
|
|
33
|
-
"@atlaskit/css": "^0.
|
|
34
|
-
"@atlaskit/icon": "^23.
|
|
33
|
+
"@atlaskit/css": "^0.9.0",
|
|
34
|
+
"@atlaskit/icon": "^23.10.0",
|
|
35
35
|
"@atlaskit/image": "^1.4.0",
|
|
36
|
-
"@atlaskit/link": "^2.
|
|
37
|
-
"@atlaskit/logo": "^15.
|
|
36
|
+
"@atlaskit/link": "^2.2.0",
|
|
37
|
+
"@atlaskit/logo": "^15.4.0",
|
|
38
38
|
"@atlaskit/menu": "^2.14.0",
|
|
39
|
-
"@atlaskit/primitives": "^13.
|
|
40
|
-
"@atlaskit/theme": "^
|
|
39
|
+
"@atlaskit/primitives": "^13.6.0",
|
|
40
|
+
"@atlaskit/theme": "^16.0.0",
|
|
41
41
|
"@atlaskit/tokens": "^3.3.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
|
-
"@compiled/react": "^0.18.
|
|
43
|
+
"@compiled/react": "^0.18.2",
|
|
44
|
+
"graphql": "^15.8.0",
|
|
45
|
+
"graphql-tag": "^2.10.1",
|
|
44
46
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
45
|
-
"react-router-dom": "^6.28.0"
|
|
47
|
+
"react-router-dom": "^6.28.0",
|
|
48
|
+
"react-sweet-state": "^2.6.5"
|
|
46
49
|
},
|
|
47
50
|
"peerDependencies": {
|
|
48
51
|
"react": "^18.2.0"
|
|
@@ -53,6 +56,7 @@
|
|
|
53
56
|
"@atlaskit/ssr": "*",
|
|
54
57
|
"@atlaskit/visual-regression": "*",
|
|
55
58
|
"@testing-library/react": "^13.4.0",
|
|
59
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
56
60
|
"@testing-library/user-event": "^14.4.3",
|
|
57
61
|
"react-dom": "^18.2.0",
|
|
58
62
|
"typescript": "~5.4.2"
|
|
@@ -96,7 +100,7 @@
|
|
|
96
100
|
}
|
|
97
101
|
},
|
|
98
102
|
"name": "@atlaskit/teams-public",
|
|
99
|
-
"version": "0.
|
|
103
|
+
"version": "0.3.1",
|
|
100
104
|
"description": "Public components related to teams",
|
|
101
105
|
"author": "Atlassian Pty Ltd",
|
|
102
106
|
"license": "Apache-2.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const PROGRESS_BAR_TEST_ID = 'myProgressBar';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var PROGRESS_BAR_TEST_ID = 'myProgressBar';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PROGRESS_BAR_TEST_ID = "myProgressBar";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PROGRESS_BAR_TEST_ID = "myProgressBar";
|