@bindu-dashing/dam-solution-v2 5.9.205 → 5.9.206

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,5 +1,6 @@
1
- declare const CreateClient: ({ onSuccess, clientSubdomain, teamsApi, username, password, existingClientData, }: {
1
+ declare const CreateClient: ({ onSuccess, onRefreshSuccess, clientSubdomain, teamsApi, username, password, existingClientData, }: {
2
2
  onSuccess: (data: any) => void;
3
+ onRefreshSuccess?: (data: any) => void;
3
4
  clientSubdomain: string;
4
5
  teamsApi: string;
5
6
  username: string;
@@ -18,7 +18,7 @@ import { showNotification } from "../common/notifications";
18
18
  import { NotificationStatus } from "../utilities/constants/interface";
19
19
  import { SOMETHING_WENT_WRONG } from "../utilities/constants/messages";
20
20
  import { get } from "lodash";
21
- const CreateClient = ({ onSuccess, clientSubdomain, teamsApi, username, password, existingClientData, }) => {
21
+ const CreateClient = ({ onSuccess, onRefreshSuccess, clientSubdomain, teamsApi, username, password, existingClientData, }) => {
22
22
  const [showForm, setShowForm] = useState(false);
23
23
  const [refreshingKey, setRefreshingKey] = useState(false);
24
24
  const isEditMode = !!existingClientData;
@@ -32,6 +32,10 @@ const CreateClient = ({ onSuccess, clientSubdomain, teamsApi, username, password
32
32
  showNotification("Access key and secret key are required to refresh", NotificationStatus.ERROR);
33
33
  return;
34
34
  }
35
+ if (!(damConfig === null || damConfig === void 0 ? void 0 : damConfig.accessToken)) {
36
+ showNotification("Authentication token is not available. Please wait for the page to load or try again.", NotificationStatus.ERROR);
37
+ return;
38
+ }
35
39
  setRefreshingKey(true);
36
40
  try {
37
41
  const response = yield api.put(REFRESH_KEY_URL, {
@@ -40,7 +44,10 @@ const CreateClient = ({ onSuccess, clientSubdomain, teamsApi, username, password
40
44
  });
41
45
  setRefreshingKey(false);
42
46
  showNotification(get(response, "data.message", "Key refreshed successfully"), NotificationStatus.SUCCESS);
43
- if (onSuccess) {
47
+ if (onRefreshSuccess) {
48
+ onRefreshSuccess(response === null || response === void 0 ? void 0 : response.data);
49
+ }
50
+ else if (onSuccess) {
44
51
  onSuccess(response === null || response === void 0 ? void 0 : response.data);
45
52
  }
46
53
  }
@@ -7,6 +7,7 @@ declare function App(props: {
7
7
  username: string;
8
8
  password: string;
9
9
  onSuccess: (data: any) => void;
10
+ onRefreshSuccess?: (data: any) => void;
10
11
  teamIds: string[] | number[];
11
12
  styles: Record<string, any>;
12
13
  appType: string;
@@ -15,6 +15,6 @@ function App(props) {
15
15
  styles: props === null || props === void 0 ? void 0 : props.styles,
16
16
  appType: props === null || props === void 0 ? void 0 : props.appType,
17
17
  };
18
- return (_jsx(DamConfigProvider, { config: config, children: _jsxs(ThemeProvider, { styles: props === null || props === void 0 ? void 0 : props.styles, sessionTheme: ThemeModes.LIGHT, children: [_jsx(CreateClient, { teamsApi: props === null || props === void 0 ? void 0 : props.teamsApi, username: props === null || props === void 0 ? void 0 : props.username, password: props === null || props === void 0 ? void 0 : props.password, clientSubdomain: props === null || props === void 0 ? void 0 : props.clientSubdomain, onSuccess: props === null || props === void 0 ? void 0 : props.onSuccess, existingClientData: props === null || props === void 0 ? void 0 : props.existingClientData }), _jsx(ToastProvider, {})] }) }));
18
+ return (_jsx(DamConfigProvider, { config: config, children: _jsxs(ThemeProvider, { styles: props === null || props === void 0 ? void 0 : props.styles, sessionTheme: ThemeModes.LIGHT, children: [_jsx(CreateClient, { teamsApi: props === null || props === void 0 ? void 0 : props.teamsApi, username: props === null || props === void 0 ? void 0 : props.username, password: props === null || props === void 0 ? void 0 : props.password, clientSubdomain: props === null || props === void 0 ? void 0 : props.clientSubdomain, onSuccess: props === null || props === void 0 ? void 0 : props.onSuccess, onRefreshSuccess: props === null || props === void 0 ? void 0 : props.onRefreshSuccess, existingClientData: props === null || props === void 0 ? void 0 : props.existingClientData }), _jsx(ToastProvider, {})] }) }));
19
19
  }
20
20
  export default App;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bindu-dashing/dam-solution-v2",
3
- "version": "5.9.205",
3
+ "version": "5.9.206",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.0.1",
6
6
  "@emoji-mart/data": "^1.2.1",