Skip to content

Commit

Permalink
feat(datagrid): remove dategrid* properties from ClrCommonStrings
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The misspelled `dategrid*` common strings are removed.
Please rename these properties to `datagrid*`.
  • Loading branch information
kevinbuhmann committed Dec 19, 2022
1 parent 6af3832 commit d931a9c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 45 deletions.
8 changes: 0 additions & 8 deletions projects/angular/clarity.api.md
Expand Up @@ -920,14 +920,6 @@ export interface ClrCommonStrings {
datagridExpandableRowsHelperText?: string;
datagridFilterAriaLabel?: string;
datagridFilterDialogAriaLabel?: string;
// @deprecated (undocumented)
dategridExpandableBeginningOf?: string;
// @deprecated (undocumented)
dategridExpandableEndOf?: string;
// @deprecated (undocumented)
dategridExpandableRowContent?: string;
// @deprecated (undocumented)
dategridExpandableRowsHelperText?: string;
// (undocumented)
datepickerCurrentDecade: string;
// (undocumented)
Expand Down
15 changes: 4 additions & 11 deletions projects/angular/src/data/datagrid/datagrid-row-detail.spec.ts
Expand Up @@ -54,19 +54,12 @@ export default function (): void {
const commonStrings = new ClrCommonStringsService();
const rows: HTMLElement[] = context.clarityElement.querySelectorAll('.clr-sr-only');

// TODO: @deprecated - dategrid* keys are deprecated. Remove in v14.
const first = [
commonStrings.keys.dategridExpandableBeginningOf,
commonStrings.keys.dategridExpandableRowContent,
commonStrings.keys.dategridExpandableRowsHelperText,
commonStrings.keys.dategridExpandableBeginningOf || commonStrings.keys.datagridExpandableBeginningOf,
commonStrings.keys.dategridExpandableRowContent || commonStrings.keys.datagridExpandableRowContent,
commonStrings.keys.dategridExpandableRowsHelperText || commonStrings.keys.datagridExpandableRowsHelperText,
];
const last = [
commonStrings.keys.dategridExpandableEndOf || commonStrings.keys.datagridExpandableEndOf,
commonStrings.keys.dategridExpandableRowContent || commonStrings.keys.datagridExpandableRowContent,
commonStrings.keys.datagridExpandableBeginningOf,
commonStrings.keys.datagridExpandableRowContent,
commonStrings.keys.datagridExpandableRowsHelperText,
];
const last = [commonStrings.keys.datagridExpandableEndOf, commonStrings.keys.datagridExpandableRowContent];

expect(rows[0].innerText.trim()).toBe(first.join(' ').trim());
expect(rows[1].innerText.trim()).toBe(last.join(' ').trim());
Expand Down
15 changes: 5 additions & 10 deletions projects/angular/src/data/datagrid/datagrid-row-detail.ts
Expand Up @@ -21,11 +21,10 @@ import { Selection } from './providers/selection';
*/
@Component({
selector: 'clr-dg-row-detail',
// TODO: @deprecated - dategrid* keys are deprecated. Remove in v14.
template: `
<div class="clr-sr-only">
{{ beginningOfExpandableContentAriaText }}
{{ commonStrings.keys.dategridExpandableRowsHelperText || commonStrings.keys.datagridExpandableRowsHelperText }}
{{ commonStrings.keys.datagridExpandableRowsHelperText }}
</div>
<ng-content></ng-content>
<div class="clr-sr-only">{{ endOfExpandableContentAriaText }}</div>
Expand Down Expand Up @@ -71,25 +70,21 @@ export class ClrDatagridRowDetail implements AfterContentInit, OnDestroy {
this.subscriptions.forEach(sub => sub.unsubscribe());
}

// TODO: @deprecated - dategrid* keys are deprecated. Remove in v14.
@Input('clrRowDetailBeginningAriaText') _beginningOfExpandableContentAriaText: string;
get beginningOfExpandableContentAriaText() {
return (
this._beginningOfExpandableContentAriaText ||
`${
this.commonStrings.keys.dategridExpandableBeginningOf || this.commonStrings.keys.datagridExpandableBeginningOf
}
${this.commonStrings.keys.dategridExpandableRowContent || this.commonStrings.keys.datagridExpandableRowContent}`
`${this.commonStrings.keys.datagridExpandableBeginningOf}
${this.commonStrings.keys.datagridExpandableRowContent}`
);
}

// TODO: @deprecated - dategrid* keys are deprecated. Remove in v14.
@Input('clrRowDetailEndAriaText') _endOfExpandableContentAriaText: string;
get endOfExpandableContentAriaText() {
return (
this._endOfExpandableContentAriaText ||
`${this.commonStrings.keys.dategridExpandableEndOf || this.commonStrings.keys.datagridExpandableEndOf}
${this.commonStrings.keys.dategridExpandableRowContent || this.commonStrings.keys.datagridExpandableRowContent}`
`${this.commonStrings.keys.datagridExpandableEndOf}
${this.commonStrings.keys.datagridExpandableRowContent}`
);
}
}
16 changes: 0 additions & 16 deletions projects/angular/src/utils/i18n/common-strings.interface.ts
Expand Up @@ -241,22 +241,6 @@ export interface ClrCommonStrings {
timelineStepProcessing: string;

// Datagrid Helper text for expandable rows
/**
* @deprecated Should be removed in v14
*/
dategridExpandableBeginningOf?: string;
/**
* @deprecated Should be removed in v14
*/
dategridExpandableEndOf?: string;
/**
* @deprecated Should be removed in v14
*/
dategridExpandableRowContent?: string;
/**
* @deprecated Should be removed in v14
*/
dategridExpandableRowsHelperText?: string;
datagridExpandableBeginningOf?: string;
datagridExpandableEndOf?: string;
datagridExpandableRowContent?: string;
Expand Down

0 comments on commit d931a9c

Please sign in to comment.