-
-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
8,677 additions
and
2,254 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'Chromatic' | ||
|
||
# Event for the workflow | ||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
# List of jobs | ||
jobs: | ||
storybook-build: | ||
# Operating System | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: NodeModules Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: node_modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
working-directory: ./src/Ombi/ClientApp | ||
run: yarn | ||
|
||
- name: Publish to Chromatic | ||
if: github.ref != 'refs/heads/master' | ||
uses: chromaui/action@v1 | ||
with: | ||
projectToken: 7c47e1a1a4bd | ||
exitZeroOnChanges: true | ||
workingDir: ./src/Ombi/ClientApp | ||
buildScriptName: storybookbuild | ||
exitOnceUploaded: true | ||
|
||
- name: Publish to Chromatic and auto accept changes | ||
if: github.ref == 'refs/heads/master' | ||
uses: chromaui/action@v1 | ||
with: | ||
projectToken: 7c47e1a1a4bd | ||
autoAcceptChanges: true # 👈 Option to accept all changes | ||
workingDir: ./src/Ombi/ClientApp | ||
buildScriptName: storybookbuild | ||
exitOnceUploaded: true |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
"stories": [ | ||
"../src/**/*.stories.mdx", | ||
"../src/**/*.stories.@(js|jsx|ts|tsx)" | ||
], | ||
"addons": [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions" | ||
], | ||
"framework": "@storybook/angular", | ||
"core": { | ||
"builder": "@storybook/builder-webpack5" | ||
}, | ||
"staticDirs": ['../../wwwroot/images'] | ||
} |
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,5 @@ | ||
<style> | ||
.test-class { | ||
background-color: purple; | ||
} | ||
</style> |
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 { setCompodocJson } from "@storybook/addon-docs/angular"; | ||
import docJson from "../documentation.json"; | ||
setCompodocJson(docJson); | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
docs: { inlineStories: true }, | ||
} |
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,24 @@ | ||
{ | ||
"extends": "../src/tsconfig.json", | ||
"compilerOptions": { | ||
"types": [ | ||
"node" | ||
], | ||
"typeRoots": [ | ||
"../node_modules/@typings" | ||
], | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"exclude": [ | ||
"../src/test.ts", | ||
"../src/**/*.spec.ts", | ||
"../projects/**/*.spec.ts" | ||
], | ||
"include": [ | ||
"../src/**/*", | ||
"../projects/**/*" | ||
], | ||
"files": [ | ||
"./typings.d.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,4 @@ | ||
declare module '*.md' { | ||
const content: string; | ||
export default content; | ||
} |
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,18 @@ | ||
{ | ||
"pipes": [], | ||
"interfaces": [], | ||
"injectables": [], | ||
"guards": [], | ||
"interceptors": [], | ||
"classes": [], | ||
"directives": [], | ||
"components": [], | ||
"modules": [], | ||
"miscellaneous": [], | ||
"routes": [], | ||
"coverage": { | ||
"count": 0, | ||
"status": "low", | ||
"files": [] | ||
} | ||
} |
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
73 changes: 73 additions & 0 deletions
73
src/Ombi/ClientApp/src/app/components/image/image.component.stories.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,73 @@ | ||
// also exported from '@storybook/angular' if you can deal with breaking changes in 6.1 | ||
import { APP_BASE_HREF } from '@angular/common'; | ||
import { Story, Meta, moduleMetadata } from '@storybook/angular'; | ||
import { RequestType } from '../../interfaces'; | ||
import { ImageComponent } from './image.component'; | ||
|
||
// More on default export: https://storybook.js.org/docs/angular/writing-stories/introduction#default-export | ||
export default { | ||
title: 'Image Component', | ||
component: ImageComponent, | ||
decorators: [ | ||
moduleMetadata({ | ||
providers: [ | ||
{ | ||
provide: APP_BASE_HREF, | ||
useValue: "" | ||
}, | ||
] | ||
}) | ||
] | ||
} as Meta; | ||
|
||
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args | ||
const Template: Story<ImageComponent> = (args: ImageComponent) => ({ | ||
props: args, | ||
}); | ||
|
||
export const Primary = Template.bind({}); | ||
// More on args: https://storybook.js.org/docs/angular/writing-stories/args | ||
Primary.args = { | ||
src: 'https://ombi.io/img/logo-orange-small.png', | ||
type: RequestType.movie | ||
}; | ||
|
||
export const ClassApplied = Template.bind({}); | ||
ClassApplied.args = { | ||
src: 'https://ombi.io/img/logo-orange-small.png', | ||
type: RequestType.movie, | ||
class: 'test-class' | ||
}; | ||
|
||
export const StyleApplied = Template.bind({}); | ||
StyleApplied.args = { | ||
src: 'https://ombi.io/img/logo-orange-small.png', | ||
type: RequestType.movie, | ||
style: 'background-color: red;' | ||
}; | ||
|
||
export const IdApplied = Template.bind({}); | ||
IdApplied.args = { | ||
src: 'https://ombi.io/img/logo-orange-small.png', | ||
type: RequestType.movie, | ||
id: 'testId123' | ||
}; | ||
|
||
// export const InvalidMovieImage = Template.bind({}); | ||
// InvalidMovieImage.args = { | ||
// src: 'https://httpstat.us/429', | ||
// type: RequestType.movie, | ||
// id: 'testId123' | ||
// }; | ||
|
||
// export const InvalidTvImage = Template.bind({}); | ||
// InvalidTvImage.args = { | ||
// src: 'https://httpstat.us/429', | ||
// type: RequestType.tvShow, | ||
// }; | ||
|
||
// export const InvalidMusicImage = Template.bind({}); | ||
// InvalidMusicImage.args = { | ||
// src: 'https://httpstat.us/429', | ||
// type: RequestType.album, | ||
// }; |
Oops, something went wrong.