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

MGDCTRS-1926 chore: remove app-services-ui-shared usage #799

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gashcrumb
Copy link
Contributor

@gashcrumb gashcrumb commented Apr 5, 2023

The first commit removes the calls to useBasename provided by app-services-ui-shared. It also updates the way chrome is accessed when initializing analytics, as accessing insights chrome via the window object has been marked deprecated. Also this change removes a duplicate package from the package.json file.

The 2nd commit in this PR removes references to Auth and useAuth from app-services-ui-shared and replaces them with the functional equivalent, when the app is a federated module the token is obtained from the insights chrome object, when the app is being run for local development keycloak is used and finally for the e2e tests a dummy value is used.

The 3rd commit in this PR introduces a local useAlert hook to replace the implementation from app-services-ui-shared. In federated mode this hook is now connected to the console notification system via frontend-components-notifications, and this component is now a direct dependency. This commit therefore also contains some required initialization code and dependencies such as a redux store and react-redux for frontend-components-notifications. Note: not sure if this quite works in app-services-ui dev mode. Finally, this commit also changes the routing behavior when saving a configuration change, the user remains in the connector detail/overview page when editing a connector instead of going back to the connector list.

The 4th commit removes usage of useConfig from app-services-ui-shared. The data it was providing has been moved to the useCos hook. For the federated entrypoint AppFederated.tsx the mapping that exists in app-services-ui is now local and added to a new endpoints file as constant values. The federated entrypoint will consult this map during initialization and will use the appropriate backend based on the hostname used to access the console. The standalone (AppDemo) and e2e (AppE2E) entrypoints behave as before but each contain their own specific setup to cater for their usage.

The last commit removes the remaining references to app-services-ui-shared from the code as well as from the webpack config. The entry in package.json remains however as app-services-ui-components also has a dependency on this package.

@gashcrumb gashcrumb marked this pull request as draft April 5, 2023 13:28
@gashcrumb gashcrumb marked this pull request as ready for review April 5, 2023 13:39
@gashcrumb gashcrumb changed the title MGDCTRS-1926 chore: remove useBasename usage MGDCTRS-1926 chore: remove useBasename and useAuth usage Apr 5, 2023
@gashcrumb gashcrumb changed the title MGDCTRS-1926 chore: remove useBasename and useAuth usage MGDCTRS-1926 chore: remove useBasename, useAuth and useAlert usage Apr 6, 2023
@gashcrumb gashcrumb force-pushed the MGDCTRS-1926 branch 2 times, most recently from f31edc4 to 7c732f7 Compare April 6, 2023 17:47
@gashcrumb gashcrumb added the do not merge Something in progress label Apr 6, 2023
@gashcrumb gashcrumb changed the title MGDCTRS-1926 chore: remove useBasename, useAuth and useAlert usage MGDCTRS-1926 chore: remove useBasename, useAuth, useAlert and useConfig usage Apr 7, 2023
@gashcrumb gashcrumb changed the title MGDCTRS-1926 chore: remove useBasename, useAuth, useAlert and useConfig usage MGDCTRS-1926 chore: remove app-services-ui-shared usage Apr 7, 2023
@gashcrumb gashcrumb removed the do not merge Something in progress label Apr 10, 2023
@gashcrumb gashcrumb added the do not merge Something in progress label Apr 12, 2023
gashcrumb added 5 commits May 2, 2023 13:56
This change removes the calls to useBasename provided by
app-services-ui-shared.  It also updates the way chrome is accessed when
initializing analytics, as accessing insights chrome via the window
object has been marked deprecated.  Also this change removes a duplicate
package from the package.json file.
This change removes references to Auth and useAuth from
app-services-ui-shared and replaces them with the functional equivalent,
when the app is a federated module the token is obtained from the
insights chrome object, when the app is being run for local development
keycloak is used and finally for the e2e tests a dummy value is used.
This change introduces a local useAlert hook to replace the
implementation from app-services-ui-shared.  In federated mode this hook
is now connected to the console notification system via
frontend-components-notifications, and this component is now a direct
dependency.  This commit therefore also contains some required
initialization code and dependencies such as a redux store and
react-redux for frontend-components-notifications.  Finally, this commit
also changes the routing behavior when saving a configuration change,
the user remains in the connector detail/overview page when editing a
connector instead of going back to the connector list.
This change removes usage of useConfig from app-services-ui-shared.  The
data it was providing has been moved to the useCos hook.  For the
federated entrypoint AppFederated.tsx the mapping that exists in
app-services-ui is now local and added to a new endpoints file as
constant values.  The federated entrypoint will consult this map during
initialization and will use the appropriate backend based on the
hostname used to access the console.  The standalone (AppDemo) and e2e
(AppE2E) entrypoints behave as before but each contain their own
specific setup to cater for their usage.
This change removes the remaining references to app-services-ui-shared
from the code as well as from the webpack config.  The entry in
package.json remains however as app-services-ui-components also has a
dependency on this package.
@gashcrumb
Copy link
Contributor Author

Keeping this around as some of these changes may be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Something in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant