qpp-style 9.45.6 → 9.45.7-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Header/ImpersonatorBanner.jsx +2 -2
- package/components/Header/PreviewBanner.jsx +2 -4
- package/components/Session/Session.jsx +2 -2
- package/components/SideNav/Content/LevelOneContent.jsx +2 -2
- package/components/SideNav/Content/SelectRole/index.js +4 -3
- package/components/SideNav/helpers.js +3 -3
- package/dist/browser.js +1 -1
- package/dist/browser.js.LICENSE.txt +0 -7
- package/dist/browser.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +0 -7
- package/dist/index.js.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.LICENSE.txt +0 -7
- package/dist/react/index.js.map +1 -1
- package/eslint.config.js +48 -0
- package/package.json +17 -17
- package/session/logout.js +2 -2
- package/session/refresh.js +11 -11
- package/session/ttl.js +1 -1
- package/styles/without-legacy.scss +3 -0
- package/webpack.config.js +2 -0
- package/.eslintignore +0 -5
- package/.eslintrc.js +0 -32
package/eslint.config.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const { FlatCompat } = require("@eslint/eslintrc");
|
|
2
|
+
const js = require("@eslint/js");
|
|
3
|
+
const babelParser = require("@babel/eslint-parser");
|
|
4
|
+
|
|
5
|
+
const compat = new FlatCompat({
|
|
6
|
+
baseDirectory: __dirname,
|
|
7
|
+
recommendedConfig: js.configs.recommended,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports = [
|
|
11
|
+
...compat.extends("eslint:recommended"),
|
|
12
|
+
...compat.extends("plugin:react/recommended"),
|
|
13
|
+
{
|
|
14
|
+
languageOptions: {
|
|
15
|
+
globals: {
|
|
16
|
+
es6: true,
|
|
17
|
+
node: true,
|
|
18
|
+
browser: true,
|
|
19
|
+
jquery: true,
|
|
20
|
+
mocha: true,
|
|
21
|
+
},
|
|
22
|
+
parser: babelParser,
|
|
23
|
+
parserOptions: {
|
|
24
|
+
sourceType: "module",
|
|
25
|
+
ecmaFeatures: {
|
|
26
|
+
jsx: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
"no-unused-vars": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
args: "none",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
"linebreak-style": ["error", "unix"],
|
|
38
|
+
"no-console": 0,
|
|
39
|
+
"no-prototype-builtins": [0],
|
|
40
|
+
"react/no-deprecated": [0],
|
|
41
|
+
"no-undef": [0],
|
|
42
|
+
},
|
|
43
|
+
settings: {
|
|
44
|
+
react: { version: "detect" },
|
|
45
|
+
},
|
|
46
|
+
ignores: ["_*", "css", "dist", "node_modules", "test"],
|
|
47
|
+
},
|
|
48
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qpp-style",
|
|
3
|
-
"version": "9.45.
|
|
3
|
+
"version": "9.45.7-beta.2",
|
|
4
4
|
"description": "Shared style guide across the QPP program.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": "https://cmsgov.github.io/qpp-style",
|
|
@@ -21,44 +21,44 @@
|
|
|
21
21
|
"format-styles": "prettier 'styles/**/*.{css,scss}' --write --quiet"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@babel/eslint-parser": "^7.
|
|
24
|
+
"@babel/eslint-parser": "^7.25.9",
|
|
25
25
|
"@svgr/webpack": "^8.0.1",
|
|
26
26
|
"@testing-library/react": "^16.0.1",
|
|
27
|
-
"@types/node": "^
|
|
27
|
+
"@types/node": "^22.10.1",
|
|
28
28
|
"@types/webpack": "^5.28.5",
|
|
29
29
|
"autoprefixer": "^10.4.20",
|
|
30
30
|
"babel-jest": "^29.6.1",
|
|
31
|
-
"babel-loader": "^9.1
|
|
31
|
+
"babel-loader": "^9.2.1",
|
|
32
32
|
"babel-plugin-transform-es2015-modules-umd": "^6.24.1",
|
|
33
33
|
"copy-webpack-plugin": "^12.0.2",
|
|
34
34
|
"css-loader": "^7.1.2",
|
|
35
|
-
"eslint": "^
|
|
35
|
+
"eslint": "^9.15.0",
|
|
36
36
|
"eslint-config-prettier": "^9.1.0",
|
|
37
37
|
"eslint-plugin-babel": "^5.3.1",
|
|
38
|
-
"eslint-plugin-prettier": "^5.1
|
|
39
|
-
"eslint-plugin-react": "^7.
|
|
38
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
39
|
+
"eslint-plugin-react": "^7.37.2",
|
|
40
40
|
"eslint-webpack-plugin": "^4.2.0",
|
|
41
41
|
"feather-icons-react": "^0.7.0",
|
|
42
|
-
"gh-pages": "^6.
|
|
43
|
-
"husky": "^9.1.
|
|
42
|
+
"gh-pages": "^6.2.0",
|
|
43
|
+
"husky": "^9.1.7",
|
|
44
44
|
"jest": "^29.6.1",
|
|
45
45
|
"jest-environment-jsdom": "^29.6.1",
|
|
46
46
|
"jsonwebtoken": "^9.0.2",
|
|
47
|
-
"mini-css-extract-plugin": "^2.9.
|
|
47
|
+
"mini-css-extract-plugin": "^2.9.2",
|
|
48
48
|
"moxios": "^0.4.0",
|
|
49
|
-
"preact": "^10.
|
|
50
|
-
"prettier": "^3.
|
|
49
|
+
"preact": "^10.25.0",
|
|
50
|
+
"prettier": "^3.4.1",
|
|
51
51
|
"react": "^18.3.1",
|
|
52
52
|
"react-dom": "^18.3.1",
|
|
53
53
|
"react-test-renderer": "^18.3.1",
|
|
54
|
-
"rimraf": "^
|
|
55
|
-
"sass": "^1.
|
|
56
|
-
"sass-loader": "^
|
|
54
|
+
"rimraf": "^6.0.1",
|
|
55
|
+
"sass": "^1.81.0",
|
|
56
|
+
"sass-loader": "^16.0.3",
|
|
57
57
|
"style-loader": "^4.0.0",
|
|
58
58
|
"svgo": "^3.3.2",
|
|
59
59
|
"svgo-loader": "^4.0.0",
|
|
60
60
|
"terser-webpack-plugin": "^5.3.10",
|
|
61
|
-
"webpack": "^5.
|
|
61
|
+
"webpack": "^5.96.1",
|
|
62
62
|
"webpack-cli": "^5.1.4"
|
|
63
63
|
},
|
|
64
64
|
"repository": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@material-design-icons/svg": "^0.14.13",
|
|
83
83
|
"ariakit": "^2.0.0-next.44",
|
|
84
|
-
"cookie": "^0.
|
|
84
|
+
"cookie": "^1.0.2",
|
|
85
85
|
"jwt-decode": "^4.0.0",
|
|
86
86
|
"prop-types": "^15.8.1",
|
|
87
87
|
"react-modal": "^3.14.4",
|
package/session/logout.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { parse } from "cookie";
|
|
2
2
|
|
|
3
3
|
export const deleteImpersonatedUser = (cookies) => {
|
|
4
4
|
if (cookies.hasOwnProperty("qpp_impersonated_user")) {
|
|
@@ -40,7 +40,7 @@ const LogoutSession = async (_window) => {
|
|
|
40
40
|
// Remove the Side Nav expanded state from localStorage
|
|
41
41
|
localStorage.removeItem("qpp_side_nav_expanded");
|
|
42
42
|
|
|
43
|
-
let cookies =
|
|
43
|
+
let cookies = parse(_window.document.cookie);
|
|
44
44
|
let logoutDestination = "/logout-confirmation";
|
|
45
45
|
|
|
46
46
|
if (cookies.hasOwnProperty("qpp_auth_token")) {
|
package/session/refresh.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import logoutSession from
|
|
1
|
+
import { parse } from "cookie";
|
|
2
|
+
import logoutSession from "./logout.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Makes an API request to refresh the session token cookie, if it exists.
|
|
@@ -9,30 +9,30 @@ import logoutSession from './logout.js';
|
|
|
9
9
|
* @return {Function} Returns a promise
|
|
10
10
|
*/
|
|
11
11
|
const refreshSession = async (options = {}) => {
|
|
12
|
-
const url =
|
|
13
|
-
let cookies =
|
|
12
|
+
const url = "/api/auth/sessions/refresh";
|
|
13
|
+
let cookies = parse(window.document.cookie);
|
|
14
14
|
const headers = new Headers({
|
|
15
15
|
Accept: `application/vnd.qpp.cms.gov.v2+json`,
|
|
16
|
-
|
|
16
|
+
"Content-Type": "application/json",
|
|
17
17
|
Authorization: `Bearer ${cookies.qpp_auth_token}`,
|
|
18
18
|
});
|
|
19
19
|
const fetchOptions = {
|
|
20
|
-
method:
|
|
20
|
+
method: "POST",
|
|
21
21
|
headers,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const onSuccess = () => {
|
|
25
|
-
if (typeof options.onSuccess ===
|
|
25
|
+
if (typeof options.onSuccess === "function") {
|
|
26
26
|
options.onSuccess();
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const onError = () => {
|
|
31
|
-
if (typeof options.onError ===
|
|
31
|
+
if (typeof options.onError === "function") {
|
|
32
32
|
options.onError();
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
return logoutSession(window);
|
|
35
|
+
return logoutSession(window);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
try {
|
|
@@ -40,8 +40,8 @@ const refreshSession = async (options = {}) => {
|
|
|
40
40
|
if (response.ok) {
|
|
41
41
|
return onSuccess();
|
|
42
42
|
}
|
|
43
|
-
throw new Error(
|
|
44
|
-
} catch
|
|
43
|
+
throw new Error("Unable to refresh session");
|
|
44
|
+
} catch {
|
|
45
45
|
onError();
|
|
46
46
|
}
|
|
47
47
|
};
|
package/session/ttl.js
CHANGED
package/webpack.config.js
CHANGED
package/.eslintrc.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ["eslint:recommended", "plugin:react/recommended"],
|
|
3
|
-
parser: "@babel/eslint-parser",
|
|
4
|
-
parserOptions: {
|
|
5
|
-
sourceType: "module",
|
|
6
|
-
ecmaFeatures: {
|
|
7
|
-
jsx: true,
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
env: {
|
|
11
|
-
es6: true,
|
|
12
|
-
node: true,
|
|
13
|
-
browser: true,
|
|
14
|
-
jquery: true,
|
|
15
|
-
mocha: true,
|
|
16
|
-
},
|
|
17
|
-
rules: {
|
|
18
|
-
"no-unused-vars": [
|
|
19
|
-
"error",
|
|
20
|
-
{
|
|
21
|
-
args: "none",
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
"linebreak-style": ["error", "unix"],
|
|
25
|
-
"no-console": 0,
|
|
26
|
-
"no-prototype-builtins": [0],
|
|
27
|
-
"react/no-deprecated": [0],
|
|
28
|
-
},
|
|
29
|
-
settings: {
|
|
30
|
-
react: { version: "detect" },
|
|
31
|
-
},
|
|
32
|
-
};
|