This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-v0.1' into dependabot/pip/backend/cryptography-…
…41.0.4
- Loading branch information
Showing
74 changed files
with
4,772 additions
and
2,414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
frontend/src/classes/Commands/FeatureModel/RemoveCommand.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import {FeatureNodeCommand} from "@/classes/Commands/FeatureModel/FeatureNodeCommand"; | ||
|
||
export class RemoveCommand extends FeatureNodeCommand { | ||
constructor(node, dstIndex) { | ||
super(); | ||
this.node = node; | ||
this.parent = node.parent | ||
this.dstIndex = dstIndex | ||
|
||
// Properties for undo. | ||
this.oldData = { | ||
name: this.node.name, | ||
groupType: this.node.groupType, | ||
mandatory: this.node.isMandatory, | ||
abstract: this.node.isAbstract, | ||
}; | ||
} | ||
|
||
undo() { | ||
this.parent.uncollapse(); | ||
this.parent.unhideChildren(); | ||
|
||
this.parent.insertChildAtIndex(this.node, this.dstIndex); | ||
} | ||
|
||
execute() { | ||
this.parent.uncollapse(); | ||
this.parent.unhideChildren(); | ||
|
||
this.parent.removeChild(this.node); | ||
} | ||
|
||
createDTO() { | ||
return { | ||
commandType: 'remove', | ||
nodeName: this.node.name, | ||
dstIndex: this.dstIndex, | ||
}; | ||
} | ||
|
||
markChanges() { | ||
this.parent.markAsEdited() | ||
} | ||
|
||
unmarkChanges() { | ||
this.parent.unmarkAsEdited() | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
frontend/src/classes/Commands/FeatureModel/SliceCommand.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {Command} from "@/classes/Commands/Command"; | ||
import * as init from '@/services/FeatureModel/init.service.js'; | ||
|
||
export class SliceCommand extends Command { | ||
constructor(oldFM, newFM) { | ||
super(); | ||
this.featureModelComponent = oldFM; | ||
this.d3Data = this.featureModelComponent.$refs.featureModelTree.d3Data; | ||
|
||
// Constraint command manager | ||
this.constraintCommandManager = this.featureModelComponent.constraintCommandManager; | ||
this.historyCommands = this.constraintCommandManager.historyCommands; | ||
this.futureCommands = this.constraintCommandManager.futureCommands; | ||
|
||
this.oldRoot = this.d3Data.root; | ||
|
||
this.oldData = this.featureModelComponent.data; | ||
this.newData = newFM; | ||
} | ||
|
||
execute() { | ||
this.featureModelComponent.data = this.newData; | ||
init.initData(this.d3Data, this.newData.rootNode); | ||
} | ||
|
||
|
||
undo() { | ||
this.featureModelComponent.data = this.oldData; | ||
this.d3Data.root = this.oldRoot; | ||
} | ||
|
||
createDTO() { | ||
return { | ||
commandType: 'slice-model', | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import {ConstraintItem} from "@/classes/Constraint/ConstraintItem"; | ||
|
||
|
||
export class SoloDisjunction extends ConstraintItem { | ||
constructor(item) { | ||
super(); | ||
this.item = item; | ||
} | ||
|
||
count() { | ||
return 1; | ||
} | ||
|
||
toString() { | ||
return `${this.addPossibleBrackets(this.item)}`; | ||
} | ||
|
||
toStringForEdit() { | ||
return `${this.addPossibleBracketsForEdit(this.item)}`; | ||
} | ||
|
||
toStringPostfix() { | ||
return `${this.item.toStringPostfix()}`; | ||
} | ||
|
||
toStringXML() { | ||
return `<disj>${this.item.toStringXML()}</disj>`; | ||
} | ||
|
||
getFeatureNodes() { | ||
return this.item.getFeatureNodes(); | ||
} | ||
|
||
setConstraint(constraint) { | ||
this.item.setConstraint(constraint); | ||
} | ||
|
||
removeConstraint() { | ||
this.item.removeConstraint(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.