Skip to content

Commit

Permalink
Merge pull request #446 from appuniversum/chore/remove-v2-deprecations
Browse files Browse the repository at this point in the history
Remove all deprecated code targetting v3
  • Loading branch information
Windvis authored Oct 12, 2023
2 parents bbe891f + ac240d9 commit add795d
Show file tree
Hide file tree
Showing 118 changed files with 108 additions and 9,247 deletions.
15 changes: 0 additions & 15 deletions addon/components/au-button.gjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AuIcon, AuLoader } from '@appuniversum/ember-appuniversum';
import { deprecate } from '@ember/debug';
import Component from '@glimmer/component';

// TODO: replace these with the named imports from ember-truth-helpers v4 once our dependencies support that version
Expand All @@ -10,21 +9,7 @@ const SKINS = ['primary', 'secondary', 'naked', 'link', 'link-secondary'];

export default class AuButton extends Component {
get skin() {
deprecate(
'[AuButton] The `tertiary` skin is deprecated. Use the `link` skin instead.',
this.args.skin !== 'tertiary',
{
id: '@appuniversum/ember-appuniversum.au-button-tertiary',
until: '3.0.0',
for: '@appuniversum/ember-appuniversum',
since: {
enabled: '2.14.0',
},
},
);

if (SKINS.includes(this.args.skin)) return this.args.skin;
else if (this.args.skin === 'tertiary') return 'link'; // DEPRECATED
else return 'primary';
}

Expand Down
24 changes: 0 additions & 24 deletions addon/components/au-control-checkbox.hbs

This file was deleted.

34 changes: 0 additions & 34 deletions addon/components/au-control-checkbox.js

This file was deleted.

24 changes: 0 additions & 24 deletions addon/components/au-control-radio.hbs

This file was deleted.

34 changes: 0 additions & 34 deletions addon/components/au-control-radio.js

This file was deleted.

76 changes: 12 additions & 64 deletions addon/components/au-date-picker.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import {
isIsoDateString,
toIsoDateString,
} from '@appuniversum/ember-appuniversum/utils/date';
import { assert, deprecate, runInDebug } from '@ember/debug';
import { assert, runInDebug } from '@ember/debug';
import { on } from '@ember/modifier';
import { action } from '@ember/object';
import { guidFor } from '@ember/object/internals';
import { getOwnConfig, macroCondition } from '@embroider/macros';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { modifier } from 'ember-modifier';
Expand Down Expand Up @@ -38,36 +37,18 @@ const DEFAULT_LOCALIZATION = {
dayNames: getLocalizedDays(),
monthNames: getLocalizedMonths(),
monthNamesShort: getLocalizedMonths('short'),
buttonLabel: 'Kies een datum',
placeholder: 'DD-MM-JJJJ',
selectedDateMessage: 'De geselecteerde datum is',
prevMonthLabel: 'Vorige maand',
nextMonthLabel: 'Volgende maand',
monthSelectLabel: 'Maand',
yearSelectLabel: 'Jaar',
closeLabel: 'Sluit venster',
keyboardInstruction: 'Gebruik de pijltjestoetsen om te navigeren',
calendarHeading: 'Kies een datum',
};

if (macroCondition(getOwnConfig().dutchDatePickerLocalization)) {
Object.assign(DEFAULT_LOCALIZATION, {
buttonLabel: 'Kies een datum',
placeholder: 'DD-MM-JJJJ',
selectedDateMessage: 'De geselecteerde datum is',
prevMonthLabel: 'Vorige maand',
nextMonthLabel: 'Volgende maand',
monthSelectLabel: 'Maand',
yearSelectLabel: 'Jaar',
closeLabel: 'Sluit venster',
keyboardInstruction: 'Gebruik de pijltjestoetsen om te navigeren',
calendarHeading: 'Kies een datum',
});
} else {
Object.assign(DEFAULT_LOCALIZATION, {
buttonLabel: 'Choose date',
placeholder: 'DD-MM-YYYY',
selectedDateMessage: 'Selected date is',
prevMonthLabel: 'Previous month',
nextMonthLabel: 'Next month',
monthSelectLabel: 'Month',
yearSelectLabel: 'Year',
closeLabel: 'Close window',
keyboardInstruction: 'You can use arrow keys to navigate dates',
calendarHeading: 'Choose a date',
});
}

export default class AuDatePicker extends Component {
@asIsoDate value;
@asIsoDate min;
Expand All @@ -77,35 +58,6 @@ export default class AuDatePicker extends Component {
constructor() {
super(...arguments);
this.registerDuetDatePicker();

let isNewImplementation = macroCondition(
getOwnConfig().dutchDatePickerLocalization,
)
? true
: false;

deprecate(
`[AuDatePicker] The English localization is deprecated. You should explicitly enable the Dutch localization by adding a build-time flag to your ember-cli-build.js file:
\`\`\`
// ember-cli-build.js
'@appuniversum/ember-appuniversum': {
dutchDatePickerLocalization: true,
},
\`\`\`
Note: This only changes the default localization of the component. You can still provide custom @adapter and @localization arguments if needed.
`,
isNewImplementation,
{
id: '@appuniversum/ember-appuniversum.au-date-picker.english-localization',
until: '3.0.0',
for: '@appuniversum/ember-appuniversum',
since: {
enabled: '1.9.0',
},
},
);
}

get adapter() {
Expand Down Expand Up @@ -273,9 +225,5 @@ function getLocalizedDays(weekdayFormat = 'long') {
}

function intl(options) {
let locale = macroCondition(getOwnConfig().dutchDatePickerLocalization)
? 'nl-BE'
: 'en';

return new Intl.DateTimeFormat(locale, options);
return new Intl.DateTimeFormat('nl-BE', options);
}
18 changes: 0 additions & 18 deletions addon/components/au-dropdown.gjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AuButton } from '@appuniversum/ember-appuniversum';
import FloatingUiModifier from '@appuniversum/ember-appuniversum/private/modifiers/floating-ui';
import { deprecate } from '@ember/debug';
import { hash } from '@ember/helper';
import { on } from '@ember/modifier';
import { action } from '@ember/object';
Expand Down Expand Up @@ -60,23 +59,6 @@ export default class AuDropdown extends Component {
return true;
}

get buttonLabel() {
if (this.args.buttonLabel) {
deprecate('@dropdownLabel is no longer used, use @title instead', false, {
id: '@appuniversum/ember-appuniversum.au-dropdown.dropdownButtonLabel-argument',
until: '3.0.0',
for: '@appuniversum/ember-appuniversum',
since: {
enabled: '1.7.0',
},
});

return this.args.buttonLabel;
} else {
return undefined;
}
}

get alignment() {
if (this.args.alignment == 'left') return 'bottom-start';
if (this.args.alignment == 'right') return 'bottom-end';
Expand Down
Loading

0 comments on commit add795d

Please sign in to comment.