forked from bcgov/common-hosted-form-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bcgov:main' into fix/FORMS-1654-make-print-visible-to-p…
…ublic
- Loading branch information
Showing
11 changed files
with
788 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
app/src/db/migrations/20241227201927_fix_identity_provider_extra.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
const BCEID_EXTRAS = { | ||
formAccessSettings: 'idim', | ||
addTeamMemberSearch: { | ||
text: { | ||
minLength: 4, | ||
message: 'trans.manageSubmissionUsers.searchInputLength', | ||
}, | ||
email: { | ||
exact: true, | ||
message: 'trans.manageSubmissionUsers.exactBCEIDSearch', | ||
}, | ||
}, | ||
}; | ||
|
||
const BCEID_EXTRAS_NEW = { | ||
...BCEID_EXTRAS, | ||
userSearch: { | ||
filters: [ | ||
{ name: 'filterIdpUserId', param: 'idpUserId', required: 0 }, | ||
{ name: 'filterIdpCode', param: 'idpCode', required: 0 }, | ||
{ name: 'filterUsername', param: 'username', required: 2, exact: true, caseSensitive: false }, | ||
{ name: 'filterFullName', param: 'fullName', required: 0 }, | ||
{ name: 'filterFirstName', param: 'firstName', required: 0 }, | ||
{ name: 'filterLastName', param: 'lastName', required: 0 }, | ||
{ name: 'filterEmail', param: 'email', required: 2, exact: true, caseSensitive: false }, | ||
{ name: 'filterSearch', param: 'search', required: 0 }, | ||
], | ||
detail: 'Could not retrieve BCeID users. Invalid options provided.', | ||
}, | ||
}; | ||
|
||
const BCEID_EXTRAS_OLD = { | ||
...BCEID_EXTRAS, | ||
userSearch: { | ||
filters: [ | ||
{ name: 'filterIdpUserId', param: 'idpUserId', required: 0 }, | ||
{ name: 'filterIdpCode', param: 'idpCode', required: 0 }, | ||
{ name: 'filterUsername', param: 'username', required: 2, exact: true }, | ||
{ name: 'filterFullName', param: 'fullName', required: 0 }, | ||
{ name: 'filterFirstName', param: 'firstName', required: 0 }, | ||
{ name: 'filterLastName', param: 'lastName', required: 0 }, | ||
{ name: 'filterEmail', param: 'email', required: 2, exact: true }, | ||
{ name: 'filterSearch', param: 'search', required: 0 }, | ||
], | ||
detail: 'Could not retrieve BCeID users. Invalid options provided.', | ||
}, | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = function (knex) { | ||
return Promise.resolve().then(() => | ||
knex.schema | ||
.then(() => | ||
knex('identity_provider').where({ code: 'bceid-business' }).update({ | ||
extra: BCEID_EXTRAS_NEW, | ||
}) | ||
) | ||
.then(() => | ||
knex('identity_provider').where({ code: 'bceid-basic' }).update({ | ||
extra: BCEID_EXTRAS_NEW, | ||
}) | ||
) | ||
); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return Promise.resolve().then(() => | ||
knex.schema | ||
.then(() => | ||
knex('identity_provider').where({ code: 'bceid-business' }).update({ | ||
extra: BCEID_EXTRAS_OLD, | ||
}) | ||
) | ||
.then(() => | ||
knex('identity_provider').where({ code: 'bceid-basic' }).update({ | ||
extra: BCEID_EXTRAS_OLD, | ||
}) | ||
) | ||
); | ||
}; |
Oops, something went wrong.