@imposium-hub/components 1.26.3 → 1.27.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/components/assets/AssetField.tsx +2 -2
- package/components/assets/AssetsTableNameCell.tsx +2 -15
- package/components/assets/DataTableDnDWrapper.tsx +34 -0
- package/components/data-table/DataTable.tsx +64 -51
- package/dist/components.js +2 -2
- package/dist/components.js.map +1 -1
- package/package.json +1 -1
- package/redux/actions/asset-list.ts +9 -11
- package/services/API.ts +11 -0
package/package.json
CHANGED
|
@@ -60,18 +60,16 @@ export const deleteAssets = (api : IImposiumAPI, ids : string[], storyId : strin
|
|
|
60
60
|
return (dispatch) => {
|
|
61
61
|
if (window.confirm(`Are you sure you want to delete ${ids.length} assets?`)) {
|
|
62
62
|
return new Promise<void>((resolve, reject) => {
|
|
63
|
-
const requests : Array<Promise<any | Error>> = ids.map((id : string) => (api.deleteAsset(id)));
|
|
64
|
-
|
|
65
63
|
dispatch(toggleLoading(true));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
api.deleteAssets(ids)
|
|
65
|
+
.then(() => {
|
|
66
|
+
dispatch(getAssets(api, storyId));
|
|
67
|
+
resolve();
|
|
68
|
+
})
|
|
69
|
+
.catch((errors : Error[]) => {
|
|
70
|
+
dispatch(toggleLoading(false));
|
|
71
|
+
reject();
|
|
72
|
+
});
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
};
|
package/services/API.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface IImposiumAPI {
|
|
|
8
8
|
getAssetItem(assetId : string);
|
|
9
9
|
uploadAsset(storyId : string, tags : string, file : File);
|
|
10
10
|
deleteAsset(assetId : string);
|
|
11
|
+
deleteAssets(assetIds : string[]);
|
|
11
12
|
copyAsset(assetId : string, data);
|
|
12
13
|
addAssetTag(assetId : string, tag : string);
|
|
13
14
|
deleteAssetTag(assetId : string, tag : string);
|
|
@@ -348,6 +349,16 @@ export default class API {
|
|
|
348
349
|
});
|
|
349
350
|
}
|
|
350
351
|
|
|
352
|
+
public deleteAssets = (assetIds : string[]) : Promise<any | Error> => {
|
|
353
|
+
return this.doRequest({
|
|
354
|
+
method: 'DELETE',
|
|
355
|
+
url: `/assets`,
|
|
356
|
+
data: {
|
|
357
|
+
ids: assetIds
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
351
362
|
public copyAsset = (assetId : string, data : any) : Promise<any | Error> => {
|
|
352
363
|
|
|
353
364
|
return this.doRequest({
|