-
+
From 3fd194138d81431075e58a5b87b055bcd1e604d7 Mon Sep 17 00:00:00 2001 From: Rebecca Hollis Date: Tue, 19 Jan 2021 11:53:34 -0500 Subject: [PATCH 10/11] added keywords to the web resources that were downloadable files --- .../human-resources/2-Paycor_Direct_Deposit_Worksheet.pdf.json | 3 ++- .../resources/human-resources/Employment-Application.docx.json | 3 ++- .../human-resources/ExpenseReportJDSfaulknerFILLIN.pdf.json | 3 ++- .../JDSfaulknerDraftingQuiz_11-16-20a.docx.json | 3 ++- .../JDSfaulknerEmpHandbook-v8.0_WithAddendums.pdf.json | 3 ++- .../resources/human-resources/Notice-and-Agreement.pdf.json | 3 ++- src/assets/resources/marketing/ComingSoon-Brochure.pdf.json | 3 ++- src/assets/resources/marketing/ComingSoon-SOQ.pdf.json | 3 ++- .../resources/marketing/JDSfaulkner-Letterhead.docx.json | 3 ++- src/assets/resources/marketing/JDSfaulkner_Logo.eps.json | 3 ++- src/assets/resources/marketing/JDSfaulkner_Logo.png.json | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/assets/resources/human-resources/2-Paycor_Direct_Deposit_Worksheet.pdf.json b/src/assets/resources/human-resources/2-Paycor_Direct_Deposit_Worksheet.pdf.json index 85fe56b..5a313b7 100644 --- a/src/assets/resources/human-resources/2-Paycor_Direct_Deposit_Worksheet.pdf.json +++ b/src/assets/resources/human-resources/2-Paycor_Direct_Deposit_Worksheet.pdf.json @@ -1,5 +1,6 @@ { "title": "Direct Deposit", "description": "Would you like have your paychecks deposited into your bank account? Fill out this form and submit it to HR.", - "altText": "PDF icon" + "altText": "PDF icon", + "keywords": "human resources" } \ No newline at end of file diff --git a/src/assets/resources/human-resources/Employment-Application.docx.json b/src/assets/resources/human-resources/Employment-Application.docx.json index 548163c..088baa6 100644 --- a/src/assets/resources/human-resources/Employment-Application.docx.json +++ b/src/assets/resources/human-resources/Employment-Application.docx.json @@ -2,5 +2,6 @@ "title": "Employment Application", "description": "Would you or someone you know like to apply for a position? JDSfaulkner is always accepting applications.", - "altText": "Document icon" + "altText": "Document icon", + "keywords": "human resources, career, job" } \ No newline at end of file diff --git a/src/assets/resources/human-resources/ExpenseReportJDSfaulknerFILLIN.pdf.json b/src/assets/resources/human-resources/ExpenseReportJDSfaulknerFILLIN.pdf.json index 42077c5..d5b1550 100644 --- a/src/assets/resources/human-resources/ExpenseReportJDSfaulknerFILLIN.pdf.json +++ b/src/assets/resources/human-resources/ExpenseReportJDSfaulknerFILLIN.pdf.json @@ -1,5 +1,6 @@ { "title": "Expense Report", "description": "Request reimbursement for preapproved, company-related expenses. Send this form and receipts to Accounts Payable.", - "altText": "PDF icon" + "altText": "PDF icon", + "keywords": "human resources, purchase" } \ No newline at end of file diff --git a/src/assets/resources/human-resources/JDSfaulknerDraftingQuiz_11-16-20a.docx.json b/src/assets/resources/human-resources/JDSfaulknerDraftingQuiz_11-16-20a.docx.json index de3a55b..d1954bc 100644 --- a/src/assets/resources/human-resources/JDSfaulknerDraftingQuiz_11-16-20a.docx.json +++ b/src/assets/resources/human-resources/JDSfaulknerDraftingQuiz_11-16-20a.docx.json @@ -1,5 +1,6 @@ { "title": "Drafting Quiz", "description": "Click here to access a prequalifying quiz that is a requirement for those applying for drafting positions.", - "altText": "Document icon" + "altText": "Document icon", + "keywords": "human resources, plans, design, job, career, interview" } \ No newline at end of file diff --git a/src/assets/resources/human-resources/JDSfaulknerEmpHandbook-v8.0_WithAddendums.pdf.json b/src/assets/resources/human-resources/JDSfaulknerEmpHandbook-v8.0_WithAddendums.pdf.json index 3fec641..14cac23 100644 --- a/src/assets/resources/human-resources/JDSfaulknerEmpHandbook-v8.0_WithAddendums.pdf.json +++ b/src/assets/resources/human-resources/JDSfaulknerEmpHandbook-v8.0_WithAddendums.pdf.json @@ -1,5 +1,6 @@ { "title": "Employee Handbook", "description": "Read the handbook to learn about the company’s policies related to employment, including pay and benefits.", - "altText": "PDF icon" + "altText": "PDF icon", + "keywords": "human resources" } \ No newline at end of file diff --git a/src/assets/resources/human-resources/Notice-and-Agreement.pdf.json b/src/assets/resources/human-resources/Notice-and-Agreement.pdf.json index 6e3cdf6..8d929e9 100644 --- a/src/assets/resources/human-resources/Notice-and-Agreement.pdf.json +++ b/src/assets/resources/human-resources/Notice-and-Agreement.pdf.json @@ -1,5 +1,6 @@ { "title": "SRA", "description": "A salary reduction agreement helps you to establish or change the part of your compensation that goes to an IRA.", - "altText": "PDF icon" + "altText": "PDF icon", + "keywords": "human resources, savings, retirement" } \ No newline at end of file diff --git a/src/assets/resources/marketing/ComingSoon-Brochure.pdf.json b/src/assets/resources/marketing/ComingSoon-Brochure.pdf.json index 83c276f..6a32cbb 100644 --- a/src/assets/resources/marketing/ComingSoon-Brochure.pdf.json +++ b/src/assets/resources/marketing/ComingSoon-Brochure.pdf.json @@ -1,5 +1,6 @@ { "title": "JDSfaulkner Brochure", "description": "Share the company's brochure with existing and potential clients to showcase the value JDSfaulkner has to offer.", - "altText": "PDF icon" + "altText": "PDF icon", + "keywords": "marketing, publications" } \ No newline at end of file diff --git a/src/assets/resources/marketing/ComingSoon-SOQ.pdf.json b/src/assets/resources/marketing/ComingSoon-SOQ.pdf.json index 1861075..5ec6021 100644 --- a/src/assets/resources/marketing/ComingSoon-SOQ.pdf.json +++ b/src/assets/resources/marketing/ComingSoon-SOQ.pdf.json @@ -1,5 +1,6 @@ { "title": "JDSfaulkner SOQ", "description": "SOQs present the experience and capabilities that qualify JDSfaulkner to win contracts or new clients.", - "altText": "PDF icon" + "altText": "PDF icon", + "keywords": "marketing, statement, qualifications, publications" } \ No newline at end of file diff --git a/src/assets/resources/marketing/JDSfaulkner-Letterhead.docx.json b/src/assets/resources/marketing/JDSfaulkner-Letterhead.docx.json index 624ebc4..dfa4e40 100644 --- a/src/assets/resources/marketing/JDSfaulkner-Letterhead.docx.json +++ b/src/assets/resources/marketing/JDSfaulkner-Letterhead.docx.json @@ -1,5 +1,6 @@ { "title": "JDSfaulkner Letterhead", "description": "Represent the company in a professional and consistent manner using the official letterhead for correspondence.", - "altText": "Document icon" + "altText": "Document icon", + "keywords": "marketing, template" } \ No newline at end of file diff --git a/src/assets/resources/marketing/JDSfaulkner_Logo.eps.json b/src/assets/resources/marketing/JDSfaulkner_Logo.eps.json index 578560e..882660a 100644 --- a/src/assets/resources/marketing/JDSfaulkner_Logo.eps.json +++ b/src/assets/resources/marketing/JDSfaulkner_Logo.eps.json @@ -1,5 +1,6 @@ { "title": "JDSfaulkner Logo - EPS", "description": "Do you need to present the logo in your work? Here's an EPS format to use in collateral and merchandise.", - "altText": "Image icon" + "altText": "Image icon", + "keywords": "marketing" } \ No newline at end of file diff --git a/src/assets/resources/marketing/JDSfaulkner_Logo.png.json b/src/assets/resources/marketing/JDSfaulkner_Logo.png.json index 1fa535d..cb07253 100644 --- a/src/assets/resources/marketing/JDSfaulkner_Logo.png.json +++ b/src/assets/resources/marketing/JDSfaulkner_Logo.png.json @@ -1,5 +1,6 @@ { "title": "JDSfaulkner Logo - PNG", "description": "Do you need to present the logo in your work? Here's a PNG format to use in collateral and merchandise.", - "altText": "Image icon" + "altText": "Image icon", + "keywords": "marketing" } \ No newline at end of file From 6b237dfbbb2253b296bee52315618c649796fa08 Mon Sep 17 00:00:00 2001 From: dtookey Date: Wed, 20 Jan 2021 13:11:46 -0500 Subject: [PATCH 11/11] search will correctly match files based on keyword --- src/ts_source/fileutils.ts | 29 ++++++++++++----------------- src/ts_source/search.ts | 20 +++++++++++++------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/ts_source/fileutils.ts b/src/ts_source/fileutils.ts index be7fafb..af42c14 100644 --- a/src/ts_source/fileutils.ts +++ b/src/ts_source/fileutils.ts @@ -114,27 +114,24 @@ export class DocumentDirectory { private static walkCards(d: DirectoryNode): Map { let cardsByCategory = new Map(); - for (let i = 0, l = d.children.length; i < l; i++) { - let child = d.children[i]; + for (let child of d.children) { if (child instanceof DirectoryNode) { let dir = child as DirectoryNode; if (dir.containsDirectory()) { let childDirectories = dir.getDirectories(); - for (let j = 0, k = childDirectories.length; j < k; j++) { - let dir = childDirectories[j]; + for (let dir of childDirectories) { let subCards = DocumentDirectory.walkCards(dir); this.mergeMaps(cardsByCategory, subCards); } } let sCards = dir.getDocuments(); let category = dir.getCategory(); - for (let sCard in sCards) { - let scrd = sCards[sCard]; + for (let sCard of sCards) { let cards = cardsByCategory.get(category); if (cards === undefined || cards === null) { cards = []; } - cards.push(scrd.toCard()); + cards.push(sCard.toCard()); cardsByCategory.set(category, cards); } } else { @@ -153,8 +150,7 @@ export class DocumentDirectory { private static mergeMaps(a: Map, b: Map) { let keys = Object.keys(b); - for (let z in keys) { - let key = keys[z]; + for (let key of keys) { let sa = a.get(key) if (sa === undefined || sa === null) { sa = []; @@ -213,12 +209,12 @@ export class FileNode { "imagePath": imageName, "urlText": this.filePath, "altText": "", - "fileCard": true + "fileCard": true, + "open": this.open } let altKeys = Object.keys(altProps); - for (let kidx in altKeys) { - let key = altKeys[kidx]; + for (let key of altKeys) { cardObj[key] = altProps[key] } @@ -251,9 +247,9 @@ export class DirectoryNode extends FileNode { let stats = fs.lstatSync(filePath); if (stats.isDirectory()) { let contents = fs.readdirSync(filePath); - for (let i = 0, l = contents.length; i < l; i++) { - if (path.extname(contents[i]) === ".json") continue; - let childPath = path.join(filePath, contents[i]); + for (let fileName of contents) { + if (path.extname(fileName) === ".json") continue; + let childPath = path.join(filePath, fileName); let childStats = fs.lstatSync(childPath); if (childStats.isDirectory()) { this.children.push(new DirectoryNode(childPath, this)); @@ -282,8 +278,7 @@ export class DirectoryNode extends FileNode { } containsDirectory(): Boolean { - for (let i = 0, l = this.children.length; i < l; i++) { - let child = this.children[i]; + for (let child of this.children) { if (child instanceof DirectoryNode) return true; } return false diff --git a/src/ts_source/search.ts b/src/ts_source/search.ts index e19d676..d651f05 100644 --- a/src/ts_source/search.ts +++ b/src/ts_source/search.ts @@ -14,7 +14,7 @@ function register() { search(term); } - }else{ + } else { let term = searchBar.val().toString(); if (!term || 0 === term.length) { reset() @@ -23,7 +23,7 @@ function register() { }); - searchButton.on("click", ()=>{ + searchButton.on("click", () => { let term = searchBar.val().toString(); if (!term || 0 === term.length) { reset() @@ -33,7 +33,7 @@ function register() { }) } -function reset(){ +function reset() { buildUiFromConfig("resources-landing-page.json"); } @@ -47,7 +47,7 @@ function search(term: string) { expandAllContainers(); } -function copyMissingKeys(webCards: object, fileCards: Map){ +function copyMissingKeys(webCards: object, fileCards: Map) { let elementConfig = Configurator.loadAppConfig("resources-landing-page.json"); let containerKeys = Object.keys(elementConfig); for (let containerKey of containerKeys) { @@ -127,8 +127,14 @@ function addToFileMap(map: Map, categoryKey: string, card) { function cardContainsTerm(term: string, card: object): boolean { let titleContains = card["title"].toLowerCase().includes(term.toLowerCase()); let descriptionContains = card["description"].toLowerCase().includes(term.toLowerCase()); + + let keywordContains = false; + if (card["keywords"]) { + keywordContains = card["keywords"].toLowerCase().includes(term.toLowerCase()); + } + //todo: add keywords - return titleContains || descriptionContains; + return titleContains || descriptionContains || keywordContains; } function highlightCardTerm(term: string, card: object): object { @@ -143,9 +149,9 @@ function escapeRegExp(term: string): string { return term.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string } -function expandAllContainers(){ +function expandAllContainers() { let containers = $('[id$="collapser"]') - for(let container of containers){ + for (let container of containers) { container.click() }