From bbd29c607b67dfaa8dad691b7675fe366c2b525c Mon Sep 17 00:00:00 2001 From: Jason Kai Date: Tue, 30 Apr 2024 16:56:57 -0400 Subject: [PATCH 1/2] Fix redirect URLs Redirects were adding an addition "https://" causing links to be broken due to "https://https://..." --- src/lib/components/ToolListviewCard.svelte | 8 +++++--- src/routes/[slug]/+page.svelte | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/components/ToolListviewCard.svelte b/src/lib/components/ToolListviewCard.svelte index 8bcb695..d366190 100644 --- a/src/lib/components/ToolListviewCard.svelte +++ b/src/lib/components/ToolListviewCard.svelte @@ -24,7 +24,7 @@ >
{#if docsUrl} - + {`The 0}
diff --git a/src/routes/[slug]/+page.svelte b/src/routes/[slug]/+page.svelte index ceeacee..627e7ef 100755 --- a/src/routes/[slug]/+page.svelte +++ b/src/routes/[slug]/+page.svelte @@ -43,7 +43,7 @@ {#each data?.urls as url (url)}
  • Date: Tue, 30 Apr 2024 21:29:59 -0400 Subject: [PATCH 2/2] Initialize evaluations in backMigrate The proceedings page is relying on these evaluations to generate the page. The issue previously was that there was some referencing issue causing all of the evaluations for all tools to be appended and pushed to the new tool to be evaluated. That combined with all of the identical generation dates I think caused it to also be sorted by alphabetical order so it was always reading the same evaluation as latest. --- src/lib/components/ToolListviewCard.svelte | 4 +--- src/lib/data/back_migrate_tools.js | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib/components/ToolListviewCard.svelte b/src/lib/components/ToolListviewCard.svelte index d366190..ce3fd62 100644 --- a/src/lib/components/ToolListviewCard.svelte +++ b/src/lib/components/ToolListviewCard.svelte @@ -97,9 +97,7 @@ .card-wrapper:hover, .card-wrapper:focus { transform: scale(1.05); - box-shadow: - rgba(0, 0, 0, 0.2) 0px 25px 30px -5px, - rgba(0, 0, 0, 0.15) 0px 10px 12px -6px; + box-shadow: rgba(0, 0, 0, 0.2) 0px 25px 30px -5px, rgba(0, 0, 0, 0.15) 0px 10px 12px -6px; border-color: rgb(90, 92, 106); } diff --git a/src/lib/data/back_migrate_tools.js b/src/lib/data/back_migrate_tools.js index 7908f33..2506b82 100644 --- a/src/lib/data/back_migrate_tools.js +++ b/src/lib/data/back_migrate_tools.js @@ -5,7 +5,6 @@ import { join } from 'path'; const PATH_DIR_ENTRIES_INPUT = 'src/lib/data/entries'; const PATH_DIR_ENTRIES_OUTPUT = 'src/lib/data/evaluatedTools'; - const OUTPUT_SKELETON = { "name": null, "description": null, @@ -23,8 +22,7 @@ const EVALUATION_SKELETON = { "date": null, "evaluatorEmail": "nmind@nmind.mock", "checklist": {} -} - +}; /** * Read all json files from the input directory @@ -83,6 +81,7 @@ function backMigrate(entry) { entry_backmigrated.description = `This tool was migrated from the old format. Please update it.`; entry_backmigrated.urls = entry.urls.map(x => ({ "text": x.url_type, href: x.url })); entry_backmigrated.slug = makeUrlSafeName(entry.name); + entry_backmigrated.evaluations = entry.evaluations ? entry.evaluations : []; const evaluation = { ...EVALUATION_SKELETON }; // set date as today in the format YYYY-MM-DD @@ -103,4 +102,4 @@ for (const entry of await readDirectoryData(PATH_DIR_ENTRIES_INPUT)) { const outputPath = join(PATH_DIR_ENTRIES_OUTPUT, `${id}.json`); await promises.writeFile(outputPath, JSON.stringify(entry_backmigrated, null, 2)); console.log(`Generated ${outputPath} successfully.`); -} \ No newline at end of file +}