Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
angellionn committed Nov 3, 2023
2 parents 4762db7 + 2168097 commit a0502d7
Show file tree
Hide file tree
Showing 70 changed files with 643 additions and 330 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/public/images/categories/location.jpg
Binary file not shown.
Binary file added app/public/images/categories/location.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/categories/manageability.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/public/images/categories/manageablity.jpg
Binary file not shown.
Binary file removed app/public/images/categories/reducibleByAdd.jpg
Binary file not shown.
Binary file added app/public/images/categories/reduciblebyadd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/public/images/categories/resolutionTime.jpg
Binary file not shown.
Binary file added app/public/images/categories/resolutiontime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/public/images/categories/severityOfImpact.jpg
Binary file not shown.
Binary file added app/public/images/categories/severityofimpact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/public/images/categories/type.jpg
Binary file not shown.
Binary file added app/public/images/categories/type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U10Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U16Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U17Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U18Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U1Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U20Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U24Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U29Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/images/uncertainties/U30Image.png
Binary file added app/public/images/uncertainties/U36Image.png
Binary file added app/public/images/uncertainties/U38Image.png
Binary file added app/public/images/uncertainties/U4Image.png
Binary file added app/public/images/uncertainties/U7Image.png
Binary file removed app/public/images/uncertainties/uncertaintyone.jpg
Diff not rendered.
Binary file removed app/public/images/uncertainties/uncertaintytwo.jpg
Diff not rendered.
7 changes: 4 additions & 3 deletions app/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ header {
main {
max-width: 2500px;
flex: 1;
flex: 2;
display: flex;
justify-content: center;
}
Expand Down Expand Up @@ -103,14 +103,15 @@ p {
.content {
clear: both;
display: flexbox;
display: flex;
margin: 40px auto;
padding: 0.5rem 1rem;
border: 1px solid #ccc;
border-radius: 0.25rem;
background: #fff;
color: #2c3e50;
font-size: 1rem;
max-width: 1500px;
max-width: 2000px;
max-height: fit-content;
}
</style>
5 changes: 3 additions & 2 deletions app/src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import './base.css';

#app {
max-width: 1500px;
max-width: 1920px;
margin: 0 auto;
padding: 2rem;

Expand All @@ -28,8 +28,9 @@ a,
}

#app {
display: grid;
display: flex;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
place-items: center;
}
}
74 changes: 61 additions & 13 deletions app/src/components/AppContent.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<template>
<div class="entry" v-if="!showTable">
<button @click="toggleShowTable()">Back</button>
<div class="entry" v-if="showUncertainty || showUncertaintyCreator">
<button class="button" @click="toggleShowTable()" @keyup="processKeyDown">Back</button>
</div>
<div class="entry" v-if="showClassification">
<button class="button" @click="toggleShowUncertainty()" @keyup="processKeyDown">Back</button>
</div>
<div class="table" v-if="showTable">
<TableInstance @selected-uncertainty="setCurrentUncertainty" :filter-by-Option="currentFilterBy" :search-value="currentSearchValue"/>
<div class="button">
<button @click="toggleShowUncertaintyCreator()">Add new uncertainty</button>
<TableInstance @selected-uncertainty="setCurrentUncertainty"/>
<div>
<button class="button" @click="toggleShowUncertaintyCreator()"> Add new uncertainty </button>
</div>
</div>
<div class="uncertainty-detail" v-if="(showUncertainty) && (currentUncertainty != null)">
<UncertaintyDetail :uncertainty="currentUncertainty" @selected-classification-category="setClassificationCategory" @selected-keyword="setSearchValue" @selected-uncertainty-id="setSearchValue"/>
<UncertaintyDetail :uncertainty="currentUncertainty" @selected-classification-category="setClassificationCategory" @selected-keyword="setKeyword" @selected-uncertainty-id="setSearchValue"/>
</div>
<div class="classification-detail" v-if="(showClassification) && (currentClassificationCategory != null)">
<CategoryOverviewPage :statedcategory="currentClassificationCategory" @filter-by="setFilteredTable"/>
Expand All @@ -28,15 +31,16 @@ import type { Category } from '@/util/types/Category';
import CategoryOverviewPage from './category/CategoryOverviewPage.vue';
import type { Option } from '@/util/types/Option';
import UncertaintyCreator from './uncertaintycreation/UncertaintyCreator.vue';
import {tableState} from '@/util/types/TableState';
window.addEventListener('keydown', processKeyDown);
const showTable = ref(true);
const showUncertainty = ref(false);
const showClassification = ref(false);
const currentSearchValue = ref('');
const showUncertaintyCreator = ref(false);
let currentUncertainty = ref(null) as Ref<Uncertainty | null>;
let currentClassificationCategory= ref(null) as Ref<Category | null>;
let currentFilterBy = ref(null) as Ref< {category: Category, option: Option} | null>;
function toggleShowTable() {
showTable.value = true;
Expand All @@ -45,8 +49,7 @@ function toggleShowTable() {
showUncertaintyCreator.value = false;
currentUncertainty = ref(null) as Ref<Uncertainty | null>;
currentClassificationCategory= ref(null) as Ref<Category | null>;
currentFilterBy = ref(null) as Ref< {category: Category, option: Option} | null>;
currentSearchValue.value = '';
console.log(tableState)
console.log("The value is set to show the table " )
}
Expand All @@ -71,6 +74,7 @@ function toggleShowClassification() {
}
}
function toggleShowUncertaintyCreator() {
showTable.value = false;
showUncertainty.value = false;
Expand All @@ -90,17 +94,61 @@ function setClassificationCategory(category: Category) {
toggleShowClassification();
}
function processKeyDown(event: KeyboardEvent) {
if (event.key === 'Escape') {
if (showUncertainty.value ||showUncertaintyCreator.value) {
toggleShowTable();
} else if (showClassification.value) {
toggleShowUncertainty();
}
}
}
function setFilteredTable(payload: {category: Category, option: Option}) {
console.log("Incoming fitered table value: " + payload.category.name + payload.option.name)
if(payload.category.name === 'Location') {
tableState.selectedLocation = payload.option.name;
} else if (payload.category.name === 'Architectural Element Type') {
tableState.selectedArchitecturalType = payload.option.name;
} else if (payload.category.name === 'Type') {
tableState.selectedType = payload.option.name;
} else if (payload.category.name === 'Manageability') {
tableState.selectedManageability = payload.option.name;
} else if (payload.category.name === 'Resolution Time') {
tableState.selectedResolutionTime = payload.option.name;
} else if (payload.category.name === 'Reducible by Add') {
tableState.selectedReducibleByAdd = payload.option.name;
} else if (payload.category.name === 'Impact on Confidentiality') {
tableState.selectedImpactOnConfidentiality = payload.option.name;
} else if (payload.category.name === 'Severity of Impact') {
tableState.selectedSeverityOfImpact = payload.option.name;
} else {
tableState.searchValue = payload.option.name;
}
toggleShowTable();
}
function setKeyword(keyword: string) {
console.log("Incoming keyword value: " + keyword)
tableState.selectedKeyword = keyword;
toggleShowTable();
currentFilterBy.value = payload;
}
function setSearchValue(searchValue: string) {
console.log("Incoming search value: " + searchValue)
tableState.searchValue = searchValue;
toggleShowTable();
currentSearchValue.value = searchValue;
}
</script>
<style scoped>
</style>@/util/types/Option
.table {
display: flex;
flex-direction: column;
align-items: center;
}
.button {
padding: 5px;
margin-top: 5px;
}
</style>
2 changes: 1 addition & 1 deletion app/src/components/category/CategoryOverviewPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<main>
<BasicInformation :definition="props.statedcategory.definition" :description="props.statedcategory.description"/>
<OptionDetailSection :options="props.statedcategory.options" :category="props.statedcategory" @filter-by-option="sendFilterOption"/>
<ExampleSection :description="props.statedcategory.exampleScenarios.toString()" :imagePath="imagePath" :collaborationUrl="props.statedcategory.discussionUrl"/>
<ExampleSection :description="props.statedcategory.exampleScenario" :imagePath="imagePath" :collaborationUrl="props.statedcategory.discussionUrl"/>
</main>

</div>
Expand Down
28 changes: 22 additions & 6 deletions app/src/components/category/OptionDetailItem.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<template>
<div class="item">
<div class="definition-and-button">
<p>{{ props.option.name }}: {{ props.option.definition }}</p>
<div class="definition-and-button">
<p style="font-weight: bold;">{{ props.option.name }}:</p>
<p>{{ props.option.definition }}</p>
</div>
<FilterButton buttontext="Show more examples!" @filter="sendFilterOption"/>
</div>
<div class="example-list">
<p v-for="(example, index) in props.option.exampleScenarios" :key="index">{{example}}</p>
<p style="margin-right:5px;">Example:</p>
<div class="list">
<p v-for="(example, index) in props.option.exampleScenarios" :key="index">{{example}}</p>
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -33,24 +39,34 @@
<style scoped>
.item {
flex-direction: row;
margin: 5px;
margin: 10px;
padding: 5px;
}
.example-list {
flex-direction: column;
display:flex;
margin: 5px;
flex-direction: row;
}
.example-list p {
text-align: left;
flex-direction: column;
}
.item p {
text-align: left;
}
.definition-and-button {
flex-direction: column;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.definition-and-button p {
margin: 5px;
}
.list {
display: flex;
flex-direction: column;
}
</style>@/util/types/Option
2 changes: 1 addition & 1 deletion app/src/components/category/OptionDetailSection.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="options">
<header>
<h3>options:</h3>
<h3>Options:</h3>
</header>
<main>
<OptionDetailItem v-for="(option, index) in props.options" :option="option" :key="index" @filter-byoption="forwardEmit"/>
Expand Down
90 changes: 0 additions & 90 deletions app/src/components/table/FilterBar.vue

This file was deleted.

40 changes: 20 additions & 20 deletions app/src/components/table/SearchBar.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<template>
<button @click="$emit('toggleSearch')">Filter</button>
<div class="input">
<span>search value:</span>
<input type="text" v-model="searchValue" @input="emitSearch"/>
<button @click="$emit('reset'), searchValue = ''">Reset</button>
<span class="search">search value:</span>
<input type="text" v-model="tableState.searchValue"/>
<button class="button" @click="$emit('reset'), tableState.searchValue = ''">Reset</button>
</div>
</template>
<script setup lang="ts">
import {ref} from 'vue';
const props = defineProps(
{
searchValue: {
type: String,
default: ''
}
}
)
const searchValue = ref(props.searchValue);
const emits = defineEmits(['search', 'reset', 'toggleSearch']);
function emitSearch() {
emits('search', searchValue.value)
}
import { tableState } from '@/util/types/TableState';
</script>
<style scoped>
.input {
display: flex;
flex-direction: row;
align-items: right;
justify-content: right;
}
.search {
margin-right: 10px;
}
.button {
margin-left: 10px;
margin-top: 0;
padding: 5px;
}
</style>
Loading

0 comments on commit a0502d7

Please sign in to comment.