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 loading spinner beside add button #5129

Conversation

AdrianaMoralesQ
Copy link
Contributor

@AdrianaMoralesQ AdrianaMoralesQ commented Mar 18, 2023

Proposed Changes

Hi, @coronasafe/code-reviewers !

LoadingSpinner

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.

  • Update product documentation.

  • Ensure that UI text is kept in I18n files.

  • Prep screenshot or demo video for changelog entry, and attach it to issue.

  • Request for Peer Reviews

  • Completion of QA

@AdrianaMoralesQ AdrianaMoralesQ requested a review from a team March 18, 2023 17:10
@AdrianaMoralesQ AdrianaMoralesQ requested a review from a team as a code owner March 18, 2023 17:10
@vercel
Copy link

vercel bot commented Mar 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 23, 2023 at 3:53PM (UTC)

@netlify
Copy link

netlify bot commented Mar 18, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 267f176
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/641c7563c768050008c3f1fd
😎 Deploy Preview https://deploy-preview-5129--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment on lines 135 to 139
{isLoading ? null : (
<div className="mb-2 mt-4">
{hasSkills ? (
<SkillsArray
isLoading={isLoading}
Copy link
Contributor

Choose a reason for hiding this comment

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

CircularProgress we can add instead of null

import ButtonV2 from "../Common/components/ButtonV2";
import { SkillModel } from "./models";

const SELECT_SKILLS_COPY = "Select and add some skills";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we decleare constant Is this use again & again.

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

@AdrianaMoralesQ

  • We don't follow .Components.tsx file naming formats.
  • For the "literal strings not allowed" warning, you may make use of translations const { t } = useTranslations(); and wrap the text like <Component label={t("add_skill")} />. Also make sure the key add_skill is present in the en locale files such as en/Common.json or any other relevant context-specific locales.
  • Would be nice if the loading spinner was inside the button to the left of the "Add" text.

@AdrianaMoralesQ
Copy link
Contributor Author

Working on this!

@AdrianaMoralesQ
Copy link
Contributor Author

AdrianaMoralesQ commented Mar 22, 2023

@rithviknishad and @ayushjnv1 : I've made the changes as requested.
Screenshot 2023-03-22 at 2 51 05 PM

  • Renamed file since we don't follow .Components.tsx file naming formats.
  • Added const { t } = useTranslations(); and wrapped as mentioned. I added three relevant strings to the en locale files in en/Common.json.
  • Added inside the "Add" button. It replaces the "Add" instead of appearing beside it because IMO it looks better - otherwise the button grows and shrinks when the spinner appears/disappears.
  • CircularProgress was added instead of null

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

  • The button size changes between loading and not loading states.

Other than that LGTM.

Just feedback, Kindly make sure to avoid too many irrelevant changes. 90% of the changes present in this PR are not relevant to adding loading the spinner for add button. It would roughly take only 3~6 lines of change to achieve, but we have around 100+ lines of change here.

@AdrianaMoralesQ
Copy link
Contributor Author

Hi,

Feedback noted - I got carried away trying to get rid of the ESLINT error, but I understand that it wasn't in scope.

I've made the change to the spinner and it's no longer changing in size.

@sonarcloud
Copy link

sonarcloud bot commented Mar 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@skks1212 skks1212 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

LGTM

@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit 37645da into coronasafe:develop Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants