Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update home page with initiative links, add back button to individual submission page #22

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions app/src/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,6 @@ model identity_provider {
user user[]
}

model permit {
permitId String @id @db.Uuid
permitTypeId Int
submissionId String @db.Uuid
issuedPermitId String?
trackingId String?
authStatus String?
needed String?
status String?
submittedDate DateTime? @db.Timestamptz(6)
adjudicationDate DateTime? @db.Timestamptz(6)
createdBy String? @default("00000000-0000-0000-0000-000000000000")
createdAt DateTime? @default(now()) @db.Timestamptz(6)
updatedBy String?
updatedAt DateTime? @db.Timestamptz(6)
permit_type permit_type @relation(fields: [permitTypeId], references: [permitTypeId], onDelete: Cascade, map: "permit_permittypeid_foreign")
submission submission @relation(fields: [submissionId], references: [submissionId], onDelete: Cascade, map: "permit_submissionid_foreign")

@@unique([permitId, permitTypeId, submissionId], map: "permit_permitid_permittypeid_submissionid_unique")
}

model permit_type {
permitTypeId Int @id @default(autoincrement())
agency String
division String?
branch String?
businessDomain String
type String
family String?
name String
nameSubtype String?
acronym String?
trackedInATS Boolean?
sourceSystem String?
sourceSystemAcronym String
createdBy String? @default("00000000-0000-0000-0000-000000000000")
createdAt DateTime? @default(now()) @db.Timestamptz(6)
updatedBy String?
updatedAt DateTime? @db.Timestamptz(6)
permit permit[]
}

model submission {
submissionId String @id @db.Uuid
assignedToUserId String? @db.Uuid
Expand Down Expand Up @@ -150,3 +108,45 @@ model user {
@@index([identityId], map: "user_identityid_index")
@@index([username], map: "user_username_index")
}

model permit {
permitId String @id @db.Uuid
permitTypeId Int
submissionId String @db.Uuid
issuedPermitId String?
trackingId String?
authStatus String?
needed String?
status String?
submittedDate DateTime? @db.Timestamptz(6)
adjudicationDate DateTime? @db.Timestamptz(6)
createdBy String? @default("00000000-0000-0000-0000-000000000000")
createdAt DateTime? @default(now()) @db.Timestamptz(6)
updatedBy String?
updatedAt DateTime? @db.Timestamptz(6)
permit_type permit_type @relation(fields: [permitTypeId], references: [permitTypeId], onDelete: Cascade, map: "permit_permittypeid_foreign")
submission submission @relation(fields: [submissionId], references: [submissionId], onDelete: Cascade, map: "permit_submissionid_foreign")

@@unique([permitId, permitTypeId, submissionId], map: "permit_permitid_permittypeid_submissionid_unique")
}

model permit_type {
permitTypeId Int @id @default(autoincrement())
agency String
division String?
branch String?
businessDomain String
type String
family String?
name String
nameSubtype String?
acronym String?
trackedInATS Boolean?
sourceSystem String?
sourceSystemAcronym String
createdBy String? @default("00000000-0000-0000-0000-000000000000")
createdAt DateTime? @default(now()) @db.Timestamptz(6)
updatedBy String?
updatedAt DateTime? @db.Timestamptz(6)
permit permit[]
}
2 changes: 1 addition & 1 deletion frontend/src/components/layout/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const { getIsAuthenticated } = storeToRefs(useAuthStore());
<router-link :to="{ name: RouteNames.HOME }">Home</router-link>
</li>
<li v-if="getIsAuthenticated">
<router-link :to="{ name: RouteNames.INITIATIVES }">Initiatives</router-link>
<router-link :to="{ name: RouteNames.SUBMISSIONS }">Submissions</router-link>
</li>
</ol>
</template>
Expand Down
84 changes: 16 additions & 68 deletions frontend/src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,49 +1,20 @@
<script setup lang="ts">
import { Message } from '@/lib/primevue';
import { storeToRefs } from 'pinia';
import { useRouter } from 'vue-router';

import { useConfigStore } from '@/store';
import { Button, Message } from '@/lib/primevue';
import { RouteNames } from '@/utils/constants';
import { useAuthStore, useConfigStore } from '@/store';

// Store
const { getConfig } = storeToRefs(useConfigStore());
const { getIsAuthenticated } = storeToRefs(useAuthStore());

// Actions
const frontEcosystem: Array<{ text: string; href: string }> = [
{
text: 'Vue 3',
href: 'https://vuejs.org/'
},
{
text: 'Pinia',
href: 'https://pinia.vuejs.org/'
},
{
text: 'PrimeVue',
href: 'https://primevue.org/'
},
{
text: 'Vitest',
href: 'https://vitest.dev/'
}
];
const router = useRouter();

const backEcosystem: Array<{ text: string; href: string }> = [
{
text: 'Express',
href: 'https://expressjs.com/'
},
{
text: 'Jest',
href: 'https://jestjs.io/'
}
];

const languagesEcosystem: Array<{ text: string; href: string }> = [
{
text: 'TypeScript',
href: 'https://www.typescriptlang.org/'
}
];
const toSubmissions = (): void => {
router.push({ name: RouteNames.SUBMISSIONS });
};
</script>

<template>
Expand All @@ -55,36 +26,13 @@ const languagesEcosystem: Array<{ text: string; href: string }> = [
</Message>

<div class="text-center">
<h1 class="font-bold">Welcome to the PermitConnect Navigator Service!</h1>
<h2>Frontend Ecosystem</h2>
<a
v-for="(eco, i) in frontEcosystem"
:key="i"
:href="eco.href"
class="mx-3"
target="_blank"
>
{{ eco.text }}
</a>
<h2>Backend Ecosystem</h2>
<a
v-for="(eco, i) in backEcosystem"
:key="i"
:href="eco.href"
class="mx-3"
target="_blank"
>
{{ eco.text }}
</a>
<h2>Languages</h2>
<a
v-for="(eco, i) in languagesEcosystem"
:key="i"
:href="eco.href"
class="mx-3"
target="_blank"
<h1 class="font-bold">Welcome to the PermitConnect Applications</h1>
<h2 class="mb-3">Choose an Initiative:</h2>
<Button
:disabled="!getIsAuthenticated"
@click="toSubmissions"
>
{{ eco.text }}
</a>
Housing
</Button>
</div>
</template>
8 changes: 8 additions & 0 deletions frontend/src/views/SubmissionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import PermitModal from '@/components/permit/PermitModal.vue';
import FileUpload from '@/components/file/FileUpload.vue';
import SubmissionForm from '@/components/submission/SubmissionForm.vue';
import { Button, TabPanel, TabView, useToast } from '@/lib/primevue';
import { RouteNames } from '@/utils/constants';
import { chefsService, documentService, permitService } from '@/services';

import type { Ref } from 'vue';
Expand Down Expand Up @@ -62,6 +63,13 @@ onMounted(async () => {
</script>

<template>
<router-link :to="{ name: RouteNames.SUBMISSIONS }">
<font-awesome-icon
icon="fa fa-arrow-circle-left"
class="mr-1"
/>
<span>Back to Submissions</span>
</router-link>
<h1>Activity submission</h1>

<TabView>
Expand Down
2 changes: 1 addition & 1 deletion frontend/tests/unit/components/layout/Navbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Navbar.vue', () => {
const linkEle = wrapper.findAll('a');
expect(linkEle).toHaveLength(2);
expect(linkEle[0].text()).toBe('Home');
expect(linkEle[1].text()).toBe('Initiatives');
expect(linkEle[1].text()).toBe('Submissions');
});

it('shows correct navbar when false', async () => {
Expand Down
Loading