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

[AAE-19610] Add specific date range settings to search filter #9250

Merged
merged 4 commits into from
Jan 18, 2024

Conversation

DiogoABastos
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)
Search filter was missing important settings for date-range type

What is the new behaviour?
Important settings for date-range type were introduced to fix this bug:
https://alfresco.atlassian.net/browse/AAE-19610

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@DiogoABastos DiogoABastos requested a review from eromano January 18, 2024 12:10
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@eromano eromano requested a review from MichalKinas January 18, 2024 13:07
@eromano eromano merged commit e1fcaed into develop Jan 18, 2024
33 checks passed
@eromano eromano deleted the dev-dbastos-AAE-19610 branch January 18, 2024 15:01
Copy link
Contributor

@MichalKinas MichalKinas left a comment

Choose a reason for hiding this comment

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

Sorry that I reviewed it a bit late, I couldn't do it earlier, overall PR looks okay I only pointed out some small improvements that can be added in other PR

this.combinedDisplayValue = this.combinedDisplayValue ? `${this.combinedDisplayValue} ${displayLabelForField}` : `${displayLabelForField}`;
}
});
}

private getDisplayLabelForField(fieldForDisplayLabel: string): string {
return this.settings && this.settings.displayedLabelsByField && this.settings.displayedLabelsByField[fieldForDisplayLabel] ? this.settings.displayedLabelsByField[fieldForDisplayLabel] : fieldForDisplayLabel;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be way shorter like: return this.settings?.displayedLabelsByField?.[fieldForDisplayLabel] ?? fieldForDisplayLabel;

}

private setDefaultDateFormatSettings() {
if (this.settings && !this.settings.dateFormat) {
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
if (this.settings && !this.settings.dateFormat) {
if (!this.settings?.dateFormat) {

export class TabLabelsPipe implements PipeTransform {

transform(field: string, settings?: SearchWidgetSettings): string {
return settings && settings.displayedLabelsByField && settings.displayedLabelsByField[field] ? settings.displayedLabelsByField[field] : field;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be way shorter like: return this.settings?.displayedLabelsByField?.[field] ?? field;

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.

3 participants