diff --git a/cypress/constants/machete-constants.ts b/cypress/constants/machete-constants.ts index af69d48a..a2ac7b29 100644 --- a/cypress/constants/machete-constants.ts +++ b/cypress/constants/machete-constants.ts @@ -27,6 +27,11 @@ export const onlineOrderRoutes: IOnlineOrderRoute = { orderConfirm: `${onlineOrdersBase}/order-confirm`, }; +const settingsBase: string = "/configuration/settings"; +export const macheteSettingsRoutes: { list: string } = { + list: `${settingsBase}` +} + export const initConfirmCheckedTerms = [ { name: "completion", diff --git a/cypress/fixtures/settings/DisableOnlineOrders.json b/cypress/fixtures/settings/DisableOnlineOrders.json new file mode 100644 index 00000000..3d7d7e14 --- /dev/null +++ b/cypress/fixtures/settings/DisableOnlineOrders.json @@ -0,0 +1,12 @@ +{ + "key": "DisableOnlineOrders", + "value": "FALSE", + "description": "Enter either TRUE or FALSE. Enter TRUE to turn off access to the online hiring portal", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.263", + "dateupdated": "2022-05-24T13:10:33.07", + "id": 28, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/DisableOnlineOrdersBanner.json b/cypress/fixtures/settings/DisableOnlineOrdersBanner.json new file mode 100644 index 00000000..c66f1a44 --- /dev/null +++ b/cypress/fixtures/settings/DisableOnlineOrdersBanner.json @@ -0,0 +1,12 @@ +{ + "key": "DisableOnlineOrdersBanner", + "value": "Online orders are currently disabled. Please call the center.anythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "The message for employers when the online hring portal is turned off", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.277", + "dateupdated": "2022-05-29T00:52:38.217", + "id": 29, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/DisableOnlineOrdersBannerInfoUrl.json b/cypress/fixtures/settings/DisableOnlineOrdersBannerInfoUrl.json new file mode 100644 index 00000000..c26b1bed --- /dev/null +++ b/cypress/fixtures/settings/DisableOnlineOrdersBannerInfoUrl.json @@ -0,0 +1,12 @@ +{ + "key": "DisableOnlineOrdersBannerInfoUrl", + "value": "DisableOnlineOrdersBannerInfoUrlanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "The URL to your center's website explaining why online hiring is turned off", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.29", + "dateupdated": "2022-05-29T00:52:39.46", + "id": 30, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/DisableWorkersVaccineRequirement.json b/cypress/fixtures/settings/DisableWorkersVaccineRequirement.json new file mode 100644 index 00000000..407a75f2 --- /dev/null +++ b/cypress/fixtures/settings/DisableWorkersVaccineRequirement.json @@ -0,0 +1,12 @@ +{ + "key": "DisableWorkersVaccineRequirement", + "value": "FALSE", + "description": null, + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T15:13:12.66", + "dateupdated": "2022-05-24T15:13:12.66", + "id": 32, + "updatedby": "Init T. Script" +} diff --git a/cypress/fixtures/settings/OnlineOrdersEnglishReqNote.json b/cypress/fixtures/settings/OnlineOrdersEnglishReqNote.json new file mode 100644 index 00000000..28f0c87a --- /dev/null +++ b/cypress/fixtures/settings/OnlineOrdersEnglishReqNote.json @@ -0,0 +1,12 @@ +{ + "key": "OnlineOrdersEnglishReqNote", + "value": "OnlineOrdersEnglishReqNoteanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the site details step. When employers requests an English-speaking worker, this note provides any center-specific details", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.137", + "dateupdated": "2022-05-29T00:53:29.85", + "id": 18, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OnlineOrdersIntroMessage.json b/cypress/fixtures/settings/OnlineOrdersIntroMessage.json new file mode 100644 index 00000000..0106a2f1 --- /dev/null +++ b/cypress/fixtures/settings/OnlineOrdersIntroMessage.json @@ -0,0 +1,12 @@ +{ + "key": "OnlineOrdersIntroMessage", + "value": "OnlineOrdersIntroMessageanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displays in the 1st step of the online hiring. Include your center's basic information and how you program works, contact number, etc. Links to your website will also work.", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.113", + "dateupdated": "2022-05-29T00:53:28.473", + "id": 16, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OnlineOrdersTerms.json b/cypress/fixtures/settings/OnlineOrdersTerms.json new file mode 100644 index 00000000..3fa499d4 --- /dev/null +++ b/cypress/fixtures/settings/OnlineOrdersTerms.json @@ -0,0 +1,12 @@ +{ + "key": "OnlineOrdersTerms", + "value": "[{\"name\":\"term1\",\"text\":\"This is the term one\"},{\"name\":\"term2\",\"text\":\"This is the term two\"}]", + "description": "The terms that an employer has to accept before proceding with creating a work order", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-06-21T15:29:44.333", + "dateupdated": "2022-06-21T15:29:44.333", + "id": 1002, + "updatedby": "Init T. Script" +} diff --git a/cypress/fixtures/settings/OnlineOrdersTransportDetailsLink.json b/cypress/fixtures/settings/OnlineOrdersTransportDetailsLink.json new file mode 100644 index 00000000..00392460 --- /dev/null +++ b/cypress/fixtures/settings/OnlineOrdersTransportDetailsLink.json @@ -0,0 +1,12 @@ +{ + "key": "OnlineOrdersTransportDetailsLink", + "value": "OnlineOrdersTransportDetailsLinkanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will display if your transport provider cost rules have any fees. Include the link to your website with transport cost info ", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.15", + "dateupdated": "2022-05-29T00:53:31.323", + "id": 19, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderConfirmTransportFeesNotice.json b/cypress/fixtures/settings/OrderConfirmTransportFeesNotice.json new file mode 100644 index 00000000..5678350e --- /dev/null +++ b/cypress/fixtures/settings/OrderConfirmTransportFeesNotice.json @@ -0,0 +1,12 @@ +{ + "key": "OrderConfirmTransportFeesNotice", + "value": "OrderConfirmTransportFeesNoticeanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will display in the last step if employer chooses a transport method with fees. Inlcude text on why the fee applies", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.16", + "dateupdated": "2022-05-29T00:53:32.737", + "id": 20, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderReviewLaborCostMethodHelper.json b/cypress/fixtures/settings/OrderReviewLaborCostMethodHelper.json new file mode 100644 index 00000000..969937fe --- /dev/null +++ b/cypress/fixtures/settings/OrderReviewLaborCostMethodHelper.json @@ -0,0 +1,12 @@ +{ + "key": "OrderReviewLaborCostMethodHelper", + "value": "OrderReviewLaborCostMethodHelperanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The helper text for labor cost explaining payment options", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.213", + "dateupdated": "2022-05-29T00:52:33.313", + "id": 24, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderReviewLaborCostPayMethodHelper.json b/cypress/fixtures/settings/OrderReviewLaborCostPayMethodHelper.json new file mode 100644 index 00000000..9c01209e --- /dev/null +++ b/cypress/fixtures/settings/OrderReviewLaborCostPayMethodHelper.json @@ -0,0 +1,12 @@ +{ + "key": "OrderReviewLaborCostPayMethodHelper", + "value": "OrderReviewLaborCostAboutUrlanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The url to your website explaining the labor cost", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.24", + "dateupdated": "2022-05-29T00:52:35.697", + "id": 26, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderReviewNextStepsHelper.json b/cypress/fixtures/settings/OrderReviewNextStepsHelper.json new file mode 100644 index 00000000..a2fb16d8 --- /dev/null +++ b/cypress/fixtures/settings/OrderReviewNextStepsHelper.json @@ -0,0 +1,12 @@ +{ + "key": "OrderReviewNextStepsHelper", + "value": "OrderReviewNextStepsHelperanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. Describe the next steps in the process, will employer need to wait for confirmation via a call, text or wait for email, etc.", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.25", + "dateupdated": "2022-05-29T00:52:36.943", + "id": 27, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderReviewSkillsSummaryLabel.json b/cypress/fixtures/settings/OrderReviewSkillsSummaryLabel.json new file mode 100644 index 00000000..900203c4 --- /dev/null +++ b/cypress/fixtures/settings/OrderReviewSkillsSummaryLabel.json @@ -0,0 +1,12 @@ +{ + "key": "OrderReviewSkillsSummaryLabel", + "value": "OrderReviewSkillsSummaryLabelanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The label for the work assignments summary table", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.183", + "dateupdated": "2022-05-29T00:52:30.817", + "id": 22, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderReviewTransportFeeEmplanationUrl.json b/cypress/fixtures/settings/OrderReviewTransportFeeEmplanationUrl.json new file mode 100644 index 00000000..b9d5c325 --- /dev/null +++ b/cypress/fixtures/settings/OrderReviewTransportFeeEmplanationUrl.json @@ -0,0 +1,12 @@ +{ + "key": "OrderReviewTransportFeeEmplanationUrl", + "value": "OrderReviewTransportFeeAboutUrlanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The url to your website explaining the transport fees", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.227", + "dateupdated": "2022-05-29T00:52:34.5", + "id": 25, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderReviewTransportFeeMethodHelper.json b/cypress/fixtures/settings/OrderReviewTransportFeeMethodHelper.json new file mode 100644 index 00000000..9082fc9f --- /dev/null +++ b/cypress/fixtures/settings/OrderReviewTransportFeeMethodHelper.json @@ -0,0 +1,12 @@ +{ + "key": "OrderReviewTransportFeeMethodHelper", + "value": "OrderReviewTransportFeeMethodHelperanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The helper text for transport fees explaining payment options", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.2", + "dateupdated": "2022-05-29T00:52:32.02", + "id": 23, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrderReviewWorkerCountLabel.json b/cypress/fixtures/settings/OrderReviewWorkerCountLabel.json new file mode 100644 index 00000000..4e1ba671 --- /dev/null +++ b/cypress/fixtures/settings/OrderReviewWorkerCountLabel.json @@ -0,0 +1,12 @@ +{ + "key": "OrderReviewWorkerCountLabel", + "value": "OrderReviewWorkerCountLabelanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The label for the count of work assignments", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.173", + "dateupdated": "2022-05-29T00:52:29.627", + "id": 21, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrganizationAddress.json b/cypress/fixtures/settings/OrganizationAddress.json new file mode 100644 index 00000000..b944d3f5 --- /dev/null +++ b/cypress/fixtures/settings/OrganizationAddress.json @@ -0,0 +1,12 @@ +{ + "key": "OrganizationAddress", + "value": "123 main st, seattle, wa 98101anythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will be displayed in work order summaries, etc", + "category": "General", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.047", + "dateupdated": "2022-05-29T00:53:25.613", + "id": 10, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/OrganizationName.json b/cypress/fixtures/settings/OrganizationName.json new file mode 100644 index 00000000..0df79fdd --- /dev/null +++ b/cypress/fixtures/settings/OrganizationName.json @@ -0,0 +1,14 @@ +[ + { + "key": "OrganizationName", + "value": "from stub", + "description": "Will be displayed in the employer's portal and throughout the app", + "category": "General", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:32.937", + "dateupdated": "2022-05-29T00:53:24.283", + "id": 1, + "updatedby": "jciispam@gmail.com" + } +] diff --git a/cypress/fixtures/settings/WorkCenterDescription_EN.json b/cypress/fixtures/settings/WorkCenterDescription_EN.json new file mode 100644 index 00000000..ff123775 --- /dev/null +++ b/cypress/fixtures/settings/WorkCenterDescription_EN.json @@ -0,0 +1,12 @@ +{ + "key": "WorkCenterDescription_EN", + "value": "
Casa Latina is nonprofit organization that empowers Latino immigrants through educational and economic opportunities. Our employment program connects immigrants with individuals and businesses looking for temporary labor. Our workers are skilled and dependable. From landscaping to dry walling to catering and housecleaning, if you can dream the project our workers can do it! Learn more about Casa Latina.
anythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will be visible in the welcome page for all users", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.103", + "dateupdated": "2022-05-29T00:53:27.143", + "id": 15, + "updatedby": "jciispam@gmail.com" +} diff --git a/cypress/fixtures/settings/settings.json b/cypress/fixtures/settings/settings.json new file mode 100644 index 00000000..622fab8b --- /dev/null +++ b/cypress/fixtures/settings/settings.json @@ -0,0 +1,232 @@ +{ + "data": [ + { + "key": "OrganizationName", + "value": "from stub", + "description": "Will be displayed in the employer's portal and throughout the app", + "category": "General", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:32.937", + "dateupdated": "2022-05-29T00:53:24.283", + "id": 1, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrganizationAddress", + "value": "123 main st, seattle, wa 98101anythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will be displayed in work order summaries, etc", + "category": "General", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.047", + "dateupdated": "2022-05-29T00:53:25.613", + "id": 10, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "WorkCenterDescription_EN", + "value": "Casa Latina is nonprofit organization that empowers Latino immigrants through educational and economic opportunities. Our employment program connects immigrants with individuals and businesses looking for temporary labor. Our workers are skilled and dependable. From landscaping to dry walling to catering and housecleaning, if you can dream the project our workers can do it! Learn more about Casa Latina.
anythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will be visible in the welcome page for all users", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.103", + "dateupdated": "2022-05-29T00:53:27.143", + "id": 15, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OnlineOrdersIntroMessage", + "value": "OnlineOrdersIntroMessageanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displays in the 1st step of the online hiring. Include your center's basic information and how you program works, contact number, etc. Links to your website will also work.", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.113", + "dateupdated": "2022-05-29T00:53:28.473", + "id": 16, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OnlineOrdersEnglishReqNote", + "value": "OnlineOrdersEnglishReqNoteanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the site details step. When employers requests an English-speaking worker, this note provides any center-specific details", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.137", + "dateupdated": "2022-05-29T00:53:29.85", + "id": 18, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OnlineOrdersTransportDetailsLink", + "value": "OnlineOrdersTransportDetailsLinkanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will display if your transport provider cost rules have any fees. Include the link to your website with transport cost info ", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.15", + "dateupdated": "2022-05-29T00:53:31.323", + "id": 19, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderConfirmTransportFeesNotice", + "value": "OrderConfirmTransportFeesNoticeanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Will display in the last step if employer chooses a transport method with fees. Inlcude text on why the fee applies", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.16", + "dateupdated": "2022-05-29T00:53:32.737", + "id": 20, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderReviewWorkerCountLabel", + "value": "OrderReviewWorkerCountLabelanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The label for the count of work assignments", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.173", + "dateupdated": "2022-05-29T00:52:29.627", + "id": 21, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderReviewSkillsSummaryLabel", + "value": "OrderReviewSkillsSummaryLabelanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The label for the work assignments summary table", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.183", + "dateupdated": "2022-05-29T00:52:30.817", + "id": 22, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderReviewTransportFeeMethodHelper", + "value": "OrderReviewTransportFeeMethodHelperanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The helper text for transport fees explaining payment options", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.2", + "dateupdated": "2022-05-29T00:52:32.02", + "id": 23, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderReviewLaborCostMethodHelper", + "value": "OrderReviewLaborCostMethodHelperanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The helper text for labor cost explaining payment options", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.213", + "dateupdated": "2022-05-29T00:52:33.313", + "id": 24, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderReviewTransportFeeEmplanationUrl", + "value": "OrderReviewTransportFeeAboutUrlanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The url to your website explaining the transport fees", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.227", + "dateupdated": "2022-05-29T00:52:34.5", + "id": 25, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderReviewLaborCostPayMethodHelper", + "value": "OrderReviewLaborCostAboutUrlanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. The url to your website explaining the labor cost", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.24", + "dateupdated": "2022-05-29T00:52:35.697", + "id": 26, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "OrderReviewNextStepsHelper", + "value": "OrderReviewNextStepsHelperanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "Displayed in the pre-sumbit review step. Describe the next steps in the process, will employer need to wait for confirmation via a call, text or wait for email, etc.", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.25", + "dateupdated": "2022-05-29T00:52:36.943", + "id": 27, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "DisableOnlineOrders", + "value": "FALSE", + "description": "Enter either TRUE or FALSE. Enter TRUE to turn off access to the online hiring portal", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.263", + "dateupdated": "2022-05-24T13:10:33.07", + "id": 28, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "DisableOnlineOrdersBanner", + "value": "Online orders are currently disabled. Please call the center.anythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "The message for employers when the online hring portal is turned off", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.277", + "dateupdated": "2022-05-29T00:52:38.217", + "id": 29, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "DisableOnlineOrdersBannerInfoUrl", + "value": "DisableOnlineOrdersBannerInfoUrlanythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganythinganything", + "description": "The URL to your center's website explaining why online hiring is turned off", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T13:08:33.29", + "dateupdated": "2022-05-29T00:52:39.46", + "id": 30, + "updatedby": "jciispam@gmail.com" + }, + { + "key": "DisableWorkersVaccineRequirement", + "value": "FALSE", + "description": null, + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-05-24T15:13:12.66", + "dateupdated": "2022-05-24T15:13:12.66", + "id": 32, + "updatedby": "Init T. Script" + }, + { + "key": "OnlineOrdersTerms", + "value": "[{\"name\":\"term1\",\"text\":\"This is the term one\"},{\"name\":\"term2\",\"text\":\"This is the term two\"}]", + "description": "The terms that an employer has to accept before proceding with creating a work order", + "category": "OnlineOrders", + "publicConfig": true, + "createdby": "Init T. Script", + "datecreated": "2022-06-21T15:29:44.333", + "dateupdated": "2022-06-21T15:29:44.333", + "id": 1002, + "updatedby": "Init T. Script" + } + ] +} diff --git a/cypress/integration/settings/edit-settings.spec.ts b/cypress/integration/settings/edit-settings.spec.ts new file mode 100644 index 00000000..20d93700 --- /dev/null +++ b/cypress/integration/settings/edit-settings.spec.ts @@ -0,0 +1,134 @@ +import { macheteSettingsRoutes, MACHETE_ADMIN } from "cypress/constants"; +import { MS_NON_EDITABLE_CONFIGS_LOWER_CASE } from "src/app/configs/machete-settings/shared/machete-settings-constants"; +import { Config } from "src/app/shared/models/config"; + +describe("machete settings edit", () => { + const STUBBED_CONFGIS_KEY = "stubbed.configs"; + let userEditableConfigs: Config[]; + + let privateConfigs: Config[]; + + beforeEach(() => { + cy.apiLogin(MACHETE_ADMIN.user, MACHETE_ADMIN.password); + + // Stubbing the response from server here + cy.fixture("settings/settings.json"); + cy.intercept( + { + method: "GET", + url: "/api/configs", + }, + { fixture: "settings/settings" } + ).as("configs"); + cy.visit(macheteSettingsRoutes.list); + + cy.wait("@configs").then((i) => { + Cypress.env(STUBBED_CONFGIS_KEY, i.response.body.data); + const configs = Cypress.env(STUBBED_CONFGIS_KEY) as Config[]; + + userEditableConfigs = configs.filter( + (c: Config) => + c.publicConfig && + !MS_NON_EDITABLE_CONFIGS_LOWER_CASE.includes(c.key.toLowerCase()) + ); + + privateConfigs = configs.filter( + (c: Config) => + !c.publicConfig && + MS_NON_EDITABLE_CONFIGS_LOWER_CASE.includes(c.key.toLowerCase()) + ); + }); + }); + + it("text field when valid saves", () => { + const nonTextFields = [ + "OnlineOrdersTerms", + "DisableOnlineOrders", + "DisableWorkersVaccineRequirement", + ]; + userEditableConfigs.forEach((c: Config) => { + if (!nonTextFields.includes(c.key)) { + // mock response + cy.intercept( + { + method: "PUT", + url: "/api/configs/*", + }, + (req) => { + req.body = {}; // don't acctually change anything + req.reply({ + statusCode: 200, + body: { fixture: `settings/${c.key}.json` }, + }); + } + ).as("edit"); + cy.visit(`${macheteSettingsRoutes.list}/${c.key}`); + cy.get("#value").type(" anything"); + cy.get(`button[label="Save"]`).click(); + cy.get(`.p-confirm-popup-accept`).click(); + cy.wait("@edit").then((i) => { + expect(i.request.body.value).to.contain("anything"); + }); + } + }); + }); + + it("text field when Invalid shows error", () => { + const nonTextFields = [ + "OnlineOrdersTerms", + "DisableOnlineOrders", + "DisableWorkersVaccineRequirement", + ]; + userEditableConfigs.forEach((c: Config) => { + if (!nonTextFields.includes(c.key)) { + cy.visit(`${macheteSettingsRoutes.list}/${c.key}`); + cy.get("#value").clear(); + cy.get(`button[label="Save"]`).should("have.attr", "disabled"); + cy.get("small").contains("Value is required"); + } + }); + }); + + it("TERMS field adds & removes children", () => { + const termField = ["OnlineOrdersTerms"]; + // Expect 3 divs. 2 divs for the stubbed 2 terms and one for the buttons + const elementPerChild = 3; + + cy.visit(`${macheteSettingsRoutes.list}/${termField}`); + cy.get("app-machete-settings-term-form") + .find("div") + .first() + .children() + .should("have.length", elementPerChild); + cy.get(".p-button-info > .p-button-icon").click(); + + cy.get("app-machete-settings-term-form") + .find("div") + .first() + .children() + .should("have.length", elementPerChild + 1); + + cy.get(".p-button-danger > .p-button-icon").click(); + cy.get("app-machete-settings-term-form") + .find("div") + .first() + .children() + .should("have.length", elementPerChild); + }); + + it("TERMS field when valid saves", () => { + const termField = ["OnlineOrdersTerms"]; + const elementPerChild = 3; + }); + + it("errors when saving", () => { + privateConfigs.forEach((c: Config) => { + cy.visit(`${macheteSettingsRoutes.list}/${c.key}`); + cy.get("#value").should("exist").type("test"); + cy.get(`button[label="Save"]`).click(); + cy.get("span.p-button-label"); + cy.get(`button[ng-reflect-label="Yes"]`).click(); + cy.contains("Action not allowed"); + }); + }); +}); diff --git a/cypress/integration/settings/list-settings.spec.ts b/cypress/integration/settings/list-settings.spec.ts new file mode 100644 index 00000000..06229b7d --- /dev/null +++ b/cypress/integration/settings/list-settings.spec.ts @@ -0,0 +1,76 @@ +import { + ENV_KEY_MACHETE_CONFIGS, + macheteSettingsRoutes, + MACHETE_ADMIN, +} from "cypress/constants"; +import { Config } from "src/app/shared/models/config"; +import { MS_NON_EDITABLE_CONFIGS_LOWER_CASE } from "src/app/configs/machete-settings/shared/machete-settings-constants"; + +describe("machete settings list", () => { + let userEditableConfigs: Config[]; + + let privateConfigs: Config[]; + + let configs: Config[]; + + beforeEach(() => { + cy.apiLogin(MACHETE_ADMIN.user, MACHETE_ADMIN.password); + + // wait for data to load + cy.intercept({ + method: "GET", + url: "/api/configs", + }).as("configs"); + + cy.getMacheteConfigs(); + cy.visit(macheteSettingsRoutes.list); + + cy.wait("@configs").then(() => { + configs = Cypress.env(ENV_KEY_MACHETE_CONFIGS) as Config[]; + userEditableConfigs = configs.filter( + (c: Config) => + c.publicConfig && + !MS_NON_EDITABLE_CONFIGS_LOWER_CASE.includes(c.key.toLowerCase()) + ); + + privateConfigs = configs.filter( + (c: Config) => + !c.publicConfig && + MS_NON_EDITABLE_CONFIGS_LOWER_CASE.includes(c.key.toLowerCase()) + ); + }); + + }); + + it("when list loads, should display table", () => { + cy.visit(macheteSettingsRoutes.list); + cy.get("table") + .should("be.visible") + .should("have.class", "p-datatable-table"); + }); + it("when list loads, results should contain user-editable configs", () => { + cy.visit(macheteSettingsRoutes.list); + + userEditableConfigs.forEach((c: Config) => { + cy.get("input").type(c.key); + cy.get("table").should("contain.text", c.key); + cy.get("input").clear(); + }); + + privateConfigs.forEach((c: Config) => { + cy.get("input").type(c.key); + cy.get("table").should("not.contain.text", c.key); + cy.get("input").clear(); + }); + }); +}); + +describe("when record selected", () => { + it("should navigate to detail page", () => { + cy.contains("OrganizationName").click(); + cy.url().should( + "include", + `${macheteSettingsRoutes.list}/OrganizationName` + ); + }); +}); diff --git a/src/app/configs/configs-routing.module.ts b/src/app/configs/configs-routing.module.ts index 2fcdf80e..7e59c4b3 100644 --- a/src/app/configs/configs-routing.module.ts +++ b/src/app/configs/configs-routing.module.ts @@ -19,6 +19,13 @@ const routes: Routes = [ }, ], }, + { + path: "settings", + loadChildren: () => + import("./machete-settings/machete-settings.module").then( + (m) => m.MacheteSettingsModule + ), + }, ]; @NgModule({ diff --git a/src/app/configs/configs.service.ts b/src/app/configs/configs.service.ts index 57d490df..df4ab43e 100644 --- a/src/app/configs/configs.service.ts +++ b/src/app/configs/configs.service.ts @@ -1,17 +1,19 @@ -import { Observable, of } from "rxjs"; +import { Observable, of, throwError } from "rxjs"; -import { first, mergeMap, map } from "rxjs/operators"; +import { first, mergeMap, map, pluck, catchError, tap } from "rxjs/operators"; import { Injectable } from "@angular/core"; import { environment } from "../../environments/environment"; import { HttpClient } from "@angular/common/http"; import { Config, CCategory } from "../shared/models/config"; +import { MessagesService } from "../shared/components/messages/messages.service"; +import { MS_NON_EDITABLE_CONFIGS_LOWER_CASE } from "./machete-settings/shared/machete-settings-constants"; @Injectable() export class ConfigsService { uriBase = environment.dataUrl + "/api/configs"; configs = new Array