Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/tk-ui-58
Browse files Browse the repository at this point in the history
  • Loading branch information
remadex committed Dec 2, 2024
2 parents cf5d47e + 5e4f543 commit 4f045a3
Show file tree
Hide file tree
Showing 36 changed files with 235 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ImmerChangeset } from 'ember-immer-changeset';

export default class DocsCheckboxValidationController extends Controller {
label = "I'm a beast";
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
checked: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ImmerChangeset } from 'ember-immer-changeset';

export default class DocsInputValidationController extends Controller {
label = 'Clear it';
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
delete_text: 'Delete my text',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsIBANController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
bic: '',
disabled: 'UKIO0000',
});

@tracked changesetWithErrors = new ImmerChangeset({
changesetWithErrors = new ImmerChangeset({
bic: 'UKIO0000',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsCheckboxController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
disabled: true,
unchecked: false,
checked: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsCurrencyController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
value: undefined,
disabled: 0.03,
error: 34020.03,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsEmailController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
email: undefined,
disabled: '[email protected]',
error: 'hyperloop.com',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsFileController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
file: undefined,
disabled: '',
error: '',
Expand All @@ -21,4 +21,4 @@ export default class DocsEmberInputValidationPrefabsFileController extends Contr
});
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsIBANController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
iban: '',
error: 'bad iban',
disabled: 'disabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsInputController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
something: '',
disabled: 'text',
});

@tracked changesetWithErrors = new ImmerChangeset({
changesetWithErrors = new ImmerChangeset({
something: '',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { ImmerChangeset } from 'ember-immer-changeset';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsIntegerController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
integer: 0,
uInteger: 0,
});

@tracked changesetWithErrors = new ImmerChangeset({
changesetWithErrors = new ImmerChangeset({
integer: 0,
uInteger: 0,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tracked } from '@glimmer/tracking';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsPhoneController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
phone: '',
error: '',
disabled: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { tracked } from '@glimmer/tracking';
import type Owner from '@ember/owner';

export default class DocsEmberInputValidationPrefabsNationalNumberController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
nationalNumber: '',
});

@tracked changesetWithErrors = new ImmerChangeset({
changesetWithErrors = new ImmerChangeset({
nationalNumber: '',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { ImmerChangeset } from 'ember-immer-changeset';
import type { Owner } from '@ember/test-helpers/build-owner';

export default class DocsEmberInputValidationPrefabsNumberController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
number: 0,
uNumber: 0,
});

@tracked changesetWithErrors = new ImmerChangeset({
changesetWithErrors = new ImmerChangeset({
number: 0,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { tracked } from '@glimmer/tracking';
import type Owner from '@ember/owner';

export default class DocsEmberInputValidationPrefabsPasswordController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
name: '',
});

@tracked changesetWithErrors = new ImmerChangeset({
changesetWithErrors = new ImmerChangeset({
name: '',
});

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from 'tracked-built-ins';
import { ImmerChangeset } from 'ember-immer-changeset';
import type Owner from '@ember/owner';

export default class DocsEmberInputValidationPrefabsRadioGroupController extends Controller {
changeset = new ImmerChangeset({
radio: undefined,
});

changesetWithErrors = new ImmerChangeset({
radio: undefined,
});

public constructor(owner: Owner) {
super(owner);
this.changesetWithErrors.addError({
key: 'radio',
message: 'Invalid value',
value: 'Invalid value',
originalValue : ''
});
}

@action
onChange() {

}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Controller from '@ember/controller';
import { ImmerChangeset } from 'ember-immer-changeset';
import { action } from '@ember/object';
import type Owner from '@ember/owner';

export default class DocsEmberInputValidationPrefabsRadioController extends Controller {
changeset = new ImmerChangeset({
radio: '',
});

changesetWithErrors = new ImmerChangeset({
radio: '',
});

public constructor(owner: Owner) {
super(owner);
this.changesetWithErrors.addError({
key: 'radio',
message: 'Invalid value',
value: 'Invalid value',
originalValue : ''
});
}

@action
onChange(e: Event) {
console.log('onChange', e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export default class DocsEmberInputValidationPrefabsSelectCreateController exten
});
}

@tracked changeset = new ImmerChangeset<ChangesetType>({
changeset = new ImmerChangeset<ChangesetType>({
ceo: undefined,
disabled: undefined,
error: undefined,
});

@tracked changesetBis = new ImmerChangeset<ChangesetBisType>({
changesetBis = new ImmerChangeset<ChangesetBisType>({
ceo: [],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export default class DocsEmberInputValidationPrefabsSelectSearchController exten
key: 'error',
});
}
@tracked changeset = new ImmerChangeset<Changeset>({

changeset = new ImmerChangeset<Changeset>({
repository: undefined,
disabled: undefined,
error: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class DocsEmberInputValidationPrefabsSelectController extends Con
key: 'error',
});
}
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
ceo: configureDisplay(
{ firstname: 'Patrick', lastname: 'Pagnoulle' },
(option) => `${option.firstname} ${option.lastname}`,
Expand All @@ -37,11 +37,11 @@ export default class DocsEmberInputValidationPrefabsSelectController extends Con
),
});

@tracked changesetBis = new ImmerChangeset({
changesetBis = new ImmerChangeset({
ceo: undefined,
});

@tracked changesetTris = new ImmerChangeset({
changesetTris = new ImmerChangeset({
ceo: [],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { tracked } from '@glimmer/tracking';
import type Owner from '@ember/owner';

export default class DocsEmberInputValidationPrefabsTextareaController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
ember: '',
});

@tracked changesetWithErrors = new ImmerChangeset({
changesetWithErrors = new ImmerChangeset({
ember: '',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tracked } from 'tracked-built-ins';
import { ImmerChangeset } from 'ember-immer-changeset';

export default class DocsRadioGroupValidationController extends Controller {
@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
radio: undefined,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class DocsRadioValidationController extends Controller {
second = 'It the good choice!';
third = 'You don t regret it!';

@tracked changeset = new ImmerChangeset({
changeset = new ImmerChangeset({
radio: undefined,
});

Expand Down
1 change: 1 addition & 0 deletions doc-app/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Router.map(function (this: RouterDSL) {
this.route('input');
this.route('textarea');
this.route('checkbox');
this.route('radio');
this.route('radio-group');
this.route('password');
this.route('mobile');
Expand Down
4 changes: 4 additions & 0 deletions doc-app/app/templates/docs.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
@label="Password"
@route="docs.ember-input-validation.prefabs.password"
/>
<nav.item
@label="Radio"
@route="docs.ember-input-validation.prefabs.radio"
/>
<nav.item
@label="Radio group"
@route="docs.ember-input-validation.prefabs.radio-group"
Expand Down
Loading

0 comments on commit 4f045a3

Please sign in to comment.