Skip to content

Commit

Permalink
feat: split rule into multiple components
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Sep 6, 2023
1 parent a6e9021 commit f9dac24
Show file tree
Hide file tree
Showing 22 changed files with 1,038 additions and 829 deletions.
4 changes: 2 additions & 2 deletions ui/src/appedit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ import trueorfalse from '@/components/trueorfalse'
import tageditor from '@/components/tageditor'
import datatype from '@/components/datatype'
import app from '@/components/app'
import branchselecter from '@/components/branchselecter'
import branchselector from '@/components/branchselector'
import search_app_mixin from '@/mixins/searchapp'
import datatypes from '@/mixins/datatypes'
Expand All @@ -555,7 +555,7 @@ export default {
mixins: [ search_app_mixin, datatypes ],
components: {
contactlist, multiprojectselecter,
datatypeselecter, trueorfalse, tageditor, datatype, app, branchselecter,
datatypeselecter, trueorfalse, tageditor, datatype, app, branchselector,
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/appadvanced.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<script>
import Vue from 'vue'
import branchselecter from '@/components/branchselecter'
import branchselecter from '@/components/branchselector'
export default {
props: [
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ui/src/components/modals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
gaarchiver: ()=>import('@/modals/gaarchiver'),
dataladimporter: ()=>import('@/modals/dataladimporter'),
ezbidsimporter: ()=>import('@/modals/ezbidsimporter'),
rulemodal: ()=>import('@/modals/rule'),
rulemodal: ()=>import('@/modals/RuleModal'),
rulelogmodal: ()=>import('@/modals/rulelog'),
pipelinegroupmodal: ()=>import('@/modals/pipelinegroup'),
},
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions ui/src/components/ruleform.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<b-col>Selection Override</b-col>
<b-col :cols="9">
<p>
<projectselecter v-model="rule.input_project_override[input.id]" placeholder="(From this project)"/>
<projectselector v-model="rule.input_project_override[input.id]" placeholder="(From this project)"/>
</p>
<b-input-group prepend="Subject">
<b-form-input v-model="rule.input_subject[input.id]" placeholder="(Use the matching subject)"/>
Expand Down Expand Up @@ -171,8 +171,8 @@ import Vue from 'vue'
import datatypetag from '@/components/datatypetag'
import app from '@/components/app'
import tageditor from '@/components/tageditor'
import projectselecter from '@/components/projectselecter'
import branchselecter from '@/components/branchselecter'
import projectselector from '@/components/projectselector'
import branchselecter from '@/components/branchselector'
import configform from '@/components/configform'
import search_app_mixin from '@/mixins/searchapp'
Expand All @@ -193,7 +193,7 @@ export default {
},
components: {
projectselecter, branchselecter, datatypetag, app, tageditor, configform,
projectselector, branchselecter, datatypetag, app, tageditor, configform,
},
data() {
Expand Down
41 changes: 41 additions & 0 deletions ui/src/modals/RuleModal.helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
function removeUndefinedOrNullProperties(obj) {
for(let key in obj) {
if(obj[key] === undefined || obj[key] === null) delete obj[key];
}
return obj;
}

function composeOutputTag(ruleName) {
let tag = ruleName||new Date().toLocaleDateString();
tag = tag.toLowerCase().replace(/\W/g, '_');
return tag;
};

function getEmptyIOConfigObj() {
return {
// app tab stuff
config: {},

// input tab stuff
subject_match: "",
session_match: "",
extra_datatype_tags: {},
input_selection: {},
input_multicount: {},
input_project_override: {},
input_subject: {},
input_session: {},
input_tags: {},
input_dataset_tags: {},

// output tab stuff
output_tags: {},
archive: {},
}
}

export {
removeUndefinedOrNullProperties,
composeOutputTag,
getEmptyIOConfigObj,
}
Loading

0 comments on commit f9dac24

Please sign in to comment.