Skip to content

Commit

Permalink
Implemented: UI for brokering rules page, updated router by adding br…
Browse files Browse the repository at this point in the history
…okering page and removed home page entry, updated tabs component and removed the home page from app(#4)
  • Loading branch information
ymaheshwari1 committed Dec 29, 2023
1 parent 7838792 commit 85aa026
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 216 deletions.
28 changes: 5 additions & 23 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
import Home from '@/views/Home.vue'
import Login from '@/views/Login.vue'
import Settings from "@/views/Settings.vue"
import store from '@/store'
import Tabs from '@/views/Tabs.vue'

Expand All @@ -25,49 +23,33 @@ const loginGuard = (to: any, from: any, next: any) => {
const routes: Array<RouteRecordRaw> = [
{
path: '/',
redirect: '/tabs/home'
redirect: '/tabs/brokering'
},
{
path: '/tabs',
component: Tabs,
children: [
{
path: '',
redirect: '/home'
redirect: '/brokering'
},
{
path: 'home',
component: () => import('@/views/Home.vue')
path: 'brokering',
component: () => import('@/views/BrokeringRuns.vue')
},
{
path: 'settings',
component: () => import('@/views/Settings.vue')
},
}
],
beforeEnter: authGuard
},
{
path: '/',
redirect: '/settings'
},
{
path: '/home',
name: 'Home',
component: Home,
beforeEnter: authGuard
},
{
path: '/login',
name: 'Login',
component: Login,
beforeEnter: loginGuard
},
{
path: "/settings",
name: "Settings",
component: Settings,
beforeEnter: authGuard
}
]

const router = createRouter({
Expand Down
125 changes: 125 additions & 0 deletions src/views/BrokeringRuns.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>{{ "Brokering Runs" }}</ion-title>

<ion-buttons slot="end">
<ion-button color="primary">
{{ "New Run" }}
<ion-icon :icon="addOutline" />
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>

<ion-content>
<main>
<section>
<ion-card>
<ion-card-header>
<ion-card-title>
{{ "Brokering run name" }}
</ion-card-title>
</ion-card-header>
<ion-item>
{{ "Description" }}
</ion-item>
<ion-item>
{{ "<Frequency>" }}
{{ "<Runtime>" }}
</ion-item>
<ion-item>
{{ "Created at <time>" }}
</ion-item>
<ion-item>
{{ "Updated at <time>" }}
</ion-item>
</ion-card>
<ion-card>
<ion-card-header>
<ion-card-title>
{{ "Brokering run name" }}
</ion-card-title>
</ion-card-header>
<ion-item>
{{ "Description" }}
</ion-item>
<ion-item>
{{ "<Frequency>" }}
{{ "<Runtime>" }}
</ion-item>
<ion-item>
{{ "Created at <time>" }}
</ion-item>
<ion-item>
{{ "Updated at <time>" }}
</ion-item>
</ion-card>
<ion-card>
<ion-card-header>
<ion-card-title>
{{ "Brokering run name" }}
</ion-card-title>
</ion-card-header>
<ion-item>
{{ "Description" }}
</ion-item>
<ion-item>
{{ "<Frequency>" }}
{{ "<Runtime>" }}
</ion-item>
<ion-item>
{{ "Created at <time>" }}
</ion-item>
<ion-item>
{{ "Updated at <time>" }}
</ion-item>
</ion-card>
<ion-card>
<ion-card-header>
<ion-card-title>
{{ "Brokering run name" }}
</ion-card-title>
</ion-card-header>
<ion-item>
{{ "Description" }}
</ion-item>
<ion-item>
{{ "<Frequency>" }}
{{ "<Runtime>" }}
</ion-item>
<ion-item>
{{ "Created at <time>" }}
</ion-item>
<ion-item>
{{ "Updated at <time>" }}
</ion-item>
</ion-card>
</section>
</main>
</ion-content>
</ion-page>
</template>

<script setup lang="ts">
import { IonButton, IonButtons, IonCard, IonCardHeader, IonCardTitle, IonContent, IonHeader, IonIcon, IonItem, IonPage, IonTitle, IonToolbar } from "@ionic/vue";
import { addOutline } from "ionicons/icons"
</script>

<style scoped>
@media (min-width: 991px) {
main {
display: flex;
justify-content: center;
align-items: start;
gap: var(--spacer-2xl);
max-width: 990px;
margin: var(--spacer-base) auto 0;
}
main > section {
min-width: 50ch;
}
}
</style>
171 changes: 0 additions & 171 deletions src/views/Home.vue

This file was deleted.

2 changes: 1 addition & 1 deletion src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-back-button slot="start" default-href="/home" />
<ion-back-button slot="start" default-href="/" />
<ion-title>{{ $t("Settings") }}</ion-title>
</ion-toolbar>
</ion-header>
Expand Down
Loading

0 comments on commit 85aa026

Please sign in to comment.