Skip to content
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

Add tour to ccdb #409

Merged
merged 32 commits into from
Sep 16, 2022
Merged

Add tour to ccdb #409

merged 32 commits into from
Sep 16, 2022

Conversation

flacoman91
Copy link
Contributor

Short description explaining the high-level reason for the pull request

Additions

Removals

Changes

Testing

Screenshots

Notes

Todos

Checklist

  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the front end playbook
  • Passes all existing automated tests
  • New functions include new tests
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged
  • Visually tested in supported browsers and devices
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

@flacoman91
Copy link
Contributor Author

@anselmbradford this is almost ready. I still have some things I need to work out in the Tour component.

Could you take over and assist with the styling?

* @param {string} value the new payload from the tooltip
* @returns {string} a packaged payload to be used by Redux reducers
*/
export function tourToggled( value ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would write a test for this, but it's unnecessary esp if we are going to convert to redux toolkit.


// hacks to setup the page. we should figure out if we should
// have this in redux instead
if ( expand === 9 ) {
Copy link
Member

Choose a reason for hiding this comment

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

Should the 9 go into a constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this so it's more scalable so we don't have to hardcode the number.

document.querySelector( '.advanced-container button' ).click()
}

if ( expand === 16 ) {
Copy link
Member

Choose a reason for hiding this comment

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

Should the 16 go into a constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as above.

@@ -0,0 +1,16 @@
// Intro.js styles
@import (css) '../../../node_modules/intro.js/introjs.css';
Copy link
Member

Choose a reason for hiding this comment

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

Does @import (css) 'node_modules/intro.js/introjs.css'; work, by chance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. This may be part of the technical debt regarding our build tools.

Screen Shot 2022-08-22 at 6 08 37 PM

@@ -0,0 +1,11 @@
@import (less) "../../css/base.less";
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it could be @import (reference) "../../css/base.less";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this one looks okay.

@flacoman91
Copy link
Contributor Author

flacoman91 commented Aug 23, 2022

Looks like the cookie test all of a sudden failing is a known issue
jsdom/jsdom#3419

@flacoman91 flacoman91 marked this pull request as ready for review August 26, 2022 18:33
@flacoman91 flacoman91 changed the title WIP: Add tour to ccdb Add tour to ccdb Aug 26, 2022
@anselmbradford
Copy link
Member

anselmbradford commented Sep 1, 2022

I'm getting an error on the end tour step

Screen Shot 2022-09-01 at 12 29 58 PM

EDIT: Looked at this further and it happens when I navigate through the tour with the return key. If I click the End Tour button at the end it closes, but if I use the return key it errors as above and then is broken and clicking doesn't work anymore.

@flacoman91
Copy link
Contributor Author

updates responding to GHE 2104 have been made.

@flacoman91
Copy link
Contributor Author

removed Date Range steps in trends and map as requested.

@flacoman91
Copy link
Contributor Author

Restored links and table of contents. made only "Index" a title heading

Screen Shot 2022-09-07 at 3 39 36 PM

Screen Shot 2022-09-07 at 3 39 04 PM

@@ -48,7 +48,7 @@ export class Select extends React.Component {
const values = this.getValues()

return (
<section className="cf-select">
<section className={'cf-select ' + this.props.id}>
Copy link
Member

Choose a reason for hiding this comment

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

Should this.props.id go in an id attribute instead of class?

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see in the snapshot it gets repeated. Well, instead of super generic class names like size and sort, let's prefix this to be <section className={'cf-select cf-select__' + this.props.id}>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to add this here so that I could target these for highlighting in intro.js here

https://github.com/cfpb/ccdb5-ui/pull/409/files#diff-1f017f3f6619b22aabaa7855af7aa91b94892609d8f7f765b5d5c942c4565d98R60

I think it might be possible to update the document.querySelector call to look for attributes instead

Copy link
Member

Choose a reason for hiding this comment

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

Hm yea, that actually would be the best way. The prefixed class sets this up as a modifier on cf-select, which implies that cf-select__sort (or whatever) is modifying cf-select. In actuality it is being used as an ID. That's not a big deal, but it could send someone off to look for the modifying CSS. If you want, you should be able to do <section className="cf-select" data-tour={this.props.id}> and query it with document.querySelector('[data-tour="sort"]'), or document.querySelector('section[data-tour="sort"]').

package.json Outdated
@@ -149,5 +149,9 @@
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
Copy link
Member

Choose a reason for hiding this comment

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

I think we want everything on devDependencies, as I think dependencies end up in the npm package. Since the npm package is just delivering a built JS file, I don't think we want anything else there.

Copy link
Member

@anselmbradford anselmbradford left a comment

Choose a reason for hiding this comment

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

You could update to use data- attributes, but otherwise looks good

@@ -44,19 +44,21 @@ export class Select extends React.Component {
}

render() {
const id = 'choose-' + this.props.id
const id = 'select-' + this.props.id
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i just renamed this to select vs choose, since that makes more sense.

@flacoman91
Copy link
Contributor Author

You could update to use data- attributes, but otherwise looks good

I updated it here and also renamed the id to make it clearer.

@flacoman91 flacoman91 merged commit a16855d into main Sep 16, 2022
@flacoman91 flacoman91 deleted the rad-ccdb-tour branch September 16, 2022 14:49
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.

None yet

3 participants