-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(report)!: Migrate to DSFR version (#31)
* feat: responsive dashboard Fixes #13 * fix: update jest snapshot * feat: responsive dashboard Fixes #13 * chore: update test snapshots * feat: design system de l'Etat Fixes #29 - add dsfr header and footer - add theme settings dark or light * chore: update snapshot test * use react dsfr * make theme settings modal properly working * Adapt home container and first url data * Add basic eslint config * Use webpack * Use proper css modules * Finish URL page * Improve table display * First version of the DSFR table * Intro page * Wappalizer * Fix remaining issues * Update ts issues * Replace package-lock by yarn.lock * Update packages * Improve badges * Improve sort on table * chore: prettier (#34) * chore(eslint): ignore build * chore: prettier * fix(Dashboard): a11y warning fix * chore: lint * chore: prettier + eslint config * Update title * some more adjustments (#35) * fix: favicon * cosmetics * fix: center-align UnknownIcon * fix(dev): fix sample config.json * fix: center-align all badges * fix: bigger gauges * fix: trends * fix(panel): bigger subtitle * fix: category link * feat(branding): add entity, description, footer in config * fix: adjustements for Tristanrobert/issue29 2 (#38) * fix: center-align UnknownIcon * fix: center-align all badges * fixes * fix: use better report.json * tests: better report.json * fix(report): no pagination and shorter urls * fix(report): hide category menu when not necessary * fix(report): remove footer html * fix Gh test Co-authored-by: Tristan Robert <tristan.robert.44@gmail.com> Co-authored-by: Julien Bouquillon <julien.bouquillon@sg.social.gouv.fr>
- Loading branch information
1 parent
0f01e30
commit d32d727
Showing
80 changed files
with
42,762 additions
and
29,753 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
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,2 @@ | ||
|
||
.DS_Store |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
.DS_Store | ||
dist |
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,50 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
"jest/globals": true, | ||
}, | ||
globals: { | ||
__PUBLIC_URL__: false, | ||
}, | ||
settings: { | ||
"import/resolver": { | ||
node: { | ||
extensions: [".js", ".jsx", ".ts", ".tsx"], | ||
}, | ||
}, | ||
}, | ||
extends: [ | ||
"plugin:react/recommended", | ||
"airbnb", | ||
"plugin:prettier/recommended", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 12, | ||
sourceType: "module", | ||
}, | ||
plugins: ["prettier", "react", "@typescript-eslint", "jest"], | ||
ignorePatterns: ["*.d.ts", "build"], | ||
rules: { | ||
"import/prefer-default-export": 0, | ||
"max-classes-per-file": 0, | ||
"max-len": 0, | ||
"import/extensions": ["error", "never", { json: "always" }], | ||
"no-use-before-define": "off", | ||
"@typescript-eslint/no-use-before-define": ["error"], | ||
"react/destructuring-assignment": 0, | ||
"react/no-unescaped-entities": 0, | ||
"react/prop-types": 0, | ||
"react/jsx-props-no-spreading": 0, | ||
"react/jsx-filename-extension": [ | ||
1, | ||
{ | ||
extensions: [".js", ".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,97 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | ||
const CopyPlugin = require("copy-webpack-plugin"); | ||
const HtmlWebpackPlugin = require("html-webpack-plugin"); | ||
|
||
const rootPath = path.resolve(__dirname, ".."); | ||
|
||
const getConfig = () => ({ | ||
context: rootPath, | ||
entry: { main: path.resolve(rootPath, "src/index.tsx") }, | ||
output: { | ||
filename: "[name].[contenthash].bundle.js", | ||
path: path.resolve(rootPath, "dist"), | ||
publicPath: "./", | ||
}, | ||
optimization: { | ||
moduleIds: "deterministic", | ||
removeEmptyChunks: true, | ||
splitChunks: { | ||
cacheGroups: { | ||
vendor: { | ||
test: /[\\/]node_modules[\\/]/, | ||
name: "vendors", | ||
chunks(chunk) { | ||
return chunk.name === "main"; | ||
}, | ||
}, | ||
}, | ||
}, | ||
runtimeChunk: { name: "manifest" }, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|jsx|ts|tsx)?$/, | ||
exclude: [/node_modules/], | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
presets: [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
"@babel/preset-typescript", | ||
], | ||
}, | ||
}, | ||
}, | ||
{ | ||
test: /\.css$/, | ||
rules: [ | ||
{ | ||
use: ["style-loader", "css-loader", "sass-loader"], | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.svg/, | ||
use: ["svg-url-loader"], | ||
}, | ||
{ | ||
test: /\.(jpg|png|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/, | ||
rules: [{ use: ["file-loader"] }], | ||
}, | ||
{ | ||
test: /\.md$/, | ||
use: [{ loader: "html-loader" }, { loader: "markdown-loader" }], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: [".js", ".jsx", ".ts", ".tsx"], | ||
}, | ||
plugins: [ | ||
new CleanWebpackPlugin(), | ||
new HtmlWebpackPlugin({ | ||
alwaysWriteToDisk: true, | ||
filename: path.resolve(rootPath, "dist/index.html"), | ||
template: path.resolve(rootPath, "index.html"), | ||
}), | ||
new CopyPlugin({ | ||
patterns: ["public"], | ||
}), | ||
new webpack.DefinePlugin({ | ||
__PUBLIC_URL__: "'http://localhost:3000'", | ||
}), | ||
], | ||
performance: { | ||
hints: "warning", | ||
// Calculates sizes of gziped bundles. | ||
assetFilter(assetFilename) { | ||
return assetFilename.endsWith(".js.gz"); | ||
}, | ||
}, | ||
}); | ||
|
||
module.exports = getConfig; |
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,57 @@ | ||
const webpack = require("webpack"); | ||
const path = require("path"); | ||
|
||
const defaultConfig = require("./webpack.base"); | ||
|
||
const baseConfig = defaultConfig(); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
mode: "development", | ||
devtool: "inline-source-map", | ||
entry: { | ||
main: [ | ||
"webpack-dev-server/client?http://localhost:3000/", | ||
"./src/index.tsx", | ||
], | ||
}, | ||
devServer: { | ||
contentBase: path.resolve(baseConfig.context, "dist"), | ||
headers: { | ||
"Access-Control-Allow-Origin": "*", | ||
}, | ||
historyApiFallback: true, | ||
port: 3000, | ||
}, | ||
output: { | ||
filename: "[name].bundle.js", | ||
path: path.resolve(baseConfig.context, "dist"), | ||
publicPath: "/", | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.cssmodule\.scss$/, | ||
use: [ | ||
"style-loader", | ||
{ | ||
loader: "css-loader", | ||
options: { | ||
modules: { | ||
localIdentName: "[path][name]__[local]", | ||
}, | ||
importLoaders: 1, | ||
}, | ||
}, | ||
"sass-loader", | ||
], | ||
}, | ||
].concat(baseConfig.module.rules), | ||
}, | ||
plugins: baseConfig.plugins.concat([ | ||
new webpack.HotModuleReplacementPlugin(), | ||
]), | ||
performance: { | ||
hints: false, | ||
}, | ||
}; |
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,35 @@ | ||
const webpack = require("webpack"); | ||
|
||
const defaultConfig = require("./webpack.base"); | ||
|
||
const baseConfig = defaultConfig(); | ||
|
||
module.exports = (apiUrl) => ({ | ||
...baseConfig, | ||
mode: "production", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.cssmodule\.scss$/, | ||
use: [ | ||
"style-loader", | ||
{ | ||
loader: "css-loader", | ||
options: { | ||
modules: { | ||
localIdentName: "[hash:base64]", | ||
}, | ||
importLoaders: 1, | ||
}, | ||
}, | ||
"sass-loader", | ||
], | ||
}, | ||
].concat(baseConfig.module.rules), | ||
}, | ||
plugins: baseConfig.plugins.concat([ | ||
new webpack.DefinePlugin({ | ||
__PUBLIC_URL__: "'http://localhost:3000'", | ||
}), | ||
]), | ||
}); |
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 @@ | ||
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); | ||
|
||
const defaultConfig = require("./webpack.production.js"); | ||
|
||
module.exports = (apiUrl) => { | ||
const config = defaultConfig(apiUrl); | ||
return { | ||
...config, | ||
plugins: config.plugins.concat([new BundleAnalyzerPlugin()]), | ||
}; | ||
}; |
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="fr" data-fr-reset> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta | ||
name="description" | ||
content="Dashboard des applications" | ||
/> | ||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico"> | ||
<title>Dashlord</title> | ||
</head> | ||
|
||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
<div id="root" style="height:100%"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.