Skip to content
Open
10,805 changes: 7,113 additions & 3,692 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"pinia": "^2.0.13",
"prismjs": "^1.29.0",
"pug": "^3.0.3",
"uuid": "^13.0.0",
"v-network-graph": "^0.9.8",
"vite": "^7.1.3",
"vue": "^3.2.31",
Expand Down
21 changes: 18 additions & 3 deletions src/components/abilities/AbilitySelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const $api = inject("$api");

const abilityStore = useAbilityStore();
const { abilities, tactics, techniqueIds, techniqueNames } = storeToRefs(abilityStore);

const newAbility = ref(null);
let filters = reactive({
searchQuery: "",
tactic: "",
Expand All @@ -38,6 +38,10 @@ const filteredAbilities = computed(() => {
const hasFiltersApplied = computed(() => {
return filters.searchQuery || filters.tactic || filters.techniqueId || filters.techniqueName;
});
function handleAbilitySave(ability) {
abilityStore.saveAbility($api, ability, true);
showCreateAbilityModal.value = false;
}

onMounted(async () => {
await abilityStore.getAbilities($api);
Expand All @@ -51,7 +55,12 @@ function clearFilters() {
}

function createAbility() {
showCreateAbilityModal.value = true;
newAbility.value = {
executors: [],
requirements: [],
metadata: { executor_facts: {} }
};
showCreateAbilityModal.value = true;
}
</script>

Expand Down Expand Up @@ -98,7 +107,13 @@ function createAbility() {
button.button(@click="emit('close')") Close

//- Modals
CreateEditAbility(v-if="props.canCreate" :ability="{}" :active="showCreateAbilityModal" :creating="true" @close="showCreateAbilityModal = false")
CreateEditAbility(
v-if="showCreateAbilityModal"
:ability="newAbility"
:creating="true"
@save="handleAbilitySave"
@close="showCreateAbilityModal = false"
)
</template>

<style scoped>
Expand Down
Loading
Loading