Skip to content

Commit

Permalink
fix(storybook): fix FakeStore api (#1030)
Browse files Browse the repository at this point in the history
Co-authored-by: Black-Hole <158blackhole@gmail.com>
  • Loading branch information
crimx and BlackHole1 committed Oct 25, 2021
1 parent 72e8d1f commit 5ed7415
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const fakeStoreImplProps = [
"onItemMenuClick",
"onItemTitleClick",
"onNewFileName",
"addOnlineH5",
] as const;

type FakeStoreImplProps = typeof fakeStoreImplProps[number];
Expand All @@ -43,6 +44,7 @@ class FakeStore extends CloudStorageStore {
public onItemMenuClick: FakeStoreConfig["onItemMenuClick"];
public onItemTitleClick;
public onNewFileName: FakeStoreConfig["onNewFileName"];
public addOnlineH5;

public pendingUploadTasks: CloudStorageStore["pendingUploadTasks"] = [];
public uploadingUploadTasks: CloudStorageStore["uploadingUploadTasks"] = [];
Expand Down Expand Up @@ -102,6 +104,7 @@ class FakeStore extends CloudStorageStore {
this.onUploadCancel = config.onUploadCancel;
this.onUploadPanelClose = config.onUploadPanelClose;
this.onUploadRetry = config.onUploadRetry;
this.addOnlineH5 = config.addOnlineH5;
this.onItemMenuClick = (fileUUID, menuKey) => {
switch (menuKey) {
case "download": {
Expand Down Expand Up @@ -153,7 +156,7 @@ class FakeStore extends CloudStorageStore {

function fakeStoreArgTypes(): ArgTypes {
return fakeStoreImplProps.reduce((o, k) => {
o[k] = { table: { disable: true } };
o[k] = { table: { disable: true }, action: k };
return o;
}, {} as ArgTypes);
}
Expand Down

0 comments on commit 5ed7415

Please sign in to comment.