From 7dc609cf94d7cb0a990dc7deaf2572d480a1d9b0 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Mon, 9 Sep 2019 19:31:15 -0500 Subject: [PATCH] Fix isActive on app list page Also added some TypeScript shorthand properties --- src/components/ApplicationListItem.vue | 4 +- src/components/sidebar/SidebarApp.vue | 7 +++- src/data/Types.ts | 58 +++----------------------- 3 files changed, 14 insertions(+), 55 deletions(-) diff --git a/src/components/ApplicationListItem.vue b/src/components/ApplicationListItem.vue index 3c629d7..78d496c 100644 --- a/src/components/ApplicationListItem.vue +++ b/src/components/ApplicationListItem.vue @@ -3,9 +3,9 @@ span.app-name(v-html='app.name') |  ~  router-link(:to="{ name: 'Application', params: { app: app.id } }") About - span(v-if='app.active')  ~  + span(v-if='app.isActive')  ~  a(:href='app.url') Visit - span(v-if='!app.active && app.archiveUrl')  ~  + span(v-if='!app.isActive && app.archiveUrl')  ~  a(:href='app.archiveUrl') Visit em  (archive) br diff --git a/src/components/sidebar/SidebarApp.vue b/src/components/sidebar/SidebarApp.vue index 0af9f3b..62c93c0 100644 --- a/src/components/sidebar/SidebarApp.vue +++ b/src/components/sidebar/SidebarApp.vue @@ -4,7 +4,7 @@ strong {{ app.name }} br span(v-if='!app.noAboutLink'). - #[router-link(:to="{ name: 'Application', params: { app: app.id } }") About] • + #[router-link(:to="{ name: 'Application', params: { app: app.id } }" :title='aboutTitle') About] • a(:title='app.name' :href='app.url') Visit p.app-sidebar-description(v-html='app.frontPageText') @@ -21,5 +21,10 @@ import { App } from '@/data' export default class SidebarApp extends Vue { @Prop() app!: App + + /** The title attribute for the About link */ + get aboutTitle () { + return `About ${this.app.name} | Bit Badger Solutions` + } } diff --git a/src/data/Types.ts b/src/data/Types.ts index 838bb47..8b18af6 100644 --- a/src/data/Types.ts +++ b/src/data/Types.ts @@ -3,38 +3,23 @@ /** An activity performed for a customer */ export class Activity { - /** The heading of the activity */ - heading: string - - /** A description of the activity */ - narrative: string - /** * Construct a new instance * @param heading The heading of the activity * @param narrative The description of the activity */ - constructor(heading: string, narrative: string) { - this.heading = heading - this.narrative = narrative - } + constructor(public heading: string, public narrative: string) { } } /** A category of application */ export class Category { - /** The ID of the category */ - id: number - - /** The name of the category */ - name: string - /** * Construct a new instance * @param id The ID of the category * @param name The name of the category */ - constructor(id: number, name: string) { + constructor(public id: number, public name: string) { this.id = id this.name = name } @@ -55,12 +40,6 @@ export class Category { /** A quote from an app */ export class Quote { - /** The name of the person who provided the quote */ - name: string - - /** What organization the person who provided the quote represents */ - from: string - /** The full text of the quote */ full: string = '' @@ -72,44 +51,23 @@ export class Quote { * @param name The name of the person who provided the quote * @param from What organization the person who provided the quote represents */ - constructor(name: string, from: string) { - this.name = name - this.from = from - } + constructor(public name: string, public from: string) { } } /** A description of a part of the technology stack used */ export class Technology { - - /** The name of the technology */ - name: string - - /** What aspect was addressed by this technology */ - usedFor: string - + /** * Construct a new instace * @param name The name of the technology * @param usedFor What aspect was addressed by this technology */ - constructor(name: string, usedFor: string) { - this.name = name - this.usedFor = usedFor - } + constructor(public name: string, public usedFor: string) { } } /** An application or web site */ export class App { - /** The ID of the app */ - id: string - - /** The name of the app */ - name: string - - /** The URL of the app */ - url: string - /** Whether this app is active (default true) */ isActive: boolean = true @@ -155,9 +113,5 @@ export class App { * @param name The name of the app * @param url The URL of the app */ - constructor(id: string, name: string, url: string) { - this.id = id - this.name = name - this.url = url - } + constructor(public id: string, public name: string, public url: string) { } }