Skip to content

Commit

Permalink
Fix #56 - method to exclude certain interviews from page; fix categor…
Browse files Browse the repository at this point in the history
…y display issue for affidavit of indigency (#97)
  • Loading branch information
nonprofittechy authored Sep 25, 2024
1 parent 1416a6b commit 5013c83
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/config/formSources.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,17 @@ export const formSources = {
},
],
};

export const excludedForms = {
greaterBostonLegalService: [
'docassemble.Collection:data/questions/validationOrDoNotCallLetterForAdvocates.yml',
'docassemble.MAAffidavitofIndigency:data/questions/affidavit.yml',
'docassemble.MAAffidavitofIndigency:data/questions/affidavit_advocate.yml',
'docassemble.docsign:data/questions/upload_template.yml',
'docassemble.Collection:data/questions/exemptOrNotQuestions.yml',
'docassemble.docsign:data/questions/fill_generic_template.yml',
'docassemble.startOfCaseDocs:data/questions/caseStartDocs.yml',
'docassemble.HousingCodeChecklist:data/questions/housing_code_interview.yml',
'docassemble.HousingCodeChecklist:data/questions/feedback.yml',
],
};
2 changes: 1 addition & 1 deletion src/config/topics.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const legalTopics: Topic[] = [
priority: 1,
},
{
codes: ['CO-00-00-00-00'],
codes: ['CO-00-00-00-00', 'CO-07-06-01-00'],
name: 'courts',
long_name: 'Court and hearings',
icon: 'gavel',
Expand Down
11 changes: 11 additions & 0 deletions src/data/fetchInterviewData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { formSources, pathToServerConfig } from '../config/formSources.config';
import { legalTopics } from '../config/topics.config';
import { excludedForms } from '../config/formSources.config';
import { findClosestTopic } from './helpers';

export const fetchInterviews = async (path) => {
Expand All @@ -22,6 +23,16 @@ export const fetchInterviews = async (path) => {
if (data && data.interviews) {
const taggedInterviews = data.interviews
.filter((interview) => !interview.metadata.unlisted) // exclude unlisted interviews
// exclude interviews with titles that are in the excludedForms list relative to this server
.filter((interview) => {
// Check if an exclusion list exists for the server, and use it if available
const exclusions = excludedForms[server.key];
if (exclusions) {
return !exclusions.includes(interview.filename);
} else {
return true;
}
})
.map((interview) => ({
...interview,
serverUrl: server.url,
Expand Down

0 comments on commit 5013c83

Please sign in to comment.