Skip to content

Commit

Permalink
Merge pull request #1480 from danskernesdigitalebibliotek/develop
Browse files Browse the repository at this point in the history
Release 2024.41.0
  • Loading branch information
kasperg authored Oct 8, 2024
2 parents e1fa2d5 + 1d712cd commit 52df86a
Show file tree
Hide file tree
Showing 139 changed files with 8,531 additions and 12,390 deletions.
Binary file added .DS_Store
Binary file not shown.
30 changes: 0 additions & 30 deletions .storybook/main.js

This file was deleted.

32 changes: 32 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const config = {
stories: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],

addons: [
"@storybook/addon-essentials",
"@storybook/addon-queryparams",
"@storybook/addon-webpack5-compiler-babel",
"@chromatic-com/storybook"
],

typescript: {
check: true,
checkOptions: {},
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) =>
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true
}
},

framework: {
name: "@storybook/react-webpack5",
options: {}
},

docs: {
autodocs: "tag"
}
};

export default config;
40 changes: 26 additions & 14 deletions .storybook/preview.js → .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { Preview } from "@storybook/react";
import "../src/components/components.scss";
import "@danskernesdigitalebibliotek/dpl-design-system/build/css/base.css";
import { setToken, TOKEN_LIBRARY_KEY, TOKEN_USER_KEY } from "../src/core/token";
import "../src/core/mount";
import Store from "../src/components/store";
import React from "react";
import { withErrorBoundary } from "react-error-boundary";
import ErrorBoundaryAlert from "../src/components/error-boundary-alert/ErrorBoundaryAlert";
import Store from "../src/components/store";


const getSessionStorage = (type) => window.sessionStorage.getItem(type);
const userToken =
Expand Down Expand Up @@ -40,18 +42,28 @@ const WrappedStory = (app) =>
}
});

const App = ({ story }) => <Store>{WrappedStory(story)}</Store>;

// Consideration for the future - using addon-redux could bring value.
// It wasn't implemented to begin with because it wasn't compatible with Storybook 6.
export const decorators = [
(Story) => (
<>
<App story={Story} />
</>
)
];
function App({ story }) {
return (
<Store>
<>{story}</>
</Store>
);
}

export const parameters = {
layout: "fullscreen"
const preview: Preview = {
parameters: {
layout: "fullscreen",
controls: {
expanded: true
}
},
decorators: [
(Story) => (
<>
<App story={Story()} />
</>
)
]
};

export default preview;
18 changes: 18 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const { defineConfig } = require("cypress");

module.exports = defineConfig({
projectId: "4trcdv",
defaultCommandTimeout: 10000,
pageLoadTimeout: 10000,
requestTimeout: 30000,
testFiles: "@(apps|components)/**/*.test.@(ts|tsx)",
integrationFolder: "./src",
retries: {
runMode: 3,
openMode: 0
},
e2e: {
baseUrl: "http://localhost:57021"
}
});
11 changes: 0 additions & 11 deletions cypress.json

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/fixtures/search-result/campaign-image-only.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"url": "https://picsum.photos/id/777/300/200",
"alt": "I am a campaign image."
},
"url": "http://localhost/?path=/story/apps-search-result--search-result"
"url": "http://localhost/?path=/story/apps-search-result--primary"
}
}
2 changes: 1 addition & 1 deletion cypress/fixtures/search-result/campaign-text-only.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"url": null,
"alt": null
},
"url": "http://localhost/?path=/story/apps-search-result--search-result"
"url": "http://localhost/?path=/story/apps-search-result--primary"
}
}
2 changes: 1 addition & 1 deletion cypress/fixtures/search-result/campaign.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"url": "https://picsum.photos/id/777/300/200",
"alt": "I am a campaign image."
},
"url": "http://localhost/?path=/story/apps-search-result--search-result"
"url": "http://localhost/?path=/story/apps-search-result--primary"
}
}
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"watch:css": "postcss ./src/apps/**/*.scss ./src/components/components.scss --ext css --dir ./dist --watch",
"watch:lint:scss": "chokidar \"./src/**/*.scss\" -c \"yarn lint:scss:fix\"",
"watch:lint:js": "chokidar \"./src/**/*.{js,jsx,ts,tsx}\" -c \"yarn lint:js\"",
"build:storybook": "build-storybook -c .storybook -o dev",
"start:storybook:test": "NODE_ENV=test start-storybook --port 57021 --quiet --ci",
"start:storybook:dev": "NODE_ENV=development start-storybook --port 80",
"build:storybook": "storybook build -c .storybook -o dev",
"start:storybook:test": "NODE_ENV=test storybook dev --port 57021 --quiet --ci",
"start:storybook:dev": "NODE_ENV=development storybook dev --port 80",
"dev": "npx concurrently --raw \"yarn start:storybook:dev\" \"yarn watch\"",
"test:unit": "vitest",
"test:integration": "cypress run",
Expand All @@ -45,15 +45,16 @@
"post-process-generated-graphql": "ts-node ./scripts/post-process-generated-graphql.ts"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.25.7",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/preset-env": "^7.25.7",
"@babel/preset-react": "^7.25.7",
"@babel/preset-typescript": "^7.25.7",
"@chromatic-com/storybook": "^1",
"@csstools/postcss-sass": "^5.1.1",
"@cypress/browserify-preprocessor": "^3.0.2",
"@cypress/code-coverage": "^3.13.2",
"@cypress/code-coverage": "^3.13.4",
"@graphql-codegen/add": "^3.1.1",
"@graphql-codegen/cli": "^2.6.2",
"@graphql-codegen/introspection": "^2.1.1",
Expand All @@ -64,31 +65,29 @@
"@graphql-typed-document-node/core": "^3.1.1",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@namics/stylelint-bem": "^10.0.1",
"@storybook/addon-essentials": "^6.5.10",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/addon-queryparams": "^6.2.9",
"@storybook/builder-webpack5": "^6.5.0-beta.7",
"@storybook/manager-webpack5": "^6.5.0-beta.7",
"@storybook/preset-typescript": "^3.0.0",
"@storybook/react": "^6.5.0-beta.7",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-queryparams": "^7.0.1",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/react": "^8.2.9",
"@storybook/react-webpack5": "^8.2.9",
"@testing-library/dom": "^9.3.4",
"@testing-library/react": "^14.2.2",
"@testing-library/react-hooks": "^8.0.1",
"@tsconfig/create-react-app": "^1.0.2",
"@types/node": "^20.16.5",
"@types/react": "^18.3.10",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-flatpickr": "^3.8.11",
"@types/react-redux": "^7.1.24",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"@typescript-eslint/parser": "^7.16.0",
"@vitest/coverage-istanbul": "^2.1.1",
"@vitest/coverage-istanbul": "^2.1.2",
"autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1",
"babel-plugin-istanbul": "^7.0.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"caniuse-lite": "^1.0.30001664",
"caniuse-lite": "^1.0.30001667",
"change-case-all": "^2.1.0",
"chokidar-cli": "^3.0.0",
"concurrently": "^9.0.1",
Expand All @@ -103,11 +102,11 @@
"eslint-config-prettier": "^9.1.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-webpack-plugin": "^4.2.0",
"glob": "^8.0.1",
Expand All @@ -125,6 +124,7 @@
"replace-in-file": "^6.3.2",
"sass": "^1.79.4",
"source-map-support": "^0.5.21",
"storybook": "^8.2.9",
"style-loader": "^4.0.0",
"stylelint": "^15.11.0",
"stylelint-config-prettier": "^9.0.5",
Expand All @@ -145,7 +145,7 @@
"prop-types": "Since we use former ddb-react components that depend on prop-types we keep this. Should be removed when usage of prop-types is deprecated."
},
"dependencies": {
"@danskernesdigitalebibliotek/dpl-design-system": "^2024.40.0-c006877c658f7b12d834a352487fc8ab333f83bc",
"@danskernesdigitalebibliotek/dpl-design-system": "^2024.41.0-1ca7f9197d2f2f7a2865e34173fba6eca7f50edc",
"@fullcalendar/core": "^6.1.15",
"@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15",
Expand Down
Binary file added src/apps/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ComponentMeta, ComponentStory } from "@storybook/react";
import type { Meta, StoryFn } from "@storybook/react";
import React from "react";
import LibraryToken from "./library-token";

export default {
title: "SB Utilities / Set Library Token",
component: LibraryToken
} as ComponentMeta<typeof LibraryToken>;
} as Meta<typeof LibraryToken>;

export const LibraryTokenApp: ComponentStory<typeof LibraryToken> = () => {
export const LibraryTokenApp: StoryFn<typeof LibraryToken> = () => {
return <LibraryToken />;
};
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ComponentMeta, ComponentStory } from "@storybook/react";
import type { Meta, StoryFn } from "@storybook/react";
import React from "react";
import UserToken from "./user-token";

export default {
title: "SB Utilities / Set User Token",
component: UserToken
} as ComponentMeta<typeof UserToken>;
} as Meta<typeof UserToken>;

export const UserTokenApp: ComponentStory<typeof UserToken> = () => {
export const UserTokenApp: StoryFn<typeof UserToken> = () => {
return <UserToken />;
};
Loading

0 comments on commit 52df86a

Please sign in to comment.