-
Notifications
You must be signed in to change notification settings - Fork 8
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
Form disable meta #133
Form disable meta #133
Conversation
this._super(...arguments); | ||
|
||
if (this.model.get("source") == "fabricaForm") { | ||
this.set('metadataFieldsDisabled', false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could set a default in line 4.
export default Component.extend({
metadataFieldsDisabled: true,
didReceiveAttrs() {
if (this.model.get("source") == "fabricaForm") {
this.set('metadataFieldsDisabled', false);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a doi-form
component. It seems to add complexity.
Because we need specific functionality that applies to the form, this seemed a logical way to encapsulate the behaviour of the metadata form fields separate to that of other parts. |
@richardhallett the form is displayed in four slightly different versions: new/edit and form/file upload. We need to disable the form in only one of them (edit form). So it would make sense for me to put that logic into the template for |
The usage of the field could be in that I suppose, but given I needed to set the metadataFieldsDisabled this seemed best to put it in component code which is where the backing of doi-form.js comes in? Where instead would you put that in place, create a backend component logic for the show/edit.js? |
@@ -23,6 +23,8 @@ export default Controller.extend({ | |||
doi.set('descriptions', [{ description: doi.get('descriptions'), descriptionType: 'Abstract' }]); | |||
} | |||
|
|||
doi.set("source", "fabricaForm"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardhallett you can also do this directly when you create the DOI, i.e. start with defaults.
For #132