Skip to content

Commit

Permalink
WIP - Add settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ewhanson committed Dec 12, 2023
1 parent 140d383 commit c8f636f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Container/SettingsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ThemeForm from '@/components/Form/context/ThemeForm.vue';
import DateTimeForm from '@/components/Form/context/DateTimeForm.vue';
import DoiSetupSettingsForm from '@/components/Form/context/DoiSetupSettingsForm.vue';
import DoiRegistrationSettingsForm from '@/components/Form/context/DoiRegistrationSettingsForm.vue';
import OrcidSettingsForm from '@/components/Form/context/OrcidSettingsForm.vue';
export default {
name: 'SettingsPage',
Expand All @@ -20,6 +21,7 @@ export default {
DateTimeForm,
DoiSetupSettingsForm,
DoiRegistrationSettingsForm,
OrcidSettingsForm,
},
extends: Page,
data() {
Expand Down
27 changes: 27 additions & 0 deletions src/components/Form/context/OrcidSettingsForm.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script>
import Form from '../Form.vue';
export default {
name: 'OrcidSettingsForm',
extends: Form,
props: {},
methods: {
/**
* Update values when a field has changed
*
* @param {String} name Name of the field to modify
* @param {String} prop Name of the prop to modify
* @param {mixed} value The new value for the prop
* @param {String} localeKey Optional locale key for multilingual props
*/
fieldChanged: function (name, prop, value, localeKey) {
if (name === 'orcidEnabled') {
this.removeError('orcidProfileAPIPath', localeKey);
this.removeError('orcidClientId', localeKey);
this.removeError('orcidClientSecret', localeKey);
}
Form.methods.fieldChanged.apply(this, [name, prop, value, localeKey]);
},
},
};
</script>

0 comments on commit c8f636f

Please sign in to comment.