Skip to content

Commit

Permalink
Added modeldoc in all variable entries and at variable export.
Browse files Browse the repository at this point in the history
  • Loading branch information
anmavrid committed Aug 28, 2023
1 parent 052ac8c commit 5d1742e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 2 additions & 6 deletions fret-electron/model/FretModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export default class FretModel {

// if a project is selected, update project dependent states
// in AnalysisTab and VariableView
console.log('this.selectedProject', this.selectedProject)
if (this.selectedProject !== 'All Projects'){
await this.synchAnalysesAndVariablesWithDB()
await this.mapVariables(this.components)
Expand Down Expand Up @@ -259,7 +258,7 @@ export default class FretModel {
const list = await fretDbGetters.getProjects();
if (projName) {
if (list.includes(projName)){
console.log('FretModel.addProject ', projName, 'already in project list')
//console.log('FretModel.addProject ', projName, 'already in project list')
} else {
this.listOfProjects = await fretDbSetters.addProject(projName);
}
Expand Down Expand Up @@ -666,10 +665,8 @@ export default class FretModel {
await modelDB.find({
selector
}).then((result) => {
//console.log('result', result)
result.docs.forEach(variable => {
delete variable._rev
delete variable.modeldoc
variables.push(variable)
})
}).catch((err) => {
Expand All @@ -689,10 +686,8 @@ export default class FretModel {
await modelDB.find({
selector
}).then((result) => {
//console.log('result', result)
result.docs.forEach(variable => {
delete variable._rev
delete variable.modeldoc
content.push(variable)
})
}).catch((err) => {
Expand Down Expand Up @@ -1128,6 +1123,7 @@ export default class FretModel {
modeldoc: vdoc.modeldoc,
modelComponent: modelComponent,
modeldoc_id: "",
completed: vdoc.completed
}).then(function (response){
}).catch(function (err) {
console.log(err);
Expand Down
13 changes: 8 additions & 5 deletions fret-electron/model/modelDbSupport/deleteVariables_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ async function removeVariablesInBulk (requirements) {
reqs: [],
dataType: '',
idType: '' ,
moduleName: '',
description: '',
assignment: '',
modeRequirement: '',
modeldoc: false,
modelComponent: '',
model_id: '',
_deleted: true})
copilotAssignment: '',
modeRequirement: '',
modeldoc: false,
modelComponent: '',
modeldoc_id: '',
completed: false,
deleted: true})
}
})
})).then(() => {
Expand Down
5 changes: 4 additions & 1 deletion fret-electron/model/modelDbSupport/modelDbSetters_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ function createOrUpdateVariables (variables, componentName, projectName, dbid) {
reqs: [dbid],
dataType: '',
idType: '',
moduleName:'',
description: '',
assignment: '',
copilotAssignment: '',
modeRequirement: '',
modeldoc: false,
modelComponent: result.docs?(result.docs[0]?result.docs[0].modelComponent:''):'',
model_id: ''
modeldoc_id: '',
completed: false,
});
}).catch(function (err) {
console.log(err);
Expand Down
5 changes: 4 additions & 1 deletion fret-electron/model/modelDbSupport/populateVariables_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@ async function populateVariables() {
reqs: [],
dataType: '',
idType: '' ,
moduleName: '',
description: '',
assignment: '',
copilotAssignment: '',
modeRequirement: '',
modeldoc: false,
modelComponent: '',
model_id: ''
modeldoc_id: '',
completed: false
};
mapIdsToVariables[variableId] = newVariable;
requirementVariables[variableId] = [dbId];
Expand Down

0 comments on commit 5d1742e

Please sign in to comment.