-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed List behaviour * removed console log
- Loading branch information
Showing
3 changed files
with
131 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,94 @@ | ||
import React from "react"; | ||
import { storiesOf } from "@storybook/react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import StoryRouter from "storybook-react-router"; | ||
import ItemContainer from ".."; | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import StoryRouter from 'storybook-react-router'; | ||
import ItemsContainer from '..'; | ||
import { withKnobs, object } from '@storybook/addon-knobs'; | ||
|
||
const projectItems = [ | ||
{ | ||
id: "1234", | ||
key: "abc123", | ||
title: "Sample Simple Card Title One", | ||
description: "This is a sample card description. This is fun!", | ||
url: "/projects/1/transcripts/5678", | ||
display: true | ||
}, | ||
{ | ||
id: "5678", | ||
key: "def456", | ||
title: "Sample Simple Card Title Two", | ||
description: "This is a sample card description. This is fun!", | ||
display: true, | ||
url: "/projects/1/transcripts/5678" | ||
} | ||
]; | ||
|
||
const transcriptItems = [ | ||
{ | ||
id: "1", | ||
projectId: "p1", | ||
key: "transcript_key_1", | ||
title: "Title - Done Transcript", | ||
description: "This transcript has finished processing.", | ||
url: "/projects/1/transcripts/", | ||
status: "done", | ||
display: true | ||
}, | ||
{ | ||
id: "2", | ||
projectId: "p1", | ||
key: "transcript_key_2", | ||
title: "Title - In Progress Transcript", | ||
description: "This transcript is still being generated.", | ||
url: "/projects/1/transcripts/", | ||
status: "in-progress", | ||
display: true | ||
}, | ||
{ | ||
id: "3", | ||
projectId: "p1", | ||
key: "transcript_key_3", | ||
title: "Title - Error Transcript", | ||
description: "Transcript generation failed for this card.", | ||
url: "/projects/1/transcripts/", | ||
status: "error", | ||
errorMessage: "Something has gone wrong with your transcription", | ||
display: true | ||
}, | ||
{ | ||
id: "4", | ||
key: "transcript_key_4", | ||
title: "Title - Uploading Transcript", | ||
description: "This transcript is still being generated.", | ||
errorMessage: "Please keep this page open until the file is uploaded.", | ||
url: "/projects/1/transcripts/", | ||
status: "uploading", | ||
display: true, | ||
progress: 30 | ||
} | ||
]; | ||
|
||
storiesOf("ItemsContainer - Demo only (not published on NPM)", module) | ||
storiesOf('ItemsContainer - Demo only (not published on NPM)', module) | ||
.addDecorator(StoryRouter()) | ||
.add("Project View", () => { | ||
.addDecorator(withKnobs) | ||
.add('Project View', () => { | ||
const projectItems = [ | ||
object('item 1', { | ||
id: '1234', | ||
key: 'abc123', | ||
title: 'Sample Simple Card Title One', | ||
description: 'This is a sample card description. This is fun!', | ||
url: '/projects/1/transcripts/5678', | ||
display: true | ||
}), | ||
object('item 2', { | ||
id: '5678', | ||
key: 'def456', | ||
title: 'Sample Simple Card Title Two', | ||
description: 'This is a sample card description. This is fun!', | ||
display: true, | ||
url: '/projects/1/transcripts/5678' | ||
}) | ||
]; | ||
|
||
return ( | ||
<ItemContainer | ||
items={projectItems} | ||
<ItemsContainer | ||
items={ projectItems } | ||
model="Project" | ||
handleSave={action("handleSave")} | ||
handleDelete={action("handleDelete")} | ||
handleSave={ action('handleSave') } | ||
handleDelete={ action('handleDelete') } | ||
/> | ||
); | ||
}) | ||
.add("Transcripts View", () => { | ||
.add('Transcripts View', () => { | ||
const transcriptItems = [ | ||
object('item 1', { | ||
id: '1', | ||
projectId: 'p1', | ||
key: 'transcript_key_1', | ||
title: 'Title - Done Transcript', | ||
description: 'This transcript has finished processing.', | ||
url: '/projects/1/transcripts/', | ||
status: 'done', | ||
display: true | ||
}), | ||
object('item 2', { | ||
id: '2', | ||
projectId: 'p1', | ||
key: 'transcript_key_2', | ||
title: 'Title - In Progress Transcript', | ||
description: 'This transcript is still being generated.', | ||
url: '/projects/1/transcripts/', | ||
status: 'in-progress', | ||
display: true | ||
}), | ||
object('item 3', { | ||
id: '3', | ||
projectId: 'p1', | ||
key: 'transcript_key_3', | ||
title: 'Title - Error Transcript', | ||
description: 'Transcript generation failed for this card.', | ||
url: '/projects/1/transcripts/', | ||
status: 'error', | ||
errorMessage: 'Something has gone wrong with your transcription', | ||
display: true | ||
}), | ||
object('item 4', { | ||
id: '4', | ||
key: 'transcript_key_4', | ||
title: 'Title - Uploading Transcript', | ||
description: 'This transcript is still being generated.', | ||
errorMessage: 'Please keep this page open until the file is uploaded.', | ||
url: '/projects/1/transcripts/', | ||
status: 'uploading', | ||
display: true, | ||
progress: 30 | ||
}) | ||
]; | ||
|
||
return ( | ||
<ItemContainer | ||
items={transcriptItems} | ||
<ItemsContainer | ||
items={ transcriptItems } | ||
model="Transcript" | ||
handleSave={action("handleSave")} | ||
handleDelete={action("handleDelete")} | ||
handleSave={ action('handleSave') } | ||
handleDelete={ action('handleDelete') } | ||
/> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters