Skip to content
Snippets Groups Projects
Commit 42b97f10 authored by Jens Christian Aanestad's avatar Jens Christian Aanestad
Browse files

feat/Created the login link and sign up link components

parent 13445f3c
No related branches found
No related tags found
1 merge request!27feat/Created the login link and sign up link components
Pipeline #275824 failed
<script setup lang="ts"> <script setup lang="ts">
import { RouterView } from 'vue-router' import { RouterView } from 'vue-router'
// import ErrorBoundaryCatcher from '@/components/Exceptions/ErrorBoundaryCatcher.vue'; import ErrorBoundaryCatcher from '@/components/Exceptions/ErrorBoundaryCatcher.vue';
</script> </script>
<template> <template>
......
...@@ -16,6 +16,12 @@ const props = defineProps({ ...@@ -16,6 +16,12 @@ const props = defineProps({
} }
}) })
/**
* This method is run whenever a change has occurred in the checkbox. It retrieves
* the current value of the checkbox (true/false) and emits a data object containing
* the challenge's description and the checked value.
* @param event The event object containing information about the input's checked value.
*/
const onChallengeChanged = (event: any) => { const onChallengeChanged = (event: any) => {
const value = event.target.checked const value = event.target.checked
const data = [props.text, value] const data = [props.text, value]
......
<script setup lang="ts"> <script setup lang="ts">
import ProgressBar from '@/components/Configuration/ProgressBar.vue' import ProgressBar from '@/components/Configuration/ConfigurationProgressBar.vue'
import { ref } from 'vue' import { ref } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
...@@ -17,7 +17,7 @@ let currentRoute = useRoute() ...@@ -17,7 +17,7 @@ let currentRoute = useRoute()
let currentPath = currentRoute.fullPath let currentPath = currentRoute.fullPath
// Sets the current path to a new path and updates progressbar // Sets the current path to a new path and updates progressbar
const onNewRouteEvent = (path) => { const onNewRouteEvent = (path: string) => {
currentPath = path currentPath = path
percentage.value = (1/length) * configurationSteps[path] percentage.value = (1/length) * configurationSteps[path]
} }
......
...@@ -7,6 +7,7 @@ import { AuthenticationService, OpenAPI, LoginRequest } from '@/api'; ...@@ -7,6 +7,7 @@ import { AuthenticationService, OpenAPI, LoginRequest } from '@/api';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import handleUnknownError from '@/components/Exceptions/unkownErrorHandler'; import handleUnknownError from '@/components/Exceptions/unkownErrorHandler';
import { useErrorStore } from '@/stores/ErrorStore'; import { useErrorStore } from '@/stores/ErrorStore';
import SignUpLink from '@/components/SignUp/SignUpLink.vue'
const emailRef = ref('') const emailRef = ref('')
const passwordRef = ref('') const passwordRef = ref('')
...@@ -95,6 +96,7 @@ const handleSubmit = async () => { ...@@ -95,6 +96,7 @@ const handleSubmit = async () => {
<p class="text-danger">{{ errorMsg }}</p> <p class="text-danger">{{ errorMsg }}</p>
<button1 id="confirmButton" type="submit" @click="handleSubmit" button-text="Login"></button1> <button1 id="confirmButton" type="submit" @click="handleSubmit" button-text="Login"></button1>
<SignUpLink/>
</form> </form>
</div> </div>
</template> </template>
......
<script setup lang="ts">
</script>
<template>
<p>Already have an account? <RouterLink to="/login">Login</RouterLink></p>
</template>
<style scoped>
</style>
\ No newline at end of file
...@@ -6,6 +6,7 @@ import { useRouter } from 'vue-router' ...@@ -6,6 +6,7 @@ import { useRouter } from 'vue-router'
import { AuthenticationService } from '@/api' import { AuthenticationService } from '@/api'
import handleUnknownError from '@/components/Exceptions/unkownErrorHandler' import handleUnknownError from '@/components/Exceptions/unkownErrorHandler'
import { useUserInfoStore } from '@/stores/UserStore' import { useUserInfoStore } from '@/stores/UserStore'
import LoginLink from '@/components/Login/LoginLink.vue'
const router = useRouter(); const router = useRouter();
const userStore = useUserInfoStore(); const userStore = useUserInfoStore();
...@@ -113,6 +114,7 @@ const handleSubmit = async () => { ...@@ -113,6 +114,7 @@ const handleSubmit = async () => {
<p class="text-danger">{{ errorMsg }}</p> <p class="text-danger">{{ errorMsg }}</p>
<p v-if="!samePasswords" class="text-danger">The passwords are not identical</p> <p v-if="!samePasswords" class="text-danger">The passwords are not identical</p>
<button1 id="confirmButton" @click="handleSubmit" button-text="Sign up"></button1> <button1 id="confirmButton" @click="handleSubmit" button-text="Sign up"></button1>
<LoginLink/>
</form> </form>
</div> </div>
......
<script setup lang="ts">
</script>
<template>
<p>Don't have an account? <RouterLink to="/sign-up">Sign up</RouterLink></p>
</template>
<style scoped>
</style>
\ No newline at end of file
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