Skip to content

Commit

Permalink
Added compatibility for exporting undefined abilities without losing …
Browse files Browse the repository at this point in the history
…the ID
  • Loading branch information
Palmer committed May 24, 2022
1 parent 2701f54 commit 2db8783
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions templates/adversaries.html
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,9 @@ <h3>Create a profile</h3>
yaml += `description: ${this.selectedProfileDescription}\n`;
yaml += `objective: ${this.selectedObjectiveId}\n`;
yaml += `atomic_ordering:\n`;
this.selectedProfileAbilities.forEach((ability) => yaml += `- ${ability.ability_id}\n`);

this.selectedProfileAbilities.forEach((ability, index) =>
ability.ability_id ? yaml += `- ${ability.ability_id}\n` : yaml += `- ${this.abilityIDs[index]}\n`);
console.log(this.selectedProfileAbilities)
const blob = new Blob([yaml], { type: 'application/x-yaml' })
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
Expand All @@ -1051,6 +1052,7 @@ <h3>Create a profile</h3>
window.URL.revokeObjectURL(url);
},


getAdversaryTactics() {
this.adversaries.forEach((adversary) => {
let tactics = adversary.atomic_ordering.map((ability_id) => {
Expand Down

0 comments on commit 2db8783

Please sign in to comment.