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

fixeat(SFINT-3295): Improve UserActions interactivity #81

Merged
merged 5 commits into from
Jul 8, 2020

Conversation

louis-bompart
Copy link
Collaborator

Changes

Add useResponsiveManager option

Add a useResponsiveManager option, default to true. Previous behaviour is kept, meaning that if you have hidden, the useResponsiveManager will be inoperant because hidden does super-seed it.

It allows SFINT to use the UserActions without hooking it to the ResponsiveComponentManager, will preserving its other functionality.

Add events for show and hide of the UserActions panel

Allow other components to be notified of when the UserActions panel is shown or hidden.

It allows SFINT to sync up the state of the ToggleActionButton with the panel when the latter get closed by something else than the button (e.g. query)

Tests

  • UT
  • SAN checked in SFINT

We want to be able to use the UserAction without him being tied to the ResponsiveComponentManager and without creating a ResponsiveHeaderButton.
this.renderNoActions();
}
} catch (e) {
if (e && e.statusCode === 404) {
Copy link
Collaborator Author

@louis-bompart louis-bompart Jul 8, 2020

Choose a reason for hiding this comment

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

Wanted to use optional chaining, was not able because of prettier, so #80 should fix it and allow latest TypeScript features to be used.

this.renderNoActions();
}
} catch (e) {
if (e && e.statusCode === 404) {

Choose a reason for hiding this comment

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

Why are we only checking for status code 404?

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 we're still considering the others status code, but do not wish to take special action for them other than render no actions.

I'm guessing that if https://platformqa.cloud.coveo.com/docs/?api=Reveal#!/User32Profiles/rest_organizations_paramId_machinelearning_user_actions_post answer 404, it means the feature is not enabled on the client organization.

Copy link
Contributor

@nathanlb nathanlb left a comment

Choose a reason for hiding this comment

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

I like it

@louis-bompart louis-bompart merged commit b6a3a3a into master Jul 8, 2020
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