From 659c7de85749b31d73e66b96405f2c080fe6c183 Mon Sep 17 00:00:00 2001 From: thomassth Date: Wed, 23 Oct 2024 03:11:25 -0400 Subject: [PATCH 1/8] moderate comments UI --- .../ModerateCommentsAccepted.stories.js | 16 ++++++++++++++++ .../ModerateCommentsRejected.stories.js | 16 ++++++++++++++++ .../client-admin/ModerateCommentsTodo.stories.js | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 stories/compdem/client-admin/ModerateCommentsAccepted.stories.js create mode 100644 stories/compdem/client-admin/ModerateCommentsRejected.stories.js create mode 100644 stories/compdem/client-admin/ModerateCommentsTodo.stories.js diff --git a/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js b/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js new file mode 100644 index 0000000..73a2c37 --- /dev/null +++ b/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js @@ -0,0 +1,16 @@ +import React from 'react' +import { withRedux, withThemeUi } from '../../../.storybook/decorators' +import ModerateCommentsAccepted from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted' +import { getAcceptedComments } from '../../../.storybook/utils' + +export default { + component: ModerateCommentsAccepted, + decorators: [withThemeUi, withRedux], +} + +const Template = (args) => + +export const Default = Template.bind({}) +Default.args = { + accepted_comments: getAcceptedComments(), +} \ No newline at end of file diff --git a/stories/compdem/client-admin/ModerateCommentsRejected.stories.js b/stories/compdem/client-admin/ModerateCommentsRejected.stories.js new file mode 100644 index 0000000..f2d8499 --- /dev/null +++ b/stories/compdem/client-admin/ModerateCommentsRejected.stories.js @@ -0,0 +1,16 @@ +import React from 'react' +import { withRedux, withThemeUi } from '../../../.storybook/decorators' +import { getRejectedComments } from '../../../.storybook/utils' +import ModerateCommentsRejected from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected' + +export default { + component: ModerateCommentsRejected, + decorators: [withThemeUi, withRedux], +} + +const Template = (args) => + +export const Default = Template.bind({}) +Default.args = { + rejected_comments: getRejectedComments(), +} \ No newline at end of file diff --git a/stories/compdem/client-admin/ModerateCommentsTodo.stories.js b/stories/compdem/client-admin/ModerateCommentsTodo.stories.js new file mode 100644 index 0000000..448e78f --- /dev/null +++ b/stories/compdem/client-admin/ModerateCommentsTodo.stories.js @@ -0,0 +1,16 @@ +import React from 'react' +import { withRedux, withThemeUi } from '../../../.storybook/decorators' +import { getUnmoderatedComments } from '../../../.storybook/utils' +import ModerateCommentsTodo from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo' + +export default { + component: ModerateCommentsTodo, + decorators: [withThemeUi, withRedux], +} + +const Template = (args) => + +export const Default = Template.bind({}) +Default.args = { + unmoderated_comments: getUnmoderatedComments(), +} \ No newline at end of file From c5ff88c6fcb8c71d36f3941457e7cc845baf0a8d Mon Sep 17 00:00:00 2001 From: thomassth Date: Wed, 23 Oct 2024 03:12:40 -0400 Subject: [PATCH 2/8] utils --- .storybook/utils.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.storybook/utils.js b/.storybook/utils.js index 91bf0f8..773afbb 100644 --- a/.storybook/utils.js +++ b/.storybook/utils.js @@ -31,6 +31,16 @@ export const getComments = () => { return commentsData } +export const getUnmoderatedComments = () => { + return commentsData.filter(comment => comment.mod === 0) +} +export const getAcceptedComments = () => { + return commentsData.filter(comment => comment.mod === 1) +} +export const getRejectedComments = () => { + return commentsData.filter(comment => comment.mod === -1) +} + // Simulates response data from /api/v3/reports?report_id=r3bpnywujybyru4rkx92i export const getReports = () => { return reportsData From 69b93524447b669d45d3eedfc23930d6fb7499cf Mon Sep 17 00:00:00 2001 From: Thomas Kam Date: Thu, 24 Oct 2024 00:34:52 -0400 Subject: [PATCH 3/8] import value to redux --- .storybook/decorators.js | 7 ++++++- codebases/compdem | 2 +- package-lock.json | 1 + package.json | 1 + .../ModerateCommentsAccepted.stories.js | 16 ++++++++-------- .../ModerateCommentsRejected.stories.js | 16 ++++++++-------- .../client-admin/ModerateCommentsTodo.stories.js | 16 ++++++++-------- 7 files changed, 33 insertions(+), 26 deletions(-) diff --git a/.storybook/decorators.js b/.storybook/decorators.js index ff04f30..5f1a81a 100644 --- a/.storybook/decorators.js +++ b/.storybook/decorators.js @@ -5,8 +5,13 @@ import haiDelibTheme from '../codebases/UT-HAI/client-deliberation/src/theme' import { Provider as ReduxProvider } from 'react-redux' import configureStore from '../codebases/compdem/client-admin/src/store' import { MemoryRouter } from 'react-router' +import { getAcceptedComments, getRejectedComments, getUnmoderatedComments } from './utils' -const store = configureStore() +const store = configureStore({ + mod_comments_unmoderated: getUnmoderatedComments(), + mod_comments_accepted: getAcceptedComments(), + mod_comments_rejected: getRejectedComments() +}) export const withThemeUi = (Story) => ( diff --git a/codebases/compdem b/codebases/compdem index e69e4df..08a9d66 160000 --- a/codebases/compdem +++ b/codebases/compdem @@ -1 +1 @@ -Subproject commit e69e4df9ab34ee536823eedf7aca9cf4e9b03d39 +Subproject commit 08a9d666bf52152b6e0cfed4041205967750bd6e diff --git a/package-lock.json b/package-lock.json index 606982d..cd7af6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,7 @@ "react-dom": "^16.14.0", "react-redux": "7.2.2", "react-router-dom": "^5.2.0", + "redux": "^4.2.1", "redux-thunk": "~2.3.0", "storybook": "^8.3.2", "storybook-branch-switcher": "^0.5.0" diff --git a/package.json b/package.json index 25e4ac8..06d82f0 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "react-dom": "^16.14.0", "react-redux": "7.2.2", "react-router-dom": "^5.2.0", + "redux": "^4.2.1", "redux-thunk": "~2.3.0", "storybook": "^8.3.2", "storybook-branch-switcher": "^0.5.0" diff --git a/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js b/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js index 73a2c37..4083342 100644 --- a/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js +++ b/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js @@ -1,16 +1,16 @@ -import React from 'react' -import { withRedux, withThemeUi } from '../../../.storybook/decorators' -import ModerateCommentsAccepted from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted' -import { getAcceptedComments } from '../../../.storybook/utils' +import React from "react"; +import { withRedux, withThemeUi } from "../../../.storybook/decorators"; +import ModerateCommentsAccepted from "../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted"; +import { getAcceptedComments } from "../../../.storybook/utils"; export default { component: ModerateCommentsAccepted, decorators: [withThemeUi, withRedux], -} +}; -const Template = (args) => +const Template = (args) => ; -export const Default = Template.bind({}) +export const Default = Template.bind({}); Default.args = { accepted_comments: getAcceptedComments(), -} \ No newline at end of file +}; diff --git a/stories/compdem/client-admin/ModerateCommentsRejected.stories.js b/stories/compdem/client-admin/ModerateCommentsRejected.stories.js index f2d8499..75f9516 100644 --- a/stories/compdem/client-admin/ModerateCommentsRejected.stories.js +++ b/stories/compdem/client-admin/ModerateCommentsRejected.stories.js @@ -1,16 +1,16 @@ -import React from 'react' -import { withRedux, withThemeUi } from '../../../.storybook/decorators' -import { getRejectedComments } from '../../../.storybook/utils' -import ModerateCommentsRejected from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected' +import React from "react"; +import { withRedux, withThemeUi } from "../../../.storybook/decorators"; +import ModerateCommentsRejected from "../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected"; +import { getRejectedComments } from "../../../.storybook/utils"; export default { component: ModerateCommentsRejected, decorators: [withThemeUi, withRedux], -} +}; -const Template = (args) => +const Template = (args) => ; -export const Default = Template.bind({}) +export const Default = Template.bind({}); Default.args = { rejected_comments: getRejectedComments(), -} \ No newline at end of file +}; diff --git a/stories/compdem/client-admin/ModerateCommentsTodo.stories.js b/stories/compdem/client-admin/ModerateCommentsTodo.stories.js index 448e78f..0eff6e1 100644 --- a/stories/compdem/client-admin/ModerateCommentsTodo.stories.js +++ b/stories/compdem/client-admin/ModerateCommentsTodo.stories.js @@ -1,16 +1,16 @@ -import React from 'react' -import { withRedux, withThemeUi } from '../../../.storybook/decorators' -import { getUnmoderatedComments } from '../../../.storybook/utils' -import ModerateCommentsTodo from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo' +import React from "react"; +import { withRedux, withThemeUi } from "../../../.storybook/decorators"; +import { getUnmoderatedComments } from "../../../.storybook/utils"; +import ModerateCommentsTodo from "../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo"; export default { component: ModerateCommentsTodo, decorators: [withThemeUi, withRedux], -} +}; -const Template = (args) => +const Template = (args) => ; -export const Default = Template.bind({}) +export const Default = Template.bind({}); Default.args = { unmoderated_comments: getUnmoderatedComments(), -} \ No newline at end of file +}; From 42376f69b191503d70a3fe7fbf8f9bef792be3db Mon Sep 17 00:00:00 2001 From: Thomas Kam Date: Thu, 24 Oct 2024 01:01:47 -0400 Subject: [PATCH 4/8] add d3 --- package-lock.json | 346 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 1 + 2 files changed, 345 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd7af6b..abfcc08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@react-spring/web": "^9.7.4", "color": "~4.2.3", + "d3": "^7.9.0", "d3-array": "1.0.2", "d3-contour": "~1.1.2", "d3-force": "~1.2.1", @@ -3659,11 +3660,85 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, + "node_modules/d3": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", + "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-array": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.0.2.tgz", "integrity": "sha512-LAd04GJ+Ah7EWWH4PWqqKtAGQAqoRf+HvWUcioWk5bNZUa8pZQYh9SXCKCkGfFN8hh4PezUtpstI1DmM009n5Q==" }, + "node_modules/d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-collection": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", @@ -3690,11 +3765,77 @@ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-dispatch": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/d3-dsv/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", @@ -3703,6 +3844,17 @@ "node": ">=12" } }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-force": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", @@ -3737,6 +3889,14 @@ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-interpolate": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", @@ -3756,11 +3916,27 @@ "node": ">=12" } }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-quadtree": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==" }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-scale": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-1.0.4.tgz", @@ -3819,6 +3995,14 @@ "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-shape": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", @@ -3873,11 +4057,152 @@ "node": ">=12" } }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, "node_modules/d3-voronoi": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.1.tgz", "integrity": "sha512-Moym3sFHgmzjQ9RhJN4Ek8eAPDtmOjf105ZFINsj4Qf5WPxQC/Ntsrxf5uxJ86JZPgxOVgR0SxGnFdXzL9L/mQ==" }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-contour": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", + "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-format": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-geo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", + "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3/node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -3963,6 +4288,14 @@ "node": ">=8" } }, + "node_modules/delaunator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.0.1.tgz", + "integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -6844,6 +7177,16 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/robust-predicates": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", + "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -6867,8 +7210,7 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/scheduler": { "version": "0.19.1", diff --git a/package.json b/package.json index 06d82f0..c4c1ab0 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "dependencies": { "@react-spring/web": "^9.7.4", "color": "~4.2.3", + "d3": "^7.9.0", "d3-array": "1.0.2", "d3-contour": "~1.1.2", "d3-force": "~1.2.1", From 863bb83920281e36e27d464b033ecac8e696c716 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 24 Oct 2024 17:17:24 -0400 Subject: [PATCH 5/8] Fixed withRedux decorator to pass in initial state via parameters. --- .storybook/decorators.js | 37 +++++++++++++------ .../ModerateCommentsAccepted.stories.js | 7 ++++ .../ModerateCommentsRejected.stories.js | 7 ++++ .../ModerateCommentsTodo.stories.js | 9 ++++- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/.storybook/decorators.js b/.storybook/decorators.js index 5f1a81a..7f724ce 100644 --- a/.storybook/decorators.js +++ b/.storybook/decorators.js @@ -7,12 +7,6 @@ import configureStore from '../codebases/compdem/client-admin/src/store' import { MemoryRouter } from 'react-router' import { getAcceptedComments, getRejectedComments, getUnmoderatedComments } from './utils' -const store = configureStore({ - mod_comments_unmoderated: getUnmoderatedComments(), - mod_comments_accepted: getAcceptedComments(), - mod_comments_rejected: getRejectedComments() -}) - export const withThemeUi = (Story) => ( @@ -25,11 +19,32 @@ export const withDelibThemeUi = (Story) => ( ) -export const withRedux = (Story) => ( - - - -) +/** + * + * Provide components support for redux-store + * optionally passing custom initial state, and using default initial state if not passed + * + * @example + * export const MyComponent = () => Template.bind({}) + * MyComponent.parameters = { + * store: { + * initialState: { + * foo: 'bar' + * }, + * } + * }; + * + * Source: https://github.com/yannbf/mealdrop/blob/main/.storybook/decorators.tsx#L118 + */ +export const withRedux = (Story, { parameters }) => { + // Creates a store by merging optional custom initialState + const store = configureStore(parameters.store?.initialState || {}) + return ( + + + + ) +} export const svgDecorator = (Story) => ( diff --git a/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js b/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js index 4083342..b6a23ad 100644 --- a/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js +++ b/stories/compdem/client-admin/ModerateCommentsAccepted.stories.js @@ -6,6 +6,13 @@ import { getAcceptedComments } from "../../../.storybook/utils"; export default { component: ModerateCommentsAccepted, decorators: [withThemeUi, withRedux], + parameters: { + store: { + initialState: { + mod_comments_accepted: {}, + }, + }, + }, }; const Template = (args) => ; diff --git a/stories/compdem/client-admin/ModerateCommentsRejected.stories.js b/stories/compdem/client-admin/ModerateCommentsRejected.stories.js index 75f9516..ddd1315 100644 --- a/stories/compdem/client-admin/ModerateCommentsRejected.stories.js +++ b/stories/compdem/client-admin/ModerateCommentsRejected.stories.js @@ -6,6 +6,13 @@ import { getRejectedComments } from "../../../.storybook/utils"; export default { component: ModerateCommentsRejected, decorators: [withThemeUi, withRedux], + parameters: { + store: { + initialState: { + mod_comments_rejected: {}, + }, + }, + }, }; const Template = (args) => ; diff --git a/stories/compdem/client-admin/ModerateCommentsTodo.stories.js b/stories/compdem/client-admin/ModerateCommentsTodo.stories.js index 0eff6e1..cf9cfb1 100644 --- a/stories/compdem/client-admin/ModerateCommentsTodo.stories.js +++ b/stories/compdem/client-admin/ModerateCommentsTodo.stories.js @@ -6,6 +6,13 @@ import ModerateCommentsTodo from "../../../codebases/compdem/client-admin/src/co export default { component: ModerateCommentsTodo, decorators: [withThemeUi, withRedux], + parameters: { + store: { + initialState: { + mod_comments_unmoderated: {}, + }, + }, + }, }; const Template = (args) => ; @@ -13,4 +20,4 @@ const Template = (args) => ; export const Default = Template.bind({}); Default.args = { unmoderated_comments: getUnmoderatedComments(), -}; +} From 3f595b9f14c414f361c85defb635438611914f4d Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 24 Oct 2024 17:18:34 -0400 Subject: [PATCH 6/8] Downgraded redux from v4.2.1 to v4.0.5 to match upstream client-admin. --- package-lock.json | 367 +++------------------------------------------- package.json | 5 +- 2 files changed, 19 insertions(+), 353 deletions(-) diff --git a/package-lock.json b/package-lock.json index abfcc08..4d83d8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,6 @@ "dependencies": { "@react-spring/web": "^9.7.4", "color": "~4.2.3", - "d3": "^7.9.0", "d3-array": "1.0.2", "d3-contour": "~1.1.2", "d3-force": "~1.2.1", @@ -45,8 +44,8 @@ "react-dom": "^16.14.0", "react-redux": "7.2.2", "react-router-dom": "^5.2.0", - "redux": "^4.2.1", - "redux-thunk": "~2.3.0", + "redux": "4.0.5", + "redux-thunk": "2.3.0", "storybook": "^8.3.2", "storybook-branch-switcher": "^0.5.0" } @@ -3660,85 +3659,11 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, - "node_modules/d3": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", - "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", - "dependencies": { - "d3-array": "3", - "d3-axis": "3", - "d3-brush": "3", - "d3-chord": "3", - "d3-color": "3", - "d3-contour": "4", - "d3-delaunay": "6", - "d3-dispatch": "3", - "d3-drag": "3", - "d3-dsv": "3", - "d3-ease": "3", - "d3-fetch": "3", - "d3-force": "3", - "d3-format": "3", - "d3-geo": "3", - "d3-hierarchy": "3", - "d3-interpolate": "3", - "d3-path": "3", - "d3-polygon": "3", - "d3-quadtree": "3", - "d3-random": "3", - "d3-scale": "4", - "d3-scale-chromatic": "3", - "d3-selection": "3", - "d3-shape": "3", - "d3-time": "3", - "d3-time-format": "4", - "d3-timer": "3", - "d3-transition": "3", - "d3-zoom": "3" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/d3-array": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.0.2.tgz", "integrity": "sha512-LAd04GJ+Ah7EWWH4PWqqKtAGQAqoRf+HvWUcioWk5bNZUa8pZQYh9SXCKCkGfFN8hh4PezUtpstI1DmM009n5Q==" }, - "node_modules/d3-axis": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", - "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-brush": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", - "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-drag": "2 - 3", - "d3-interpolate": "1 - 3", - "d3-selection": "3", - "d3-transition": "3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-chord": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", - "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", - "dependencies": { - "d3-path": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/d3-collection": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", @@ -3765,77 +3690,11 @@ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" }, - "node_modules/d3-delaunay": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", - "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", - "dependencies": { - "delaunator": "5" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/d3-dispatch": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" }, - "node_modules/d3-drag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", - "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-selection": "3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-dsv": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", - "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", - "dependencies": { - "commander": "7", - "iconv-lite": "0.6", - "rw": "1" - }, - "bin": { - "csv2json": "bin/dsv2json.js", - "csv2tsv": "bin/dsv2dsv.js", - "dsv2dsv": "bin/dsv2dsv.js", - "dsv2json": "bin/dsv2json.js", - "json2csv": "bin/json2dsv.js", - "json2dsv": "bin/json2dsv.js", - "json2tsv": "bin/json2dsv.js", - "tsv2csv": "bin/dsv2dsv.js", - "tsv2json": "bin/dsv2json.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-dsv/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "engines": { - "node": ">= 10" - } - }, - "node_modules/d3-dsv/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", @@ -3844,17 +3703,6 @@ "node": ">=12" } }, - "node_modules/d3-fetch": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", - "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", - "dependencies": { - "d3-dsv": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/d3-force": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", @@ -3889,14 +3737,6 @@ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" }, - "node_modules/d3-hierarchy": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", - "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", - "engines": { - "node": ">=12" - } - }, "node_modules/d3-interpolate": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", @@ -3916,27 +3756,11 @@ "node": ">=12" } }, - "node_modules/d3-polygon": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", - "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", - "engines": { - "node": ">=12" - } - }, "node_modules/d3-quadtree": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==" }, - "node_modules/d3-random": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", - "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", - "engines": { - "node": ">=12" - } - }, "node_modules/d3-scale": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-1.0.4.tgz", @@ -3995,14 +3819,6 @@ "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" }, - "node_modules/d3-selection": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", - "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", - "engines": { - "node": ">=12" - } - }, "node_modules/d3-shape": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", @@ -4057,152 +3873,11 @@ "node": ">=12" } }, - "node_modules/d3-transition": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", - "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", - "dependencies": { - "d3-color": "1 - 3", - "d3-dispatch": "1 - 3", - "d3-ease": "1 - 3", - "d3-interpolate": "1 - 3", - "d3-timer": "1 - 3" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "d3-selection": "2 - 3" - } - }, "node_modules/d3-voronoi": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/d3-voronoi/-/d3-voronoi-1.1.1.tgz", "integrity": "sha512-Moym3sFHgmzjQ9RhJN4Ek8eAPDtmOjf105ZFINsj4Qf5WPxQC/Ntsrxf5uxJ86JZPgxOVgR0SxGnFdXzL9L/mQ==" }, - "node_modules/d3-zoom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", - "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-drag": "2 - 3", - "d3-interpolate": "1 - 3", - "d3-selection": "2 - 3", - "d3-transition": "2 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-array": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", - "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", - "dependencies": { - "internmap": "1 - 2" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-contour": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", - "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", - "dependencies": { - "d3-array": "^3.2.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-dispatch": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", - "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-force": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", - "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", - "dependencies": { - "d3-dispatch": "1 - 3", - "d3-quadtree": "1 - 3", - "d3-timer": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-format": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", - "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-geo": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", - "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", - "dependencies": { - "d3-array": "2.5.0 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-quadtree": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", - "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-scale": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", - "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", - "dependencies": { - "d3-array": "2.10.0 - 3", - "d3-format": "1 - 3", - "d3-interpolate": "1.2.0 - 3", - "d3-time": "2.1.1 - 3", - "d3-time-format": "2 - 4" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-scale-chromatic": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", - "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", - "dependencies": { - "d3-color": "1 - 3", - "d3-interpolate": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3/node_modules/d3-time-format": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", - "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", - "dependencies": { - "d3-time": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -4288,14 +3963,6 @@ "node": ">=8" } }, - "node_modules/delaunator": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.0.1.tgz", - "integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==", - "dependencies": { - "robust-predicates": "^3.0.2" - } - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -7035,11 +6702,12 @@ } }, "node_modules/redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz", + "integrity": "sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==", "dependencies": { - "@babel/runtime": "^7.9.2" + "loose-envify": "^1.4.0", + "symbol-observable": "^1.2.0" } }, "node_modules/redux-thunk": { @@ -7177,16 +6845,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/robust-predicates": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", - "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" - }, - "node_modules/rw": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", - "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -7210,7 +6868,8 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "node_modules/scheduler": { "version": "0.19.1", @@ -7677,6 +7336,14 @@ "webpack": ">=2" } }, + "node_modules/symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", diff --git a/package.json b/package.json index c4c1ab0..b1fd84f 100644 --- a/package.json +++ b/package.json @@ -29,15 +29,14 @@ "react-dom": "^16.14.0", "react-redux": "7.2.2", "react-router-dom": "^5.2.0", - "redux": "^4.2.1", - "redux-thunk": "~2.3.0", + "redux": "4.0.5", + "redux-thunk": "2.3.0", "storybook": "^8.3.2", "storybook-branch-switcher": "^0.5.0" }, "dependencies": { "@react-spring/web": "^9.7.4", "color": "~4.2.3", - "d3": "^7.9.0", "d3-array": "1.0.2", "d3-contour": "~1.1.2", "d3-force": "~1.2.1", From 30f1794adc131f7a44292f871460f7095d06dc20 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 24 Oct 2024 17:35:06 -0400 Subject: [PATCH 7/8] Revert back to storybook-prep branch to avoid d3 import incompatibilities. --- codebases/compdem | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codebases/compdem b/codebases/compdem index 08a9d66..24604e5 160000 --- a/codebases/compdem +++ b/codebases/compdem @@ -1 +1 @@ -Subproject commit 08a9d666bf52152b6e0cfed4041205967750bd6e +Subproject commit 24604e5fa1a1e32357b18237b33510c26d3bd3fb From ebbfa21bdf6aa994e7c835dd21211242830b80f8 Mon Sep 17 00:00:00 2001 From: thomassth Date: Thu, 24 Oct 2024 19:06:15 -0400 Subject: [PATCH 8/8] cleanup --- .storybook/decorators.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.storybook/decorators.js b/.storybook/decorators.js index 7f724ce..961e4b6 100644 --- a/.storybook/decorators.js +++ b/.storybook/decorators.js @@ -5,7 +5,6 @@ import haiDelibTheme from '../codebases/UT-HAI/client-deliberation/src/theme' import { Provider as ReduxProvider } from 'react-redux' import configureStore from '../codebases/compdem/client-admin/src/store' import { MemoryRouter } from 'react-router' -import { getAcceptedComments, getRejectedComments, getUnmoderatedComments } from './utils' export const withThemeUi = (Story) => ( @@ -38,7 +37,7 @@ export const withDelibThemeUi = (Story) => ( */ export const withRedux = (Story, { parameters }) => { // Creates a store by merging optional custom initialState - const store = configureStore(parameters.store?.initialState || {}) + const store = configureStore(parameters.store?.initialState) return (