Skip to content

Commit

Permalink
Create FormView
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Jan 24, 2025
1 parent 024d5b8 commit 344309f
Show file tree
Hide file tree
Showing 10 changed files with 805 additions and 203 deletions.
728 changes: 728 additions & 0 deletions frontend/package-lock.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"format": "prettier --write src/"
},
"dependencies": {
"@primevue/forms": "^4.2.5",
"@primevue/themes": "^4.2.5",
"pinia": "^2.3.0",
"primevue": "^4.2.5",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
Expand All @@ -28,11 +31,15 @@
"@vue/eslint-config-typescript": "^14.1.3",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.7.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.14.0",
"eslint-plugin-vue": "^9.30.0",
"jsdom": "^25.0.1",
"npm-run-all2": "^7.0.2",
"postcss": "^8.5.1",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.17",
"tailwindcss-primeui": "^0.4.0",
"typescript": "~5.6.3",
"vite": "^6.0.5",
"vite-plugin-vue-devtools": "^7.6.8",
Expand Down
6 changes: 6 additions & 0 deletions frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
85 changes: 5 additions & 80 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,85 +1,10 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
import { RouterView } from 'vue-router'
</script>

<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />

<div class="wrapper">
<HelloWorld msg="You did it!" />

<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
</header>

<RouterView />
<header></header>
<main>
<RouterView />
</main>
</template>

<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 2rem;
}
nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}
nav a.router-link-exact-active {
color: var(--color-text);
}
nav a.router-link-exact-active:hover {
background-color: transparent;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
}
</style>
86 changes: 0 additions & 86 deletions frontend/src/assets/base.css

This file was deleted.

37 changes: 6 additions & 31 deletions frontend/src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
@import './base.css';
@layer tailwind-base, primevue, tailwind-utilities;

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
font-weight: normal;
@layer tailwind-base {
@tailwind base;
}

a,
.green {
text-decoration: none;
color: hsla(160, 100%, 37%, 1);
transition: 0.4s;
padding: 3px;
}

@media (hover: hover) {
a:hover {
background-color: hsla(160, 100%, 37%, 0.2);
}
}

@media (min-width: 1024px) {
body {
display: flex;
place-items: center;
}

#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
@layer tailwind-utilities {
@tailwind components;
@tailwind utilities;
}
19 changes: 15 additions & 4 deletions frontend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import './assets/main.css'

import { createApp } from 'vue'
import Aura from '@primevue/themes/aura'
import { createPinia } from 'pinia'

import PrimeVue from 'primevue/config'
import { createApp } from 'vue'
import App from './App.vue'
import './assets/main.css'
import router from './router'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(PrimeVue, {
theme: {
preset: Aura,
options: {
cssLayer: {
name: 'primevue',
order: 'tailwind-base, primevue, tailwind-utilities',
},
},
},
})

app.mount('#app')
4 changes: 2 additions & 2 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import FormView from '../views/FormView.vue'

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: HomeView,
component: FormView,
},
{
path: '/about',
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/views/FormView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { Form, FormField } from '@primevue/forms'
import { Button } from 'primevue'
import InputText from 'primevue/inputtext'
</script>

<template>
<div class="flex flex-col my-12 items-center">
<div class="text-4xl text-gray-800 mb-10">Synchronization of datasets between platforms</div>
<Form class="flex flex-col gap-5">
<FormField name="sourceDataset" class="flex gap-5 items-center">
<label for="sourceDataset" class="w-36">Source dataset</label>
<InputText id="sourceDataset" placeholder="" />
</FormField>
<FormField name="sourceLayer" class="flex gap-5 items-center">
<label for="sourceLayer" class="w-36">Source layer</label>
<InputText id="sourceLayer" placeholder="" />
</FormField>
<FormField name="targetPlatform" class="flex gap-5 items-center">
<label for="targetPlatform" class="w-36">Target platform</label>
<InputText id="targetPlatform" placeholder="" />
</FormField>
<Button label="Synchronize" class="mt-5" />
</Form>
</div>
</template>
10 changes: 10 additions & 0 deletions frontend/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Config } from 'tailwindcss'
import tailwindcssPrimeUI from 'tailwindcss-primeui'

export default {
content: ['./src/**/*.vue'],
theme: {
extend: {},
},
plugins: [tailwindcssPrimeUI],
} satisfies Config

0 comments on commit 344309f

Please sign in to comment.