-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into component/search_configuration
- Loading branch information
Showing
27 changed files
with
9,150 additions
and
1,587 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
Source/Plugins/Core/com.equella.core/js/.storybook/main.js
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
stories: ["../__stories__/**/*.stories.tsx"], | ||
addons: [ | ||
"@storybook/preset-typescript", | ||
"@storybook/addon-a11y", | ||
"@storybook/addon-actions", | ||
"@storybook/addon-docs", | ||
"@storybook/addon-knobs", | ||
"@storybook/addon-links" | ||
] | ||
}; |
6 changes: 6 additions & 0 deletions
6
Source/Plugins/Core/com.equella.core/js/.storybook/preview.ts
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { addDecorator } from "@storybook/react"; | ||
import { withA11y } from "@storybook/addon-a11y"; | ||
import StoryRouter from "storybook-react-router"; | ||
|
||
addDecorator(withA11y); | ||
addDecorator(StoryRouter()); |
12 changes: 12 additions & 0 deletions
12
Source/Plugins/Core/com.equella.core/js/__stories__/components/AppBarQuery.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as React from "react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import AppBarQuery from "../../tsrc/components/AppBarQuery"; | ||
|
||
export default { | ||
title: "AppBarQuery", | ||
component: AppBarQuery | ||
}; | ||
|
||
export const QueryText = () => ( | ||
<AppBarQuery query="" onChange={action("change")} /> | ||
); |
21 changes: 21 additions & 0 deletions
21
Source/Plugins/Core/com.equella.core/js/__stories__/components/ConfirmDialog.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as React from "react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import { boolean, text } from "@storybook/addon-knobs"; | ||
import ConfirmDialog from "../../tsrc/components/ConfirmDialog"; | ||
|
||
export default { | ||
title: "ConfirmDialog", | ||
component: ConfirmDialog | ||
}; | ||
|
||
export const ShowDialog = () => ( | ||
<ConfirmDialog | ||
open={boolean("open", true)} | ||
title={text( | ||
"title", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
onCancel={action("cancel")} | ||
onConfirm={action("confirm")} | ||
/> | ||
); |
14 changes: 14 additions & 0 deletions
14
Source/Plugins/Core/com.equella.core/js/__stories__/components/Error.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as React from "react"; | ||
import Error from "../../tsrc/components/Error"; | ||
|
||
export default { | ||
title: "Error", | ||
component: Error | ||
}; | ||
|
||
export const WithWarningMessage = () => ( | ||
<Error> | ||
<h1>Warning</h1> | ||
<p>Something has gone wrong.</p> | ||
</Error> | ||
); |
9 changes: 9 additions & 0 deletions
9
Source/Plugins/Core/com.equella.core/js/__stories__/components/Loader.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as React from "react"; | ||
import Loader from "../../tsrc/components/Loader"; | ||
|
||
export default { | ||
title: "Loader", | ||
component: Loader | ||
}; | ||
|
||
export const Loading = () => <Loader />; |
73 changes: 73 additions & 0 deletions
73
Source/Plugins/Core/com.equella.core/js/__stories__/components/MessageInfo.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import * as React from "react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import { boolean, select, text } from "@storybook/addon-knobs"; | ||
import MessageInfo from "../../tsrc/components/MessageInfo"; | ||
|
||
export default { | ||
title: "MessageInfo", | ||
component: MessageInfo | ||
}; | ||
|
||
export const DynamicVariant = () => ( | ||
<MessageInfo | ||
open={boolean("open", true)} | ||
onClose={action("close")} | ||
title={text( | ||
"title", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
variant={select( | ||
"variant", | ||
{ success: "success", error: "error", info: "info", warning: "warning" }, | ||
"success" | ||
)} | ||
/> | ||
); | ||
|
||
export const VariantSuccess = () => ( | ||
<MessageInfo | ||
open={boolean("open", true)} | ||
onClose={action("close")} | ||
title={text( | ||
"title", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
variant="success" | ||
/> | ||
); | ||
|
||
export const VariantError = () => ( | ||
<MessageInfo | ||
open={boolean("open", true)} | ||
onClose={action("close")} | ||
title={text( | ||
"title", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
variant="error" | ||
/> | ||
); | ||
|
||
export const VariantInfo = () => ( | ||
<MessageInfo | ||
open={boolean("open", true)} | ||
onClose={action("close")} | ||
title={text( | ||
"title", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
variant="info" | ||
/> | ||
); | ||
|
||
export const VariantWarning = () => ( | ||
<MessageInfo | ||
open={boolean("open", true)} | ||
onClose={action("close")} | ||
title={text( | ||
"title", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
variant="warning" | ||
/> | ||
); |
28 changes: 28 additions & 0 deletions
28
Source/Plugins/Core/com.equella.core/js/__stories__/components/RichEditor.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as React from "react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import { text } from "@storybook/addon-knobs"; | ||
import RichTextEditor from "../../tsrc/components/RichTextEditor"; | ||
|
||
/** | ||
* FIXME: to get the tinyMCE skin styles with the current setup | ||
* the entire node modules folder needed to be included as a static source | ||
* in the future only the skin styles should be served as a static folder | ||
* | ||
* When an alternative is ready update the `storybook` and `build-storybook` scripts | ||
* in package.json with the new `-s` option | ||
*/ | ||
export default { | ||
title: "RichTextEditor", | ||
component: RichTextEditor | ||
}; | ||
|
||
export const WithHTMLInput = () => ( | ||
<RichTextEditor | ||
htmlInput={text("htmlInput", "<p>example</p>")} | ||
onStateChange={action("stateChange")} | ||
/> | ||
); | ||
|
||
export const WithoutHTMLInput = () => ( | ||
<RichTextEditor onStateChange={action("stateChange")} /> | ||
); |
37 changes: 37 additions & 0 deletions
37
Source/Plugins/Core/com.equella.core/js/__stories__/components/SearchResults.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as React from "react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import { text } from "@storybook/addon-knobs"; | ||
import SearchResult from "../../tsrc/components/SearchResult"; | ||
|
||
export default { | ||
title: "SearchResult", | ||
component: SearchResult | ||
}; | ||
|
||
export const PrimaryTextOnly = () => ( | ||
<SearchResult | ||
onClick={action("click")} | ||
onDelete={action("delete")} | ||
to={text("to", "#example")} | ||
primaryText={text( | ||
"primaryText", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
/> | ||
); | ||
|
||
export const PrimaryAndSecondaryText = () => ( | ||
<SearchResult | ||
onClick={action("click")} | ||
onDelete={action("delete")} | ||
to={text("to", "#example")} | ||
primaryText={text( | ||
"primaryText", | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit" | ||
)} | ||
secondaryText={text( | ||
"secondaryText", | ||
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum" | ||
)} | ||
/> | ||
); |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../tsrc/__tests__/mainui/ErrorPage.test.tsx → .../__tests__/tsrc/mainui/ErrorPage.test.tsx
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
2 changes: 1 addition & 1 deletion
2
...js/tsrc/__tests__/util/actionutil.test.ts → ...js/__tests__/tsrc/util/actionutil.test.ts
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
2 changes: 1 addition & 1 deletion
2
...tsrc/__tests__/util/commonstrings.test.ts → ...__tests__/tsrc/util/commonstrings.test.ts
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
2 changes: 1 addition & 1 deletion
2
...js/tsrc/__tests__/util/dictionary.test.ts → ...js/__tests__/tsrc/util/dictionary.test.ts
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
2 changes: 1 addition & 1 deletion
2
...s/tsrc/__tests__/util/encodequery.test.ts → ...s/__tests__/tsrc/util/encodequery.test.ts
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
2 changes: 1 addition & 1 deletion
2
...js/tsrc/__tests__/util/validation.test.ts → ...js/__tests__/tsrc/util/validation.test.ts
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
Oops, something went wrong.