Skip to content
Snippets Groups Projects
Commit 2042a35a authored by VIktorGrev's avatar VIktorGrev
Browse files

Merge branch 'fix/pipeline' of...

Merge branch 'fix/pipeline' of https://gitlab.stud.idi.ntnu.no/idatt2106-2024-07/frontend into fix/pipeline
parents 5935dd14 776297e3
No related branches found
No related tags found
1 merge request!44Fix/pipeline
Pipeline #279599 failed
...@@ -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 {
......
...@@ -12,10 +12,10 @@ emit('changeRouterEvent', '/experience') ...@@ -12,10 +12,10 @@ emit('changeRouterEvent', '/experience')
// Declaration of reactive variables for the form and radio buttons // Declaration of reactive variables for the form and radio buttons
const formRef = ref() const formRef = ref()
const beginnerRef = ref('') const beginnerRef = ref()
const someExperienceRef = ref('') const someExperienceRef = ref()
const expertRef = ref('') const expertRef = ref()
let errorMsg = ref(''); let errorMsg = ref();
/** /**
* Validates the experience form radio buttons and updates the commitment choice in the store. * Validates the experience form radio buttons and updates the commitment choice in the store.
......
...@@ -44,7 +44,7 @@ export default defineComponent({ ...@@ -44,7 +44,7 @@ export default defineComponent({
left: 50%; left: 50%;
transform: translate(-50%, 0); transform: translate(-50%, 0);
width: min(100%, 700px); width: min(100%, 700px);
background-color: var(--red-color); background-color: red ; /*var(--red-color);*/
padding: 7px; padding: 7px;
border-radius: 5px; border-radius: 5px;
z-index: 1000; z-index: 1000;
......
...@@ -7,8 +7,10 @@ import { useUserInfoStore } from '@/stores/UserStore'; ...@@ -7,8 +7,10 @@ import { useUserInfoStore } from '@/stores/UserStore';
import router from '@/router/index'; import router from '@/router/index';
describe('Leaderboard', () => { describe('Leaderboard', () => {
let wrapper: any, store: any, mockRouter; let wrapper: any, store: any, mockRouter;
const leaderboard = [ const leaderboard = [
{ user: { id: 1, firstName: 'Alice', email: 'alice@example.com' }, rank: 1, score: 50 }, { user: { id: 1, firstName: 'Alice', email: 'alice@example.com' }, rank: 1, score: 50 },
{ user: { id: 2, firstName: 'Bob', email: 'bob@example.com' }, rank: 2, score: 45 } { user: { id: 2, firstName: 'Bob', email: 'bob@example.com' }, rank: 2, score: 45 }
......
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