Skip to content

Commit

Permalink
🐛 fix: corrections diverses 1.13.0 (#1054)
Browse files Browse the repository at this point in the history
- Corrections mineures : legacy, storybook, analytics, ...
  • Loading branch information
keryanS authored Dec 4, 2024
1 parent a006496 commit 28809e5
Show file tree
Hide file tree
Showing 53 changed files with 599 additions and 1,240 deletions.
6 changes: 6 additions & 0 deletions dsfr-sb/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

const config = {
stories: ['../*.mdx', '../../src/dsfr/**/*.mdx', '../../src/dsfr/**/*.stories.@(js|jsx|mjs|ts|tsx)'],

addons: [
'@storybook/theming',
'@storybook/addon-themes',
'@whitespace/storybook-addon-html',
'@storybook/addon-mdx-gfm',
{
name: '@storybook/addon-essentials',
options: {
Expand All @@ -17,11 +19,15 @@ const config = {
},
}
],

framework: {
name: "@storybook/html-vite",
options: {},
},

staticDirs: ["./static", { from: "../../dist", to: "dist" }, { from: "../../tool/example/img", to: "img" }],

docs: {}
};

export default config;
5 changes: 5 additions & 0 deletions dsfr-sb/.storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<style>
#storybook-testing-module {
display: none;
}
</style>
7 changes: 6 additions & 1 deletion dsfr-sb/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { addons } from '@storybook/manager-api';
import { getPreferredColorScheme } from './dsfr-theme';

import { version } from '../../package.json';

addons.setConfig({
theme: getPreferredColorScheme(),
});

window.addEventListener('load', (event) => {
const title = document.querySelector('#dsfr button');
title.append(` ${version}`);
})
13 changes: 12 additions & 1 deletion dsfr-sb/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const preview = {
decorators: [
themeDecorator
],

parameters: {
controls: {
matchers: {
Expand Down Expand Up @@ -113,8 +114,18 @@ const preview = {
viewports: viewports,
defaultViewport: 'lg',
},
}
},

tags: ['autodocs']
};


// FIX : Vide la div 'storybook-root' pour eviter les conflits d'ID entre les docs et les stories
addEventListener("DOMContentLoaded", (event) => {
const root = document.getElementById('storybook-root');
if (root && root.hasAttribute('hidden')) {
root.innerHTML = '';
}
});

export default preview;
27 changes: 14 additions & 13 deletions dsfr-sb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@
"devDependencies": {
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-virtual": "^2.1.0",
"@storybook/addon-essentials": "^8.1.5",
"@storybook/addon-interactions": "^8.1.5",
"@storybook/addon-links": "^8.1.5",
"@storybook/addon-themes": "^8.1.5",
"@storybook/addon-viewport": "^8.1.5",
"@storybook/blocks": "^8.1.5",
"@storybook/html": "^8.1.5",
"@storybook/html-vite": "^8.1.5",
"@storybook/manager-api": "^8.1.5",
"@storybook/preview-api": "^8.1.5",
"@storybook/test": "^8.1.5",
"@storybook/theming": "^8.1.5",
"@storybook/addon-essentials": "^8.4.6",
"@storybook/addon-interactions": "^8.4.6",
"@storybook/addon-links": "^8.4.6",
"@storybook/addon-mdx-gfm": "^8.4.6",
"@storybook/addon-themes": "^8.4.6",
"@storybook/addon-viewport": "^8.4.6",
"@storybook/blocks": "^8.4.6",
"@storybook/html": "^8.4.6",
"@storybook/html-vite": "^8.4.6",
"@storybook/manager-api": "^8.4.6",
"@storybook/preview-api": "^8.4.6",
"@storybook/test": "^8.4.6",
"@storybook/theming": "^8.4.6",
"@teskon/vite-plugin-ejs-engine": "^1.2.0",
"@whitespace/storybook-addon-html": "^6.1.1",
"ejs4b": "^3.1.63",
Expand All @@ -36,7 +37,7 @@
"react-dom": "^18.3.1",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^4.0.0",
"storybook": "^8.1.5",
"storybook": "^8.4.6",
"yaml": "^2.5.0"
},
"dependencies": {
Expand Down
1,260 changes: 286 additions & 974 deletions dsfr-sb/yarn.lock

Large diffs are not rendered by default.

113 changes: 0 additions & 113 deletions src/component/radio/style/module/_rich.scss

This file was deleted.

27 changes: 0 additions & 27 deletions src/component/radio/style/module/_sm.scss

This file was deleted.

8 changes: 4 additions & 4 deletions src/dsfr/analytics/example/component/table/index.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

<%
const sample = getSample(include);
let data = { caption: 'Titre du tableau (caption)', col: 6, row: 3};
eval(include('../../../../core/index.ejs'));
const data = JSON.parse(include('../../../../component/table/example/data/data-simple.json.ejs', {table: {caption: 'tableau analytics', id: 'table'}})) || [];
%>


<div class="<%= prefix %>-container">
<%- sample('Tableau', '../../../../component/table/example/sample/table-default', {table:data}); %>
<%- include('../../../../component/table/template/ejs/table-wrapper', { table: data }); %>
</div>
4 changes: 2 additions & 2 deletions src/dsfr/analytics/example/spa/vue/config.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
mode: 'vue',
analytics: {
domain: 'gva.et-gv.fr',
// collection: 'manual', // method of collection [manual, load, full, hash]
isActionEnabled: true, // ensable action tracking
collection: 'manual', // method of collection [manual, load, full, hash]
isActionEnabled: false, // enable action tracking
cmp: {
id: 'tarteaucitron'
},
Expand Down
2 changes: 1 addition & 1 deletion src/dsfr/analytics/example/spa/vue/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
const { createRouter, createMemoryHistory } = VueRouter
const Base = { template: `lorem ipsum dolor sit amet` };
const Link = { template: `<a href="#" id="btn-4" data-<%= prefix %>-analytics-click="libellé du lien envoyé à l'analytics" id="link-attr-click">test</a>` };
const Link = { template: `<a href="#" id="btn-4" data-<%= prefix %>-analytics-click="libellé du lien envoyé à l'analytics">test</a>` };
const Button = { template: `<button type="button" id="btn-5" class="<%= prefix %>-btn">Button page 3</button>` };
const routes = [
Expand Down
2 changes: 1 addition & 1 deletion src/dsfr/analytics/script/analytics/engine/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import actions from '../action/actions';
import { Location } from './location';
import { CollectorEvent } from './collector-event';
import { ActioneeEmission } from '../../integration/core/actionee-emission';
import { ActionEnable } from './action-enable'
import { ActionEnable } from './action-enable';

class Collector {
constructor (config) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Type from '../../analytics/action/type';
import { Actionee } from '../core/actionee';
import { ActionRegulation } from '../../analytics/action/action-regulation';

class AttributeActionee extends Actionee {
constructor () {
super(100, '', null, true);
super(100, '', null, ActionRegulation.ENFORCE);
}

static get instanceClassName () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import api from '../../../../api';
import { HighlightSelector } from './highlight-selector';
import { HighlightActionee } from './highlight-actionee';
import { joinSelector } from '../../join-selector'
import { joinSelector } from '../../join-selector';

const integrateHighlight = (selector = '') => {
api.internals.register(joinSelector(HighlightSelector.HIGHLIGHT, selector), HighlightActionee);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import api from '../../../../api';
import { SelectSelector } from './select-selector';
import { SelectActionee } from './select-actionee';
import { joinSelector } from '../../join-selector'
import { joinSelector } from '../../join-selector';

const integrateSelect = (selector = '') => {
api.internals.register(joinSelector(SelectSelector.SELECT, selector), SelectActionee);
Expand Down
2 changes: 1 addition & 1 deletion src/dsfr/component/alert/deprecated/template/ejs/alert.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (size !== "md") classes.push(prefix + '-alert--' + size);
<p><%= text %></p>
<% } %>

<% if(alert.dismissable) { %>
<% if(alert.dismissible) { %>
<%- include('../../../../link/template/ejs/link', {link: {size: 'md', classes: [`${prefix}-link--close`], markup:'button', ...alert.button}}) %>
<% } %>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const alertArgTypes = {
description: 'L\'alerte est refermable'
},
icon: {
if: { arg: 'type', eq: 'default' },
control: 'text',
description: 'Icône personnalisée sur l\'alerte'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { badgesGroupArgs, badgesGroupArgTypes, badgesGroupProps } from './badges

const render = (args) => renderBadgesGroup({ badgesGroup: badgesGroupProps(args) });

const renders = (argsArray) => argsArray.map(args => render(args)).join('\n\n');

export default {
id: 'badges-group',
title: 'DSFR/Component/Badge/Badges-Group',
Expand All @@ -19,7 +17,7 @@ export const BadgesGroupStory = {

export const SizeMdStory = {
tags: ['autodocs', '!dev'],
render: () => renders([
args:
{
size: 'md',
type1: 'accent',
Expand All @@ -29,12 +27,11 @@ export const SizeMdStory = {
type3: 'accent',
accent3: 'blue-ecume'
}
])
};

export const SizeSmStory = {
tags: ['autodocs', '!dev'],
render: () => renders([
args:
{
size: 'sm',
type1: 'accent',
Expand All @@ -44,5 +41,4 @@ export const SizeSmStory = {
type3: 'accent',
accent3: 'blue-ecume'
}
])
};
Loading

0 comments on commit 28809e5

Please sign in to comment.