diff --git a/.storybook/alfrescoTheme.js b/.storybook/alfrescoTheme.js new file mode 100644 index 0000000000..3ae4aea6ac --- /dev/null +++ b/.storybook/alfrescoTheme.js @@ -0,0 +1,8 @@ +import { create } from '@storybook/theming'; + +export default create({ + base: 'light', + brandTitle: 'Hyland | Alfresco Storybook App', + brandUrl: 'https://www.alfresco.com/', + brandImage: '/assets/storybook-logo.png', +}); diff --git a/demo-shell/src/assets/storybook-logo.png b/demo-shell/src/assets/storybook-logo.png new file mode 100644 index 0000000000..45f4c6eb14 Binary files /dev/null and b/demo-shell/src/assets/storybook-logo.png differ diff --git a/lib/.gitignore b/lib/.gitignore index 6db1f6fd21..2c10b30d3a 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -7,6 +7,7 @@ coverage dist content-services/**/*.js +!content-services/.storybook/*.js !content-services/karma.conf.js content-services/**/*.js.map content-services/**/*.d.ts @@ -17,6 +18,7 @@ process-services/**/*.js.map process-services/**/*.d.ts core/**/*.js +!core/.storybook/*.js !core/karma.conf.js core/**/*.js.map core/**/*.d.ts diff --git a/lib/content-services/.storybook/main.js b/lib/content-services/.storybook/main.js new file mode 100644 index 0000000000..0ba498c521 --- /dev/null +++ b/lib/content-services/.storybook/main.js @@ -0,0 +1,26 @@ +const rootMain = require('../../../.storybook/main'); + + +module.exports = { + ...rootMain, + + core: { ...rootMain.core, builder: 'webpack4' }, + + stories: [ + ...rootMain.stories, + '../**/*.stories.@(js|jsx|ts|tsx)' + ], + addons: [...rootMain.addons ], + webpackFinal: async (config, { configType }) => { + // apply any global webpack configs that might have been specified in .storybook/main.js + if (rootMain.webpackFinal) { + config = await rootMain.webpackFinal(config, { configType }); + } + + + + // add your own webpack tweaks if needed + + return config; + }, +}; diff --git a/lib/content-services/.storybook/manager.js b/lib/content-services/.storybook/manager.js new file mode 100644 index 0000000000..b5a1a8fa6f --- /dev/null +++ b/lib/content-services/.storybook/manager.js @@ -0,0 +1,6 @@ +import { addons } from '@storybook/addons'; +import alfrescoTheme from '../../../.storybook/alfrescoTheme'; + +addons.setConfig({ + theme: alfrescoTheme, +}); diff --git a/lib/content-services/.storybook/preview.js b/lib/content-services/.storybook/preview.js new file mode 100644 index 0000000000..117506016e --- /dev/null +++ b/lib/content-services/.storybook/preview.js @@ -0,0 +1,3 @@ +export const parameters = { + docs: { inlineStories: true } +} diff --git a/lib/content-services/src/lib/search/models/response-facet-query-list.model.ts b/lib/content-services/src/lib/search/models/response-facet-query-list.model.ts index 72071efc8c..ab501eb10a 100644 --- a/lib/content-services/src/lib/search/models/response-facet-query-list.model.ts +++ b/lib/content-services/src/lib/search/models/response-facet-query-list.model.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { FacetQuery } from '../../../facet-query.interface'; +import { FacetQuery } from './facet-query.interface'; import { SearchFilterList } from './search-filter-list.model'; export class ResponseFacetQueryList extends SearchFilterList { diff --git a/lib/core/.storybook/main.js b/lib/core/.storybook/main.js new file mode 100644 index 0000000000..0ba498c521 --- /dev/null +++ b/lib/core/.storybook/main.js @@ -0,0 +1,26 @@ +const rootMain = require('../../../.storybook/main'); + + +module.exports = { + ...rootMain, + + core: { ...rootMain.core, builder: 'webpack4' }, + + stories: [ + ...rootMain.stories, + '../**/*.stories.@(js|jsx|ts|tsx)' + ], + addons: [...rootMain.addons ], + webpackFinal: async (config, { configType }) => { + // apply any global webpack configs that might have been specified in .storybook/main.js + if (rootMain.webpackFinal) { + config = await rootMain.webpackFinal(config, { configType }); + } + + + + // add your own webpack tweaks if needed + + return config; + }, +}; diff --git a/lib/core/.storybook/manager.js b/lib/core/.storybook/manager.js new file mode 100644 index 0000000000..b5a1a8fa6f --- /dev/null +++ b/lib/core/.storybook/manager.js @@ -0,0 +1,6 @@ +import { addons } from '@storybook/addons'; +import alfrescoTheme from '../../../.storybook/alfrescoTheme'; + +addons.setConfig({ + theme: alfrescoTheme, +}); diff --git a/lib/core/.storybook/preview.js b/lib/core/.storybook/preview.js new file mode 100644 index 0000000000..117506016e --- /dev/null +++ b/lib/core/.storybook/preview.js @@ -0,0 +1,3 @@ +export const parameters = { + docs: { inlineStories: true } +} diff --git a/lib/process-services-cloud/.storybook/manager.js b/lib/process-services-cloud/.storybook/manager.js new file mode 100644 index 0000000000..b5a1a8fa6f --- /dev/null +++ b/lib/process-services-cloud/.storybook/manager.js @@ -0,0 +1,6 @@ +import { addons } from '@storybook/addons'; +import alfrescoTheme from '../../../.storybook/alfrescoTheme'; + +addons.setConfig({ + theme: alfrescoTheme, +}); diff --git a/lib/process-services-cloud/src/lib/form/mocks/form-cloud.service.mock.ts b/lib/process-services-cloud/src/lib/form/mocks/form-cloud.service.mock.ts index 339cdd9e95..4a7251ee70 100644 --- a/lib/process-services-cloud/src/lib/form/mocks/form-cloud.service.mock.ts +++ b/lib/process-services-cloud/src/lib/form/mocks/form-cloud.service.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { FormModel, FormValues } from '@alfresco/adf-core'; +import { FormFieldOption, FormModel, FormValues } from '@alfresco/adf-core'; import { UploadApi } from '@alfresco/js-api'; import { Observable, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; @@ -96,4 +96,8 @@ export class FormCloudServiceMock implements FormCloudServiceInterface { parseForm(_json: any, _data?: TaskVariableCloud[], _readOnly: boolean = false): FormModel { throw new Error('Method not implemented.'); } + + getRestWidgetData(_formName: string, _widgetId: string, _body: Map): Observable { + throw new Error('Method not implemented.'); + } } diff --git a/lib/stories/.storybook/manager.js b/lib/stories/.storybook/manager.js new file mode 100644 index 0000000000..b5a1a8fa6f --- /dev/null +++ b/lib/stories/.storybook/manager.js @@ -0,0 +1,6 @@ +import { addons } from '@storybook/addons'; +import alfrescoTheme from '../../../.storybook/alfrescoTheme'; + +addons.setConfig({ + theme: alfrescoTheme, +});