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

chore: OPTIC-1313: Reducing Toast usage in django templates to get rid of toast.min.js #6604

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

yyassi-heartex
Copy link
Contributor

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

reducing relyance on toast.min.js to reduce the need for the extra file

@github-actions github-actions bot added the chore label Nov 5, 2024
Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 64f9005
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/672e7f7409ffbf0008c8bb64

Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 64f9005
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/672e7f74d55b1300089cb8d9

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.63%. Comparing base (d14d01e) to head (64f9005).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6604   +/-   ##
========================================
  Coverage    76.63%   76.63%           
========================================
  Files          169      169           
  Lines        13840    13840           
========================================
  Hits         10606    10606           
  Misses        3234     3234           
Flag Coverage Δ
pytests 76.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@luarmr
Copy link
Contributor

luarmr commented Nov 8, 2024

So cool!

Copy link
Collaborator

Choose a reason for hiding this comment

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

typo in the name of param is app settings: should be persistEnce

Copy link
Collaborator

@hlomzik hlomzik left a comment

Choose a reason for hiding this comment

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

let's fix important typo

@@ -0,0 +1 @@
export { ReactComponent as LsCross } from "./cross.svg";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export { ReactComponent as LsCross } from "./cross.svg";
export { ReactComponent as IconCross } from "./cross.svg";

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is now getting used from the proper place, the name needs to reflect properly what it is. Ls is a namespace based on the application not a particular to the function. Can we update this accordingly here and also let's maybe document this somewhere in the Guild initiatives to call this out.

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 also considered having LSE using this version of cross.svg - but i noticed that the 2 versions of cross.svg are actually different - which is mildly concerning - I'll have one of the designers chime in on that - would be nice to double down on standardization

@@ -1,24 +1,30 @@
import { Toast, ToastAction, type ToastProps } from "../../components/Toast/Toast";
import { Toast, ToastAction, ToastType, type ToastProps } from "../Toast/Toast";
import { LsCross } from "../../assets/icons";
import type { FC } from "react";
import { Block } from "../../utils/bem";
Copy link
Contributor

Choose a reason for hiding this comment

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

BEM cannot be used in the ui library.

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 reservations on this tbh, but this ticket has already exploded in scope so i opted to go down this route. you are right though i'll get rid of BEM in Toast and MessageToast in favor of scss modules

Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be added to the UI library.

Copy link
Contributor

@bmartel bmartel left a comment

Choose a reason for hiding this comment

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

Moving BEM into the UI lib is opening the door for an antipattern we are actively moving away from. Let's remove that and just use standard SCSS means to migrate over. Any component that lands in the UI lib must be kept consistent.

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.

4 participants