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

(fix) Refactor login and location picker components #614

Merged
merged 1 commit into from
Feb 22, 2023
Merged

Conversation

denniskigen
Copy link
Member

@denniskigen denniskigen commented Feb 22, 2023

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.
  • I have updated the esm-framework mock to reflect any API changes I have made.

Summary

This PR refactors the components that handle logging in and selecting a location. Specifically, it:

  • Refactors the LocationPicker component to get rid of a bunch of unnecessary useEffect calls.
  • Refactors the Login component so a loading state gets shown and the button gets disabled when the Log in button gets clicked. It also refactors the Contact the site administrator link, changing it from a button to a ConfigurableLink.
  • Applies some UI tweaks, including:
    • Constraining the height of the login page card so it doesn't get scrunched up on small viewports.
    • Changing the spacing around the error message container on the login page.
    • Changing the background colour of primary buttons from brand-01 to brand-03.
    • Removing the blue outline from the close buttons of search inputs that get shown on hover.

Video

Kapture.2023-02-22.at.20.34.49.mp4

@github-actions
Copy link
Contributor

Size Change: +666 B (0%)

Total Size: 2.05 MB

Filename Size Change
packages/apps/esm-login-app/dist/581.js 0 B -23.9 kB (removed) 🏆
packages/apps/esm-login-app/dist/904.js 24.4 kB +24.4 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
packages/apps/esm-devtools-app/dist/733.js 3.55 kB 0 B
packages/apps/esm-devtools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-devtools-app/dist/889.js 109 kB 0 B
packages/apps/esm-devtools-app/dist/988.js 362 B 0 B
packages/apps/esm-devtools-app/dist/main.js 2.87 kB 0 B
packages/apps/esm-devtools-app/dist/openmrs-esm-devtools-app.js 3.04 kB 0 B
packages/apps/esm-implementer-tools-app/dist/102.js 2.76 kB 0 B
packages/apps/esm-implementer-tools-app/dist/146.js 6.71 kB 0 B
packages/apps/esm-implementer-tools-app/dist/246.js 1.14 kB 0 B
packages/apps/esm-implementer-tools-app/dist/280.js 3.46 kB 0 B
packages/apps/esm-implementer-tools-app/dist/284.js 1.46 kB 0 B
packages/apps/esm-implementer-tools-app/dist/319.js 454 B 0 B
packages/apps/esm-implementer-tools-app/dist/406.js 11.8 kB 0 B
packages/apps/esm-implementer-tools-app/dist/519.js 2.36 kB 0 B
packages/apps/esm-implementer-tools-app/dist/531.js 1.49 kB 0 B
packages/apps/esm-implementer-tools-app/dist/542.js 2.04 kB 0 B
packages/apps/esm-implementer-tools-app/dist/574.js 421 B 0 B
packages/apps/esm-implementer-tools-app/dist/620.js 126 kB 0 B
packages/apps/esm-implementer-tools-app/dist/626.js 5.06 kB 0 B
packages/apps/esm-implementer-tools-app/dist/684.js 61.8 kB 0 B
packages/apps/esm-implementer-tools-app/dist/697.js 11.7 kB 0 B
packages/apps/esm-implementer-tools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-implementer-tools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-implementer-tools-app/dist/889.js 109 kB 0 B
packages/apps/esm-implementer-tools-app/dist/main.js 3.94 kB 0 B
packages/apps/esm-implementer-tools-app/dist/openmrs-esm-implementer-tools-app.js 3.26 kB 0 B
packages/apps/esm-login-app/dist/236.js 268 B 0 B
packages/apps/esm-login-app/dist/240.js 359 B 0 B
packages/apps/esm-login-app/dist/272.js 260 B 0 B
packages/apps/esm-login-app/dist/319.js 356 B 0 B
packages/apps/esm-login-app/dist/336.js 224 B 0 B
packages/apps/esm-login-app/dist/390.js 597 B 0 B
packages/apps/esm-login-app/dist/406.js 1.13 kB +1 B (0%)
packages/apps/esm-login-app/dist/420.js 1.61 kB +1 B (0%)
packages/apps/esm-login-app/dist/539.js 294 B 0 B
packages/apps/esm-login-app/dist/574.js 450 B +7 B (+2%)
packages/apps/esm-login-app/dist/607.js 3.86 kB -55 B (-1%)
packages/apps/esm-login-app/dist/611.js 720 B 0 B
packages/apps/esm-login-app/dist/644.js 299 B 0 B
packages/apps/esm-login-app/dist/673.js 278 B 0 B
packages/apps/esm-login-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-login-app/dist/757.js 598 B 0 B
packages/apps/esm-login-app/dist/759.js 16.5 kB 0 B
packages/apps/esm-login-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-login-app/dist/889.js 109 kB 0 B
packages/apps/esm-login-app/dist/897.js 5.43 kB +255 B (+5%) 🔍
packages/apps/esm-login-app/dist/925.js 6.66 kB 0 B
packages/apps/esm-login-app/dist/951.js 1.32 kB +1 B (0%)
packages/apps/esm-login-app/dist/98.js 5.71 kB 0 B
packages/apps/esm-login-app/dist/main.js 3.3 kB 0 B
packages/apps/esm-login-app/dist/openmrs-esm-login-app.js 3.18 kB 0 B
packages/apps/esm-offline-tools-app/dist/106.js 7.44 kB 0 B
packages/apps/esm-offline-tools-app/dist/126.js 1.35 kB 0 B
packages/apps/esm-offline-tools-app/dist/259.js 2.76 kB 0 B
packages/apps/esm-offline-tools-app/dist/290.js 434 B 0 B
packages/apps/esm-offline-tools-app/dist/316.js 3.57 kB 0 B
packages/apps/esm-offline-tools-app/dist/373.js 2.83 kB 0 B
packages/apps/esm-offline-tools-app/dist/386.js 51.2 kB 0 B
packages/apps/esm-offline-tools-app/dist/391.js 299 B 0 B
packages/apps/esm-offline-tools-app/dist/412.js 3.85 kB 0 B
packages/apps/esm-offline-tools-app/dist/456.js 1.89 kB 0 B
packages/apps/esm-offline-tools-app/dist/518.js 2.1 kB 0 B
packages/apps/esm-offline-tools-app/dist/534.js 5.46 kB 0 B
packages/apps/esm-offline-tools-app/dist/541.js 379 B 0 B
packages/apps/esm-offline-tools-app/dist/574.js 996 B 0 B
packages/apps/esm-offline-tools-app/dist/58.js 1.99 kB 0 B
packages/apps/esm-offline-tools-app/dist/733.js 285 B 0 B
packages/apps/esm-offline-tools-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-offline-tools-app/dist/740.js 4.58 kB 0 B
packages/apps/esm-offline-tools-app/dist/757.js 1.14 kB 0 B
packages/apps/esm-offline-tools-app/dist/759.js 16.5 kB 0 B
packages/apps/esm-offline-tools-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-offline-tools-app/dist/889.js 109 kB 0 B
packages/apps/esm-offline-tools-app/dist/925.js 6.66 kB 0 B
packages/apps/esm-offline-tools-app/dist/967.js 489 B 0 B
packages/apps/esm-offline-tools-app/dist/996.js 5.88 kB 0 B
packages/apps/esm-offline-tools-app/dist/main.js 52.3 kB 0 B
packages/apps/esm-offline-tools-app/dist/openmrs-esm-offline-tools-app.js 3.26 kB 0 B
packages/apps/esm-primary-navigation-app/dist/146.js 6.72 kB 0 B
packages/apps/esm-primary-navigation-app/dist/216.js 544 B 0 B
packages/apps/esm-primary-navigation-app/dist/34.js 3.04 kB 0 B
packages/apps/esm-primary-navigation-app/dist/414.js 461 B 0 B
packages/apps/esm-primary-navigation-app/dist/473.js 1.16 kB 0 B
packages/apps/esm-primary-navigation-app/dist/483.js 11.4 kB 0 B
packages/apps/esm-primary-navigation-app/dist/574.js 178 B 0 B
packages/apps/esm-primary-navigation-app/dist/656.js 5.52 kB 0 B
packages/apps/esm-primary-navigation-app/dist/710.js 6.28 kB 0 B
packages/apps/esm-primary-navigation-app/dist/723.js 4.52 kB 0 B
packages/apps/esm-primary-navigation-app/dist/735.js 2.63 kB 0 B
packages/apps/esm-primary-navigation-app/dist/757.js 202 B 0 B
packages/apps/esm-primary-navigation-app/dist/787.js 9.38 kB 0 B
packages/apps/esm-primary-navigation-app/dist/788.js 42.9 kB 0 B
packages/apps/esm-primary-navigation-app/dist/889.js 109 kB 0 B
packages/apps/esm-primary-navigation-app/dist/98.js 2.2 kB 0 B
packages/apps/esm-primary-navigation-app/dist/main.js 9.4 kB 0 B
packages/apps/esm-primary-navigation-app/dist/openmrs-esm-primary-navigation-app.js 3.27 kB 0 B
packages/framework/esm-api/dist/openmrs-esm-api.js 9.49 kB 0 B
packages/framework/esm-breadcrumbs/dist/openmrs-esm-breadcrumbs.js 3.24 kB 0 B
packages/framework/esm-config/dist/openmrs-esm-module-config.js 7.87 kB 0 B
packages/framework/esm-error-handling/dist/openmrs-esm-error-handling.js 1.41 kB 0 B
packages/framework/esm-extensions/dist/openmrs-esm-extensions.js 8.45 kB 0 B
packages/framework/esm-framework/dist/openmrs-esm-framework.js 202 kB 0 B
packages/framework/esm-globals/dist/openmrs-esm-globals.js 1.59 kB 0 B
packages/framework/esm-offline/dist/openmrs-esm-offline.js 35 kB 0 B
packages/framework/esm-react-utils/dist/openmrs-esm-react-utils.js 18.2 kB 0 B
packages/framework/esm-state/dist/openmrs-esm-state.js 1.47 kB 0 B
packages/framework/esm-styleguide/dist/openmrs-esm-styleguide.js 19 kB 0 B
packages/framework/esm-utils/dist/openmrs-esm-utils.js 10.8 kB 0 B
packages/shell/esm-app-shell/dist/b027c420fa9c0ea61b1b.js 922 B 0 B
packages/shell/esm-app-shell/dist/openmrs.js 350 kB 0 B
packages/shell/esm-app-shell/dist/service-worker.js 51.1 kB +1 B (0%)
packages/tooling/openmrs/dist/cli.js 2.8 kB 0 B
packages/tooling/openmrs/dist/commands/assemble.js 2.45 kB 0 B
packages/tooling/openmrs/dist/commands/build.js 1.16 kB 0 B
packages/tooling/openmrs/dist/commands/debug.js 539 B 0 B
packages/tooling/openmrs/dist/commands/develop.js 1.66 kB 0 B
packages/tooling/openmrs/dist/commands/index.js 360 B 0 B
packages/tooling/openmrs/dist/commands/start.js 848 B 0 B
packages/tooling/openmrs/dist/index.js 445 B 0 B
packages/tooling/openmrs/dist/runner.js 799 B 0 B
packages/tooling/openmrs/dist/utils/config.js 639 B 0 B
packages/tooling/openmrs/dist/utils/debugger.js 529 B 0 B
packages/tooling/openmrs/dist/utils/dependencies.js 300 B 0 B
packages/tooling/openmrs/dist/utils/helpers.js 275 B 0 B
packages/tooling/openmrs/dist/utils/importmap.js 2.79 kB 0 B
packages/tooling/openmrs/dist/utils/index.js 370 B 0 B
packages/tooling/openmrs/dist/utils/logger.js 234 B 0 B
packages/tooling/openmrs/dist/utils/npmConfig.js 854 B 0 B
packages/tooling/openmrs/dist/utils/untar.js 648 B 0 B
packages/tooling/openmrs/dist/utils/variables.js 192 B 0 B
packages/tooling/openmrs/dist/utils/webpack.js 276 B 0 B
packages/tooling/webpack-config/dist/index.js 3.01 kB 0 B
packages/tooling/webpack-config/dist/optimize.js 1.79 kB 0 B

compressed-size-action

Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

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

Great work!

@ibacher
Copy link
Member

ibacher commented Feb 22, 2023

PS We may want to assess getting rid of the "Contact the Administrator" button / link... It seems much more user-hostile to have a do-nothing link than no link at all.

@ibacher ibacher changed the title (refactor) Refactor login and location picker components (fix) Refactor login and location picker components Feb 22, 2023
@ibacher ibacher merged commit 9e4bce8 into main Feb 22, 2023
@ibacher ibacher deleted the refactor/login branch February 22, 2023 17:43
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.

2 participants