Skip to content

[MDS-4971] In-app help #3271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Oct 18, 2024
Merged

[MDS-4971] In-app help #3271

merged 16 commits into from
Oct 18, 2024

Conversation

taraepp
Copy link
Collaborator

@taraepp taraepp commented Oct 18, 2024

Objective

  • create in-app help feature
  • I left in the stubbed image handler for rich text editor (it was a bit tricky to get it to call the function at all!)

MDS-4971

Why are you making this change? Provide a short explanation and/or screenshots

@@ -35,7 +35,8 @@ const PATHS = {
};

const BUILD_FILE_NAMES = {
css: "style/[name].[contenthash:4].css",
css: "style/[name].[contenthash:8].css",
cssChunkName: "style/[name].[chunkhash:8].css",
Copy link
Collaborator

@simensma-fresh simensma-fresh Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taraepp Reading through our webpack config I remembered we updated this in Minespace a while ago, but looks like we didn't in Core!

Do not know why it fixes the bundle error, but it does (at least when built in production mode locally). Thanks anonymous stackoverflow post

https://stackoverflow.com/questions/71142869/invalid-js-in-webpack-5-bundle-some-numbers-from-source-code-are-replaced-by-nu

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Nice!

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_minespace-web'

Failed conditions
66.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_common'

Failed conditions
69.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link

Quality Gate Passed Quality Gate passed for 'bcgov-sonarcloud_mds_core-web'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
90.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

Quality Gate Passed Quality Gate passed for 'bcgov-sonarcloud_mds_core-api'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
91.7% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@@ -41,42 +41,49 @@ const ProjectSubmissionStatusPage = React.lazy(() =>
export const HOME = {
route: "/",
component: LandingPage,
helpKey: "Home",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thought I'd mention:

  • currently, this is what the title of the guide is based on
  • some of these pages are very difficult to access on prod without actually creating data
  • I anticipate that "title" is going to be an editable field in the future to deal with the first problem
  • as for accessing the pages, I anticipate that CORE users will be able to view a list of keys and pick one without actually going through the motions to get there
  • I duplicated keys where I felt it was appropriate

I didn't worry about it too much about making them perfect right now, I figure that'll come out in testing.

pageTab={pageTab}
/>
) : (
parse(DOMPurify.sanitize(content))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

);
};

const HelpGuide: FC = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is just personal preference, but I generally prefer to have functional components in their own files where possible. I'll leave it up to you though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll leave it this time... The sub-component I only turned into an export so that I'd be able to test it easier!

helpGuides: {},
};

const helpSlice = createAppSlice({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big fan of the slices!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sooo much simpler to write! 🔪

@@ -16,7 +16,7 @@
}

.ant-modal-wrap {
z-index: 1001;
z-index: 1005;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one goes to 11 🎸

Copy link
Collaborator

@matbusby-fw matbusby-fw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! Really nice work! Added one preference for separating functional components to their own files, but I'm not stuck on it, so it's up to you.

@taraepp taraepp merged commit ad29b1a into develop Oct 18, 2024
16 of 18 checks passed
@taraepp taraepp deleted the mds-4971-help branch October 18, 2024 23:01
taraepp added a commit that referenced this pull request Oct 21, 2024
* add roles and packages

* BE: create model, migration, add new role to constants, add basic resource

* create reducer, add to root, add keys to routes

* create HelpGuide component. Copy in rich text editor from prototype, improve later

* add to CORE header. Refactor CORE navbar

* change MS Header to TS and add in help guide. Add in basic CSS rules for tooltips in editor

* fix bugs, add missing functionality

* extract HelpGuide interface

* fix a couple style things on MS, make sure delete is disabled properly

* fix a bug on MS, sanitize HTML, and test sanitization of HTML on MS

* BE testing

* MDS-4971 Updated webpack css chunk filename for MiniCssExtractPlugin to fix webpack bundle issue

---------

Co-authored-by: Simen Fivelstad Smaaberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants