Skip to content

Commit

Permalink
chore: more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisvisser committed Nov 6, 2024
1 parent 291d054 commit f872638
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ test.beforeEach(async ({ page }) => {
);
});

test('[28043] Update custom attributes successfully', async ({ page }) => {
test('[28043] Update registration attributes successfully', async ({
page,
}) => {
const table = new TableModule(page);
const homePage = new HomePage(page);
const registration = new RegistrationDetails(page);
Expand Down
5 changes: 2 additions & 3 deletions features/121-Portal/Edit_Info_Person_Affected.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Feature: Edit information on Person Affected
Then a popup opens
And in the title the ID-number of the Person Affected is mentioned
And an input-field for the "paymentAmountMultiplier" and "phoneNumber" and "preferredLanguage" is shown
And an input-field for each Custom Attribute is shown
And an input-field for each FSP-attribute (such as "whatsappPhoneNumber") is shown
And an input-field for each "program registration attribute" is shown
And a dropdown-list with the current chosen FSP is shown
And all input-fields have an accompanying "save" button which is disabled
And there is an explanation, including PII-warning
Expand Down Expand Up @@ -68,7 +67,7 @@ Feature: Edit information on Person Affected
And the "preferredLanguage" is updated
And the data change is logged in the Profile page Activity overview > See 'View_PA_profile_page.feature' for details

Scenario: Update custom attributes successfully
Scenario: Update program registration attribute successfully
Given a logged-in user with "RegistrationPersonalREAD" permission
Given the user has opened the popup to edit information
Given an input-field for the is shown
Expand Down
3 changes: 1 addition & 2 deletions features/121-Portal/Export_Payment_Details.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ Feature: Export payment data
And - if program and user have scope - then it shows only the PAs within the scope of the user
And it shows the "name" and other program-attributes to be able to identify people
And it shows the dates at which the person reached each status, to be able to assess the trajectory towards inclusion
And it shows all program questions which have "included" as "export" attribute
And it shows all program custom attributes which have "included" as "export" attribute
And it shows all program registration attributes which have "included" as "export" attribute
And the "export inclusion list" button remains enabled, so the action can be repeated infinitely
And if no "included" registrations then an alert is shown that "no data can be downloaded"

Expand Down
3 changes: 1 addition & 2 deletions features/121-Portal/Export_people_affected.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Feature: Export People Affected list
And it shows the "name" and other dynamic program-attributes, that are also in the PA-table
And it shows "id" and other generic attributes, that are also in the PA-table
And it does not show any attributes that are not directly visible in the PA-table, such as "note"
And it shows all program questions which have "all-people-affected" as "export" attribute
And it shows all program custom attributes which have "all-people-affected" as "export" attribute
And it shows all program registration attributes which have "all-people-affected" as "export" attribute
And any columns that only contain null-values are automatically filtered out

Scenario: Export inclusion list with 15000 PAs
Expand Down
2 changes: 1 addition & 1 deletion features/121-Portal/Import_registrations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: Import registrations with status registered
And it has the dynamic columns for "programRegistrationAttributes" of that program

When the program is not configured with a paymentAmountMultiplierFormula
Then it contains the column "paymentAmountMultiplier" after the "fspQuestions"
Then it contains the column "paymentAmountMultiplier"

When the program has scope enabled
Then it contains the column scope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Feature: Send message to people affected (extension of View_and_Manage_people_af
When user selects the "Send message to PAs" action
Then the popup shows an empty message
And the user can edit the message
And the user can add placeholders for (Program question, Program attributes, Payment multiplier, Fsp diplayname and Max payments)
And the user can add placeholders for (Program registration attributes, Payment multiplier, Fsp diplayname and Max payments)
And the placeholders are replaced by the preview values of the first PA in the popup

Scenario: Confirm "Send message to PAs" action
Expand Down
10 changes: 4 additions & 6 deletions features/121-Portal/View_and_Manage_people_affected.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@ Feature: View and manage people affected (generic features)
And for each person the columns that make up the "name" are shown
And for each person a "phone number" is shown
And all above columns are fixed when scrolling horizontally
And "custom attribute" columns are shown if configured to be showing for that phase
And "program questions" are shown if configured to be showing for that phase
And "fsp questions" are shown if configured to be showing for that phase
And "program registration attribrutes" are shown if configured to be showing for that phase

Scenario: Edit boolean custom attributes in PA table
Scenario: Edit boolean program registration attribute in PA table
Given the logged-in user also has "RegistrationAttributeUPDATE" permission
When the user clicks one of the "custom attribute" columns with type 'boolean'
Then the clicked "custom attribute" is updated
When the user clicks one of the "program registration attribute" columns with type 'boolean'
Then the clicked "program registration attribute" is updated
And a popup with 'update successful' appears

Scenario: Filter rows of PA-table by People Affected status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ export class ProgramPeopleAffectedComponent implements OnDestroy {
personRow = this.fillPaymentHistoryColumn(personRow);
}

// Custom attributes can be personal data or not personal data
// Program registration attributes can be personal data or not personal data
// for now only users that view custom data can see it
if (this.canViewPersonalData) {
personRow = this.fillPaTableAttributeRows(person, personRow);
Expand Down
2 changes: 1 addition & 1 deletion k6/tests/getProgramWithManyAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function () {
return r.timings.duration < 200;
},
});
// add 50 program questions to generate a bigger load
// add 50 program registration attributes to generate a bigger load
for (let i = 1; i <= 50; i++) {
const attributeName = `attribute${i}`;
const programRegistrationAttributes =
Expand Down
2 changes: 1 addition & 1 deletion k6/tests/statusChangePaymentInLargeProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function () {
},
});

// add 50 program questions to generate a bigger load
// add 50 program registration attributes to generate a bigger load
for (let i = 1; i <= 50; i++) {
const attributeName = `attribute${i}`;
const programRegistrationAttributes =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class ExcelService
where: { id: Equal(programId) },
relations: ['programRegistrationAttributes'],
});
// Default to using all program questions & attributes names if columnsToExport is not specified
// Default to using all program registration attributes names if columnsToExport is not specified
// So generic fields must be specified in the programFspConfiguration
return programWithAttributes.programRegistrationAttributes.map(
(q) => q.name,
Expand Down
8 changes: 4 additions & 4 deletions services/121-service/src/programs/programs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class ProgramService {

for (const name of Object.values(programData.fullnameNamingConvention)) {
if (!programAttributeNames.includes(name)) {
const errors = `Element '${name}' of fullnameNamingConvention is not found in program questions or custom attributes`;
const errors = `Element '${name}' of fullnameNamingConvention is not found in program registration attributes`;
throw new HttpException({ errors }, HttpStatus.BAD_REQUEST);
}
}
Expand Down Expand Up @@ -336,13 +336,13 @@ export class ProgramService {
return attr.name;
});
if (existingNames.includes(name)) {
const errors = `Unable to create program question/attribute with name ${name}. The names ${existingNames.join(
const errors = `Unable to create program registration attribute with name ${name}. The names ${existingNames.join(
', ',
)} are already in use`;
throw new HttpException({ errors }, HttpStatus.BAD_REQUEST);
}
if (nameConstraintQuestionsArray.includes(name)) {
const errors = `Unable to create program question/attribute with name ${name}. The names ${nameConstraintQuestionsArray.join(
const errors = `Unable to create program registration attribute with name ${name}. The names ${nameConstraintQuestionsArray.join(
', ',
)} are forbidden to use`;
throw new HttpException({ errors }, HttpStatus.BAD_REQUEST);
Expand Down Expand Up @@ -446,7 +446,7 @@ export class ProgramService {
where: { id: Number(programRegistrationAttributeId) },
});
if (!programRegistrationAttribute) {
const errors = `Program question with id: '${programRegistrationAttributeId}' not found.'`;
const errors = `Program registration attribute with id: '${programRegistrationAttributeId}' not found.'`;
throw new HttpException({ errors }, HttpStatus.NOT_FOUND);
}
return await this.programRegistrationAttributeRepository.remove(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class RegistrationsController {
@AuthenticatedUser({ permissions: [PermissionEnum.RegistrationREAD] })
@ApiOperation({
summary:
'[SCOPED] Get paginated registrations. Below you will find all the default paginate options, including filtering on any generic fields. NOTE: additionally you can filter on program-specific fields, like program questions, fsp questions, and custom attributes, even though not specified in the Swagger Docs.',
'[SCOPED] Get paginated registrations. Below you will find all the default paginate options, including filtering on any generic fields. NOTE: additionally you can filter on program registration attributes, even though not specified in the Swagger Docs.',
})
@ApiParam({
name: 'programId',
Expand Down
2 changes: 1 addition & 1 deletion services/121-service/src/scripts/seed-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export class SeedHelper {

const programReturn = await programRepository.save(programFromJSON);

// Remove original program questions and add it to a separate variable
// Remove original program registration attributes and add it to a separate variable
const programRegistrationAttributes =
programFromJSON.programRegistrationAttributes;
programFromJSON.programRegistrationAttibutes = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`Create program should not be able to post a program with 2 of the same

exports[`Create program should not be able to post a program with missing names of full name naming convention 1`] = `
{
"errors": "Element 'middle_name' of fullnameNamingConvention is not found in program questions or custom attributes",
"errors": "Element 'middle_name' of fullnameNamingConvention is not found in program registration attributes",
}
`;

Expand Down

0 comments on commit f872638

Please sign in to comment.