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

refactor(progress-bar): refactor progress bars initial commit #15231

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

desig9stein
Copy link
Contributor

Closes #15162

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@desig9stein desig9stein marked this pull request as ready for review January 13, 2025 08:30
Comment on lines +126 to +145
$bar-height: map.get((
'material': rem(4px),
'fluent': rem(2px),
'bootstrap': rem(16px),
'indigo': rem(4px),
), $variant);

$bar-height: map.get((
'material': rem(4px),
'fluent': rem(2px),
'bootstrap': rem(16px),
'indigo': rem(4px),
), $variant);

$strip-size: map.get((
'material': rem(16px),
'fluent': rem(16px),
'bootstrap': rem(5px),
'indigo': rem(16px),
), $variant);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, all of these should be listed as design tokens in the component schema. Let's defer this for now and add it to another task for when we refactor the token system in the theming 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 am adding a TODO so we don't forget about this

expect(progress.max).toBe(defaultMaxValue);
expect(progress.value).toBe(0);
});
function clasListContains(element: HTMLElement, className: string, expected: boolean) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
function clasListContains(element: HTMLElement, className: string, expected: boolean) {
function classListContains(element: HTMLElement, className: string, expected: boolean) {

Comment on lines +29 to +31
function clasListContains(element: HTMLElement, className: string, expected: boolean) {
expect(element.classList.contains(className)).toBe(expected);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
function clasListContains(element: HTMLElement, className: string, expected: boolean) {
expect(element.classList.contains(className)).toBe(expected);
}
function hasClass(element: HTMLElement, className: string, expected: boolean) {
expect(element.classList.contains(className)).toBe(expected);
}

This function is declared both here and in the circular tests. Extract it into the helper-utils.spec.ts in the test-utils folder.

Comment on lines +5 to +7
@Component({
template: '',
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@Component({
template: '',
})
@Directive()

@Component({
template: '',
})
class TestProgressComponent extends BaseProgressDirective {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
class TestProgressComponent extends BaseProgressDirective {
class TestProgressDirective extends BaseProgressDirective {

@@ -203,27 +196,48 @@ export abstract class BaseProgressDirective {
return this._max;
}

@HostBinding('style')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This means that any style attribute the end-users apply to the progressbar component will be overridden by this method.

simeonoff and others added 4 commits January 14, 2025 10:24
…ess/circular/_circular-theme.scss

Co-authored-by: Simeon Simeonoff <sim.simeonoff@gmail.com>
…onent.spec.ts

Co-authored-by: Simeon Simeonoff <sim.simeonoff@gmail.com>
…ent.spec.ts

Co-authored-by: Simeon Simeonoff <sim.simeonoff@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SSR] Progress bar throws an error when using within a SSR project
2 participants