Skip to content

Commit

Permalink
wis2box-webapp dataset editor: auto-lowercase centre-id
Browse files Browse the repository at this point in the history
  • Loading branch information
pjjin-design committed Nov 21, 2024
1 parent ce3507b commit dbca869
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions src/components/DatasetEditorForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<v-row>
<v-col cols="12">
<v-combobox v-model="model.identification.centreID" :items="centreList"
label="Centre ID" :rules="[rules.centreID]" variant="outlined"
@update:modelValue="convertToLowercase"></v-combobox>
label="Centre ID" :rules="[rules.centreID]" variant="outlined" @update:modelValue="convertToLowercase"></v-combobox>
</v-col>
</v-row>
<v-select v-model="selectedTemplate" :items="templateFiles" item-title="label" return-object
Expand Down Expand Up @@ -83,9 +82,8 @@
</v-card-text>
<v-container>
<v-text-field label="wis2box auth token for 'processes/wis2box'" v-model="token" rows="1"
:append-icon="showToken ? 'mdi-eye' : 'mdi-eye-off'" :type="showToken ? 'text' : 'password'"
autocomplete="one-time-code" @click:append="showToken = !showToken" :rules="[rules.token]"
variant="outlined">
:append-icon="showToken ? 'mdi-eye' : 'mdi-eye-off'" :type="showToken ? 'text' : 'password'" autocomplete="one-time-code"
@click:append="showToken = !showToken" :rules="[rules.token]" variant="outlined">
</v-text-field>
</v-container>
<v-card-actions>
Expand Down Expand Up @@ -117,12 +115,14 @@
<v-row dense>
<v-col cols="11">
<v-text-field label="Identifier" type="string"
v-model="model.identification.identifier" readonly variant="outlined">
v-model="model.identification.identifier"
readonly variant="outlined">
</v-text-field>
</v-col>
<v-col cols="1">
<v-btn icon @click="copyIdentifier" aria-label="Copy Identifier">
<v-icon>mdi-content-copy</v-icon>
<v-col cols="1">
<v-btn icon @click="copyIdentifier"
aria-label="Copy Identifier">
<v-icon>mdi-content-copy</v-icon>
</v-btn>
</v-col>
</v-row>
Expand Down Expand Up @@ -215,7 +215,8 @@
</v-col>
<v-col cols="5">
<v-select label="Unit" :items="durations" item-title="name" item-value="code"
v-model="model.extents.resolutionUnit" variant="outlined" clearable></v-select>
v-model="model.extents.resolutionUnit"
variant="outlined" clearable></v-select>
</v-col>
</v-row>
</v-col>
Expand Down Expand Up @@ -395,9 +396,8 @@
</v-card-title>
<v-card-text>
<v-text-field label="wis2box auth token for 'processes/wis2box'" v-model="token" rows="1"
:append-icon="showToken ? 'mdi-eye' : 'mdi-eye-off'" :type="showToken ? 'text' : 'password'"
autocomplete="one-time-code" @click:append="showToken = !showToken" :rules="[rules.token]"
variant="outlined">
:append-icon="showToken ? 'mdi-eye' : 'mdi-eye-off'" :type="showToken ? 'text' : 'password'" autocomplete="one-time-code"
@click:append="showToken = !showToken" :rules="[rules.token]" variant="outlined">
</v-text-field>
</v-card-text>
</v-card>
Expand Down Expand Up @@ -508,8 +508,7 @@
<br>
<p><b>End Date:</b> The date in UTC when the dataset ends.</p>
<br>
<p><b>Temporal Resolution (optional):</b> The smallest increment of time that is represented in
the
<p><b>Temporal Resolution (optional):</b> The smallest increment of time that is represented in the
dataset.
</p>
<p>This is split into two parts, the <b>value</b> (e.g. 1) and the <b>unit</b> (e.g.
Expand Down Expand Up @@ -651,8 +650,7 @@
{{ message }}
</v-card-text>
<v-card-actions>
<v-btn block variant="flat" @click="resetMessage('validation')"
:color="formValidated ? '#64BF40' : 'error'">
<v-btn block variant="flat" @click="resetMessage('validation')" :color="formValidated ? '#64BF40' : 'error'">
OK
</v-btn>
</v-card-actions>
Expand Down Expand Up @@ -724,8 +722,7 @@
<v-col cols="8">
<!-- Disable this if editing an existing plugin -->
<v-select label="Plugin Name" v-model="pluginName" :items="pluginList"
item-title="title" item-value="id" variant="outlined"
:disabled="!pluginIsNew"></v-select>
item-title="title" item-value="id" variant="outlined" :disabled="!pluginIsNew"></v-select>
</v-col>
<v-col cols="4">
<v-text-field label="File Extension" v-model="pluginFileExtension"
Expand Down Expand Up @@ -1248,7 +1245,7 @@ export default defineComponent({
// Properties information
formModel.identification.title = schema.properties.title;
formModel.identification.description = schema.properties.description;
formModel.identification.language = { code: schema.properties.language };
formModel.identification.language = {code: schema.properties.language};
formModel.identification.keywords = schema.properties.keywords;
// Themes - hardcoded for now
Expand Down Expand Up @@ -1809,7 +1806,7 @@ export default defineComponent({
schemaModel.properties.identifier = form.identification.identifier;
schemaModel.properties.title = form.identification.title;
schemaModel.properties.description = form.identification.description;
schemaModel.properties.language = { code: null };
schemaModel.properties.language = {code: null};
schemaModel.properties.keywords = form.identification.keywords;
// Themes
const concepts = form.identification.concepts.map(item => ({ id: item, title: getTitleOf(item) }));
Expand Down

0 comments on commit dbca869

Please sign in to comment.