Skip to content

Commit

Permalink
set defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesabarnes committed Oct 30, 2019
1 parent 4d2e2ae commit 83135d2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions src/app/services/settings/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/app/typings/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface IServiceSettings {
port: number|null;
swimlane: number;
fields: string[];
jobInfoChips: [string | JobChipField];
jobInfoChips: [string | JobChipField] | any;
showCategory: boolean;
keywordSearchFields: string[];
}
Expand Down
1 change: 1 addition & 0 deletions src/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CUSTOM BUILD

0 comments on commit 83135d2

Please sign in to comment.