Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method to exclude certain interviews from page; fix category display for affidavit of indigency #97

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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