Skip to content

Commit

Permalink
Merge branch 'main' into feature/small-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeNamedRobin authored Aug 5, 2023
2 parents d44dc9d + 71083c3 commit 615024e
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 172 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ module.exports = {
],
parserOptions: {
ecmaVersion: 'latest'
}
},
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"vue": "^3.3.4",
"vue-router": "^4.2.2",
"yup": "^1.2.0"
"vue-i18n": "^9.2.2",
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
Expand Down
31 changes: 11 additions & 20 deletions src/components/CardComponent.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<template>
<Panel :header="header.toUpperCase()" class="card">
<div class="wrapper">
<slot/>
<slot />
<template v-if="action" #footer>
<Button severity="secondary" id="bottom-left-button" @click="handleClick">{{ action.toUpperCase() }}</Button>
</div>

</template>
</Panel>
</template>

Expand All @@ -23,7 +22,7 @@ const props = defineProps({
},
action: {
type: String,
required: true,
required: false,
},
func: {
type: Function,
Expand All @@ -49,20 +48,15 @@ const handleClick = () => {
}
#bottom-left-button {
width: 100%;
position: absolute;
left: 0;
bottom: 0;
color: #d40000!important;
background-color: #f2f2f2;
border-top: none;
padding: 1rem 1.25rem!important;
padding: 1rem 1.25rem;
font-family: Lato,Arial,sans-serif!important;
font-weight: 400;
border-color: #dee2e6;
border: none #dee2e6;
}
:deep(.p-panel-header) {
border-bottom: none!important;
color: #d40000!important;
font-family: Lato,Arial,sans-serif!important;
font-weight: 400;
Expand All @@ -73,17 +67,14 @@ const handleClick = () => {
:deep(.p-panel-content) {
background-color: #f8f8f8!important;
padding-left: 2rem!important;
padding-right: 2rem!important;
padding-bottom: 0!important;
padding: 1rem 2rem!important;
}
.card {
color: #d40000!important;
:deep(.p-panel-footer) {
padding: 0!important;
}
.wrapper {
margin-bottom: 4.75rem;
.card {
color: #d40000!important;
}
</style>
41 changes: 0 additions & 41 deletions src/components/HelloWorld.vue

This file was deleted.

86 changes: 0 additions & 86 deletions src/components/TheWelcome.vue

This file was deleted.

24 changes: 24 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"login": {
"SudoSOS Login": "SudoSOS Login",
"Login via GEWIS": "Login via GEWIS",
"Login": "Login",
"Username": "Username",
"Enter username": "Enter username",
"Password": "Password",
"Enter password": "Enter password",
"Password reset": "Reset password (External accounts only)",
"Back to login": "Go back to login",
"Email": "Email",
"Enter email": "Enter email",
"Reset": "Reset password",
"Email sent": "If there exists an account on this email address, an email has been sent to {email} with instructions on how to reset your password.",
"Set new password": "Set new password",
"New password": "New password",
"Confirm password": "Confirm new password",
"Enter password again": "Enter password again",
"Reset the password for": "Reset the password for {email}",
"Passwords not equal": "Passwords are not equal",
"Password not strong": "Password needs to be longer than 8 characters and needs a lower- and uppercase letter, number and a special character"
}
}
9 changes: 9 additions & 0 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import English from '@/locales/en.json';
import Dutch from '@/locales/nl.json';

const languages = {
en: English,
nl: Dutch,
};

export default languages;
24 changes: 24 additions & 0 deletions src/locales/nl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"login": {
"SudoSOS Login": "SudoSOS Login",
"Login via GEWIS": "Login via GEWIS",
"Login": "Login",
"Username": "Username",
"Enter username": "Enter username",
"Password": "Password",
"Enter password": "Enter password",
"Password reset": "Reset password (External accounts only)",
"Back to login": "Go back to login",
"Email": "Email",
"Enter email": "Enter email",
"Reset": "Reset password",
"Email sent": "If there exists an account on this email address, an email has been sent to {email} with instructions on how to reset your password.",
"Set new password": "Set new password",
"New password": "New password",
"Confirm password": "Confirm new password",
"Enter password again": "Enter password again",
"Reset the password for": "Reset the password for {email}",
"Passwords not equal": "Passwords are not equal",
"Password not strong": "Password needs to be longer than 8 characters and needs a lower- and uppercase letter, number and a special character"
}
}
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createI18n } from 'vue-i18n';

import App from './App.vue'
import router from './router'
Expand All @@ -15,12 +16,20 @@ import DataTable from "primevue/datatable";
import InputNumber from "primevue/inputnumber";
import Dialog from "primevue/dialog";
import 'primeicons/primeicons.css';
import languages from "@/locales";

const app = createApp(App)

const messages = Object.assign(languages);
const i18n = createI18n({
locale: 'en',
fallbackLocale: 'en',
messages,
});
app.use(createPinia())
app.use(router)
app.use(PrimeVue)
app.use(i18n);

app.component('Button', Button);
app.component('InputText', InputText);
Expand All @@ -29,4 +38,5 @@ app.component('Panel', Panel);
app.component('DataTable', DataTable);
app.component('InputNumber', InputNumber);
app.component('Dialog', Dialog);

app.mount('#app')
18 changes: 18 additions & 0 deletions src/utils/formatterUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export function formatDateTime(date: Date): string {

const daysOfWeek: Array<string> = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
]

const day = date.getDate().toString();
const monthIndex = date.getMonth().toString();
const year = date.getFullYear().toString();
const dayOfWeek = daysOfWeek[date.getDay()];
return `${day}-${monthIndex}-${year} (${dayOfWeek})`;
}
15 changes: 0 additions & 15 deletions src/views/AboutView.vue

This file was deleted.

20 changes: 11 additions & 9 deletions src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
<div>
<main>
<img id="login-image" src="../assets/img/bier.png" alt="logo">
<h1>SudoSOS Login</h1>
<Button id="login-gewis-button" @click="loginViaGEWIS" severity="success"><img id="gewis-branding" src="../assets/img/gewis-branding.svg" alt="GEWIS">Login via GEWIS</Button>
<h1>{{ $t('login.SudoSOS Login' )}}</h1>
<Button id="login-gewis-button" @click="loginViaGEWIS" severity="success"><img id="gewis-branding" src="../assets/img/gewis-branding.svg" alt="GEWIS">{{
$t('login.Login via GEWIS')
}}</Button>
<hr>
<form id="login-form" @submit="ldapLogin">
<!-- TODO: Form validation with vee-validate -->
<label for="username">Username</label>
<InputText id="username" type="text" v-bind="username" placeholder="Enter username"/>
<label for="password">Password</label>
<InputText id="password" type="password" v-bind="password" placeholder="Enter password" />
<Button type="submit" id="login-button" severity="danger">Login</Button>
<!-- TODO: Form validation with vee-validate -->
<label for="username">{{$t('login.Username')}}</label>
<InputText id="username" type="text" v-bind="username" :placeholder="$t('login.Enter username')"/>
<label for="password">{{$t('login.Password')}}</label>
<InputText id="password" type="password" v-bind="password" :placeholder="$t('login.Enter password')" />
<Button type="submit" id="login-button" severity="danger">{{$t('login.Login')}}</Button>
<a href="https://wieditleesttrekteenbak.nl/">{{$t('login.Password reset')}}</a>
</form>
<a href="https://wieditleesttrekteenbak.nl/">Reset password (External accounts only)</a>
</main>
<CopyrightBanner />
</div>
Expand Down

0 comments on commit 615024e

Please sign in to comment.