From 144c34919cb67c68a73b8fb8e51a92096dd80cbc Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sun, 29 Aug 2021 15:42:18 -0400 Subject: [PATCH] Finish expire; mod Success Story Add label display to several view pages; fix lint errors --- src/JobsJobsJobs/Api/Data.fs | 3 +- src/JobsJobsJobs/App/.eslintrc.js | 2 +- src/JobsJobsJobs/App/src/App.vue | 8 +++- src/JobsJobsJobs/App/src/components/index.ts | 4 +- .../App/src/components/layout/TitleBar.vue | 2 +- src/JobsJobsJobs/App/src/views/Home.vue | 2 +- .../App/src/views/PrivacyPolicy.vue | 34 +++++++-------- .../App/src/views/citizen/LogOn.vue | 6 +-- .../App/src/views/listing/ListingEdit.vue | 14 +++---- .../App/src/views/listing/ListingExpire.vue | 1 + .../App/src/views/listing/ListingView.vue | 8 +++- .../App/src/views/listing/MyListings.vue | 41 +++++++++++++++---- .../App/src/views/profile/ProfileSearch.vue | 8 ++-- .../App/src/views/profile/ProfileView.vue | 10 ++--- .../App/src/views/profile/Seeking.vue | 6 +-- .../App/src/views/success-story/StoryView.vue | 14 ++++--- 16 files changed, 102 insertions(+), 61 deletions(-) diff --git a/src/JobsJobsJobs/Api/Data.fs b/src/JobsJobsJobs/Api/Data.fs index 30a499c..201967a 100644 --- a/src/JobsJobsJobs/Api/Data.fs +++ b/src/JobsJobsJobs/Api/Data.fs @@ -489,7 +489,7 @@ module Listing = let! _ = r.Table(Table.Listing) .Get(listingId) - .Update(r.HashMap("isExpired", true).With("fromHere", fromHere).With("updatedOn", now)) + .Update(r.HashMap("isExpired", true).With("wasFilledHere", fromHere).With("updatedOn", now)) .RunWriteAsync conn () }) @@ -569,4 +569,5 @@ module Success = it.G("naUser"))) .With("hasStory", it.G("story").Default_("").Gt("")))) .Pluck("id", "citizenId", "citizenName", "recordedOn", "fromHere", "hasStory") + .OrderBy(r.Desc("recordedOn")) .RunResultAsync conn) diff --git a/src/JobsJobsJobs/App/.eslintrc.js b/src/JobsJobsJobs/App/.eslintrc.js index e5f5576..8ca901c 100644 --- a/src/JobsJobsJobs/App/.eslintrc.js +++ b/src/JobsJobsJobs/App/.eslintrc.js @@ -22,7 +22,7 @@ module.exports = { "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "vue/no-multiple-template-root": "off", "vue/script-setup-uses-vars": 1, - "quotes": ["error", "double", { avoidEscape: true }], + "quotes": ["error", "double", { avoidEscape: true, allowTemplateLiterals: true }], "func-call-spacing": "off", "@typescript-eslint/no-unused-vars": "off" } diff --git a/src/JobsJobsJobs/App/src/App.vue b/src/JobsJobsJobs/App/src/App.vue index 272dac7..dd516fe 100644 --- a/src/JobsJobsJobs/App/src/App.vue +++ b/src/JobsJobsJobs/App/src/App.vue @@ -3,8 +3,8 @@ app-nav .jjj-main title-bar - main.container-fluid: router-view(v-slot="{ Component }"): transition(name='fade' mode='out-in') - component(:is='Component') + main.container-fluid: router-view(v-slot="{ Component }"): transition(name="fade" mode="out-in") + component(:is="Component") app-footer app-toaster @@ -63,6 +63,10 @@ a:not(.btn):hover label.jjj-required::after color: red content: ' *' +.jjj-heading-label + display: inline-block + font-size: 1rem + text-transform: uppercase // Styles for this component .jjj-app display: flex diff --git a/src/JobsJobsJobs/App/src/components/index.ts b/src/JobsJobsJobs/App/src/components/index.ts index 96919a9..38d422b 100644 --- a/src/JobsJobsJobs/App/src/components/index.ts +++ b/src/JobsJobsJobs/App/src/components/index.ts @@ -1,5 +1,5 @@ -import { parseJSON } from 'date-fns' -import { utcToZonedTime } from 'date-fns-tz' +import { parseJSON } from "date-fns" +import { utcToZonedTime } from "date-fns-tz" /** * Parse a date from its JSON representation to a UTC-aligned date diff --git a/src/JobsJobsJobs/App/src/components/layout/TitleBar.vue b/src/JobsJobsJobs/App/src/components/layout/TitleBar.vue index 7785dad..f5ad388 100644 --- a/src/JobsJobsJobs/App/src/components/layout/TitleBar.vue +++ b/src/JobsJobsJobs/App/src/components/layout/TitleBar.vue @@ -2,7 +2,7 @@ nav.navbar.navbar-light.bg-light span   span.navbar-text. - (…and Jobs – #[audio-clip(clip="pelosi-jobs") Let's Vote for Jobs!]) + (…and Jobs – #[audio-clip(clip="pelosi-jobs") Let’s Vote for Jobs!]) diff --git a/src/JobsJobsJobs/App/src/views/profile/ProfileView.vue b/src/JobsJobsJobs/App/src/views/profile/ProfileView.vue index 570c683..a4ab108 100644 --- a/src/JobsJobsJobs/App/src/views/profile/ProfileView.vue +++ b/src/JobsJobsJobs/App/src/views/profile/ProfileView.vue @@ -2,7 +2,10 @@ article page-title(:title="title") load-data(:load="retrieveProfile") - h2: a(:href="it.citizen.profileUrl" target="_blank") {{citizenName(it.citizen)}} + h2 + a(:href="it.citizen.profileUrl" target="_blank") {{citizenName(it.citizen)}} + .jjj-heading-label(v-if="it.profile.seekingEmployment") + |    #[span.badge.bg-dark Currently Seeking Employment] h4.pb-3 {{it.continent.name}}, {{it.profile.region}} p(v-html="workTypes") hr @@ -47,11 +50,6 @@ const workTypes = computed(() => { const parts : string[] = [] if (it.value) { const p = it.value.profile - if (p.seekingEmployment) { - parts.push("CURRENTLY SEEKING EMPLOYMENT") - } else { - parts.push("Not actively seeking employment") - } parts.push(`${p.fullTime ? "I" : "Not i"}nterested in full-time employment`) parts.push(`${p.remoteWork ? "I" : "Not i"}nterested in remote opportunities`) } diff --git a/src/JobsJobsJobs/App/src/views/profile/Seeking.vue b/src/JobsJobsJobs/App/src/views/profile/Seeking.vue index 0f2f4e4..edf068b 100644 --- a/src/JobsJobsJobs/App/src/views/profile/Seeking.vue +++ b/src/JobsJobsJobs/App/src/views/profile/Seeking.vue @@ -52,10 +52,10 @@ const errors : Ref = ref([]) /** An empty set of search criteria */ const emptyCriteria = { - continentId: '', + continentId: "", region: undefined, skill: undefined, - remoteWork: '' + remoteWork: "" } /** The search criteria being built from the page */ @@ -109,5 +109,5 @@ watch(() => route.query, setUpPage, { immediate: true }) const toggleCollapse = (it : boolean) => { isCollapsed.value = it } /** Execute a search */ -const doSearch = () => router.push({ query: { searched: 'true', ...criteria.value } }) +const doSearch = () => router.push({ query: { searched: "true", ...criteria.value } }) diff --git a/src/JobsJobsJobs/App/src/views/success-story/StoryView.vue b/src/JobsJobsJobs/App/src/views/success-story/StoryView.vue index 667f72e..d215f84 100644 --- a/src/JobsJobsJobs/App/src/views/success-story/StoryView.vue +++ b/src/JobsJobsJobs/App/src/views/success-story/StoryView.vue @@ -2,10 +2,11 @@ article page-title(title="Success Story") load-data(:load="retrieveStory") - h3.pb-3 {{citizenName}}’s Success Story - h4.text-muted: full-date-time(:date="story.recordedOn") - p.fst-italic(v-if="story.fromHere"): strong Found via Jobs, Jobs, Jobs - hr + h3 + | {{citizenName}}’s Success Story + .jjj-heading-label(v-if="story.fromHere") + |    #[span.badge.bg-success Via {{profileOrListing}} on Jobs, Jobs, Jobs] + h4.pb-3.text-muted: full-date-time(:date="story.recordedOn") div(v-if="story.story" v-html="successStory") @@ -15,7 +16,7 @@ import { useRoute } from "vue-router" import api, { LogOnSuccess, Success } from "@/api" import { citizenName as citName } from "@/App.vue" -import { toHtml } from '@/markdown' +import { toHtml } from "@/markdown" import { useStore } from "@/store" import FullDateTime from "@/components/FullDateTime.vue" @@ -55,6 +56,9 @@ const retrieveStory = async (errors : string []) => { } } +/** Whether this success is from an employment profile or a job listing */ +const profileOrListing = computed(() => story.value?.source === "profile" ? "employment profile" : "job listing") + /** The HTML success story */ const successStory = computed(() => toHtml(story.value?.story ?? ""))