Skip to content

Commit

Permalink
dialog-user: Move tagging fix from #412 to setDefaultValue
Browse files Browse the repository at this point in the history
The dialogField component should not be changing default_value,
the dialogData service is the place where default_value gets set.

https://bugzilla.redhat.com/show_bug.cgi?id=1729379
  • Loading branch information
himdel committed Sep 4, 2019
1 parent f015d5b commit 403703b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/dialog-user/components/dialog-user/dialogField.ts
Expand Up @@ -50,13 +50,6 @@ export class DialogFieldController {
this.clonedDialogField = _.cloneDeep(this.field);
this.dialogField = this.service.setupField(this.field);

if (this.dialogField.type === 'DialogFieldTagControl') {
// if not set already, setting the default_value on <None>
if (typeof this.dialogField.default_value === 'undefined') {
this.dialogField.default_value = 0;
}
}

if ((this.dialogField.type === 'DialogFieldDateTimeControl') ||
(this.dialogField.type === 'DialogFieldDateControl')) {
this.setMinDate();
Expand Down
5 changes: 5 additions & 0 deletions src/dialog-user/services/dialogData.ts
Expand Up @@ -128,6 +128,11 @@ export default class DialogDataService {
defaultOption.id = 0;
defaultValue = defaultOption.id;
}

// if not set already, setting the default_value on <None>
if (defaultValue === undefined) {
defaultValue = 0;
}
}

return defaultValue;
Expand Down

0 comments on commit 403703b

Please sign in to comment.