Skip to content
Snippets Groups Projects
Commit b1e0c8ce authored by Anders Høvik's avatar Anders Høvik
Browse files

Fix/ fixed the errors in Menu, BudgetBox and Commitment

parent 2e46a090
No related branches found
No related tags found
1 merge request!44Fix/pipeline
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<li v-if="userStore.isLoggedIn" class="nav-item dropdown"> <li v-if="userStore.isLoggedIn" class="nav-item dropdown">
<a class="nav-link dropdown-toggle username-text text-white " href="#" role="button" <a class="nav-link dropdown-toggle username-text text-white " href="#" role="button"
data-bs-toggle="dropdown" aria-expanded="false"> data-bs-toggle="dropdown" aria-expanded="false">
<img src="@/assets/icons/person.svg">{{ userStore.firstname }} <img src="@/assets/icons/person.svg">{{ useUserInfoStore().firstname}}
</a> </a>
<ul class="dropdown-menu dropdown-username-content"> <ul class="dropdown-menu dropdown-username-content">
<li><a class="dropdown-item text-white dropdown-username-link" href="#" <li><a class="dropdown-item text-white dropdown-username-link" href="#"
...@@ -64,7 +64,7 @@ import { useUserInfoStore } from '@/stores/UserStore'; ...@@ -64,7 +64,7 @@ import { useUserInfoStore } from '@/stores/UserStore';
const router = useRouter(); const router = useRouter();
const userStore = useUserInfoStore(); const userStore : any = useUserInfoStore();
function toHome() { function toHome() {
router.push('/') router.push('/')
......
...@@ -21,16 +21,17 @@ const props = defineProps({ ...@@ -21,16 +21,17 @@ const props = defineProps({
// Calculated balance variable // Calculated balance variable
let balance = props.budget - props.expenses let balance = props.budget - props.expenses
// Reactive variable for determining background color // Reactive variable for determining background color
const iRef = ref(null) const iRef = ref<Element | null>(null);
/** /**
* Checks if the balance is positive, and depending on the value * Checks if the balance is positive, and depending on the value
* changes background color to green (positive) or red (negative) * changes background color to green (positive) or red (negative)
*/ */
onMounted(() => { onMounted(() => {
if (balance >= 0) { if (iRef.value !== null && balance >= 0) {
// By default, the background is set to red // By default, the background is set to red
iRef.value.style.backgroundColor = 'rgba(34, 231, 50, 0.43)'; const element = iRef.value as HTMLElement;
element.style.backgroundColor = 'rgba(34, 231, 50, 0.43)';
} }
}) })
......
...@@ -12,10 +12,10 @@ emit('changeRouterEvent', '/commitment') ...@@ -12,10 +12,10 @@ emit('changeRouterEvent', '/commitment')
// Reactive variables for form and radio buttons. // Reactive variables for form and radio buttons.
const formRef = ref() const formRef = ref()
const lowRef = ref('') const lowRef = ref()
const mediumRef = ref('') const mediumRef = ref()
const highRef = ref('') const highRef = ref()
let errorMsg = ref(''); let errorMsg = ref();
/** /**
* Validates the commitment form radio buttons and updates the commitment choice in the store. * Validates the commitment form radio buttons and updates the commitment choice in the store.
...@@ -30,7 +30,7 @@ const onClick = () => { ...@@ -30,7 +30,7 @@ const onClick = () => {
if (lowRef.value.checked) choice = 'LITTLE' if (lowRef.value.checked) choice = 'LITTLE'
else if (mediumRef.value.checked) choice = 'SOME' else if (mediumRef.value.checked) choice = 'SOME'
else if (highRef.value.checked) choice = 'MUCH' else if (highRef.value.checked) choice = 'MUCH'
useConfigurationStore().setCommitment(choice) useConfigurationStore().commitment(choice)
router.push('/experience') router.push('/experience')
} }
else { else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment