From 83135d24583290c35b47fc4212f672e259a1ccd8 Mon Sep 17 00:00:00 2001 From: Charles Barnes Date: Wed, 30 Oct 2019 09:17:41 -0500 Subject: [PATCH] set defaults --- src/app/services/settings/settings.service.ts | 34 +++++++++++++++++++ src/app/typings/settings.d.ts | 2 +- src/version.txt | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/app/services/settings/settings.service.ts b/src/app/services/settings/settings.service.ts index 8d13620b..144f114a 100644 --- a/src/app/services/settings/settings.service.ts +++ b/src/app/services/settings/settings.service.ts @@ -34,6 +34,40 @@ export class SettingsService { SettingsService.settings[option] = {}; } }); + if (!SettingsService.settings.service.fields || SettingsService.settings.service.fields.length === 0) { + SettingsService.settings.service.fields = [ + 'id', + 'title', + 'publishedCategory(id,name)', + 'address(city,state,countryName)', + 'employmentType', + 'dateLastPublished', + 'publicDescription', + 'isOpen', + 'isPublic', + 'isDeleted', + 'publishedZip', + 'salary', + 'salaryUnit', + ]; + } + + if (!SettingsService.settings.service.jobInfoChips) { + SettingsService.settings.service.jobInfoChips = [ + 'employmentType', + { + type: 'mediumDate', + field: 'dateLastPublished', + }, + ]; + } + + if (!SettingsService.settings.service.keywordSearchFields || SettingsService.settings.service.keywordSearchFields.length === 0) { + SettingsService.settings.service.keywordSearchFields = [ + 'publicDescription', + 'title', + ]; + } const validTokenRegex: RegExp = /[^A-Za-z0-9]/; if (!SettingsService.settings.service.corpToken || validTokenRegex.test(SettingsService.settings.service.corpToken)) { throw new Error('Invalid Corp Token'); diff --git a/src/app/typings/settings.d.ts b/src/app/typings/settings.d.ts index b63bccc9..501e061f 100644 --- a/src/app/typings/settings.d.ts +++ b/src/app/typings/settings.d.ts @@ -23,7 +23,7 @@ interface IServiceSettings { port: number|null; swimlane: number; fields: string[]; - jobInfoChips: [string | JobChipField]; + jobInfoChips: [string | JobChipField] | any; showCategory: boolean; keywordSearchFields: string[]; } diff --git a/src/version.txt b/src/version.txt index e69de29b..d2c736c3 100644 --- a/src/version.txt +++ b/src/version.txt @@ -0,0 +1 @@ +CUSTOM BUILD