Skip to content

Commit

Permalink
Add control to automatically update indicators from DFIQ (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchop authored May 27, 2024
1 parent 8a70ff8 commit 8319f1c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/components/EditDFIQObject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
<v-card-title>{{ localObject.name }}</v-card-title>
<v-card-subtitle>Editing DFIQ {{ localObject.type }}</v-card-subtitle>
<v-card-text>
<v-checkbox-btn
v-if="localObject.type === 'approach'"
label="Automatically create new indicators from Approach"
density="compact"
hide-details
color="primary"
class="mb-5"
v-model="updateApproachIndicators"
></v-checkbox-btn>
<v-textarea class="yeti-code" label="DFIQ Yaml" auto-grow v-model="localObject.dfiq_yaml"></v-textarea>
<div v-if="yamlValidationError === 'valid'">
<v-alert type="success">YAML is valid!</v-alert>
Expand Down Expand Up @@ -75,7 +84,8 @@ export default {
dfiq: "dfiq"
},
validatingYaml: false,
yamlValidationError: ""
yamlValidationError: "",
updateApproachIndicators: true
};
},
mounted() {},
Expand All @@ -100,9 +110,14 @@ export default {
saveObject() {
let patchRequest = {
dfiq_type: this.localObject.type,
dfiq_yaml: this.localObject.dfiq_yaml
dfiq_yaml: this.localObject.dfiq_yaml,
update_indicators: false
};
if (this.localObject.type === "approach") {
patchRequest.update_indicators = this.updateApproachIndicators;
}
axios
.patch(`/api/v2/dfiq/${this.localObject.id}`, patchRequest)
.then(response => {
Expand Down

0 comments on commit 8319f1c

Please sign in to comment.