ethyca-fides 2.71.2b0__py2.py3-none-any.whl → 2.72.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ethyca-fides might be problematic. Click here for more details.
- {ethyca_fides-2.71.2b0.dist-info → ethyca_fides-2.72.0.dist-info}/METADATA +1 -1
- {ethyca_fides-2.71.2b0.dist-info → ethyca_fides-2.72.0.dist-info}/RECORD +261 -245
- fides/_version.py +3 -3
- fides/api/alembic/migrations/versions/4bfbeff34611_add_polling_status.py +45 -12
- fides/api/api/v1/endpoints/connection_endpoints.py +38 -45
- fides/api/api/v1/endpoints/saas_config_endpoints.py +60 -48
- fides/api/api/v1/endpoints/system.py +11 -43
- fides/api/api/v1/endpoints/user_endpoints.py +8 -1
- fides/api/app_setup.py +1 -3
- fides/api/common_exceptions.py +4 -0
- fides/api/email_templates/get_email_template.py +3 -0
- fides/api/email_templates/template_names.py +1 -0
- fides/api/email_templates/templates/manual_task_digest.html +316 -0
- fides/api/models/detection_discovery/monitor_task.py +1 -0
- fides/api/models/digest/digest_execution.py +11 -1
- fides/api/models/event_audit.py +9 -0
- fides/api/models/messaging_template.py +7 -0
- fides/api/schemas/connection_configuration/connection_config.py +1 -30
- fides/api/schemas/messaging/messaging.py +15 -0
- fides/api/service/connectors/saas/connector_registry_service.py +1 -138
- fides/api/service/deps.py +8 -0
- fides/api/service/messaging/message_dispatch_service.py +38 -1
- fides/api/service/privacy_request/request_runner_service.py +32 -1
- fides/api/tasks/__init__.py +0 -1
- fides/api/util/connection_util.py +99 -215
- fides/api/util/event_audit_util.py +230 -0
- fides/api/util/masking_util.py +31 -0
- fides/api/util/saas_config_updater.py +66 -0
- fides/service/connection/__init__.py +0 -0
- fides/service/connection/connection_service.py +651 -0
- fides/service/event_audit_service.py +16 -22
- fides/ui-build/static/admin/404.html +1 -1
- fides/ui-build/static/admin/_next/static/BOxlzhSs4KC4KKoRi_z4Y/_buildManifest.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{1437-fb699e9d69c3e325.js → 1437-4604a69888906ec0.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/155-bf4e3ffb18f29226.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{1817-10b392e1dd9c4673.js → 1817-6a6b4aea9d242c5b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{2040-01d5edb1802d3482.js → 2040-8eead9d29546a50f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{2397-40506a386a3a469a.js → 2397-92f628c53688925b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/2921-9b596ba7f5267afc.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/3377-80612c111e047cb6.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{3696-259be222ea12392a.js → 3696-e4abb6a922b954a2.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/3700-1f9f6e5ebfa3ab0a.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/401-c2f1e4ea077f1f26.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/4496-8204168bae78092d.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/5185-bf5655b5d697b714.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{5258-2d28b2c64acf5de3.js → 5258-63325c03319e87dc.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{5279-21929b12c927b022.js → 5279-fcac4a8575f41ecc.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/5643-7800464c8df7a78e.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{5783-55c0387508e50f3e.js → 5783-7deeb7de5d2db4c4.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/6277-0ab2a15c37b83b8d.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{6315-2d4e86a32fc40458.js → 6315-d0b886d849c2e5e3.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{6853-cb15625a713b3ef9.js → 6853-6d64d627df6f8194.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/6954-8b106311a3be35f4.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/7245-53a20677c49b41c8.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{7476-f25fce73eeb1f9c6.js → 7476-08717f00da5f89ab.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{7488-df17b592fbeaa1eb.js → 7488-bad160a2bfd89871.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/7630-775c578fa8109b0f.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{8011-56031d82d5428981.js → 8011-c23d609ed3f0efa5.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/8212-67ac884660ddb63a.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{8373-7f940f5ac9c38b1f.js → 8373-43b6df89a2085d6b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{9046-31b16a7e872c22be.js → 9046-28fe0723e3b6584f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/9070-6d3aaaf5aa5913ba.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{9330-cea1bf40f5d27e53.js → 9330-6eb11127296c54c2.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{9682-2754256aeae141bb.js → 9682-65d253d54f84f6f2.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{9899-15530c468d5656a1.js → 9899-63998972698a49fb.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/9965-4709f43bf62af9a9.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/{_app-9e869a44215709ed.js → _app-4f697016cf2fb1bb.js} +43 -43
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/multiple-e2a5c951347195e3.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems-0058fe05f2d23d1a.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience-b6b2d50d894cefa5.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-a7fe3925771bb6c3.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/reporting-e9ec351281c54822.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{projects-69b429a9d30ebaf1.js → projects-3c935e93208d2bdd.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{data-catalog-a53ef0161235ee47.js → data-catalog-79d06a04698c47c0.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/[systemId]-e50e9c8e11412b2a.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/data-explorer-dd93cffd6744837d.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/{[monitorId]-ace848575e688200.js → [monitorId]-878aa4ab0746df5b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{action-center-53ca31c50c43007f.js → action-center-a2e9c0bfa67c633d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{activity-f87e4a0f664f4cde.js → activity-70ca690b253a118e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/dataset/{new-db54d01fd8f6df50.js → new-5c20080cdb053b1d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{dataset-55d312af5228e098.js → dataset-96355a68e8c28fe8.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{[id]-488beba62e832660.js → [id]-448729ee9d1d78c3.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{new-4aad5495f9bf81ce.js → new-42c720ec5c941573.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{index-8a2ba955d92d52ee.js → index-ca794e85c16cba67.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/integrations/[id]-2f1dc17eba11fb4e.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/{integrations-f69b04d3b4cf43b1.js → integrations-bbec0140433a199b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/digests/[id]-058125922d1eaeec.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/digests/new-7a5f76708c79f714.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/digests-31bed1f86b89d1d8.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/providers/[key]-d08f3a7cd2d011ec.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/providers/new-cb2c7fbc26886052.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/providers-40b9f1f70d27b660.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/templates/[id]-a6ae72abe59ff830.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/templates/add-template-a3e4b5b575b31be1.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications/templates-4918f86f7300ac9b.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/notifications-9644c0f088a01fea.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/ant-components-39b5586d9c8b64aa.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/AntForm-5163f3213377bd35.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/FormikAntFormItem-0b1547cd9b114c6b.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/FormikControlled-da562cba4cffd6bb.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/FormikField-3a587676869d2ef6.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/forms-defc3b917306a6d8.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/{table-migration-b46f432b51421fae.js → table-migration-11a70bcfa672ce8f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/[id]-787621468b5a7619.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/{storage-de681c2d022c9e0d.js → storage-24a8c2ab57625556.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests-da634187d8201ab3.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/reporting/datamap-e410d13a2b35cff4.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent/[configuration_id]/[purpose_id]-aec1bf8a409ec75f.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent-4c20c08ca7ea8cff.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{custom-fields-ea9baf24de35d3b1.js → custom-fields-8e4a76376927afd5.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/domains-2e88cc7a6074a28b.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{locations-33448bf0a1d53870.js → locations-20789aa0c84d544e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{organization-3c315036f1fc9f90.js → organization-f84a13eb9688cb5f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/[id]/test-datasets-5be9ce7a745ce908.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/systems-86f5557384124f79.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-2589729c47976357.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/user-management/profile/{[id]-726fbc0a34ffba1f.js → [id]-6217433a26599521.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{user-management-df9b75ab01c1a2ea.js → user-management-b6c4bf35c003965d.js} +1 -1
- fides/ui-build/static/admin/_next/static/css/de09ed8a0adf1ca2.css +1 -0
- fides/ui-build/static/admin/add-systems/manual.html +1 -1
- fides/ui-build/static/admin/add-systems/multiple.html +1 -1
- fides/ui-build/static/admin/add-systems.html +1 -1
- fides/ui-build/static/admin/consent/configure/add-vendors.html +1 -1
- fides/ui-build/static/admin/consent/configure.html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience/[id].html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience/new.html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience.html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices/[id].html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices/new.html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices.html +1 -1
- fides/ui-build/static/admin/consent/properties.html +1 -1
- fides/ui-build/static/admin/consent/reporting.html +1 -1
- fides/ui-build/static/admin/consent.html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects.html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/resources/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/resources.html +1 -1
- fides/ui-build/static/admin/data-catalog.html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/[systemId].html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/data-explorer.html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center/[monitorId].html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center.html +1 -1
- fides/ui-build/static/admin/data-discovery/activity.html +1 -1
- fides/ui-build/static/admin/data-discovery/detection/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-discovery/detection.html +1 -1
- fides/ui-build/static/admin/data-discovery/discovery/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-discovery/discovery.html +1 -1
- fides/ui-build/static/admin/datamap.html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId]/[collectionName]/[...subfieldNames].html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId]/[collectionName].html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId].html +1 -1
- fides/ui-build/static/admin/dataset/new.html +1 -1
- fides/ui-build/static/admin/dataset.html +1 -1
- fides/ui-build/static/admin/datastore-connection/[id].html +1 -1
- fides/ui-build/static/admin/datastore-connection/new.html +1 -1
- fides/ui-build/static/admin/datastore-connection.html +1 -1
- fides/ui-build/static/admin/index.html +1 -1
- fides/ui-build/static/admin/integrations/[id].html +1 -1
- fides/ui-build/static/admin/integrations.html +1 -1
- fides/ui-build/static/admin/lib/fides-preview.js +1 -1
- fides/ui-build/static/admin/lib/fides-tcf.js +2 -2
- fides/ui-build/static/admin/lib/fides.js +2 -2
- fides/ui-build/static/admin/login/[provider].html +1 -1
- fides/ui-build/static/admin/login.html +1 -1
- fides/ui-build/static/admin/notifications/digests/[id].html +1 -0
- fides/ui-build/static/admin/notifications/digests/new.html +1 -0
- fides/ui-build/static/admin/notifications/digests.html +1 -0
- fides/ui-build/static/admin/notifications/providers/[key].html +1 -0
- fides/ui-build/static/admin/notifications/providers/new.html +1 -0
- fides/ui-build/static/admin/notifications/providers.html +1 -0
- fides/ui-build/static/admin/notifications/templates/[id].html +1 -0
- fides/ui-build/static/admin/notifications/templates/add-template.html +1 -0
- fides/ui-build/static/admin/notifications/templates.html +1 -0
- fides/ui-build/static/admin/notifications.html +1 -0
- fides/ui-build/static/admin/poc/ant-components.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/AntForm.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikAntFormItem.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikControlled.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikField.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikSpreadField.html +1 -1
- fides/ui-build/static/admin/poc/forms.html +1 -1
- fides/ui-build/static/admin/poc/table-migration.html +1 -1
- fides/ui-build/static/admin/privacy-requests/[id].html +1 -1
- fides/ui-build/static/admin/privacy-requests/configure/storage.html +1 -1
- fides/ui-build/static/admin/privacy-requests/configure.html +1 -1
- fides/ui-build/static/admin/privacy-requests.html +1 -1
- fides/ui-build/static/admin/properties/[id].html +1 -1
- fides/ui-build/static/admin/properties/add-property.html +1 -1
- fides/ui-build/static/admin/properties.html +1 -1
- fides/ui-build/static/admin/reporting/datamap.html +1 -1
- fides/ui-build/static/admin/settings/about/alpha.html +1 -1
- fides/ui-build/static/admin/settings/about.html +1 -1
- fides/ui-build/static/admin/settings/consent/[configuration_id]/[purpose_id].html +1 -1
- fides/ui-build/static/admin/settings/consent.html +1 -1
- fides/ui-build/static/admin/settings/custom-fields/[id].html +1 -1
- fides/ui-build/static/admin/settings/custom-fields/new.html +1 -1
- fides/ui-build/static/admin/settings/custom-fields.html +1 -1
- fides/ui-build/static/admin/settings/domain-records.html +1 -1
- fides/ui-build/static/admin/settings/domains.html +1 -1
- fides/ui-build/static/admin/settings/email-templates.html +1 -1
- fides/ui-build/static/admin/settings/locations.html +1 -1
- fides/ui-build/static/admin/settings/organization.html +1 -1
- fides/ui-build/static/admin/settings/privacy-requests.html +1 -1
- fides/ui-build/static/admin/settings/regulations.html +1 -1
- fides/ui-build/static/admin/systems/configure/[id]/test-datasets.html +1 -1
- fides/ui-build/static/admin/systems/configure/[id].html +1 -1
- fides/ui-build/static/admin/systems.html +1 -1
- fides/ui-build/static/admin/taxonomy.html +1 -1
- fides/ui-build/static/admin/user-management/new.html +1 -1
- fides/ui-build/static/admin/user-management/profile/[id].html +1 -1
- fides/ui-build/static/admin/user-management.html +1 -1
- fides/ui-build/static/admin/_next/static/chunks/155-3d03f101c662c054.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/2921-edfdffa353a611e4.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/3377-4c129258b4c4ea28.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/3700-42976bfaad3b91c9.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/401-5270e3e23b08ab2b.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/5185-325e5435a0c7dcb7.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/5643-7583c1f8dbd83273.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/6277-ca31d48a33202761.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/6954-08b59d28d7a2a43b.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/7245-895bb7c6a6c797bc.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/7630-71582de0e818e28f.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/9070-13f237db78da586d.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/9965-54037b6c8f36d14b.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/multiple-1c9cef80deccb15d.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems-4adeec3bcec05f7b.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience-4254abef7bb52edd.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-8e76cbfaf71fdcb9.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/reporting-93730a4316c0d980.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/[systemId]-f85f4f8fcf1bfbdb.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/data-explorer-3619e454763dba09.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/integrations/[id]-4580f70eb41b6a7d.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/messaging/[id]-d6eed2dc5d27f625.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/messaging/add-template-c7b43fa365f4be10.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/messaging-c7ba755c2e0e2377.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/ant-components-f14bfd5890a0e939.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/AntForm-e4274a4d5d23eea9.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/FormikAntFormItem-f5bce1ceb0502f04.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/FormikControlled-90b4ea9f9deca6e2.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/FormikField-d6043ae8dae6ef7d.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/forms-520ba5ae02f47bda.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/[id]-fe4ed3ad75151e36.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests-cd8ba2eef9085377.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/reporting/datamap-764b6ce8e030d4a1.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent/[configuration_id]/[purpose_id]-da78452b3c41b29e.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent-6442e761ecb5c65a.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/domains-6f61d886aa6f5ce7.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/messaging-providers/[key]-4a18d8135c0dbf2a.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/messaging-providers/new-41957281b8ec26b1.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/messaging-providers-776258bad0941a7d.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/[id]/test-datasets-8067e12227210f48.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/systems-277ea1f34c3714cf.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-cecea5832cb1f3b0.js +0 -1
- fides/ui-build/static/admin/_next/static/css/372d6a236c84613f.css +0 -1
- fides/ui-build/static/admin/_next/static/zmEQMSpOBih8kmA1t-EWO/_buildManifest.js +0 -1
- fides/ui-build/static/admin/messaging/[id].html +0 -1
- fides/ui-build/static/admin/messaging/add-template.html +0 -1
- fides/ui-build/static/admin/messaging.html +0 -1
- fides/ui-build/static/admin/settings/messaging-providers/[key].html +0 -1
- fides/ui-build/static/admin/settings/messaging-providers/new.html +0 -1
- fides/ui-build/static/admin/settings/messaging-providers.html +0 -1
- {ethyca_fides-2.71.2b0.dist-info → ethyca_fides-2.72.0.dist-info}/WHEEL +0 -0
- {ethyca_fides-2.71.2b0.dist-info → ethyca_fides-2.72.0.dist-info}/entry_points.txt +0 -0
- {ethyca_fides-2.71.2b0.dist-info → ethyca_fides-2.72.0.dist-info}/licenses/LICENSE +0 -0
- {ethyca_fides-2.71.2b0.dist-info → ethyca_fides-2.72.0.dist-info}/top_level.txt +0 -0
- /fides/ui-build/static/admin/_next/static/{zmEQMSpOBih8kmA1t-EWO → BOxlzhSs4KC4KKoRi_z4Y}/_ssgManifest.js +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{1099-27b2d4e59a569b38.js → 1099-d1b22e891705eaf8.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{1115-8fb5000847f73ec7.js → 1115-584dac093cef6cc3.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{3772-aa7beafe5df5e656.js → 3772-b945c6839e43c753.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{3923-fa1d71afc7dc9e6e.js → 3923-c1e41661ebf57178.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{4817-5f9b9c9bafe888f1.js → 4817-066598cef25d7e88.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{549-c3b4c51f45a84a52.js → 549-3e3b8d01bc984f96.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{7773-98d34d188ae0a694.js → 7773-24899908bf8ff659.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{796-7944f684f8945506.js → 796-6fe49d134f660156.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{9826-e71887e2c4283249.js → 9826-1f42934a2863992e.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{404-2014144a1a0fa64f.js → 404-962d132471cd41ba.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/{manual-4f3ba02774f27795.js → manual-055d058d16c02957.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/configure/{add-vendors-f7bdc2da53137ffd.js → add-vendors-7c829e58485fc821.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/{configure-a27b220fe76bdc8e.js → configure-5c58b69dd473cc06.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience/{[id]-542fd4a4322122f1.js → [id]-58460ac9c1dface5.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices/{[id]-d31d1c233e94dc1f.js → [id]-25ce8366e689363b.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices/{new-2ea057e6217993f9.js → new-faa457089616711a.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/consent/{properties-eb557180eded0abd.js → properties-45a2901a35edc8f7.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{consent-c64589e53338e59a.js → consent-a7a4e419e4086033.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/projects/[projectUrn]/{[resourceUrn]-d3d1841bc8105e56.js → [resourceUrn]-3b59925f6c9a13a9.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/projects/{[projectUrn]-8cd4d1d6ba000333.js → [projectUrn]-ffb6e0fe6712342e.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/resources/{[resourceUrn]-791c522ad1d9a2ce.js → [resourceUrn]-8d7d9152e215c3b6.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{resources-8c7103ebf01d6e6a.js → resources-96be972a983616e3.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/detection/{[resourceUrn]-699762cb8a66237e.js → [resourceUrn]-260f5deb68966b70.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{detection-d970d0b82db36c88.js → detection-d735dab3d9f3adc5.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/discovery/{[resourceUrn]-a6343038a447699c.js → [resourceUrn]-c7f055275a2c503f.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{discovery-ce82ba79f9bf825c.js → discovery-b1cfd55c7e127865.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{datamap-ae7a4c1c4eabc0d4.js → datamap-18f255a8bbeecaa4.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/[collectionName]/{[...subfieldNames]-179e5d09ccff50c1.js → [...subfieldNames]-e04a4e16ccf32aef.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/{[collectionName]-59466e5e238c59d0.js → [collectionName]-a40c4febe16a0a6d.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/dataset/{[datasetId]-36d90c8c39fb0d1c.js → [datasetId]-f500a77eefb057e7.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{datastore-connection-496ec7ecca8259dc.js → datastore-connection-a8fc95a46de38b35.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/{configure-04ebf2fb6fc4358a.js → configure-1926359bdf5d6c30.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/properties/{[id]-f75a407d78857ab3.js → [id]-47118b9976ad7212.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/properties/{add-property-975ff605e1dbc09c.js → add-property-2e6b0d8b409ba1fd.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/{properties-e7fdf3a9a3e8c267.js → properties-32486c25255c9cb1.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/custom-fields/{[id]-bd1042a0e9be6aff.js → [id]-a270325109398f48.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/custom-fields/{new-469ad83c8cfa1290.js → new-2e0c8e249f286427.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{domain-records-44d06e280990854d.js → domain-records-e3dcef1ec8cf8b9e.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{email-templates-11148b182370fd83.js → email-templates-7469d2f85396c693.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{privacy-requests-00917525c9245a90.js → privacy-requests-b72df6f3d460125f.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/settings/{regulations-5d924b2f1f926b88.js → regulations-aa02bc818e089c49.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/{[id]-1a902922759cae76.js → [id]-2fc7c0d3988427b3.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/pages/user-management/{new-629c88e90699369b.js → new-e399005c3bb4db1b.js} +0 -0
- /fides/ui-build/static/admin/_next/static/chunks/{webpack-118fb4723d13c14f.js → webpack-8eac1ea5c825c8b4.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2397],{14908:function(e,a,s){var i=s(86677),t=s(27378);let l=e=>e.startsWith("#")?e.slice(1):e;a.Z=e=>{let{tabKeys:a,initialTab:s}=e,r=(0,i.useRouter)(),o=r.asPath.split("#")[1]||a[0],[c,n]=(0,t.useState)(o);return(0,t.useEffect)(()=>{s&&a.includes(s)&&n(s)},[s,a,r.isReady]),{activeTab:c,onTabChange:(0,t.useCallback)(async e=>{if(!a.includes(e)){await r.replace({pathname:r.pathname,query:r.query,hash:void 0}),n(a[0]);return}r.isReady&&(await r.replace({pathname:r.pathname,query:r.query,hash:l(e)},void 0,{shallow:!0}),n(e))},[r,a]),setActiveTab:n}}},69828:function(e,a,s){s.d(a,{Y:function(){return r}});var i=s(24246),t=s(20595),l=s(70788);let r=[(0,i.jsx)(t.PJP.S9g,{},"layers"),(0,i.jsx)(t.PJP.ehp,{},"dataset"),(0,i.jsx)(t.PJP.iA_,{},"table"),(0,i.jsx)(t.PJP.$4y,{style:{transform:"rotate(-90deg)"}},"field")];a.Z=e=>{let{resourceUrn:a,parentLink:s,onPathClick:t=()=>{}}=e,o=[];if(a||o.push({title:"All activity"}),a){o.push({title:"All activity",href:s});let e=a.split(".");e.forEach((a,s)=>{0!==s&&o.push({title:a,icon:r[s-1],onClick:a=>{a.preventDefault(),t(e.slice(0,s+1).join("."))}})})}return(0,i.jsx)(l.m,{"data-testid":"results-breadcrumb",items:o})}},1039:function(e,a,s){s.d(a,{Z:function(){return P}});var i,t,l=s(24246),r=s(59003),o=s(92222),c=s(20595),n=s(27378),d=s(47935),u=s(70675),h=s(72625),g=s(54409),j=s(79947),x=s(87667),m=s(50169),v=s(28278),p=s(
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2397],{14908:function(e,a,s){var i=s(86677),t=s(27378);let l=e=>e.startsWith("#")?e.slice(1):e;a.Z=e=>{let{tabKeys:a,initialTab:s}=e,r=(0,i.useRouter)(),o=r.asPath.split("#")[1]||a[0],[c,n]=(0,t.useState)(o);return(0,t.useEffect)(()=>{s&&a.includes(s)&&n(s)},[s,a,r.isReady]),{activeTab:c,onTabChange:(0,t.useCallback)(async e=>{if(!a.includes(e)){await r.replace({pathname:r.pathname,query:r.query,hash:void 0}),n(a[0]);return}r.isReady&&(await r.replace({pathname:r.pathname,query:r.query,hash:l(e)},void 0,{shallow:!0}),n(e))},[r,a]),setActiveTab:n}}},69828:function(e,a,s){s.d(a,{Y:function(){return r}});var i=s(24246),t=s(20595),l=s(70788);let r=[(0,i.jsx)(t.PJP.S9g,{},"layers"),(0,i.jsx)(t.PJP.ehp,{},"dataset"),(0,i.jsx)(t.PJP.iA_,{},"table"),(0,i.jsx)(t.PJP.$4y,{style:{transform:"rotate(-90deg)"}},"field")];a.Z=e=>{let{resourceUrn:a,parentLink:s,onPathClick:t=()=>{}}=e,o=[];if(a||o.push({title:"All activity"}),a){o.push({title:"All activity",href:s});let e=a.split(".");e.forEach((a,s)=>{0!==s&&o.push({title:a,icon:r[s-1],onClick:a=>{a.preventDefault(),t(e.slice(0,s+1).join("."))}})})}return(0,i.jsx)(l.m,{"data-testid":"results-breadcrumb",items:o})}},1039:function(e,a,s){s.d(a,{Z:function(){return P}});var i,t,l=s(24246),r=s(59003),o=s(92222),c=s(20595),n=s(27378),d=s(47935),u=s(70675),h=s(72625),g=s(54409),j=s(79947),x=s(87667),m=s(50169),v=s(28278),p=s(39449),y=s(74241),R=e=>{let{resourceType:a,changeTypeOverride:s}=e,i=(0,o.Cl)(),t=[];return a?a===p.D$.SCHEMA?{columns:[i.accessor(e=>e.name,{id:"name",cell:e=>(0,l.jsx)(x.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Name",...e}),size:300}),i.accessor(e=>e.urn,{id:"project",cell:e=>(0,l.jsx)(d.G3,{value:(0,y.Z)(e.getValue())}),header:e=>(0,l.jsx)(d.Rr,{value:"Project",...e})}),i.display({id:"status",cell:e=>(0,l.jsx)(m.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Status",...e})}),i.accessor(e=>e.system,{id:"system",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"System",...e})}),i.accessor(e=>e.monitor_config_id,{id:"monitor",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"Detected by",...e})}),i.accessor(e=>e.updated_at,{id:"time",cell:e=>(0,l.jsx)(h.Cy,{time:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"When",...e})}),i.display({id:"actions",cell:e=>(0,l.jsx)(g.Z,{ignoreChildActions:s===v.E.MONITORED||s===v.E.MUTED,resource:e.row.original}),header:"Actions",size:200,meta:{disableRowClick:!0}})]}:a===p.D$.TABLE?{columns:[i.accessor(e=>e.name,{id:"name",cell:e=>(0,l.jsx)(x.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Table name",...e}),size:300}),i.accessor(e=>e.description,{id:"description",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue(),cellProps:e}),header:e=>(0,l.jsx)(d.Rr,{value:"Description",...e}),meta:{showHeaderMenu:!0}}),i.display({id:"status",cell:e=>(0,l.jsx)(m.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Status",...e})}),i.accessor(e=>e.monitor_config_id,{id:"monitor",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"Detected by",...e})}),i.accessor(e=>e.updated_at,{id:"time",cell:e=>(0,l.jsx)(h.Cy,{time:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"When",...e})}),i.display({id:"actions",cell:e=>(0,l.jsx)(g.Z,{resource:e.row.original}),header:"Actions",size:200,meta:{disableRowClick:!0}})]}:a===p.D$.FIELD?{columns:[i.accessor(e=>e.name,{id:"name",cell:e=>(0,l.jsx)(x.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Field name",...e}),size:300}),i.accessor(e=>e.source_data_type,{id:"data-type",cell:e=>(0,l.jsx)(j.Z,{type:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"Data type",...e})}),i.accessor(e=>e.description,{id:"description",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue(),cellProps:e}),header:e=>(0,l.jsx)(d.Rr,{value:"Description",...e}),meta:{showHeaderMenu:!0}}),i.display({id:"status",cell:e=>(0,l.jsx)(m.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Status",...e})}),i.accessor(e=>e.monitor_config_id,{id:"monitor",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"Detected by",...e})}),i.accessor(e=>e.updated_at,{id:"time",cell:e=>(0,l.jsx)(h.Cy,{time:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"When",...e})}),i.display({id:"actions",cell:e=>(0,l.jsx)(g.Z,{resource:e.row.original}),header:"Actions",size:200,meta:{disableRowClick:!0}})]}:a===p.D$.ENDPOINT?{columns:[i.accessor(e=>e.name,{id:"name",cell:e=>(0,l.jsx)(x.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Object",...e}),size:300}),i.accessor(e=>e.description,{id:"description",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue(),cellProps:e}),header:e=>(0,l.jsx)(d.Rr,{value:"Description",...e}),meta:{showHeaderMenu:!0}}),i.display({id:"status",cell:e=>(0,l.jsx)(m.Z,{changeTypeOverride:s,result:e.row.original}),header:e=>(0,l.jsx)(d.Rr,{value:"Status",...e})}),i.accessor(e=>e.monitor_config_id,{id:"monitor",cell:e=>(0,l.jsx)(d.G3,{value:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"Detected by",...e})}),i.accessor(e=>e.updated_at,{id:"time",cell:e=>(0,l.jsx)(h.Cy,{time:e.getValue()}),header:e=>(0,l.jsx)(d.Rr,{value:"When",...e})}),i.display({id:"actions",cell:e=>(0,l.jsx)(g.Z,{resource:e.row.original}),header:"Actions",size:200,meta:{disableRowClick:!0}})]}:{columns:t}:{columns:t}},f=s(14908);(i=t||(t={})).ACTION_REQUIRED="action-required",i.MONITORED="monitored",i.UNMONITORED="unmonitored";let b={"action-required":{label:"Action Required",key:"action-required",filters:[p.LL.ADDITION,p.LL.REMOVAL],childFilters:[p.LL.ADDITION,p.LL.REMOVAL]},monitored:{label:"Monitored",key:"monitored",filters:[p.LL.MONITORED],childFilters:[],changeTypeOverride:v.E.MONITORED},unmonitored:{label:"Unmonitored",key:"unmonitored",filters:[p.LL.MUTED],childFilters:[],changeTypeOverride:v.E.MUTED}};var w=()=>{var e,a,s;let{activeTab:i,onTabChange:l}=(0,f.Z)({tabKeys:Object.values(t)});return{filterTabs:Object.values(b),activeTabKey:i,onTabChange:l,activeDiffFilters:null===(e=b[i])||void 0===e?void 0:e.filters,activeChildDiffFilters:null===(a=b[i])||void 0===a?void 0:a.childFilters,activeChangeTypeOverride:null===(s=b[i])||void 0===s?void 0:s.changeTypeOverride}},C=s(47182),D=s(38347),T=s(7940),O=s(80285),E=s(36168),_=s(30952);let k={items:[],total:0,page:1,size:50,pages:1},Z=()=>(0,l.jsx)(c.gCW,{mt:6,p:10,spacing:4,borderRadius:"base",maxW:"70%","data-testid":"empty-state",alignSelf:"center",margin:"auto",children:(0,l.jsxs)(c.gCW,{children:[(0,l.jsx)(c.xvT,{fontSize:"md",fontWeight:"600",children:"No activity found"}),(0,l.jsx)(c.xvT,{fontSize:"sm",children:"You're up to date!"})]})});var P=e=>{let{resourceUrn:a}=e,[s,i]=(0,n.useState)(""),{filterTabs:t,activeTabKey:h,onTabChange:g,activeDiffFilters:j,activeChildDiffFilters:x,activeChangeTypeOverride:m}=w(),{PAGE_SIZES:v,pageSize:y,setPageSize:f,onPreviousPageClick:b,isPreviousPageDisabled:P,onNextPageClick:M,isNextPageDisabled:I,startRange:N,endRange:A,pageIndex:L,setTotalPages:V,resetPageIndexToDefault:z}=(0,d.oi)();(0,n.useEffect)(()=>{z()},[a,s,z,j,x]);let{isFetching:S,isLoading:G,data:F}=(0,u.z8)({staged_resource_urn:a,page:L,size:y,child_diff_status:x,diff_status:j,search:s}),q=(0,T.G)(null==F?void 0:F.items[0]),{columns:W}=R({resourceType:q,changeTypeOverride:m}),{items:U,total:$,pages:H}=(0,n.useMemo)(()=>null!=F?F:k,[F]);(0,n.useEffect)(()=>{V(H)},[H,V]);let J=(0,n.useMemo)(()=>W,[W]),{navigateToDetectionResults:K}=(0,C.Z)(),Q=(0,r.b7)({getCoreRowModel:(0,o.sC)(),getGroupedRowModel:(0,o.qe)(),getExpandedRowModel:(0,o.rV)(),getRowId:O.Z,columns:J,manualPagination:!0,data:U,columnResizeMode:"onChange"});return G?(0,l.jsx)(d.I4,{rowHeight:36,numRows:36}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.A5g,{items:t.map(e=>({key:e.key,label:e.label})),activeKey:h,onChange:e=>g(e)}),(0,l.jsx)(d.Q$,{children:(0,l.jsx)(c.kCb,{direction:"row",alignItems:"center",justifyContent:"space-between",width:"full",children:(0,l.jsxs)(c.kCb,{gap:6,align:"center",children:[(0,l.jsx)(c.xuv,{flexShrink:0,children:(0,l.jsx)(_.f,{value:s,onChange:i})}),(0,l.jsx)(D.a,{})]})})}),(0,l.jsx)(d.ZK,{tableInstance:Q,onRowClick:e=>K({resourceUrn:e.urn,filterTab:h}),getRowIsClickable:e=>q!==p.D$.FIELD||(0,E.Z)(e),emptyTableNotice:(0,l.jsx)(Z,{})}),(0,l.jsx)(d.s8,{totalRows:$||0,pageSizes:v,setPageSize:f,onPreviousPageClick:b,isPreviousPageDisabled:P||S,onNextPageClick:M,isNextPageDisabled:I||S,startRange:N,endRange:A})]})}},79947:function(e,a,s){var i=s(24246),t=s(20595);a.Z=e=>{let{type:a}=e;return(0,i.jsx)(t.kCb,{align:"center",h:"full",children:!!a&&(0,i.jsx)(t.j8w,{children:a})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2921],{95813:function(e,l,r){r.d(l,{S:function(){return t}});let t={input:"default text",radio:"2",checkbox:!0,switch:!0,select:"2",multiselect:["2"],tags:["1"],date:"",number:12}},12921:function(e,l,r){r.r(l),r.d(l,{FormikSpreadFieldPOC:function(){return u}});var t=r(24246),n=r(20595),i=r(3124),s=r.n(i),d=r(34090),c=r(95813);let{Text:o,Title:a}=n.AntTypography,u=()=>(0,t.jsx)(d.J9,{initialValues:{...c.S},onSubmit:console.log,children:e=>{let{values:l}=e;return(0,t.jsxs)(n.bue,{children:[(0,t.jsxs)(n.JGx,{span:12,children:[(0,t.jsx)(a,{level:2,children:"<Formik> + <Form> + {...field}"}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(n.j8w,{color:"red",children:"non functional"}),(0,t.jsx)(n.j8w,{color:"red",children:"high effort"})]}),(0,t.jsx)(d.l0,{children:(0,t.jsxs)(n.jqI,{vertical:!0,gap:16,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"input",children:"Input"}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"input",children:e=>{let{field:l}=e;return(0,t.jsx)(n.AntInput,{...l,id:"input",type:"text"})}})})]}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"radio",children:e=>{let{field:l}=e;return(0,t.jsxs)(n.y02.Group,{...l,children:[(0,t.jsx)(n.y02,{value:"1",children:"Radio 1"}),(0,t.jsx)(n.y02,{value:"2",children:"Radio 2"})]})}})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.gN,{name:"checkbox",children:e=>{let{field:r}=e;return(0,t.jsx)(n.E_O,{...r,defaultChecked:l.checkbox,children:"Checkbox"})}}),(0,t.jsx)(o,{type:"warning",children:"Requires additional logic to handle default state"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"switch",children:"Switch"}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"switch",children:e=>{let{field:l}=e;return(0,t.jsx)(n.rAg,{id:"switch",...l})}})}),(0,t.jsx)(o,{type:"danger",children:"Ant Switch's onChange is too different from Formik, requires to be fully controlled."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"select",children:"Select"}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"select",children:e=>{let{field:r}=e;return(0,t.jsx)(n.WPr,{allowClear:!0,id:"select",className:"w-full",defaultValue:l.select,status:"error",...r,options:[{value:"1",label:"Option 1"},{value:"2",label:"Option 2"}]})}})}),(0,t.jsx)(o,{type:"danger",children:"Ant Select's onChange is too different from Formik, requires to be fully controlled."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"multiselect",children:"Multiselect"}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"multiselect",children:e=>{let{field:r}=e;return(0,t.jsx)(n.WPr,{mode:"multiple",allowClear:!0,id:"multiselect",className:"w-full",defaultValue:l.multiselect,status:"error",...r,options:[{value:"1",label:"Option 1"},{value:"2",label:"Option 2"}]})}})}),(0,t.jsx)(o,{type:"danger",children:"Ant Select's onChange is too different from Formik, requires to be fully controlled."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"tags",children:"Tags"}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"tags",children:e=>{let{field:r}=e;return(0,t.jsx)(n.WPr,{mode:"tags",allowClear:!0,id:"tags",className:"w-full",defaultValue:l.tags,status:"error",...r,options:[{value:"1",label:"Option 1"},{value:"2",label:"Option 2"}]})}})}),(0,t.jsx)(o,{type:"danger",children:"Ant Select's onChange is too different from Formik, requires to be fully controlled."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"date",children:"Date"}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"date",children:e=>{let{field:l}=e;return(0,t.jsx)(n.cv2,{id:"date",status:"error",...l})}})}),(0,t.jsx)(o,{type:"danger",children:"Ant DatePicker's onChange is different from Formik, requires to be fully controlled."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"number",children:"Number"}),(0,t.jsx)("div",{children:(0,t.jsx)(d.gN,{name:"number",children:e=>{let{field:r}=e;return(0,t.jsx)(n.W7D,{id:"number",defaultValue:l.number,status:"error",...r})}})}),(0,t.jsx)(o,{type:"danger",children:"Ant InputNumber's onChange is different from Formik, requires to be fully controlled."})]})]})})]}),(0,t.jsxs)(n.JGx,{span:8,offset:4,children:[(0,t.jsx)(a,{level:4,children:"Controlled Values"}),(0,t.jsx)(n.V4A,{style:{backgroundColor:s().FIDESUI_MINOS,color:s().FIDESUI_CORINTH},children:(0,t.jsx)("pre",{children:(0,t.jsxs)("code",{children:["{\n",Object.keys(l).map(e=>" ".concat(e,": ").concat(l[e],"\n")),"}"]})})})]})]})}});l.default=u}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3377],{77213:function(e,i,s){s.d(i,{Z:function(){return g}});var t=s(24246),a=s(20595),r=s(88038),n=s.n(r),l=s(86677);s(27378);var o=s(25980),d=s(90867),c=s(42478),u=s(77830),m=()=>{let e=(0,l.useRouter)();return(0,t.jsx)(a.xuv,{bg:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",p:5,mb:5,mt:5,children:(0,t.jsxs)(a.xuv,{children:[(0,t.jsxs)(a.Kqy,{direction:{base:"column",sm:"row"},justifyContent:"space-between",children:[(0,t.jsx)(a.xvT,{fontWeight:"semibold",children:"Configure your storage and messaging provider"}),(0,t.jsx)(a.wpx,{onClick:()=>{e.push(u.AD)},children:"Configure"})]}),(0,t.jsxs)(a.xvT,{children:["Before Fides can process your privacy requests we need two simple steps to configure your storage and email client."," "]})]})})},g=e=>{let{children:i,title:s,padded:r=!0,mainProps:u}=e,g=(0,o.hz)(),f=(0,l.useRouter)(),p="/privacy-requests"===f.pathname||"/datastore-connection"===f.pathname,y=!(g.flags.messagingConfiguration&&p),{data:x}=(0,c.JE)(void 0,{skip:y}),{data:h}=(0,d.PW)(void 0,{skip:y}),_=g.flags.messagingConfiguration&&(!x||!h)&&p;return(0,t.jsxs)(a.kCb,{"data-testid":s,direction:"column",h:"100vh",children:[(0,t.jsxs)(n(),{children:[(0,t.jsxs)("title",{children:["Fides Admin UI - ",s]}),(0,t.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,t.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,t.jsxs)(a.kCb,{as:"main",direction:"column",py:r?6:0,px:r?10:0,h:r?"calc(100% - 48px)":"full",flex:1,minWidth:0,overflow:"auto",...u,children:[_?(0,t.jsx)(m,{}):null,i]})]})}},90980:function(e,i,s){s.d(i,{R:function(){return o}});var t=s(24246),a=s(20595),r=s(79894),n=s.n(r),l=s(63662);let o=e=>{let{onClick:i,...s}=e;return(0,t.jsxs)(a.kCb,{alignItems:"center",mt:-4,mb:3,onClick:i,cursor:"pointer",...s,children:[(0,t.jsx)(a.wpx,{"aria-label":"Back",icon:(0,t.jsx)(a.Rpv,{}),className:"mr-2",size:"small"}),(0,t.jsx)(a.xvT,{as:"a",fontSize:"sm",fontWeight:"500",children:"Back"})]})};i.Z=e=>{let{backPath:i,...s}=e,r=(0,l.useRouter)();return(0,t.jsxs)(a.kCb,{alignItems:"center",mb:6,...s,children:[(0,t.jsx)(a.wpx,{onClick:()=>r.push(i),"aria-label":"Back",icon:(0,t.jsx)(a.Rpv,{}),className:"mr-2",size:"small"}),(0,t.jsx)(a.xvT,{as:n(),href:i,tabIndex:-1,fontSize:"sm",fontWeight:"500",children:"Back"})]})}},10792:function(e,i,s){s.d(i,{Z:function(){return D}});var t=s(24246),a=s(20595),r=s(27378),n=s(17245),l=s(90710),o=s(51980),d=s(90104),c=s.n(d),u=s(56141),m=s.n(u),g=s(92465),f=s.n(g),p=s(25389),y=s.n(p),x=s(15539),h=s.n(x),_=s(86677),v=s(812),w=s(77830),j=s(17828),k=s(42478);let b=e=>{let{serviceType:i,isOpen:s,onClose:n}=e,[o]=(0,k.SU)(),[d,c]=(0,r.useState)(!1),[u]=a.PPS.useForm(),m=i===l.q.twilio_text,g=e=>{let i="An unexpected error occurred. Please try again.";return(0,v.Ot)(e)?i=e.data.detail:(0,v.tB)(e)&&(i=e.data.detail[0].msg),i},f=async e=>{c(!0);try{let s=await o({service_type:i,details:{to_identity:m?{phone_number:e.phone}:{email:e.email}}});(0,v.D4)(s)?a.Pg3.error(g(s.error)):(a.Pg3.success("Test message sent successfully!"),n())}catch(e){a.Pg3.error(g(e))}finally{c(!1)}},p=m?"SMS":"email",y=()=>{n()};return(0,t.jsx)(a.$zI,{title:"Test ".concat(p),open:s,onCancel:y,footer:null,children:(0,t.jsx)(a.gCW,{spacing:4,children:(0,t.jsxs)(a.PPS,{form:u,onFinish:f,layout:"vertical",style:{width:"100%"},children:[m?(0,t.jsx)(a.PPS.Item,{name:"phone",label:"Phone number",rules:[{required:!0,message:"Phone number is required"},{pattern:/^\+?[1-9]\d{1,14}$/,message:"Please enter a valid phone number"}],children:(0,t.jsx)(a.AntInput,{placeholder:"+1234567890"})}):(0,t.jsx)(a.PPS.Item,{name:"email",label:"Email address",rules:[{required:!0,message:"Email address is required"},{type:"email",message:"Please enter a valid email address"}],children:(0,t.jsx)(a.AntInput,{placeholder:"test@example.com"})}),(0,t.jsx)(a.PPS.Item,{style:{marginBottom:0,marginTop:24},children:(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[(0,t.jsx)(a.wpx,{onClick:y,disabled:d,children:"Cancel"}),(0,t.jsx)(a.wpx,{type:"primary",htmlType:"submit",loading:d,"data-testid":"send-test-message-btn",children:d?"Sending...":"Send test ".concat(p)})]})})]})})})},S=()=>{let[e]=(0,k.SU)(),[i,s]=(0,r.useState)(!1),[t,n]=(0,r.useState)({}),o=e=>{let i="An unexpected error occurred. Please try again.";return(0,v.Ot)(e)?i=e.data.detail:(0,v.tB)(e)&&(i=e.data.detail[0].msg),i};return{verifyConfiguration:async i=>{s(!0);try{let s=i===l.q.twilio_text,t=await e({service_type:i,details:{to_identity:s?{phone_number:"+15551234567"}:{email:"test@example.com"}}});if((0,v.D4)(t)){a.Pg3.error(o(t.error));let e=new Date().toISOString();return n(s=>({...s,[i]:{timestamp:e,success:!1}})),!1}a.Pg3.success("Configuration verified successfully!");let r=new Date().toISOString();return n(e=>({...e,[i]:{timestamp:r,success:!0}})),!0}catch(e){return a.Pg3.error(o(e)),!1}finally{s(!1)}},isVerifying:i,isConfigurationVerified:e=>{var i;return!!(null===(i=t[e])||void 0===i?void 0:i.success)},getVerificationData:e=>t[e]}};var P=e=>{var i,s,d;let{configKey:u}=e,g=(0,_.useRouter)(),{handleError:p}=(0,n.HK)(),{verifyConfiguration:x,isVerifying:P,getVerificationData:C}=S(),q=!!u,[V,A]=(0,r.useState)(!1),[I,D]=(0,r.useState)(!1),[E,T]=(0,r.useState)(q?"**********":"secret_keys"),[M]=a.PPS.useForm(),[B]=(0,k.h9)(),[W]=(0,k.sn)(),[F]=(0,k.Ki)(),{data:N,refetch:z}=(0,k.FU)({key:u},{skip:!u}),R={email_from:(null==N?void 0:null===(i=N.details)||void 0===i?void 0:i.email_from)||"",domain:(null==N?void 0:null===(s=N.details)||void 0===s?void 0:s.domain)||"",aws_region:(null==N?void 0:null===(d=N.details)||void 0===d?void 0:d.aws_region)||"",auth_method:q?"**********":"secret_keys",aws_access_key_id:q?"**********":"",aws_secret_access_key:q?"**********":"",aws_assume_role_arn:q?"**********":""};(0,r.useEffect)(()=>{if(N){var e,i,s;let t={email_from:(null===(e=N.details)||void 0===e?void 0:e.email_from)||"",domain:(null===(i=N.details)||void 0===i?void 0:i.domain)||"",aws_region:(null===(s=N.details)||void 0===s?void 0:s.aws_region)||"",auth_method:"**********",aws_access_key_id:"**********",aws_secret_access_key:"**********",aws_assume_role_arn:"**********"};M.setFieldsValue(t),T("**********"),D(!1)}},[N,M]);let K=(()=>{let e=C(l.q.aws_ses);if(e){if(!e.success)return{isVerified:!1,status:"Verify configuration"};let i=new Date(e.timestamp),s=(0,o.B)(i,new Date,{addSuffix:!0});return{isVerified:!0,status:"Verified ".concat(s),timestamp:e.timestamp}}if(N){let{last_test_succeeded:e,last_test_timestamp:i}=N;if(i){let s=new Date(i),t=(0,o.B)(s,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(t):"Verify configuration",timestamp:i}}}let i=g.query.last_test_succeeded,s=g.query.last_test_timestamp;if(s){let e="true"===i||"1"===i,t=new Date(s),a=(0,o.B)(t,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(a):"Verify configuration",timestamp:s}}return{isVerified:!1,status:"Verify configuration"}})(),O=e=>h()(y()(e,e=>q&&"**********"===e?void 0:e),f()),U=(0,r.useCallback)(()=>{let e=M.getFieldsValue(),i=e.email_from,{domain:s}=e,t=i&&""!==i.trim(),a=s&&""!==s.trim();return t||a?Promise.resolve():Promise.reject(Error("Either email from or domain must be provided"))},[M]),L=async e=>{try{var i,s,t,r;if(q&&u){let r=[],n=(null==N?void 0:null===(i=N.details)||void 0===i?void 0:i.email_from)||"",o=(null==N?void 0:null===(s=N.details)||void 0===s?void 0:s.domain)||"",d=(null==N?void 0:null===(t=N.details)||void 0===t?void 0:t.aws_region)||"";(e.email_from!==n||e.domain!==o||e.aws_region!==d)&&r.push(W({key:u,config:{key:(null==N?void 0:N.key)||u,name:null==N?void 0:N.name,service_type:(null==N?void 0:N.service_type)||l.q.aws_ses,details:{...null==N?void 0:N.details,email_from:e.email_from||null,domain:e.domain||null,aws_region:e.aws_region}}}));let m={auth_method:e.auth_method,aws_access_key_id:e.aws_access_key_id,aws_secret_access_key:e.aws_secret_access_key,aws_assume_role_arn:e.aws_assume_role_arn},g=O(m);if(c()(g)||r.push(F({key:u,secrets:g})),0===r.length){a.Pg3.info("No changes to save.");return}let f=await Promise.all(r);if(f.some(e=>(0,v.D4)(e))){let e=f.find(e=>(0,v.D4)(e));p(null==e?void 0:e.error)}else a.Pg3.success("AWS SES configuration successfully updated."),D(!1),z&&z()}else{let i={service_type:l.q.aws_ses,details:{email_from:e.email_from||null,domain:e.domain||null,aws_region:e.aws_region},secrets:{auth_method:e.auth_method,aws_access_key_id:e.aws_access_key_id,aws_secret_access_key:e.aws_secret_access_key,aws_assume_role_arn:e.aws_assume_role_arn}},s=await B(i);if((0,v.D4)(s))p(s.error);else{a.Pg3.success("AWS SES configuration successfully created."),D(!1);let e=null===(r=s.data)||void 0===r?void 0:r.key;if(e){let i=w.GE.replace("[key]",e);g.push(i)}else g.push(w.AD)}}}catch(e){p(e)}},Z=async()=>{try{await x(l.q.aws_ses)&&z&&setTimeout(()=>{z()},500)}catch(e){p(e)}},H=()=>{M.validateFields(["email_from","domain"]).catch(()=>{})};return(0,t.jsxs)(a.xuv,{position:"relative",children:[(0,t.jsx)(a.PPS,{form:M,layout:"vertical",initialValues:R,onFinish:L,onValuesChange:(e,i)=>{let s={...i},t={...R};q&&Object.keys(s).forEach(e=>{"**********"===s[e]&&(s[e]=t[e])}),void 0!==e.auth_method&&(T(e.auth_method),"automatic"===e.auth_method&&M.setFieldsValue({aws_access_key_id:"",aws_secret_access_key:""})),D(!m()(s,t))},children:(0,t.jsxs)(a.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,children:[(0,t.jsx)(a.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,t.jsxs)(a.Ugi,{children:[(0,t.jsx)(j.Z,{}),(0,t.jsx)(a.X6q,{as:"h3",size:"xs",children:"AWS SES email messaging configuration"})]})}),(0,t.jsxs)(a.xuv,{px:6,py:6,children:[(0,t.jsx)(a.PPS.Item,{name:"email_from",label:"Email from",rules:[{validator:U}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput,{placeholder:q?"Enter new email from":"Enter email from",onChange:()=>H()})}),(0,t.jsx)(a.PPS.Item,{name:"domain",label:"Domain",rules:[{validator:U}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput,{placeholder:q?"Enter new domain":"Enter domain",onChange:()=>H()})}),(0,t.jsx)(a.PPS.Item,{name:"aws_region",label:"AWS region",rules:[{required:!0,message:"AWS region is required"}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput,{placeholder:q?"Enter new AWS region":"Enter AWS region (e.g., us-east-1)"})}),(0,t.jsx)(a.PPS.Item,{name:"auth_method",label:"Authentication method",rules:[{required:!0,message:"Authentication method is required"}],style:{marginBottom:24},children:(0,t.jsx)(a.WPr,{placeholder:"Select authentication method",options:[{label:"Secret keys",value:"secret_keys"},{label:"Automatic",value:"automatic"}]})}),("secret_keys"===E||q&&"**********"===E)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.PPS.Item,{name:"aws_access_key_id",label:"AWS access key ID",rules:"secret_keys"===E||q&&"**********"===E?[{required:!0,message:"AWS access key ID is required for secret keys authentication"}]:[],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput.Password,{placeholder:q?"Enter new AWS access key ID":"Enter AWS access key ID"})}),(0,t.jsx)(a.PPS.Item,{name:"aws_secret_access_key",label:"AWS secret access key",rules:"secret_keys"===E||q&&"**********"===E?[{required:!0,message:"AWS secret access key is required for secret keys authentication"}]:[],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput.Password,{placeholder:q?"Enter new AWS secret access key":"Enter AWS secret access key"})})]}),(0,t.jsx)(a.PPS.Item,{name:"aws_assume_role_arn",label:"AWS assume role ARN",children:(0,t.jsx)(a.AntInput.Password,{placeholder:q?"Enter new AWS assume role ARN":"Enter AWS assume role ARN (optional)"})}),(0,t.jsxs)(a.xuv,{mt:6,className:"flex justify-between",children:[(0,t.jsx)(a.xuv,{children:q&&K.isVerified&&(0,t.jsx)(a.wpx,{type:"default",onClick:()=>A(!0),"data-testid":"send-test-message-btn",children:"Send test email"})}),(0,t.jsxs)(a.xuv,{className:"flex",children:[q?(0,t.jsx)(a.wpx,{onClick:Z,className:"mr-2","data-testid":"test-btn",loading:P,icon:K.isVerified&&!P?(0,t.jsx)(a.StI,{}):void 0,children:P?"Verifying":K.isVerified?"Verified":K.status}):(0,t.jsx)(a.wpx,{onClick:()=>g.push(w.AD),className:"mr-2",children:"Cancel"}),(0,t.jsx)(a.wpx,{htmlType:"submit",type:"primary","data-testid":"save-btn",disabled:!I,children:"Save"})]})]})]})]})}),(0,t.jsx)(b,{serviceType:l.q.aws_ses,isOpen:V,onClose:()=>A(!1)})]})},C=s(44907),q=e=>{var i;let{configKey:s}=e,d=(0,_.useRouter)(),{handleError:u}=(0,n.HK)(),{verifyConfiguration:g,isVerifying:p,getVerificationData:x}=S(),[j,P]=(0,r.useState)(!1),[q,V]=(0,r.useState)(!1),[A]=a.PPS.useForm(),[I]=(0,k.h9)(),[D]=(0,k.sn)(),[E]=(0,k.Ki)(),T=!!s,{data:M,refetch:B}=(0,k.FU)({key:s},{skip:!s}),W={domain:(null==M?void 0:null===(i=M.details)||void 0===i?void 0:i.domain)||"",mailgun_api_key:T?"**********":""};(0,r.useEffect)(()=>{if(M){var e;let i={domain:(null===(e=M.details)||void 0===e?void 0:e.domain)||"",mailgun_api_key:"**********"};A.setFieldsValue(i),V(!1)}},[M,A]);let F=(()=>{let e=x(l.q.mailgun);if(e){if(!e.success)return{isVerified:!1,status:"Verify configuration"};let i=new Date(e.timestamp),s=(0,o.B)(i,new Date,{addSuffix:!0});return{isVerified:!0,status:"Verified ".concat(s),timestamp:e.timestamp}}if(M){let{last_test_succeeded:e,last_test_timestamp:i}=M;if(i){let s=new Date(i),t=(0,o.B)(s,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(t):"Verify configuration",timestamp:i}}}let i=d.query.last_test_succeeded,s=d.query.last_test_timestamp;if(s){let e="true"===i||"1"===i,t=new Date(s),a=(0,o.B)(t,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(a):"Verify configuration",timestamp:s}}return{isVerified:!1,status:"Verify configuration"}})(),N=e=>h()(y()(e,e=>T&&"**********"===e?void 0:e),f()),z=async e=>{try{var i,t;if(T&&s){let t=[],r=(null==M?void 0:null===(i=M.details)||void 0===i?void 0:i.domain)||"";e.domain!==r&&""!==e.domain.trim()&&t.push(D({key:s,config:{key:(null==M?void 0:M.key)||s,name:null==M?void 0:M.name,service_type:(null==M?void 0:M.service_type)||l.q.mailgun,details:{...null==M?void 0:M.details,is_eu_domain:"false",domain:e.domain}}}));let n=N({mailgun_api_key:e.mailgun_api_key});if(c()(n)||t.push(E({key:s,secrets:n})),0===t.length){a.Pg3.info("No changes to save.");return}let o=await Promise.all(t);if(o.some(e=>(0,v.D4)(e))){let e=o.find(e=>(0,v.D4)(e));u(null==e?void 0:e.error)}else a.Pg3.success("Mailgun configuration successfully updated."),V(!1),B&&B()}else{let i={service_type:l.q.mailgun,details:{is_eu_domain:"false",domain:e.domain},secrets:{mailgun_api_key:e.mailgun_api_key}},s=await I(i);if((0,v.D4)(s))u(s.error);else{a.Pg3.success("Mailgun configuration successfully created."),V(!1);let e=null===(t=s.data)||void 0===t?void 0:t.key;if(e){let i=w.GE.replace("[key]",e);d.push(i)}else d.push(w.AD)}}}catch(e){u(e)}},R=async()=>{try{await g(l.q.mailgun)&&B&&setTimeout(()=>{B()},500)}catch(e){u(e)}};return(0,t.jsxs)(a.xuv,{position:"relative",children:[(0,t.jsx)(a.PPS,{form:A,layout:"vertical",initialValues:W,onFinish:z,onValuesChange:(e,i)=>{let s={...i},t={...W};T&&"**********"===s.mailgun_api_key&&(s.mailgun_api_key=t.mailgun_api_key),V(!m()(s,t))},children:(0,t.jsxs)(a.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,children:[(0,t.jsx)(a.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,t.jsxs)(a.Ugi,{children:[(0,t.jsx)(C.Z,{}),(0,t.jsx)(a.X6q,{as:"h3",size:"xs",children:"Mailgun email messaging configuration"})]})}),(0,t.jsxs)(a.xuv,{px:6,py:6,children:[(0,t.jsx)(a.PPS.Item,{name:"domain",label:"Domain",rules:[{required:!0,message:"Domain is required"},{type:"string",min:1,message:"Domain cannot be empty"}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput,{placeholder:T?"Enter new domain":"Enter domain"})}),(0,t.jsx)(a.PPS.Item,{name:"mailgun_api_key",label:"API key",rules:[{required:!0,message:"API key is required"},{type:"string",min:1,message:"API key cannot be empty"}],children:(0,t.jsx)(a.AntInput.Password,{placeholder:T?"Enter new API key":"Enter API key"})}),(0,t.jsxs)(a.xuv,{mt:6,className:"flex justify-between",children:[(0,t.jsx)(a.xuv,{children:T&&F.isVerified&&(0,t.jsx)(a.wpx,{type:"default",onClick:()=>P(!0),"data-testid":"send-test-message-btn",children:"Send test email"})}),(0,t.jsxs)(a.xuv,{className:"flex",children:[T?(0,t.jsx)(a.wpx,{onClick:R,className:"mr-2","data-testid":"test-btn",loading:p,icon:F.isVerified&&!p?(0,t.jsx)(a.StI,{}):void 0,children:p?"Verifying":F.isVerified?"Verified":F.status}):(0,t.jsx)(a.wpx,{onClick:()=>d.push(w.AD),className:"mr-2",children:"Cancel"}),(0,t.jsx)(a.wpx,{htmlType:"submit",type:"primary","data-testid":"save-btn",disabled:!q,children:"Save"})]})]})]})]})}),(0,t.jsx)(b,{serviceType:l.q.mailgun,isOpen:j,onClose:()=>P(!1)})]})},V=s(5144),A=e=>{var i;let{configKey:s}=e,d=(0,_.useRouter)(),{handleError:u}=(0,n.HK)(),{verifyConfiguration:g,isVerifying:p,getVerificationData:x}=S(),[j,P]=(0,r.useState)(!1),[C,q]=(0,r.useState)(!1),[A]=a.PPS.useForm(),[I]=(0,k.h9)(),[D]=(0,k.sn)(),[E]=(0,k.Ki)(),T=!!s,{data:M,refetch:B}=(0,k.FU)({key:s},{skip:!s}),W={email:(null==M?void 0:null===(i=M.details)||void 0===i?void 0:i.twilio_email_from)||"",twilio_api_key:T?"**********":""};(0,r.useEffect)(()=>{if(M){var e;let i={email:(null===(e=M.details)||void 0===e?void 0:e.twilio_email_from)||"",twilio_api_key:"**********"};A.setFieldsValue(i),q(!1)}},[M,A]);let F=(()=>{let e=x(l.q.twilio_email);if(e){if(!e.success)return{isVerified:!1,status:"Verify configuration"};let i=new Date(e.timestamp),s=(0,o.B)(i,new Date,{addSuffix:!0});return{isVerified:!0,status:"Verified ".concat(s),timestamp:e.timestamp}}if(M){let{last_test_succeeded:e,last_test_timestamp:i}=M;if(i){let s=new Date(i),t=(0,o.B)(s,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(t):"Verify configuration",timestamp:i}}}let i=d.query.last_test_succeeded,s=d.query.last_test_timestamp;if(s){let e="true"===i||"1"===i,t=new Date(s),a=(0,o.B)(t,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(a):"Verify configuration",timestamp:s}}return{isVerified:!1,status:"Verify configuration"}})(),N=e=>h()(y()(e,e=>T&&"**********"===e?void 0:e),f()),z=async e=>{try{var i,t;if(T&&s){let t=[],r=(null==M?void 0:null===(i=M.details)||void 0===i?void 0:i.twilio_email_from)||"";e.email!==r&&""!==e.email.trim()&&t.push(D({key:s,config:{key:(null==M?void 0:M.key)||s,name:null==M?void 0:M.name,service_type:(null==M?void 0:M.service_type)||l.q.twilio_email,details:{...null==M?void 0:M.details,twilio_email_from:e.email}}}));let n=N({twilio_api_key:e.twilio_api_key});if(c()(n)||t.push(E({key:s,secrets:n})),0===t.length){a.Pg3.info("No changes to save.");return}let o=await Promise.all(t);if(o.some(e=>(0,v.D4)(e))){let e=o.find(e=>(0,v.D4)(e));u(null==e?void 0:e.error)}else a.Pg3.success("Twilio email configuration successfully updated."),q(!1),B&&B()}else{let i={service_type:l.q.twilio_email,details:{twilio_email_from:e.email},secrets:{twilio_api_key:e.twilio_api_key}},s=await I(i);if((0,v.D4)(s))u(s.error);else{a.Pg3.success("Twilio email configuration successfully created."),q(!1);let e=null===(t=s.data)||void 0===t?void 0:t.key;if(e){let i=w.GE.replace("[key]",e);d.push(i)}else d.push(w.AD)}}}catch(e){u(e)}},R=async()=>{try{await g(l.q.twilio_email)&&B&&setTimeout(()=>{B()},500)}catch(e){u(e)}};return(0,t.jsxs)(a.xuv,{position:"relative",children:[(0,t.jsx)(a.PPS,{form:A,layout:"vertical",initialValues:W,onFinish:z,onValuesChange:(e,i)=>{let s={...i},t={...W};T&&"**********"===s.twilio_api_key&&(s.twilio_api_key=t.twilio_api_key),q(!m()(s,t))},children:(0,t.jsxs)(a.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,children:[(0,t.jsx)(a.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,t.jsxs)(a.Ugi,{children:[(0,t.jsx)(V.Z,{}),(0,t.jsx)(a.X6q,{as:"h3",size:"xs",children:"Twilio email messaging configuration"})]})}),(0,t.jsxs)(a.xuv,{px:6,py:6,children:[(0,t.jsx)(a.PPS.Item,{name:"email",label:"Email",rules:[{required:!0,message:"Email is required"},{type:"email",message:"Please enter a valid email"}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput,{placeholder:T?"Enter new email":"Enter email"})}),(0,t.jsx)(a.PPS.Item,{name:"twilio_api_key",label:"API key",rules:[{required:!0,message:"API key is required"},{type:"string",min:1,message:"API key cannot be empty"}],children:(0,t.jsx)(a.AntInput.Password,{placeholder:T?"Enter new API key":"Enter API key"})}),(0,t.jsxs)(a.xuv,{mt:6,className:"flex justify-between",children:[(0,t.jsx)(a.xuv,{children:T&&F.isVerified&&(0,t.jsx)(a.wpx,{type:"default",onClick:()=>P(!0),"data-testid":"send-test-message-btn",children:"Send test email"})}),(0,t.jsxs)(a.xuv,{className:"flex",children:[T?(0,t.jsx)(a.wpx,{onClick:R,className:"mr-2","data-testid":"test-btn",loading:p,icon:F.isVerified&&!p?(0,t.jsx)(a.StI,{}):void 0,children:p?"Verifying":F.isVerified?"Verified":F.status}):(0,t.jsx)(a.wpx,{onClick:()=>d.push(w.AD),className:"mr-2",children:"Cancel"}),(0,t.jsx)(a.wpx,{htmlType:"submit",type:"primary","data-testid":"save-btn",disabled:!C,children:"Save"})]})]})]})]})}),(0,t.jsx)(b,{serviceType:l.q.twilio_email,isOpen:j,onClose:()=>P(!1)})]})},I=e=>{let{configKey:i}=e,s=(0,_.useRouter)(),{verifyConfiguration:n,isVerifying:d,getVerificationData:u}=S(),[g,p]=(0,r.useState)(!1),[x,j]=(0,r.useState)(!1),[P]=a.PPS.useForm(),[C]=(0,k.h9)(),[q]=(0,k.Ki)(),A=!!i,{data:I,refetch:D}=(0,k.FU)({key:i},{skip:!i}),E={account_sid:A?"**********":"",auth_token:A?"**********":"",messaging_service_sid:A?"**********":"",phone:A?"**********":""};(0,r.useEffect)(()=>{I&&(P.setFieldsValue({account_sid:"**********",auth_token:"**********",messaging_service_sid:"**********",phone:"**********"}),j(!1))},[I,P]);let T=(()=>{let e=u(l.q.twilio_text);if(e){if(!e.success)return{isVerified:!1,status:"Verify configuration"};let i=new Date(e.timestamp),s=(0,o.B)(i,new Date,{addSuffix:!0});return{isVerified:!0,status:"Verified ".concat(s),timestamp:e.timestamp}}if(I){let{last_test_succeeded:e,last_test_timestamp:i}=I;if(i){let s=new Date(i),t=(0,o.B)(s,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(t):"Verify configuration",timestamp:i}}}let i=s.query.last_test_succeeded,t=s.query.last_test_timestamp;if(t){let e="true"===i||"1"===i,s=new Date(t),a=(0,o.B)(s,new Date,{addSuffix:!0});return{isVerified:e,status:e?"Verified ".concat(a):"Verify configuration",timestamp:t}}return{isVerified:!1,status:"Verify configuration"}})(),M=e=>h()(y()(e,e=>A&&"**********"===e?void 0:e),f()),B=e=>{let i="An unexpected error occurred. Please try again.";return(0,v.Ot)(e)?i=e.data.detail:(0,v.tB)(e)&&(i=e.data.detail[0].msg),i},W=(0,r.useCallback)(()=>{let e=P.getFieldsValue(),i=e.messaging_service_sid,s=e.phone,t=i&&""!==i.trim()&&"**********"!==i,a=s&&""!==s.trim()&&"**********"!==s;return t||a?Promise.resolve():Promise.reject(Error("Either messaging service SID or phone number must be provided"))},[P]),F=async e=>{try{if(A&&i){let s={twilio_account_sid:e.account_sid,twilio_auth_token:e.auth_token,twilio_messaging_service_sid:e.messaging_service_sid,twilio_sender_phone_number:e.phone},t=M(s);if(c()(t)){a.Pg3.info("No changes to save.");return}let r=await q({key:i,secrets:t});(0,v.D4)(r)?a.Pg3.error(B(r.error)):(a.Pg3.success("Twilio SMS configuration successfully updated."),j(!1),D&&D())}else{let i={service_type:l.q.twilio_text,secrets:{twilio_account_sid:e.account_sid,twilio_auth_token:e.auth_token,twilio_messaging_service_sid:e.messaging_service_sid,twilio_sender_phone_number:e.phone}},r=await C(i);if((0,v.D4)(r))a.Pg3.error(B(r.error));else{var t;a.Pg3.success("Twilio SMS configuration successfully created."),j(!1);let e=null===(t=r.data)||void 0===t?void 0:t.key;if(e){let i=w.GE.replace("[key]",e);s.push(i)}else s.push(w.AD)}}}catch(e){a.Pg3.error("An unexpected error occurred. Please try again.")}},N=async()=>{try{await n(l.q.twilio_text)&&D&&setTimeout(()=>{D()},500)}catch(e){a.Pg3.error("An unexpected error occurred during verification.")}},z=()=>{P.validateFields(["messaging_service_sid","phone"]).catch(()=>{})};return(0,t.jsxs)(a.xuv,{position:"relative",children:[(0,t.jsx)(a.PPS,{form:P,layout:"vertical",initialValues:E,onFinish:F,onValuesChange:(e,i)=>{let s={...i},t={...E};A&&Object.keys(s).forEach(e=>{"**********"===s[e]&&(s[e]=t[e])}),j(!m()(s,t))},children:(0,t.jsxs)(a.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,children:[(0,t.jsx)(a.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,t.jsxs)(a.Ugi,{children:[(0,t.jsx)(V.Z,{}),(0,t.jsx)(a.X6q,{as:"h3",size:"xs",children:"Twilio SMS messaging configuration"})]})}),(0,t.jsxs)(a.xuv,{px:6,py:6,children:[(0,t.jsx)(a.PPS.Item,{name:"account_sid",label:"Account SID",rules:[{required:!0,message:"Account SID is required"},{type:"string",min:1,message:"Account SID cannot be empty"}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput.Password,{placeholder:A?"Enter new account SID":"Enter account SID"})}),(0,t.jsx)(a.PPS.Item,{name:"auth_token",label:"Auth token",rules:[{required:!0,message:"Auth token is required"},{type:"string",min:1,message:"Auth token cannot be empty"}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput.Password,{placeholder:A?"Enter new auth token":"Enter auth token"})}),(0,t.jsx)(a.PPS.Item,{name:"messaging_service_sid",label:"Messaging service SID",rules:[{validator:W}],style:{marginBottom:24},children:(0,t.jsx)(a.AntInput.Password,{placeholder:A?"Enter new messaging service SID":"Enter messaging service SID",onChange:()=>z()})}),(0,t.jsx)(a.PPS.Item,{name:"phone",label:"Phone number",rules:[{validator:W}],children:(0,t.jsx)(a.AntInput.Password,{placeholder:A?"Enter new phone number":"Enter phone number",onChange:()=>z()})}),(0,t.jsxs)(a.xuv,{mt:6,className:"flex justify-between",children:[(0,t.jsx)(a.xuv,{children:A&&T.isVerified&&(0,t.jsx)(a.wpx,{type:"default",onClick:()=>p(!0),"data-testid":"send-test-message-btn",children:"Send test SMS"})}),(0,t.jsxs)(a.xuv,{className:"flex",children:[A?(0,t.jsx)(a.wpx,{onClick:N,className:"mr-2","data-testid":"test-btn",loading:d,icon:T.isVerified&&!d?(0,t.jsx)(a.StI,{}):void 0,children:d?"Verifying":T.isVerified?"Verified":T.status}):(0,t.jsx)(a.wpx,{onClick:()=>s.push(w.AD),className:"mr-2",children:"Cancel"}),(0,t.jsx)(a.wpx,{htmlType:"submit",type:"primary","data-testid":"save-btn",disabled:!x,children:"Save"})]})]})]})]})}),(0,t.jsx)(b,{serviceType:l.q.twilio_text,isOpen:g,onClose:()=>p(!1)})]})},D=e=>{let{configKey:i,initialProviderType:s}=e,[o,d]=(0,r.useState)(s||""),c=!!i,{handleError:u}=(0,n.HK)(),{data:m,isLoading:g,error:f}=(0,k.FU)({key:i},{skip:!i}),{data:p}=(0,k.qt)();(0,r.useEffect)(()=>{c&&(null==m?void 0:m.service_type)&&d(m.service_type)},[c,null==m?void 0:m.service_type]),(0,r.useEffect)(()=>{f&&u(f)},[f,u]);let y=(0,r.useMemo)(()=>{var e;let i=new Set((null==p?void 0:null===(e=p.items)||void 0===e?void 0:e.map(e=>e.service_type))||[]),s=!c&&i.has(l.q.mailgun),t=!c&&i.has(l.q.twilio_email),a=!c&&i.has(l.q.twilio_text),r=!c&&i.has(l.q.aws_ses);return[{value:l.q.mailgun,label:l.k.mailgun,disabled:s,title:s?"Only one messaging provider of each type can be created":void 0},{value:l.q.twilio_email,label:l.k.twilio_email,disabled:t,title:t?"Only one messaging provider of each type can be created":void 0},{value:l.q.twilio_text,label:l.k.twilio_text,disabled:a,title:a?"Only one messaging provider of each type can be created":void 0},{value:l.q.aws_ses,label:l.k.aws_ses,disabled:r,title:r?"Only one messaging provider of each type can be created":void 0}]},[p,c]);return c&&g?(0,t.jsx)(a.xuv,{display:"flex",justifyContent:"center",alignItems:"center",height:"200px",children:(0,t.jsx)(a.$jN,{})}):!c||m||g?(0,t.jsxs)(a.xuv,{children:[!c&&(0,t.jsxs)(a.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,mb:4,children:[(0,t.jsx)(a.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,t.jsx)(a.X6q,{as:"h3",size:"xs",children:"Select messaging provider"})}),(0,t.jsx)(a.xuv,{px:6,py:6,children:(0,t.jsx)(a.PPS,{layout:"vertical",children:(0,t.jsx)(a.PPS.Item,{label:"Provider type",name:"provider_type",rules:[{required:!0,message:"Please select a provider type"}],children:(0,t.jsx)(a.WPr,{placeholder:"Choose a messaging provider...","aria-label":"Select a messaging provider",value:o||void 0,onChange:e=>d(e),options:y})})})})]}),o&&(()=>{switch(o){case l.q.mailgun:return(0,t.jsx)(q,{configKey:i});case l.q.twilio_email:return(0,t.jsx)(A,{configKey:i});case l.q.twilio_text:return(0,t.jsx)(I,{configKey:i});case l.q.aws_ses:return(0,t.jsx)(P,{configKey:i});default:return null}})()]}):(0,t.jsx)(a.xuv,{children:(0,t.jsxs)(a.xvT,{color:"red.500",children:["Messaging configuration not found for key: ",i]})})}},90710:function(e,i,s){s.d(i,{k:function(){return a},q:function(){return t}});let t={mailgun:"mailgun",twilio_email:"twilio_email",twilio_text:"twilio_text",aws_ses:"aws_ses"},a={mailgun:"Mailgun email",twilio_email:"Twilio email",twilio_text:"Twilio SMS",aws_ses:"AWS SES email"}},17828:function(e,i,s){var t=s(24246);s(27378),i.Z=()=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 74.375 85",width:"20",height:"20",fill:"#fff",fillRule:"evenodd",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("use",{xlinkHref:"#A",x:"2.188",y:"2.5"}),(0,t.jsx)("symbol",{id:"A",overflow:"visible",children:(0,t.jsxs)("g",{stroke:"none",children:[(0,t.jsx)("path",{d:"M16.558 12.75L0 38.591l16.558 25.841 13.227-3.324.654-44.869-13.881-3.489z",fill:"#876929"}),(0,t.jsx)("path",{d:"M35.049 59.786l-18.491 4.645V12.75l18.491 4.645v42.391z",fill:"#d9a741"}),(0,t.jsxs)("g",{fill:"#876929",children:[(0,t.jsx)("path",{d:"M32.849 21.614L35.05 80 70 62.867l-.01-43.615-8.914 1.448-28.228.913z"}),(0,t.jsx)("path",{d:"M46.184 33.149l10.906-.632 10.778-19.164L40.612 0 30.439 4.364l15.745 28.785z"})]}),(0,t.jsx)("path",{d:"M40.612 0l27.256 13.353-10.778 19.164L40.612 0z",fill:"#d9a741"}),(0,t.jsx)("path",{d:"M35.049 5.539L57.09 44.742l3.788 22.595L35.049 80l-10.46-5.131V9.64l10.45-4.101h.01z",fill:"#876929"}),(0,t.jsx)("path",{d:"M69.991 19.251L70 62.867 35.05 80V5.539l22.041 39.203 12.899-25.491z",fill:"#d9a741"})]})})]})},44907:function(e,i,s){var t=s(24246);s(27378),i.Z=()=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",preserveAspectRatio:"xMidYMid",viewBox:"-0.5 0 257 257",children:(0,t.jsx)("path",{fill:"#C02428",d:"M128.418 80.526c-26.51 0-48.884 21.475-48.884 48.728a48.197 48.197 0 0014.187 34.579 48.532 48.532 0 0034.697 14.14c26.511 0 48.875-21.476 48.875-48.719 0-27.253-22.364-48.728-48.875-48.728zm-76.22 47.895c0-41.285 33.968-75.138 75.395-75.138 41.417 0 75.385 33.853 75.385 75.138 0 2.478 0 5.788-.825 8.266-.835 7.422 4.972 13.2 12.43 13.2 12.43 0 14.08-15.678 14.08-21.466 0-55.328-45.573-100.746-101.07-100.746-55.518 0-101.07 45.418-101.07 100.746 0 55.339 45.552 100.747 101.07 100.747 29.822 0 56.333-12.388 74.56-33.03l20.703 17.342c-22.364 26.43-57.158 42.952-94.448 42.952-34.097.105-66.827-13.35-90.932-37.384C13.37 195.016-.118 162.392 0 128.411 0 58.228 57.159.432 128.418.432 198.832.432 256 58.238 256 128.432c0 28.075-13.256 51.205-40.591 51.205-11.605 0-19.053-5.787-23.2-11.565-13.255 21.476-37.29 35.508-64.626 35.508-20.017.068-39.234-7.827-53.388-21.933a74.755 74.755 0 01-22.008-53.205l.01-.02zm76.21-22.297c12.43 0 22.374 9.91 22.374 22.297 0 12.388-9.944 22.298-22.364 22.298a22.322 22.322 0 01-15.848-6.504 22.169 22.169 0 01-6.526-15.794c0-12.387 9.944-22.297 22.374-22.297h-.01z"})})},5144:function(e,i,s){var t=s(24246);i.Z=()=>(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",children:(0,t.jsx)("path",{fill:"#F12E45",d:"M128 0c70.656 0 128 57.344 128 128s-57.344 128-128 128S0 198.656 0 128 57.344 0 128 0zm0 33.792c-52.224 0-94.208 41.984-94.208 94.208S75.776 222.208 128 222.208s94.208-41.984 94.208-94.208S180.224 33.792 128 33.792zm31.744 99.328c14.704 0 26.624 11.92 26.624 26.624 0 14.704-11.92 26.624-26.624 26.624-14.704 0-26.624-11.92-26.624-26.624 0-14.704 11.92-26.624 26.624-26.624zm-63.488 0c14.704 0 26.624 11.92 26.624 26.624 0 14.704-11.92 26.624-26.624 26.624-14.704 0-26.624-11.92-26.624-26.624 0-14.704 11.92-26.624 26.624-26.624zm63.488-63.488c14.704 0 26.624 11.92 26.624 26.624 0 14.704-11.92 26.624-26.624 26.624-14.704 0-26.624-11.92-26.624-26.624 0-14.704 11.92-26.624 26.624-26.624zm-63.488 0c14.704 0 26.624 11.92 26.624 26.624 0 14.704-11.92 26.624-26.624 26.624-14.704 0-26.624-11.92-26.624-26.624 0-14.704 11.92-26.624 26.624-26.624z"})})},42478:function(e,i,s){s.d(i,{FU:function(){return d},JE:function(){return a},Ki:function(){return u},SU:function(){return m},W:function(){return g},h9:function(){return r},jc:function(){return t},qt:function(){return o},sn:function(){return c}});let{useGetEmailInviteStatusQuery:t,useGetActiveMessagingProviderQuery:a,useCreateMessagingConfigurationMutation:r,useCreateMessagingConfigurationSecretsMutation:n,useGetMessagingConfigurationDetailsQuery:l,useGetMessagingConfigurationsQuery:o,useGetMessagingConfigurationByKeyQuery:d,useUpdateMessagingConfigurationByKeyMutation:c,useUpdateMessagingConfigurationSecretsByKeyMutation:u,useCreateTestConnectionMessageMutation:m,useDeleteMessagingConfigurationByKeyMutation:g}=s(78780).u.injectEndpoints({endpoints:e=>({getEmailInviteStatus:e.query({query:()=>({url:"/messaging/email-invite/status"}),providesTags:()=>["Email Invite Status"]}),createMessagingConfiguration:e.mutation({query:e=>({url:"messaging/config",method:"POST",body:e}),invalidatesTags:["Messaging Config","Configuration Settings"]}),getActiveMessagingProvider:e.query({queryFn:async(e,i,s,t)=>{let a=await t({url:"messaging/default/active"});return a.error&&404===a.error.status?{data:null}:a},providesTags:["Messaging Config"]}),createMessagingConfigurationSecrets:e.mutation({query:e=>({url:"messaging/default/".concat(e.service_type,"/secret"),method:"PUT",body:e.details}),invalidatesTags:["Messaging Config","Configuration Settings"]}),getMessagingConfigurationDetails:e.query({query:e=>({url:"messaging/default/".concat(e.type)}),providesTags:["Messaging Config"]}),getMessagingConfigurations:e.query({query:()=>({url:"messaging/config"}),providesTags:["Messaging Config"]}),getMessagingConfigurationByKey:e.query({query:e=>({url:"messaging/config/".concat(e.key)}),providesTags:["Messaging Config"]}),createTestConnectionMessage:e.mutation({query:e=>({url:"messaging/test/".concat(e.service_type),method:"POST",body:e.details}),invalidatesTags:["Messaging Config"]}),updateMessagingConfigurationByKey:e.mutation({query:e=>({url:"messaging/config/".concat(e.key),method:"PATCH",body:e.config}),invalidatesTags:["Messaging Config","Configuration Settings"]}),updateMessagingConfigurationSecretsByKey:e.mutation({query:e=>({url:"messaging/config/".concat(e.key,"/secret"),method:"PUT",body:e.secrets}),invalidatesTags:["Messaging Config","Configuration Settings"]}),deleteMessagingConfigurationByKey:e.mutation({query:e=>({url:"messaging/config/".concat(e.key),method:"DELETE"}),invalidatesTags:["Messaging Config","Configuration Settings"]})})})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3696],{83696:function(e,s,a){a.d(s,{Z:function(){return el}});var l=a(24246),t=a(20595),n=a(91437),i=()=>(0,l.jsxs)(t.xuv,{children:[(0,l.jsx)(t.xuv,{pb:4,fontSize:"18px",fontWeight:"semibold",children:"Role Description"}),(0,l.jsx)(t.gCW,{spacing:4,children:n.K.map(e=>(0,l.jsxs)(t.xuv,{width:"100%",padding:4,borderRadius:"md",backgroundColor:"gray.75",fontSize:"14px",children:[(0,l.jsx)(t.xuv,{fontWeight:"semibold",children:e.label}),(0,l.jsx)(t.xuv,{color:"gray.700",children:e.description})]},e.roleKey))})]}),r=a(16134),d=a(85054),o=a(19904),c=a(34090),h=a(86677),u=a(27378),m=a(812),p=a(46238),x=a(58452),j=a(77830),w=a(46628),g=a(26917),b=a(1315),f=a(95492),y=a(65497);let v=e=>{let{assignedSystems:s,onAssignedSystemChange:a}=e,n=(0,r.C)(y.Ux);if((0,y.d6)(n,{skip:!n}),0===s.length)return null;let i=e=>{a(s.filter(s=>s.fides_key!==e.fides_key))};return(0,l.jsxs)(t.iA_,{size:"sm","data-testid":"assign-systems-delete-table",children:[(0,l.jsx)(t.hrZ,{children:(0,l.jsxs)(t.Tr,{children:[(0,l.jsx)(t.Th,{children:"System"}),(0,l.jsx)(t.Th,{})]})}),(0,l.jsx)(t.p3B,{children:s.map(e=>(0,l.jsxs)(t.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,l.jsx)(t.Td,{children:e.name}),(0,l.jsx)(t.Td,{textAlign:"end",children:(0,l.jsx)(t.wpx,{"aria-label":"Unassign system from user",icon:(0,l.jsx)(f.l,{}),onClick:()=>i(e),"data-testid":"unassign-btn"})})]},e.fides_key))})]})};var _=e=>{let{allSystems:s,assignedSystems:a,onChange:n}=e,i=e=>{a.find(s=>s.fides_key===e.fides_key)?n(a.filter(s=>s.fides_key!==e.fides_key)):n([...a,e])};return(0,l.jsx)(t.xuv,{overflowY:"auto",maxHeight:"300px",children:(0,l.jsxs)(t.iA_,{size:"sm","data-testid":"assign-systems-table",maxHeight:"50vh",overflowY:"scroll",children:[(0,l.jsx)(t.hrZ,{position:"sticky",top:0,background:"white",zIndex:1,children:(0,l.jsxs)(t.Tr,{children:[(0,l.jsx)(t.Th,{children:"System"}),(0,l.jsx)(t.Th,{children:"Assign"})]})}),(0,l.jsx)(t.p3B,{children:s.map(e=>{let s=!!a.find(s=>s.fides_key===e.fides_key);return(0,l.jsxs)(t.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,l.jsx)(t.Td,{children:e.name}),(0,l.jsx)(t.Td,{children:(0,l.jsx)(t.rAg,{checked:s,onChange:()=>i(e),"data-testid":"assign-switch"})})]},e.fides_key)})})]})})};let C=(e,s)=>{var a,l;return(null===(a=e.name)||void 0===a?void 0:a.toLocaleLowerCase().includes(s.toLocaleLowerCase()))||(null===(l=e.description)||void 0===l?void 0:l.toLocaleLowerCase().includes(s.toLocaleLowerCase()))};var k=e=>{let{isOpen:s,onClose:a,assignedSystems:n,onAssignedSystemChange:i}=e,{data:r}=(0,b.K3)(),[d,o]=(0,u.useState)(""),[c,h]=(0,u.useState)(n),m=async()=>{i(c),a()},p=!r||0===r.length,x=(0,u.useMemo)(()=>r?r.filter(e=>C(e,d)):[],[r,d]),j=(0,u.useMemo)(()=>{let e=new Set(c.map(e=>e.fides_key));return x.every(s=>e.has(s.fides_key))},[x,c]);return(0,l.jsxs)(t.u_l,{isOpen:s,onClose:a,size:"2xl",children:[(0,l.jsx)(t.ZAr,{}),(0,l.jsxs)(t.hzk,{p:8,"data-testid":"confirmation-modal",children:[(0,l.jsxs)(t.xBx,{fontWeight:"medium",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,l.jsx)(t.xvT,{children:"Assign systems"}),(0,l.jsxs)(t.j8w,{color:"success",children:["Assigned to ",n.length," systems"]})]}),(0,l.jsx)(t.fef,{"data-testid":"assign-systems-modal-body",children:p?(0,l.jsx)(t.xvT,{children:"No systems found"}):(0,l.jsxs)(t.Kqy,{spacing:4,children:[(0,l.jsxs)(t.kCb,{justifyContent:"space-between",children:[(0,l.jsx)(t.xvT,{fontSize:"sm",flexGrow:1,fontWeight:"medium",children:"Assign systems in your organization to this user"}),(0,l.jsx)(t.xuv,{children:(0,l.jsxs)(t.NIc,{display:"flex",alignItems:"center",children:[(0,l.jsx)(t.lXp,{fontSize:"sm",htmlFor:"assign-all-systems",mb:"0",children:"Assign all systems"}),(0,l.jsx)(t.rAg,{size:"small",id:"assign-all-systems",checked:j,onChange:e=>{e&&r?h(x):h(r?r.filter(e=>!x.includes(e)):[])},"data-testid":"assign-all-systems-toggle"})]})})]}),(0,l.jsx)(g.Z,{value:d,onChange:o,placeholder:"Search for systems","data-testid":"system-search",withIcon:!0}),(0,l.jsx)(_,{allSystems:x,assignedSystems:c,onChange:h})]})}),(0,l.jsx)(t.mzw,{justifyContent:"flex-start",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(t.wpx,{onClick:a,className:"mr-2","data-testid":"cancel-btn",children:"Cancel"}),p?null:(0,l.jsx)(t.wpx,{type:"primary",onClick:m,"data-testid":"confirm-btn",children:"Confirm"})]})})]})]})},S=e=>{let{label:s,roleKey:a,isSelected:n,isDisabled:i,assignedSystems:r,onAssignedSystemChange:o}=e,{setFieldValue:h}=(0,c.u6)(),u=(0,t.qY0)(),m=i?"You do not have sufficient permissions to assign this role.":void 0;return n?(0,l.jsxs)(t.Kqy,{borderRadius:"md",border:"1px solid",borderColor:"gray.200",p:4,backgroundColor:"gray.50","aria-selected":"true",spacing:4,"data-testid":"selected",children:[(0,l.jsxs)(t.kCb,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(t.xvT,{fontSize:"md",fontWeight:"semibold",children:s}),(0,l.jsx)(t.StI,{})]}),a!==d.A7.APPROVER&&a!==d.A7.RESPONDENT&&a!==d.A7.EXTERNAL_RESPONDENT?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(t.kCb,{alignItems:"center",children:[(0,l.jsx)(t.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"Assigned systems"}),(0,l.jsx)(p.b,{label:"Assigned systems refer to those systems that have been specifically allocated to a user for management purposes. Users assigned to a system possess full edit permissions and are listed as the Data Steward for the respective system."})]}),(0,l.jsx)(t.wpx,{disabled:i,title:m,type:"primary",size:"small",onClick:u.onOpen,"data-testid":"assign-systems-btn",children:"Assign systems +"}),(0,l.jsx)(v,{assignedSystems:r,onAssignedSystemChange:o}),u.isOpen?(0,l.jsx)(k,{isOpen:u.isOpen,onClose:u.onClose,assignedSystems:r,onAssignedSystemChange:o}):null]}):null]}):(0,l.jsx)(t.wpx,{onClick:()=>{h("roles",[a])},"data-testid":"role-option-".concat(s),title:m,disabled:i,children:s})};let E={roles:[]};var R=()=>{var e,s;let a=(0,t.pmc)(),i=(0,h.useRouter)(),g=(0,r.C)(y.Ux);(0,y.d6)(g,{skip:!g});let{isOpen:b,onOpen:f,onClose:v}=(0,t.qY0)(),_=(0,r.C)(y.R$),[C,k]=(0,u.useState)(_),[R]=(0,y.G$)();(0,u.useEffect)(()=>{k(_)},[_]);let{data:A,isLoading:P}=(0,y.gU)(null!=g?g:"",{skip:!g}),[T]=(0,y.lD)(),N=!!(null==A?void 0:null===(e=A.roles)||void 0===e?void 0:e.includes(d.A7.EXTERNAL_RESPONDENT)),O=async e=>{if(b&&v(),!g)return;let s=e.roles.includes(d.A7.APPROVER),l=await T({user_id:g,payload:{roles:e.roles}});if((0,m.D4)(l)){a((0,w.Vo)((0,m.e$)(l.error)));return}if(!s){let e=C.map(e=>e.fides_key),s=await R({userId:g,fidesKeys:e});if((0,m.D4)(s)){a((0,w.Vo)((0,m.e$)(s.error)));return}}a((0,w.t5)("Permissions updated"))},I=async e=>{g&&(C.length>0&&e.roles.includes(d.A7.APPROVER)?f():await O(e))},z=(0,o.Tg)([d.Sh.USER_PERMISSION_ASSIGN_OWNERS]);if(!g)return null;if(P)return(0,l.jsx)(t.$jN,{});if(!z&&(null==A?void 0:null===(s=A.roles)||void 0===s?void 0:s.includes(d.A7.OWNER)))return(0,l.jsx)(t.xvT,{"data-testid":"insufficient-access",children:"You do not have sufficient access to change this user's permissions."});let q=(null==A?void 0:A.roles)?{roles:A.roles}:E,U=n.K.filter(e=>N?e.roleKey===d.A7.EXTERNAL_RESPONDENT:e.roleKey!==d.A7.EXTERNAL_RESPONDENT),D=N?"External respondent role cannot be changed":void 0;return(0,l.jsx)(c.J9,{onSubmit:I,initialValues:q,enableReinitialize:!0,children:e=>{let{values:s,isSubmitting:a,dirty:n}=e;return(0,l.jsxs)(c.l0,{children:[(0,l.jsxs)(t.Kqy,{spacing:7,children:[(0,l.jsxs)(t.Kqy,{spacing:3,"data-testid":"role-options",children:[(0,l.jsxs)(t.kCb,{alignItems:"center",children:[(0,l.jsx)(t.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"User role"}),(0,l.jsx)(p.b,{label:"A user's role in the organization determines what parts of the UI they can access and which functions are available to them."})]}),U.map(e=>{let a=s.roles.indexOf(e.roleKey)>=0,t=e.roleKey===d.A7.OWNER?!z:N;return(0,l.jsx)(S,{isSelected:a,isDisabled:t,assignedSystems:C,onAssignedSystemChange:k,...e},e.roleKey)}),!N&&(0,l.jsx)(t.esZ,{title:"To invite a new External respondent user, create a manual task integration and then click on the 'Manage secure access' button",children:(0,l.jsx)(t.wpx,{disabled:!0,"data-testid":"role-option-External respondent",children:"External respondent"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(t.wpx,{onClick:()=>i.push(j.e3),children:"Cancel"}),(0,l.jsx)(t.esZ,{title:D,children:(0,l.jsx)(t.wpx,{className:"ml-2",type:"primary",htmlType:"submit",loading:a,disabled:!n&&C===_||N,"data-testid":"save-btn",children:"Save"})})]})]}),(0,l.jsx)(x.Z,{isOpen:b,onClose:v,onConfirm:()=>O(s),title:"Change role to Approver",testId:"downgrade-to-approver-confirmation-modal",continueButtonText:"Yes",message:(0,l.jsx)(t.xvT,{children:"Switching to an approver role will remove all assigned systems. Do you wish to proceed?"})})]})}})},A=a(61038),P=a(55484),T=a(25980),N=a(40324),O=a(96006),I=a(7426),z=a(42478),q=a(76174),U=a(91317),D=a(16125),Z=a(36835),W=a(31883),K=a(52253);let L=(e,s,a)=>{var l;try{localStorage.removeItem(K.xH)}catch(e){}e((0,Z.kS)()),null==a||null===(l=a.onClose)||void 0===l||l.call(a),s.push(K._e)},V=P.Ry().shape({password:O.a.label("Password"),passwordConfirmation:P.Z_().required().oneOf([P.iH("password")],"Passwords must match").label("Password confirmation")}),B={password:"",passwordConfirmation:""},Y=e=>{let s=(0,t.qY0)(),a=(0,t.pmc)(),[l]=(0,y.ls)(),n=(0,h.useRouter)(),i=(0,D.I0)(),d=(0,r.C)(Z.dy),o=async t=>{let r=await l({id:e,new_password:t.password});(0,W.D4)(r)?a((0,w.Vo)((0,m.e$)(r.error))):(a((0,w.t5)("Successfully reset user's password. Please inform the user of their new password.")),s.onClose(),(null==d?void 0:d.id)===e&&L(i,n))};return{...s,handleResetPassword:o}};var F=e=>{let{id:s}=e,{handleResetPassword:a,isOpen:n,onClose:i,onOpen:r}=Y(s);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.wpx,{onClick:r,"data-testid":"reset-password-btn",children:"Reset password"}),(0,l.jsxs)(t.u_l,{isCentered:!0,isOpen:n,onClose:i,children:[(0,l.jsx)(t.ZAr,{}),(0,l.jsx)(t.hzk,{children:(0,l.jsx)(c.J9,{initialValues:B,validationSchema:V,onSubmit:a,children:e=>{let{isSubmitting:s,dirty:a,isValid:n}=e;return(0,l.jsxs)(c.l0,{children:[(0,l.jsx)(t.xBx,{children:"Reset Password"}),(0,l.jsx)(t.olH,{}),(0,l.jsx)(t.fef,{children:(0,l.jsxs)(t.Kqy,{direction:"column",spacing:4,children:[(0,l.jsx)(t.xvT,{mb:2,children:"Choose a new password for this user."}),(0,l.jsx)(N.j0,{name:"password",label:"Password",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",autoComplete:"new-password"}),(0,l.jsx)(N.j0,{name:"passwordConfirmation",label:"Confirm Password",placeholder:"********",type:"password",tooltip:"Must match above password.",autoComplete:"confirm-password"})]})}),(0,l.jsx)(t.mzw,{children:(0,l.jsxs)("div",{className:"w-full gap-2",children:[(0,l.jsx)(t.wpx,{onClick:i,className:"w-1/2",children:"Cancel"}),(0,l.jsx)(t.wpx,{type:"primary",disabled:!a||!n,loading:s,htmlType:"submit",className:"w-1/2","data-testid":"submit-btn",children:"Change Password"})]})})]})}})})]})]})};let $=e=>{let s=(0,t.qY0)(),a=(0,t.pmc)(),[l,n]=(0,u.useState)(""),[i,r]=(0,u.useState)(""),[d,{isLoading:o}]=(0,y.ev)(),c=(0,h.useRouter)(),m=(0,D.I0)(),p=!!(e&&i&&l),x=async()=>{p&&d({id:e,old_password:l,new_password:i}).unwrap().then(()=>{a((0,w.t5)("Password updated")),L(m,c,{onClose:s.onClose})})};return{...s,changePasswordValidation:p,handleChange:e=>{"oldPassword"===e.target.name?n(e.target.value):r(e.target.value)},handleChangePassword:x,isLoading:o,newPasswordValue:i,oldPasswordValue:l}};var H=e=>{let{id:s}=e,{changePasswordValidation:a,handleChange:n,handleChangePassword:i,isLoading:r,isOpen:d,newPasswordValue:o,oldPasswordValue:c,onClose:h,onOpen:u}=$(s);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.wpx,{onClick:u,"data-testid":"update-password-btn",children:"Update password"}),(0,l.jsxs)(t.u_l,{isCentered:!0,isOpen:d,onClose:h,children:[(0,l.jsx)(t.ZAr,{}),(0,l.jsxs)(t.hzk,{children:[(0,l.jsx)(t.xBx,{children:"Update Password"}),(0,l.jsx)(t.olH,{}),(0,l.jsx)(t.fef,{pb:6,children:(0,l.jsxs)(t.Kqy,{direction:"column",spacing:"15px",children:[(0,l.jsx)(t.NIc,{children:(0,l.jsx)(t.IIB,{isRequired:!0,name:"oldPassword",onChange:n,placeholder:"Old Password",type:"password",value:c,"data-testid":"input-oldPassword"})}),(0,l.jsx)(t.NIc,{children:(0,l.jsx)(t.IIB,{isRequired:!0,name:"newPassword",onChange:n,placeholder:"New Password",type:"password",value:o,"data-testid":"input-newPassword"})})]})}),(0,l.jsxs)(t.mzw,{children:[(0,l.jsx)(t.wpx,{onClick:h,className:"mr-2 w-1/2",children:"Cancel"}),(0,l.jsx)(t.wpx,{type:"primary",disabled:!a,loading:r,onClick:i,htmlType:"submit",className:"mr-3 w-1/2","data-testid":"submit-btn",children:"Change Password"})]})]})]})]})},M=()=>{var e;let s=(0,r.C)(y.Ux),a=(0,r.C)(U.dy),n=!!a&&a.id===s,{data:i}=(0,y.gU)(null!=s?s:"",{skip:!s});return(null==i?void 0:null===(e=i.roles)||void 0===e?void 0:e.includes(d.A7.EXTERNAL_RESPONDENT))?null:(0,l.jsx)(t.xuv,{children:s?(0,l.jsxs)(t.Ugi,{children:[n?(0,l.jsx)(H,{id:s}):null,(0,l.jsx)(o.ZP,{scopes:[d.Sh.USER_PASSWORD_RESET],children:(0,l.jsx)(F,{id:s})})]}):null})};let X=(e,s,a,l)=>!e||e&&!s||e&&s&&!0===a&&!!l,G=(e,s,a)=>!!(e&&s&&a),J=(e,s,a,l,t,n)=>!!e&&!s&&X(a,l,t,n),Q=(e,s,a,l)=>X(e,s,a,l),ee={username:"",first_name:"",email_address:"",last_name:"",password:"",password_login_enabled:!1},es=(e,s,a,l,t)=>P.Ry().shape({username:P.Z_().required().label("Username"),email_address:P.Z_().email().required().label("Email address"),first_name:P.Z_().label("First name"),last_name:P.Z_().label("Last name"),password:P.Z_().when(["password_login_enabled"],{is:n=>J(e,s,a,l,t,n),then:()=>O.a.label("Password"),otherwise:()=>P.Z_().optional().label("Password")}),password_login_enabled:P.O7().label("Allow password login")});var ea=e=>{let{onSubmit:s,initialValues:a,canEditNames:n}=e,i=(0,h.useRouter)(),d=(0,t.pmc)(),o=(0,r.T)(),u=(0,t.qY0)(),{data:p}=(0,z.jc)(),{data:x}=(0,q.qv)();(0,I.tB)({api_set:!1});let g=(0,r.C)(y.ZC),b=(0,r.C)(I.iR),{plus:v}=(0,T.hz)(),_=(null==p?void 0:p.enabled)||!1,C=(null==b?void 0:b.allow_username_password_login)||!1,k=!g,S=!k&&!n,E=x&&x.length>0||!1,R=G(v,E,C),P=null!=a?a:ee;g&&"password_login_enabled"in g&&(P={...P,password_login_enabled:!!g.password_login_enabled});let O=es(k,_,v,E,C),U=async e=>{let a=J(k,_,v,E,C,e.password_login_enabled),l={username:e.username,email_address:e.email_address,first_name:e.first_name,last_name:e.last_name};R&&(l.password_login_enabled=e.password_login_enabled),a&&e.password&&(l.password=e.password);let t=await s(l);if((0,m.D4)(t)){d((0,w.Vo)((0,m.e$)(t.error)));return}d((0,w.t5)("".concat(k?"User created. By default, new users are set to the Viewer role. To change the role, please go to the Permissions tab.":"User updated."))),(null==t?void 0:t.data)&&o((0,y.Vv)(t.data.id))};return(0,l.jsx)(c.J9,{onSubmit:U,initialValues:P,validationSchema:O,"data-testid":"user-form",children:e=>{let{dirty:s,isSubmitting:a,isValid:n,values:r}=e;return(0,l.jsx)(c.l0,{children:(0,l.jsxs)(t.Kqy,{maxW:["xs","xs","100%"],width:"100%",spacing:7,children:[(0,l.jsxs)(t.Kqy,{spacing:6,maxWidth:"55%",children:[(0,l.jsxs)(t.kCb,{children:[(0,l.jsxs)(t.xvT,{display:"flex",alignItems:"center",fontSize:"sm",fontWeight:"semibold",children:["Profile"," ",(null==g?void 0:g.disabled)&&(0,l.jsx)(t.j8w,{color:"success",className:"ml-2","data-testid":"invite-sent-badge",children:"Invite sent"})]}),(0,l.jsx)(t.xuv,{marginLeft:"auto",children:(0,l.jsxs)(t.Ugi,{children:[Q(v,E,C||!1,r.password_login_enabled)&&(0,l.jsx)(M,{"data-testid":"password-management"}),k?null:(0,l.jsxs)(t.xuv,{children:[(0,l.jsx)(t.wpx,{"aria-label":"delete",icon:(0,l.jsx)(f.l,{}),onClick:u.onOpen,"data-testid":"delete-user-btn"}),(0,l.jsx)(A.Z,{user:g,...u})]})]})})]}),(0,l.jsx)(N.j0,{name:"username",label:"Username",variant:"block",placeholder:"Enter new username",disabled:!k,isRequired:!0,"data-testid":"input-username"}),(0,l.jsx)(N.j0,{name:"email_address",label:"Email address",variant:"block",placeholder:"Enter email of user",isRequired:!0,"data-testid":"input-email-address"}),(0,l.jsx)(N.j0,{name:"first_name",label:"First name",variant:"block",placeholder:"Enter first name of user",disabled:S,"data-testid":"input-first-name"}),(0,l.jsx)(N.j0,{name:"last_name",label:"Last name",variant:"block",placeholder:"Enter last name of user",disabled:S,"data-testid":"input-last-name"}),R&&(0,l.jsx)(N.w8,{name:"password_login_enabled",label:"Allow password login",tooltip:"When enabled, user can log in with username and password. When disabled, user must use SSO.",variant:"stacked",isDisabled:!k,"data-testid":"toggle-allow-password-login",size:"default"}),J(k,_,v,E,C,r.password_login_enabled)&&(0,l.jsx)(N.j0,{name:"password",label:"Password",variant:"block",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",isRequired:!0,"data-testid":"input-password"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(t.wpx,{onClick:()=>i.push(j.e3),className:"mr-3","data-testid":"cancel-btn",children:"Cancel"}),(0,l.jsx)(t.wpx,{htmlType:"submit",type:"primary",disabled:!s||!n,loading:a,"data-testid":"save-user-btn",children:"Save"})]})]})})}})},el=e=>{let{onSubmit:s,initialValues:a,...n}=e,c=(0,r.C)(y.Ux);(0,y.Fk)(c,{skip:!c});let h=(0,o.Tg)([d.Sh.USER_PERMISSION_UPDATE]),u=!c||!h,m=[{label:"Profile",key:"profile",children:(0,l.jsx)(ea,{onSubmit:s,initialValues:a,...n})},{label:"Permissions",key:"permissions",children:(0,l.jsxs)(t.kCb,{gap:"97px",children:[(0,l.jsx)(t.xuv,{w:{base:"100%",md:"50%",xl:"50%"},children:(0,l.jsx)(R,{})}),(0,l.jsx)(t.xuv,{position:"absolute",top:"96px",right:6,height:"calc(100% + 100px)",overflowY:"scroll",padding:6,w:"35%",borderLeftWidth:"1px",children:(0,l.jsx)(i,{})})]}),disabled:u,forceRender:!u}];return(0,l.jsx)(t.A5g,{items:m})}},31883:function(e,s,a){a.d(s,{Bw:function(){return l.Bw},D4:function(){return l.D4}});var l=a(19043)}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3696],{83696:function(e,s,a){a.d(s,{Z:function(){return el}});var l=a(24246),t=a(20595),n=a(91437),i=()=>(0,l.jsxs)(t.xuv,{children:[(0,l.jsx)(t.xuv,{pb:4,fontSize:"18px",fontWeight:"semibold",children:"Role Description"}),(0,l.jsx)(t.gCW,{spacing:4,children:n.K.map(e=>(0,l.jsxs)(t.xuv,{width:"100%",padding:4,borderRadius:"md",backgroundColor:"gray.75",fontSize:"14px",children:[(0,l.jsx)(t.xuv,{fontWeight:"semibold",children:e.label}),(0,l.jsx)(t.xuv,{color:"gray.700",children:e.description})]},e.roleKey))})]}),r=a(16134),d=a(39449),o=a(19904),c=a(34090),h=a(86677),u=a(27378),m=a(812),p=a(46238),x=a(58452),j=a(77830),w=a(46628),g=a(26917),b=a(1315),f=a(95492),y=a(65497);let v=e=>{let{assignedSystems:s,onAssignedSystemChange:a}=e,n=(0,r.C)(y.Ux);if((0,y.d6)(n,{skip:!n}),0===s.length)return null;let i=e=>{a(s.filter(s=>s.fides_key!==e.fides_key))};return(0,l.jsxs)(t.iA_,{size:"sm","data-testid":"assign-systems-delete-table",children:[(0,l.jsx)(t.hrZ,{children:(0,l.jsxs)(t.Tr,{children:[(0,l.jsx)(t.Th,{children:"System"}),(0,l.jsx)(t.Th,{})]})}),(0,l.jsx)(t.p3B,{children:s.map(e=>(0,l.jsxs)(t.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,l.jsx)(t.Td,{children:e.name}),(0,l.jsx)(t.Td,{textAlign:"end",children:(0,l.jsx)(t.wpx,{"aria-label":"Unassign system from user",icon:(0,l.jsx)(f.l,{}),onClick:()=>i(e),"data-testid":"unassign-btn"})})]},e.fides_key))})]})};var _=e=>{let{allSystems:s,assignedSystems:a,onChange:n}=e,i=e=>{a.find(s=>s.fides_key===e.fides_key)?n(a.filter(s=>s.fides_key!==e.fides_key)):n([...a,e])};return(0,l.jsx)(t.xuv,{overflowY:"auto",maxHeight:"300px",children:(0,l.jsxs)(t.iA_,{size:"sm","data-testid":"assign-systems-table",maxHeight:"50vh",overflowY:"scroll",children:[(0,l.jsx)(t.hrZ,{position:"sticky",top:0,background:"white",zIndex:1,children:(0,l.jsxs)(t.Tr,{children:[(0,l.jsx)(t.Th,{children:"System"}),(0,l.jsx)(t.Th,{children:"Assign"})]})}),(0,l.jsx)(t.p3B,{children:s.map(e=>{let s=!!a.find(s=>s.fides_key===e.fides_key);return(0,l.jsxs)(t.Tr,{_hover:{bg:"gray.50"},"data-testid":"row-".concat(e.fides_key),children:[(0,l.jsx)(t.Td,{children:e.name}),(0,l.jsx)(t.Td,{children:(0,l.jsx)(t.rAg,{checked:s,onChange:()=>i(e),"data-testid":"assign-switch"})})]},e.fides_key)})})]})})};let C=(e,s)=>{var a,l;return(null===(a=e.name)||void 0===a?void 0:a.toLocaleLowerCase().includes(s.toLocaleLowerCase()))||(null===(l=e.description)||void 0===l?void 0:l.toLocaleLowerCase().includes(s.toLocaleLowerCase()))};var k=e=>{let{isOpen:s,onClose:a,assignedSystems:n,onAssignedSystemChange:i}=e,{data:r}=(0,b.K3)(),[d,o]=(0,u.useState)(""),[c,h]=(0,u.useState)(n),m=async()=>{i(c),a()},p=!r||0===r.length,x=(0,u.useMemo)(()=>r?r.filter(e=>C(e,d)):[],[r,d]),j=(0,u.useMemo)(()=>{let e=new Set(c.map(e=>e.fides_key));return x.every(s=>e.has(s.fides_key))},[x,c]);return(0,l.jsxs)(t.u_l,{isOpen:s,onClose:a,size:"2xl",children:[(0,l.jsx)(t.ZAr,{}),(0,l.jsxs)(t.hzk,{p:8,"data-testid":"confirmation-modal",children:[(0,l.jsxs)(t.xBx,{fontWeight:"medium",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,l.jsx)(t.xvT,{children:"Assign systems"}),(0,l.jsxs)(t.j8w,{color:"success",children:["Assigned to ",n.length," systems"]})]}),(0,l.jsx)(t.fef,{"data-testid":"assign-systems-modal-body",children:p?(0,l.jsx)(t.xvT,{children:"No systems found"}):(0,l.jsxs)(t.Kqy,{spacing:4,children:[(0,l.jsxs)(t.kCb,{justifyContent:"space-between",children:[(0,l.jsx)(t.xvT,{fontSize:"sm",flexGrow:1,fontWeight:"medium",children:"Assign systems in your organization to this user"}),(0,l.jsx)(t.xuv,{children:(0,l.jsxs)(t.NIc,{display:"flex",alignItems:"center",children:[(0,l.jsx)(t.lXp,{fontSize:"sm",htmlFor:"assign-all-systems",mb:"0",children:"Assign all systems"}),(0,l.jsx)(t.rAg,{size:"small",id:"assign-all-systems",checked:j,onChange:e=>{e&&r?h(x):h(r?r.filter(e=>!x.includes(e)):[])},"data-testid":"assign-all-systems-toggle"})]})})]}),(0,l.jsx)(g.Z,{value:d,onChange:o,placeholder:"Search for systems","data-testid":"system-search",withIcon:!0}),(0,l.jsx)(_,{allSystems:x,assignedSystems:c,onChange:h})]})}),(0,l.jsx)(t.mzw,{justifyContent:"flex-start",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(t.wpx,{onClick:a,className:"mr-2","data-testid":"cancel-btn",children:"Cancel"}),p?null:(0,l.jsx)(t.wpx,{type:"primary",onClick:m,"data-testid":"confirm-btn",children:"Confirm"})]})})]})]})},S=e=>{let{label:s,roleKey:a,isSelected:n,isDisabled:i,assignedSystems:r,onAssignedSystemChange:o}=e,{setFieldValue:h}=(0,c.u6)(),u=(0,t.qY0)(),m=i?"You do not have sufficient permissions to assign this role.":void 0;return n?(0,l.jsxs)(t.Kqy,{borderRadius:"md",border:"1px solid",borderColor:"gray.200",p:4,backgroundColor:"gray.50","aria-selected":"true",spacing:4,"data-testid":"selected",children:[(0,l.jsxs)(t.kCb,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(t.xvT,{fontSize:"md",fontWeight:"semibold",children:s}),(0,l.jsx)(t.StI,{})]}),a!==d.A7.APPROVER&&a!==d.A7.RESPONDENT&&a!==d.A7.EXTERNAL_RESPONDENT?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(t.kCb,{alignItems:"center",children:[(0,l.jsx)(t.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"Assigned systems"}),(0,l.jsx)(p.b,{label:"Assigned systems refer to those systems that have been specifically allocated to a user for management purposes. Users assigned to a system possess full edit permissions and are listed as the Data Steward for the respective system."})]}),(0,l.jsx)(t.wpx,{disabled:i,title:m,type:"primary",size:"small",onClick:u.onOpen,"data-testid":"assign-systems-btn",children:"Assign systems +"}),(0,l.jsx)(v,{assignedSystems:r,onAssignedSystemChange:o}),u.isOpen?(0,l.jsx)(k,{isOpen:u.isOpen,onClose:u.onClose,assignedSystems:r,onAssignedSystemChange:o}):null]}):null]}):(0,l.jsx)(t.wpx,{onClick:()=>{h("roles",[a])},"data-testid":"role-option-".concat(s),title:m,disabled:i,children:s})};let E={roles:[]};var R=()=>{var e,s;let a=(0,t.pmc)(),i=(0,h.useRouter)(),g=(0,r.C)(y.Ux);(0,y.d6)(g,{skip:!g});let{isOpen:b,onOpen:f,onClose:v}=(0,t.qY0)(),_=(0,r.C)(y.R$),[C,k]=(0,u.useState)(_),[R]=(0,y.G$)();(0,u.useEffect)(()=>{k(_)},[_]);let{data:A,isLoading:P}=(0,y.gU)(null!=g?g:"",{skip:!g}),[T]=(0,y.lD)(),N=!!(null==A?void 0:null===(e=A.roles)||void 0===e?void 0:e.includes(d.A7.EXTERNAL_RESPONDENT)),O=async e=>{if(b&&v(),!g)return;let s=e.roles.includes(d.A7.APPROVER),l=await T({user_id:g,payload:{roles:e.roles}});if((0,m.D4)(l)){a((0,w.Vo)((0,m.e$)(l.error)));return}if(!s){let e=C.map(e=>e.fides_key),s=await R({userId:g,fidesKeys:e});if((0,m.D4)(s)){a((0,w.Vo)((0,m.e$)(s.error)));return}}a((0,w.t5)("Permissions updated"))},I=async e=>{g&&(C.length>0&&e.roles.includes(d.A7.APPROVER)?f():await O(e))},z=(0,o.Tg)([d.Sh.USER_PERMISSION_ASSIGN_OWNERS]);if(!g)return null;if(P)return(0,l.jsx)(t.$jN,{});if(!z&&(null==A?void 0:null===(s=A.roles)||void 0===s?void 0:s.includes(d.A7.OWNER)))return(0,l.jsx)(t.xvT,{"data-testid":"insufficient-access",children:"You do not have sufficient access to change this user's permissions."});let q=(null==A?void 0:A.roles)?{roles:A.roles}:E,U=n.K.filter(e=>N?e.roleKey===d.A7.EXTERNAL_RESPONDENT:e.roleKey!==d.A7.EXTERNAL_RESPONDENT),D=N?"External respondent role cannot be changed":void 0;return(0,l.jsx)(c.J9,{onSubmit:I,initialValues:q,enableReinitialize:!0,children:e=>{let{values:s,isSubmitting:a,dirty:n}=e;return(0,l.jsxs)(c.l0,{children:[(0,l.jsxs)(t.Kqy,{spacing:7,children:[(0,l.jsxs)(t.Kqy,{spacing:3,"data-testid":"role-options",children:[(0,l.jsxs)(t.kCb,{alignItems:"center",children:[(0,l.jsx)(t.xvT,{fontSize:"sm",fontWeight:"semibold",mr:1,children:"User role"}),(0,l.jsx)(p.b,{label:"A user's role in the organization determines what parts of the UI they can access and which functions are available to them."})]}),U.map(e=>{let a=s.roles.indexOf(e.roleKey)>=0,t=e.roleKey===d.A7.OWNER?!z:N;return(0,l.jsx)(S,{isSelected:a,isDisabled:t,assignedSystems:C,onAssignedSystemChange:k,...e},e.roleKey)}),!N&&(0,l.jsx)(t.esZ,{title:"To invite a new External respondent user, create a manual task integration and then click on the 'Manage secure access' button",children:(0,l.jsx)(t.wpx,{disabled:!0,"data-testid":"role-option-External respondent",children:"External respondent"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(t.wpx,{onClick:()=>i.push(j.e3),children:"Cancel"}),(0,l.jsx)(t.esZ,{title:D,children:(0,l.jsx)(t.wpx,{className:"ml-2",type:"primary",htmlType:"submit",loading:a,disabled:!n&&C===_||N,"data-testid":"save-btn",children:"Save"})})]})]}),(0,l.jsx)(x.Z,{isOpen:b,onClose:v,onConfirm:()=>O(s),title:"Change role to Approver",testId:"downgrade-to-approver-confirmation-modal",continueButtonText:"Yes",message:(0,l.jsx)(t.xvT,{children:"Switching to an approver role will remove all assigned systems. Do you wish to proceed?"})})]})}})},A=a(61038),P=a(55484),T=a(25980),N=a(40324),O=a(96006),I=a(7426),z=a(42478),q=a(76174),U=a(91317),D=a(16125),Z=a(36835),W=a(31883),K=a(52253);let L=(e,s,a)=>{var l;try{localStorage.removeItem(K.xH)}catch(e){}e((0,Z.kS)()),null==a||null===(l=a.onClose)||void 0===l||l.call(a),s.push(K._e)},V=P.Ry().shape({password:O.a.label("Password"),passwordConfirmation:P.Z_().required().oneOf([P.iH("password")],"Passwords must match").label("Password confirmation")}),B={password:"",passwordConfirmation:""},Y=e=>{let s=(0,t.qY0)(),a=(0,t.pmc)(),[l]=(0,y.ls)(),n=(0,h.useRouter)(),i=(0,D.I0)(),d=(0,r.C)(Z.dy),o=async t=>{let r=await l({id:e,new_password:t.password});(0,W.D4)(r)?a((0,w.Vo)((0,m.e$)(r.error))):(a((0,w.t5)("Successfully reset user's password. Please inform the user of their new password.")),s.onClose(),(null==d?void 0:d.id)===e&&L(i,n))};return{...s,handleResetPassword:o}};var F=e=>{let{id:s}=e,{handleResetPassword:a,isOpen:n,onClose:i,onOpen:r}=Y(s);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.wpx,{onClick:r,"data-testid":"reset-password-btn",children:"Reset password"}),(0,l.jsxs)(t.u_l,{isCentered:!0,isOpen:n,onClose:i,children:[(0,l.jsx)(t.ZAr,{}),(0,l.jsx)(t.hzk,{children:(0,l.jsx)(c.J9,{initialValues:B,validationSchema:V,onSubmit:a,children:e=>{let{isSubmitting:s,dirty:a,isValid:n}=e;return(0,l.jsxs)(c.l0,{children:[(0,l.jsx)(t.xBx,{children:"Reset Password"}),(0,l.jsx)(t.olH,{}),(0,l.jsx)(t.fef,{children:(0,l.jsxs)(t.Kqy,{direction:"column",spacing:4,children:[(0,l.jsx)(t.xvT,{mb:2,children:"Choose a new password for this user."}),(0,l.jsx)(N.j0,{name:"password",label:"Password",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",autoComplete:"new-password"}),(0,l.jsx)(N.j0,{name:"passwordConfirmation",label:"Confirm Password",placeholder:"********",type:"password",tooltip:"Must match above password.",autoComplete:"confirm-password"})]})}),(0,l.jsx)(t.mzw,{children:(0,l.jsxs)("div",{className:"w-full gap-2",children:[(0,l.jsx)(t.wpx,{onClick:i,className:"w-1/2",children:"Cancel"}),(0,l.jsx)(t.wpx,{type:"primary",disabled:!a||!n,loading:s,htmlType:"submit",className:"w-1/2","data-testid":"submit-btn",children:"Change Password"})]})})]})}})})]})]})};let $=e=>{let s=(0,t.qY0)(),a=(0,t.pmc)(),[l,n]=(0,u.useState)(""),[i,r]=(0,u.useState)(""),[d,{isLoading:o}]=(0,y.ev)(),c=(0,h.useRouter)(),m=(0,D.I0)(),p=!!(e&&i&&l),x=async()=>{p&&d({id:e,old_password:l,new_password:i}).unwrap().then(()=>{a((0,w.t5)("Password updated")),L(m,c,{onClose:s.onClose})})};return{...s,changePasswordValidation:p,handleChange:e=>{"oldPassword"===e.target.name?n(e.target.value):r(e.target.value)},handleChangePassword:x,isLoading:o,newPasswordValue:i,oldPasswordValue:l}};var H=e=>{let{id:s}=e,{changePasswordValidation:a,handleChange:n,handleChangePassword:i,isLoading:r,isOpen:d,newPasswordValue:o,oldPasswordValue:c,onClose:h,onOpen:u}=$(s);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.wpx,{onClick:u,"data-testid":"update-password-btn",children:"Update password"}),(0,l.jsxs)(t.u_l,{isCentered:!0,isOpen:d,onClose:h,children:[(0,l.jsx)(t.ZAr,{}),(0,l.jsxs)(t.hzk,{children:[(0,l.jsx)(t.xBx,{children:"Update Password"}),(0,l.jsx)(t.olH,{}),(0,l.jsx)(t.fef,{pb:6,children:(0,l.jsxs)(t.Kqy,{direction:"column",spacing:"15px",children:[(0,l.jsx)(t.NIc,{children:(0,l.jsx)(t.IIB,{isRequired:!0,name:"oldPassword",onChange:n,placeholder:"Old Password",type:"password",value:c,"data-testid":"input-oldPassword"})}),(0,l.jsx)(t.NIc,{children:(0,l.jsx)(t.IIB,{isRequired:!0,name:"newPassword",onChange:n,placeholder:"New Password",type:"password",value:o,"data-testid":"input-newPassword"})})]})}),(0,l.jsxs)(t.mzw,{children:[(0,l.jsx)(t.wpx,{onClick:h,className:"mr-2 w-1/2",children:"Cancel"}),(0,l.jsx)(t.wpx,{type:"primary",disabled:!a,loading:r,onClick:i,htmlType:"submit",className:"mr-3 w-1/2","data-testid":"submit-btn",children:"Change Password"})]})]})]})]})},M=()=>{var e;let s=(0,r.C)(y.Ux),a=(0,r.C)(U.dy),n=!!a&&a.id===s,{data:i}=(0,y.gU)(null!=s?s:"",{skip:!s});return(null==i?void 0:null===(e=i.roles)||void 0===e?void 0:e.includes(d.A7.EXTERNAL_RESPONDENT))?null:(0,l.jsx)(t.xuv,{children:s?(0,l.jsxs)(t.Ugi,{children:[n?(0,l.jsx)(H,{id:s}):null,(0,l.jsx)(o.ZP,{scopes:[d.Sh.USER_PASSWORD_RESET],children:(0,l.jsx)(F,{id:s})})]}):null})};let X=(e,s,a,l)=>!e||e&&!s||e&&s&&!0===a&&!!l,G=(e,s,a)=>!!(e&&s&&a),J=(e,s,a,l,t,n)=>!!e&&!s&&X(a,l,t,n),Q=(e,s,a,l)=>X(e,s,a,l),ee={username:"",first_name:"",email_address:"",last_name:"",password:"",password_login_enabled:!1},es=(e,s,a,l,t)=>P.Ry().shape({username:P.Z_().required().label("Username"),email_address:P.Z_().email().required().label("Email address"),first_name:P.Z_().label("First name"),last_name:P.Z_().label("Last name"),password:P.Z_().when(["password_login_enabled"],{is:n=>J(e,s,a,l,t,n),then:()=>O.a.label("Password"),otherwise:()=>P.Z_().optional().label("Password")}),password_login_enabled:P.O7().label("Allow password login")});var ea=e=>{let{onSubmit:s,initialValues:a,canEditNames:n}=e,i=(0,h.useRouter)(),d=(0,t.pmc)(),o=(0,r.T)(),u=(0,t.qY0)(),{data:p}=(0,z.jc)(),{data:x}=(0,q.qv)();(0,I.tB)({api_set:!1});let g=(0,r.C)(y.ZC),b=(0,r.C)(I.iR),{plus:v}=(0,T.hz)(),_=(null==p?void 0:p.enabled)||!1,C=(null==b?void 0:b.allow_username_password_login)||!1,k=!g,S=!k&&!n,E=x&&x.length>0||!1,R=G(v,E,C),P=null!=a?a:ee;g&&"password_login_enabled"in g&&(P={...P,password_login_enabled:!!g.password_login_enabled});let O=es(k,_,v,E,C),U=async e=>{let a=J(k,_,v,E,C,e.password_login_enabled),l={username:e.username,email_address:e.email_address,first_name:e.first_name,last_name:e.last_name};R&&(l.password_login_enabled=e.password_login_enabled),a&&e.password&&(l.password=e.password);let t=await s(l);if((0,m.D4)(t)){d((0,w.Vo)((0,m.e$)(t.error)));return}d((0,w.t5)("".concat(k?"User created. By default, new users are set to the Viewer role. To change the role, please go to the Permissions tab.":"User updated."))),(null==t?void 0:t.data)&&o((0,y.Vv)(t.data.id))};return(0,l.jsx)(c.J9,{onSubmit:U,initialValues:P,validationSchema:O,"data-testid":"user-form",children:e=>{let{dirty:s,isSubmitting:a,isValid:n,values:r}=e;return(0,l.jsx)(c.l0,{children:(0,l.jsxs)(t.Kqy,{maxW:["xs","xs","100%"],width:"100%",spacing:7,children:[(0,l.jsxs)(t.Kqy,{spacing:6,maxWidth:"55%",children:[(0,l.jsxs)(t.kCb,{children:[(0,l.jsxs)(t.xvT,{display:"flex",alignItems:"center",fontSize:"sm",fontWeight:"semibold",children:["Profile"," ",(null==g?void 0:g.disabled)&&(0,l.jsx)(t.j8w,{color:"success",className:"ml-2","data-testid":"invite-sent-badge",children:"Invite sent"})]}),(0,l.jsx)(t.xuv,{marginLeft:"auto",children:(0,l.jsxs)(t.Ugi,{children:[Q(v,E,C||!1,r.password_login_enabled)&&(0,l.jsx)(M,{"data-testid":"password-management"}),k?null:(0,l.jsxs)(t.xuv,{children:[(0,l.jsx)(t.wpx,{"aria-label":"delete",icon:(0,l.jsx)(f.l,{}),onClick:u.onOpen,"data-testid":"delete-user-btn"}),(0,l.jsx)(A.Z,{user:g,...u})]})]})})]}),(0,l.jsx)(N.j0,{name:"username",label:"Username",variant:"block",placeholder:"Enter new username",disabled:!k,isRequired:!0,"data-testid":"input-username"}),(0,l.jsx)(N.j0,{name:"email_address",label:"Email address",variant:"block",placeholder:"Enter email of user",isRequired:!0,"data-testid":"input-email-address"}),(0,l.jsx)(N.j0,{name:"first_name",label:"First name",variant:"block",placeholder:"Enter first name of user",disabled:S,"data-testid":"input-first-name"}),(0,l.jsx)(N.j0,{name:"last_name",label:"Last name",variant:"block",placeholder:"Enter last name of user",disabled:S,"data-testid":"input-last-name"}),R&&(0,l.jsx)(N.w8,{name:"password_login_enabled",label:"Allow password login",tooltip:"When enabled, user can log in with username and password. When disabled, user must use SSO.",variant:"stacked",isDisabled:!k,"data-testid":"toggle-allow-password-login",size:"default"}),J(k,_,v,E,C,r.password_login_enabled)&&(0,l.jsx)(N.j0,{name:"password",label:"Password",variant:"block",placeholder:"********",type:"password",tooltip:"Password must contain at least 8 characters, 1 number, 1 capital letter, 1 lowercase letter, and at least 1 symbol.",isRequired:!0,"data-testid":"input-password"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(t.wpx,{onClick:()=>i.push(j.e3),className:"mr-3","data-testid":"cancel-btn",children:"Cancel"}),(0,l.jsx)(t.wpx,{htmlType:"submit",type:"primary",disabled:!s||!n,loading:a,"data-testid":"save-user-btn",children:"Save"})]})]})})}})},el=e=>{let{onSubmit:s,initialValues:a,...n}=e,c=(0,r.C)(y.Ux);(0,y.Fk)(c,{skip:!c});let h=(0,o.Tg)([d.Sh.USER_PERMISSION_UPDATE]),u=!c||!h,m=[{label:"Profile",key:"profile",children:(0,l.jsx)(ea,{onSubmit:s,initialValues:a,...n})},{label:"Permissions",key:"permissions",children:(0,l.jsxs)(t.kCb,{gap:"97px",children:[(0,l.jsx)(t.xuv,{w:{base:"100%",md:"50%",xl:"50%"},children:(0,l.jsx)(R,{})}),(0,l.jsx)(t.xuv,{position:"absolute",top:"96px",right:6,height:"calc(100% + 100px)",overflowY:"scroll",padding:6,w:"35%",borderLeftWidth:"1px",children:(0,l.jsx)(i,{})})]}),disabled:u,forceRender:!u}];return(0,l.jsx)(t.A5g,{items:m})}},31883:function(e,s,a){a.d(s,{Bw:function(){return l.Bw},D4:function(){return l.D4}});var l=a(19043)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3700],{30454:function(e,s,t){var a=t(40699);e.exports=function(e){return a(e,5)}},77867:function(e,s,t){"use strict";var a=t(24246),i=t(20595);s.Z=e=>{let{connected:s,...t}=e,n="red.500";return null==s?n="gray.300":s&&(n="green.500"),(0,a.jsx)(i.xuv,{width:"12px",height:"12px",borderRadius:"6px",backgroundColor:n,...t})}},59301:function(e,s,t){"use strict";var a=t(24246);let{Link:i}=t(20595).AntTypography;s.Z=e=>{let{children:s,...t}=e;return(0,a.jsx)(i,{target:"_blank",rel:"noopener noreferrer",...t,children:s})}},83099:function(e,s,t){"use strict";var a=t(24246),i=t(79283),n=t(34929);s.Z=e=>{let{selectedTaxonomies:s,showDisabled:t=!1,...r}=e,{getDataUseDisplayNameProps:l,getDataUses:o}=(0,n.Z)(),d=(t?o():o().filter(e=>e.active)).filter(e=>!(null==s?void 0:s.includes(e.fides_key))).map(e=>{let{name:s,primaryName:t}=l(e.fides_key);return{value:e.fides_key,name:s,primaryName:t,description:e.description||""}});return(0,a.jsx)(i.l,{options:d,...r})}},71248:function(e,s,t){"use strict";t.d(s,{A:function(){return o}});var a=t(24246),i=t(34090),n=t(46782),r=t(97181),l=t(40324);let o=e=>{var s,t;let{name:o,fieldSchema:d,isRequired:c,layout:u="stacked",secretsSchema:p,validate:m}=e,h=(null===(t=d.allOf)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.$ref)&&d.allOf[0].$ref!==n.j?null==p?void 0:p.definitions[d.allOf[0].$ref.replace("#/definitions/","")]:void 0,x=!!(null==h?void 0:h.enum)||d.options,y="boolean"===d.type,g=()=>{var e;if((null===(e=d.allOf)||void 0===e?void 0:e[0].$ref)===n.j)return"Enter dataset.collection.field"};return(0,a.jsx)(i.gN,{id:o,name:o,validate:m,children:e=>{let{field:s}=e;if(x){var t,i,n;let e=null!==(n=null==h?void 0:null===(t=h.enum)||void 0===t?void 0:t.map(e=>({label:e,value:e})))&&void 0!==n?n:null===(i=d.options)||void 0===i?void 0:i.map(e=>({label:e,value:e}));return(0,a.jsx)(r.d,{name:s.name,id:s.name,label:d.title,isRequired:c,tooltip:d.description,layout:u,options:e,mode:d.multiselect?"multiple":void 0},s.name)}return y?(0,a.jsx)(r.d,{name:s.name,id:s.name,label:d.title,isRequired:c,tooltip:d.description,layout:u,options:[{label:"False",value:"false"},{label:"True",value:"true"}]},s.name):(0,a.jsx)(l.j0,{...s,label:d.title,tooltip:d.description,isRequired:c,type:d.sensitive?"password":"text",placeholder:g(),autoComplete:"off",color:"gray.700",variant:u})}},o)}},16220:function(e,s,t){"use strict";t.d(s,{V:function(){return n}});var a=t(25980),i=t(77830);let n=()=>({systemOrDatamapRoute:(0,a.hz)().plus?i.oG:i.So})},90111:function(e,s,t){"use strict";var a=t(24246),i=t(20595);s.Z=e=>{let{children:s,...t}=e;return(0,a.jsx)(i.xuv,{p:4,mb:4,border:"1px solid",borderColor:"gray.200",bgColor:"gray.50",borderRadius:"md",...t,children:s})}},26183:function(e,s,t){"use strict";var a=t(24246);t(27378),s.Z=e=>{let{children:s,className:t,...i}=e;return(0,a.jsx)("div",{className:"relative flex w-full flex-wrap items-center gap-2 overflow-x-auto py-2 ".concat(t||""),...i,children:s})}},3765:function(e,s,t){"use strict";var a=t(20595),i=t(812),n=t(46628),r=t(32885),l=t(1315),o=t(39449),d=t(31883);let c=(e,s)=>{let t=[],a=[];return Object.entries(e).forEach(e=>{let[i,n]=e;n?t.push({id:i,value:n,resource_id:s,custom_field_definition_id:i}):a.push(i)}),{upsert:t,delete:a,resource_type:o.P6.PRIVACY_DECLARATION,resource_id:s}};s.Z=e=>{let s=(0,a.pmc)(),[t]=(0,l.qQ)(),[o]=(0,r._D)(),u=t=>!!e.privacy_declarations.find(e=>e.data_use===t.data_use&&e.name===t.name)&&(s((0,n.Vo)("A declaration already exists with that data use in this system. Please supply a different data use.")),!0),p=e=>{let{systemResult:t,customFieldsResult:a,isDelete:r}=e;if((0,d.D4)(t)){let e=(0,i.e$)(t.error,"An unexpected error occurred while updating the system. Please try again.");s((0,n.Vo)(e));return}if(a&&(0,d.D4)(a)){let e=(0,i.e$)(a.error,"Data use was updated, but an error occurred while updating custom fields. Please try again.");s((0,n.Vo)(e));return}return s((0,n.t5)(r?"Data use deleted":"Data use saved")),t.data.privacy_declarations},m=async(s,a,i,n)=>{let r;let l=s.map(e=>{var s;return{...e,name:null!==(s=e.name)&&void 0!==s?s:""}}),d={...e,privacy_declarations:l},u=await t(d);if(i&&n){var m,h;let e=null==u?void 0:null===(h=u.data)||void 0===h?void 0:null===(m=h.privacy_declarations)||void 0===m?void 0:m.find(e=>e.data_use===n);if(e){let s=c(i,e.id);r=await o(s)}}return p({systemResult:u,customFieldsResult:r,isDelete:a})};return{createDataUse:async t=>{if(u(t))return;let{customFieldValues:a,...i}=t;return s.closeAll(),m([...e.privacy_declarations,i],!1,a,i.data_use)},updateDataUse:async(s,t)=>{if(t.id!==s.id&&u(t))return;let{customFieldValues:a,...i}=t;return m(e.privacy_declarations.map(e=>e.id===s.id?i:e),!1,a,i.data_use)},deleteDataUse:async s=>m(e.privacy_declarations.filter(e=>e.id!==s.id),!0),deleteDeclarationByDataUse:async s=>m(e.privacy_declarations.filter(e=>e.data_use!==s),!0)}}},73183:function(e,s,t){"use strict";var a=t(24246),i=t(20595);t(27378);var n=t(14207);s.Z=e=>{let{connection_key:s,disabled:t,name:r,access_type:l,connection_type:o,isSwitch:d}=e,{isOpen:c,onOpen:u,onClose:p}=(0,i.qY0)(),[m,h]=(0,n.XX)(),x=async()=>{await m({key:s,name:r,disabled:!t,access:l,connection_type:o}),p()},y=()=>{h.isLoading||p()};return(0,a.jsxs)(a.Fragment,{children:[d?(0,a.jsxs)(i.kCb,{justifyContent:"space-between",alignItems:"center",children:[(0,a.jsx)(i.xvT,{fontSize:"sm",children:"Enable integration"}),(0,a.jsx)(i.rAg,{className:"ml-2",checked:!t,onChange:()=>u()})]}):(0,a.jsx)(i.sNh,{_focus:{color:"complimentary.500",bg:"gray.100"},onClick:u,children:(0,a.jsx)(i.xvT,{fontSize:"sm",children:t?"Enable":"Disable"})}),(0,a.jsxs)(i.u_l,{isCentered:!0,isOpen:c,onClose:y,children:[(0,a.jsx)(i.ZAr,{}),(0,a.jsxs)(i.hzk,{children:[(0,a.jsxs)(i.xBx,{children:[t?"Enable":"Disable"," Connection"]}),(0,a.jsx)(i.olH,{}),(0,a.jsx)(i.fef,{pb:6,children:(0,a.jsx)(i.Kqy,{direction:"column",spacing:"15px",children:(0,a.jsxs)(i.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:[t?"Enabling":"Disabling"," a connection may impact any privacy request that is currently in progress. Do you wish to proceed?"]})})}),(0,a.jsxs)(i.mzw,{className:"flex gap-4",children:[(0,a.jsx)(i.wpx,{onClick:y,className:"w-1/2",children:"Cancel"}),(0,a.jsxs)(i.wpx,{onClick:x,loading:h.isLoading,className:"w-1/2",children:[t?"Enable":"Disable"," Connection"]})]})]})]})]})}},8627:function(e,s,t){"use strict";t.d(s,{s:function(){return l}});var a=t(24246),i=t(20595),n=t(77867),r=t(16394);let l=e=>{let{succeeded:s,timestamp:t}=e,l=t?(0,r.p6)(t):"";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z,{connected:s}),(0,a.jsx)(i.xvT,{color:"gray.500",fontSize:"xs",fontWeight:"semibold",lineHeight:"16px",ml:"10px",children:t?"Last tested on ".concat(l):"This connection has not been tested yet"})]})}},19812:function(e,s,t){"use strict";t.d(s,{t:function(){return l}});var a=t(17245),i=t(14207),n=t(27378),r=t(41966);let l=e=>{var s,t,l;let{connectionConfig:o}=e,[d]=(0,i.S6)(),{data:c}=(0,i.Eg)(null!==(t=null==o?void 0:o.key)&&void 0!==t?t:""),u=null!==(l=null==c?void 0:null===(s=c.items)||void 0===s?void 0:s.map(e=>e.fides_key))&&void 0!==l?l:[],p=u.map(e=>({label:e,value:e})),{data:m}=(0,r.LH)({onlyUnlinkedDatasets:!0,minimal:!0}),h=(0,n.useMemo)(()=>{var e;return null!==(e=null==m?void 0:m.map(e=>({value:e.fides_key,label:"".concat(e.name," (").concat(e.fides_key,")")||0})))&&void 0!==e?e:[]},[m]),{errorAlert:x,successAlert:y}=(0,a.VY)();return{dropdownOptions:[...p,...h],initialDatasets:u,patchConnectionDatasetConfig:async function(e,s){var t,a,i;let{showSuccessAlert:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null!==(i=null===(t=e.dataset)||void 0===t?void 0:t.map(e=>({fides_key:e,ctl_dataset_fides_key:e})))&&void 0!==i?i:[],l=await d({connection_key:s,dataset_pairs:r}).unwrap();(null===(a=l.failed)||void 0===a?void 0:a.length)>0?x(l.failed[0].message):n&&y("Dataset successfully updated!")}}}},72774:function(e,s,t){"use strict";t.d(s,{Z:function(){return r}});var a=t(24246),i=t(20595),n=e=>{let{title:s,description:t,button:n}=e;return(0,a.jsxs)(i.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",py:4,px:6,"data-testid":"empty-state",children:[(0,a.jsx)(i.iid,{alignSelf:"start",color:"blue.400",mt:.5}),(0,a.jsxs)(i.xuv,{flexGrow:1,children:[(0,a.jsx)(i.xvT,{fontWeight:"bold",fontSize:"sm",mb:1,children:s}),(0,a.jsx)(i.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:t})]}),n]})},r=()=>(0,a.jsx)(i.xuv,{mb:"6",maxW:"720px","data-testid":"locked-for-GVL-notice",children:(0,a.jsx)(n,{title:"This system is part of the TCF Global Vendor List (GVL)",description:(0,a.jsxs)(a.Fragment,{children:["As a result, certain fields are not editable as they come directly from Fides Compass and the Global Vendor List (GVL). In some cases, where the legal basis has been declared to be flexible, you may update the legal basis for particular data uses."," ",(0,a.jsx)(i.rUS,{href:"https://fid.es/tcf_gvl",isExternal:!0,color:"complimentary.500",children:"For more information on the Global Vendor List, click here."})]})})})},69525:function(e,s,t){"use strict";t.d(s,{U:function(){return a}});let a=e=>{let s=e.data_categories.flatMap(e=>e.split(","));return{data_use:e.data_use,data_categories:s,features:e.features,legal_basis_for_processing:e.legal_basis_for_processing,flexible_legal_basis_for_processing:e.flexible_legal_basis_for_processing,retention_period:e.retention_period?e.retention_period:""}}},21103:function(e,s,t){"use strict";t.d(s,{Z:function(){return sJ}});var a,i,n,r,l=t(24246),o=t(20595),d=t(79894),c=t.n(d),u=t(86677),p=t.n(u),m=t(27378),h=t(16134),x=t(25980),y=t(45938),g=t(16220),_=t(77830),f=t(84720),b=t(14908),v=t(46628),j=t(26089),k=t(19904),w=t(16394),C=t(20682),S=t(41337);let D=e=>{let{connectionConfig:s,hiddenTypes:t=[]}=e,a=(0,h.C)(C.pw),{data:i}=(0,C.$I)(a),n=(0,m.useMemo)(()=>(null==i?void 0:i.items)||[],[i]),[r,l]=(0,m.useState)(),o=(0,m.useMemo)(()=>[...n].filter(e=>!t.includes(e.identifier)).sort((e,s)=>e.human_readable>s.human_readable?1:-1),[n,t]),d=(0,m.useMemo)(()=>{let e=new Map;return null==o||o.map(s=>e.set(s.human_readable,{value:s})),e},[o]),c=(0,m.useMemo)(()=>{var e;return(null===(e=n.find(e=>e.identifier===(null==s?void 0:s.connection_type)||(null==s?void 0:s.saas_config)&&e.identifier===(null==s?void 0:s.saas_config.type)))||void 0===e?void 0:e.type)||"ethyca"},[s,n]);return(0,m.useMemo)(()=>{let e=n.find(e=>(null==s?void 0:s.saas_config)&&e.identifier===(null==s?void 0:s.saas_config.type)||e.identifier===(null==s?void 0:s.connection_type));e&&l(e)},[s,n]),{dropDownOptions:d,selectedValue:r,setSelectedValue:l,systemType:c}};var T=e=>{var s;let{disabled:t,hasClear:a=!0,label:i,list:n,onChange:r,selectedValue:d}=e,c=(0,m.useRef)(null),[u,p]=(0,m.useState)(!1),[h,x]=(0,m.useState)(""),y=()=>{p(!1)},g=null===(s=[...n].find(e=>{let[,s]=e;return s.value.identifier===(null==d?void 0:d.identifier)}))||void 0===s?void 0:s[0],_=(0,m.useCallback)(e=>{(0===e.target.value.length||e.target.value.length>1)&&(x(e.target.value),setTimeout(()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.focus()},0))},[]),f=(0,m.useMemo)(()=>(0,w.Ds)(_,100),[_]),b=(0,m.useMemo)(()=>[...n].filter(e=>e[0].toLowerCase().includes(h.toLowerCase())),[n,h]);return(0,l.jsxs)(o.v2r,{isLazy:!0,onClose:y,onOpen:()=>{p(!0)},strategy:"fixed",matchWidth:!0,children:[(0,l.jsx)(o.j2t,{"aria-label":null!=g?g:i,as:o.wpx,color:g?"complimentary.500":void 0,disabled:t,icon:(0,l.jsx)(o.mCO,{}),iconPosition:"end",className:"!bg-transparent text-left hover:bg-transparent active:bg-transparent","data-testid":"select-dropdown-btn",width:"272px",children:(0,l.jsx)(o.xvT,{noOfLines:1,style:{wordBreak:"break-all"},children:null!=g?g:i})}),u?(0,l.jsxs)(o.qyq,{id:"MENU_LIST",lineHeight:"1rem",p:"0",maxHeight:"400px",overflow:"hidden","data-testid":"select-dropdown-list",width:"272px",children:[(0,l.jsx)(o.xuv,{px:"8px",mt:2,children:(0,l.jsxs)(o.BZy,{size:"sm",children:[(0,l.jsx)(o.Z8_,{pointerEvents:"none",children:(0,l.jsx)(o.PTu,{color:"gray.300",h:"17px",w:"17px"})}),(0,l.jsx)(o.IIB,{"data-testid":"input-search-integrations",ref:c,autoComplete:"off",autoFocus:!0,borderRadius:"md",name:"search",onChange:f,placeholder:"Search integrations",size:"sm",type:"search"})]})}),a&&(0,l.jsx)(o.kCb,{borderBottom:"1px",borderColor:"gray.200",cursor:"auto",p:"8px",children:(0,l.jsx)(o.wpx,{onClick:()=>{r(void 0),x(""),y()},size:"small",children:"Clear"})}),(0,l.jsx)(o.xuv,{overflowY:"auto",maxHeight:"272px",children:b.map(e=>{let[s,t]=e;return(0,l.jsx)(o.esZ,{title:t.toolTip,placement:"rightTop",mouseEnterDelay:.5,children:(0,l.jsxs)(o.sNh,{color:d===t.value?"complimentary.500":void 0,isDisabled:t.isDisabled,onClick:()=>r(t.value),paddingTop:"10px",paddingRight:"8.5px",paddingBottom:"10px",paddingLeft:"8.5px",_focus:{bg:"gray.100"},children:[(0,l.jsx)(S.ZP,{data:(0,S.PT)(t.value)}),(0,l.jsx)(o.xvT,{ml:2,fontSize:"0.75rem",noOfLines:1,wordBreak:"break-all",children:s})]})},s)})})]}):null]})},A=t(17245),E=t(1315),q=t(39449),R=t(84306),I=t(14207),L=t(59301),F=(0,o.IUT)({displayName:"RightArrow",viewBox:"0 0 16 16",d:"M10.7814 7.33312L7.20541 3.75712L8.14808 2.81445L13.3334 7.99979L8.14808 13.1851L7.20541 12.2425L10.7814 8.66645H2.66675V7.33312H10.7814Z"}),z=t(19812),O=e=>{let{status:s,failure_reason:t}=e;if("error"===s){let e="Connection test failed.";return t&&(e+=" ".concat(t)),(0,l.jsx)(o.xvT,{"data-testid":"toast-error-msg",children:e})}return(0,l.jsx)(o.xvT,{"data-testid":"toast-success-msg",children:"Connection test was successful"})},Z=t(8627),P=t(32885),W=t(65450),N=t(40324),U=t(34090),V=t(55484),B=t(97181),M=t(57072),K=t(5785),H=t(27259);let Y=e=>{let{isSubmitting:s=!1,onCancelClick:t}=e;return(0,l.jsxs)(o.hE2,{size:"sm",spacing:"8px",variant:"outline",children:[(0,l.jsx)(o.zxk,{onClick:t,variant:"outline",children:"Cancel"}),(0,l.jsx)(o.zxk,{bg:"primary.800",color:"white",isDisabled:s,isLoading:s,loadingText:"Submitting",size:"sm",variant:"solid",type:"submit",_active:{bg:"primary.500"},_disabled:{opacity:"inherit"},_hover:{bg:"primary.400"},children:"Save"})]})};var G=e=>{let{data:s=[],isSubmitting:t=!1,onSaveClick:a,onCancel:i}=e,{isLoading:n}=(0,M.MO)(),r=(0,h.C)(K.qb),{errorAlert:d}=(0,A.VY)();return n?null:(0,l.jsx)(U.J9,{enableReinitialize:!0,initialValues:{fields:s.length>0?s:[{pii_field:"",dsr_package_label:"",data_categories:[]}]},onSubmit:(e,s)=>{if(new Set(e.fields.map(e=>e.pii_field)).size<e.fields.length){d("PII Field must be unique");return}a(e,s)},validateOnBlur:!1,validateOnChange:!1,validationSchema:V.Ry({fields:V.IX().of(V.Ry().shape({pii_field:V.Z_().required("PII Field is required").min(1,"PII Field must have at least one character").max(200,"PII Field has a maximum of 200 characters").label("PII Field"),dsr_package_label:V.Z_().required("DSR Package Label is required").min(1,"DSR Package Label must have at least one character").max(200,"DSR Package Label has a maximum of 200 characters").label("DSR Package Label"),data_categories:V.IX(V.Z_()).label("Data Categories")}))}),children:e=>(0,l.jsx)(U.l0,{style:{marginTop:0},noValidate:!0,children:(0,l.jsx)(o.gCW,{align:"stretch",children:(0,l.jsx)(U.F2,{name:"fields",render:s=>{let{fields:a}=e.values;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(o.Ugi,{color:"gray.900",flex:"1",fontSize:"14px",fontWeight:"semibold",lineHeight:"20px",mb:"6px",spacing:"24px",children:[(0,l.jsx)(o.xuv,{w:"416px",children:"PII Field"}),(0,l.jsx)(o.xuv,{w:"416px",children:"DSR Package Label"}),(0,l.jsx)(o.xuv,{w:"416px",children:"Data Categories"}),(0,l.jsx)(o.xuv,{visibility:"hidden",children:(0,l.jsx)(o.lr0,{})})]}),(0,l.jsx)(o.xuv,{children:a&&a.length>0?a.map((e,t)=>(0,l.jsxs)(o.Ugi,{mt:t>0?"12px":void 0,spacing:"24px",align:"flex-start",children:[(0,l.jsx)(o.xuv,{minH:"57px",w:"416px",children:(0,l.jsx)(H.Z,{autoFocus:0===t,isRequired:!0,name:"fields.".concat(t,".pii_field")})}),(0,l.jsx)(o.xuv,{minH:"57px",w:"416px",children:(0,l.jsx)(H.Z,{isRequired:!0,name:"fields.".concat(t,".dsr_package_label")})}),(0,l.jsx)(o.xuv,{minH:"57px",w:"416px",children:(0,l.jsx)(B.d,{name:"fields.".concat(t,".data_categories"),options:r.map(e=>({value:e.fides_key,label:e.fides_key})),isRequired:!0,mode:"multiple"})}),(0,l.jsx)(o.xuv,{h:"57px",visibility:t>0?"visible":"hidden",children:(0,l.jsx)(o.lr0,{onClick:()=>s.remove(t),_hover:{cursor:"pointer"}})})]},t)):null}),(0,l.jsx)(o.wpx,{className:"my-6",onClick:()=>{s.push({pii_field:"",dsr_package_label:"",data_categories:[]})},children:"Add new PII field"}),(0,l.jsx)(Y,{isSubmitting:t,onCancelClick:i})]})}})})})})},$=e=>{let{connectionConfig:s}=e,t=(0,m.useRef)(!1),{successAlert:a}=(0,A.VY)(),{handleError:i}=(0,A.HK)(),[n,r]=(0,m.useState)(!1),[d,c]=(0,m.useState)([]),{isOpen:u,onOpen:p,onClose:h}=(0,o.qY0)(),{data:x,isFetching:y,isLoading:g,isSuccess:_}=(0,I.QV)(s?s.key:"",{skip:!s}),[f]=(0,I.jF)(),[b]=(0,I._d)(),v=async(e,t)=>{try{r(!0);let t={connection_key:s.key,body:{...e}};d.length>0?await b(t).unwrap():await f(t).unwrap(),a("DSR customization ".concat(d.length>0?"updated":"added","!"))}catch(e){i(e)}finally{r(!1)}};(0,m.useEffect)(()=>(t.current=!0,_&&x&&c(x.fields),()=>{t.current=!1}),[x,_]);let j=(0,l.jsx)(o.wpx,{disabled:!s||n,loading:n,onClick:p,children:"Customize DSR"});return(0,l.jsxs)(l.Fragment,{children:[s?j:(0,l.jsx)(o.esZ,{title:"Save an Integration first to customize the DSR",placement:"top",children:j}),(0,l.jsxs)(o.u_l,{isCentered:!0,isOpen:u,size:"lg",onClose:h,children:[(0,l.jsx)(o.ZAr,{}),(0,l.jsxs)(o.hzk,{minWidth:"775px",children:[(0,l.jsx)(o.xBx,{children:"Customize DSR"}),(0,l.jsx)(o.olH,{}),(0,l.jsx)(o.fef,{pb:6,children:(0,l.jsxs)(o.gCW,{align:"stretch",gap:"16px",children:[(0,l.jsx)(o.xuv,{color:"gray.700",fontSize:"14px",children:'Customize your PII fields to create a friendly label name for your privacy request packages. This "Package Label" is the label your user will see in their downloaded package.'}),(y||g)&&(0,l.jsx)(o.M5Y,{children:(0,l.jsx)(o.$jN,{})}),t.current&&!g?(0,l.jsx)(G,{data:d,isSubmitting:n,onSaveClick:v,onCancel:h}):null]})})]})]})]})},Q=t(98784),J=t.n(Q),X=t(71248),ee=t(46782),es=t(73183),et=t(95492),ea=e=>{let{onDelete:s,deleteResult:t}=e,{isOpen:a,onOpen:i,onClose:n}=(0,o.qY0)(),r=()=>{(!t.isLoading&&t.isSuccess||!t.isLoading&&t.isUninitialized)&&n()};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.LZC,{}),(0,l.jsxs)(o.kCb,{alignItems:"center",children:[(0,l.jsx)(o.xvT,{fontSize:"sm",children:"Delete integration"}),(0,l.jsx)(o.wpx,{"aria-label":"Delete integration",icon:(0,l.jsx)(et.l,{}),disabled:t.isLoading,onClick:i,className:"ml-2"})]})]}),(0,l.jsxs)(o.u_l,{isCentered:!0,isOpen:a,onClose:r,children:[(0,l.jsx)(o.ZAr,{}),(0,l.jsxs)(o.hzk,{children:[(0,l.jsx)(o.xBx,{children:"Delete integration"}),(0,l.jsx)(o.olH,{}),(0,l.jsx)(o.fef,{pb:6,children:(0,l.jsx)(o.Kqy,{direction:"column",spacing:"15px",children:(0,l.jsx)(o.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:"Deleting an integration may impact any privacy request that is currently in progress. Do you wish to proceed?"})})}),(0,l.jsxs)(o.mzw,{children:[(0,l.jsx)(o.wpx,{onClick:r,className:"w-1/2",children:"Cancel"}),(0,l.jsx)(o.wpx,{onClick:()=>{s()},loading:t.isLoading,type:"primary",className:"w-1/2",children:"Delete integration"})]})]})]})]})},ei=t(99792);let en=(e,s)=>{let t={...e};return s&&Object.entries(s.properties).forEach(e=>{let[s,a]=e;if("secrets"in t||(t.secrets={}),"integer"===a.type)t.secrets[s]=a.default?Number(a.default):0;else{var i;t.secrets[s]=null!==(i=a.default)&&void 0!==i?i:""}}),t},er=(e,s)=>{let t=e.replace(/[^A-Za-z0-9\-_]/g,"");return t.includes(s.identifier)||(t+="_".concat(s.identifier)),s.type===ei.Z.SAAS&&(t+="_api"),t},el=e=>{let{secretsSchema:s,defaultValues:t,isSubmitting:a=!1,isAuthorizing:i=!1,onSaveClick:n,onTestConnectionClick:r,onTestDatasetsClick:d,onAuthorizeConnectionClick:c,testButtonLabel:u="Test integration",connectionOption:p,connectionConfig:m,initialDatasets:h,datasetDropdownOptions:y,isCreatingConnectionConfig:g,onDelete:_,deleteResult:f}=e,[b,{isLoading:v,isFetching:j}]=(0,I.h2)(),{plus:k}=(0,x.hz)(),{getFieldValidation:w,preprocessValues:C}=(0,ee.l)(s),S=async(e,s)=>{Object.keys(await s.validateForm()).length>0||c(C(e))},D=async e=>{Object.keys(await e.validateForm()).length>0||r(await b(m.key))},T=(null==m?void 0:m.disabled)||!1;return(0,l.jsx)(U.J9,{enableReinitialize:!0,initialValues:(()=>{let e={...t};if(null==m?void 0:m.key){var a,i;return e.name=null!==(i=m.name)&&void 0!==i?i:"",e.description=m.description,e.instance_key=m.connection_type===q.Rj.SAAS?null===(a=m.saas_config)||void 0===a?void 0:a.fides_key:m.key,e.enabled_actions=(m.enabled_actions||[]).map(e=>e.toString()),e.secrets=m.secrets?J().cloneDeep(m.secrets):{},e.dataset=h,(null==s?void 0:s.properties)&&Object.entries(s.properties).forEach(t=>{var a,i;let[n,r]=t;if((null===(a=r.allOf)||void 0===a?void 0:a[0].$ref)===ee.j){let s=e.secrets[n];s&&(e.secrets[n]="".concat(s.dataset,".").concat(s.field))}if((null===(i=s.properties[n])||void 0===i?void 0:i.type)==="boolean"){let s=e.secrets[n];"boolean"==typeof s&&(e.secrets[n]=s.toString())}}),e}return J().isEmpty(e.enabled_actions)&&(e.enabled_actions=p.supported_actions.map(e=>e.toString())),en(e,s)})(),onSubmit:(e,s)=>{n(C(e),s)},validateOnBlur:!0,children:e=>{var t;let n=!e.dirty&&(null==m?void 0:m.authorized);return(0,l.jsx)(U.l0,{children:(0,l.jsxs)(o.gCW,{align:"stretch",gap:"16px",children:[(0,l.jsxs)("div",{className:"flex flex-row",children:[m?(0,l.jsx)(es.Z,{connection_key:null==m?void 0:m.key,disabled:T,connection_type:null==m?void 0:m.connection_type,access_type:null==m?void 0:m.access,name:null!==(t=null==m?void 0:m.name)&&void 0!==t?t:m.key,isSwitch:!0}):null,m?(0,l.jsx)(ea,{onDelete:_,deleteResult:f}):null]}),!!(null==m?void 0:m.key)&&(0,l.jsx)(N.j0,{name:"instance_key",id:"instance_key",label:"Integration identifier",isRequired:!0,disabled:!!(null==m?void 0:m.key),tooltip:"The fides_key will allow fidesops to associate dataset field references appropriately. Must be a unique alphanumeric value with no spaces (underscores allowed) to represent this integration."},"instance_key"),s?Object.entries(s.properties).map(e=>{var t;let[a,i]=e;return"advanced_settings"===a?null:(0,l.jsx)(X.A,{name:"secrets.".concat(a),fieldSchema:i,isRequired:null===(t=s.required)||void 0===t?void 0:t.includes(a),secretsSchema:s,validate:w(a,i),layout:"inline"},"secrets.".concat(a))}):null,k&&(0,l.jsx)(B.d,{name:"enabled_actions",id:"enabled_actions",label:"Request types",isRequired:!0,layout:"inline",mode:"multiple",tooltip:"The request types that are supported for this integration",options:p.supported_actions.map(e=>({label:J().upperFirst(e),value:e}))},"enabled_actions"),q.Zi.DATABASE===p.type&&!g&&(0,l.jsx)(B.d,{name:"dataset",id:"dataset",tooltip:"Select datasets to associate with this integration",label:"Datasets",options:y,layout:"inline",mode:"multiple"}),(0,l.jsxs)("div",{className:"flex gap-4",children:[!p.authorization_required||n?(0,l.jsx)(o.wpx,{disabled:!(null==m?void 0:m.key)||a||f.isLoading,loading:v||j,onClick:()=>D(e),"data-testid":"test-connection-button",children:u}):null,k&&q.Zi.DATABASE===p.type&&!J().isEmpty(h)&&(0,l.jsx)(o.wpx,{onClick:()=>d(),children:"Test datasets"}),p.authorization_required&&!n?(0,l.jsx)(o.wpx,{loading:i,onClick:()=>S(e.values,e),children:"Authorize integration"}):null,p.type===q.Zi.MANUAL?(0,l.jsx)($,{connectionConfig:m}):null,(0,l.jsx)(o.LZC,{}),(0,l.jsx)(o.wpx,{type:"primary",disabled:f.isLoading||a,loading:a,htmlType:"submit","data-testid":"save-integration-btn",children:"Save"})]})]})})}})},eo=async(e,s,t,a,i)=>{let n={description:e.description||"",instance_key:er(a,t),saas_connector_type:t.identifier,secrets:{},...e.enabled_actions?{enabled_actions:e.enabled_actions}:{}},r={systemFidesKey:a,connectionConfig:n};return Object.entries(s.properties).forEach(s=>{r.connectionConfig.secrets[s[0]]=e.secrets[s[0]]}),await i(r).unwrap()},ed=async(e,s,t,a,i)=>{var n;let r=a?a.key:er(t,s),l={access:q.uv.WRITE,connection_type:s.type===q.Zi.SAAS?s.type:s.identifier,description:e.description,key:r,...e.enabled_actions?{enabled_actions:e.enabled_actions}:{}},o=await i({systemFidesKey:t,connectionConfigs:[l]}).unwrap();if((null===(n=o.failed)||void 0===n?void 0:n.length)>0){let e=o.failed[0].message;throw Object.assign(Error(e),{data:{detail:e}})}return o},ec=async(e,s,t,a,i)=>{let n={systemFidesKey:t,secrets:{}};return(Object.entries(s.properties).forEach(s=>{s[0]in a&&e.secrets[s[0]]===a[s[0]]||(n.secrets[s[0]]=e.secrets[s[0]])}),0===Object.keys(n.secrets).length)?Promise.resolve():await i(n).unwrap()},eu=e=>{let{secretsSchema:s,systemFidesKey:t,connectionOption:a,connectionConfig:i,setSelectedConnectionOption:n}=e,{successAlert:r}=(0,R.V)(),{handleError:l}=(0,A.HK)(),[o,d]=(0,m.useState)(!1),[c,u]=(0,m.useState)(!1),{dropdownOptions:p,patchConnectionDatasetConfig:h,initialDatasets:y}=(0,z.t)({connectionConfig:i}),[g]=(0,I.NG)(),[_]=(0,P.IB)(),[f]=(0,I.rO)(),[b]=(0,W.Zh)(),[v]=(0,W.qd)(),[j]=(0,P.kg)(),[k,w]=(0,W._w)(),{plus:C}=(0,x.hz)(),S=(0,m.useMemo)(()=>{var e;return null!==(e=null==i?void 0:i.secrets)&&void 0!==e?e:{}},[i]);return{isSubmitting:o,isAuthorizing:c,handleSubmit:async e=>{let n=!i;try{if(d(!0),a.type===q.Zi.SAAS&&n)i=(await eo(e,s,a,t,C?_:g)).connection;else{let n=await ed(e,a,t,i,C?j:v);i||a.type!==q.Zi.DATABASE||(i=n.succeeded[0]),a.type!==q.Zi.MANUAL&&await ec(e,s,t,S,b)}i&&e.dataset&&a.type===q.Zi.DATABASE&&await h(e,i.key,{showSuccessAlert:!1}),r("Integration successfully ".concat(n?"added":"updated","!"))}catch(e){l(e)}finally{d(!1)}},handleAuthorization:async e=>{let n=!i;try{u(!0),n?i=(await eo(e,s,a,t,g)).connection:await ec(e,s,t,S,b);let r=await f(i.key).unwrap();u(!1),setTimeout(()=>{window.location.href=r},0)}catch(e){l(e)}finally{u(!1)}},datasetDropdownOptions:p,initialDatasets:y,handleDelete:async()=>{try{await k(t),n(void 0),r("Integration successfully deleted!")}catch(e){l(e)}},deleteDatastoreConnectionResult:w}},ep=e=>{let{systemFidesKey:s,connectionOption:t,connectionConfig:a,setSelectedConnectionOption:i}=e,[n,r]=(0,m.useState)(),d=(0,o.pmc)(),c=t.type===q.Zi.MANUAL,{data:u}=(0,C.n3)(t.identifier,{skip:c}),{isSubmitting:h,isAuthorizing:x,handleSubmit:y,handleAuthorization:g,datasetDropdownOptions:_,initialDatasets:f,handleDelete:b,deleteDatastoreConnectionResult:j}=eu({secretsSchema:u,systemFidesKey:s,connectionOption:t,connectionConfig:a,setSelectedConnectionOption:i});return u||t.type===q.Zi.MANUAL?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(o.xuv,{borderRadius:"6px",border:"1px",borderColor:"gray.200",backgroundColor:"gray.50",fontSize:"14px",p:4,mb:4,children:[(0,l.jsxs)("div",{children:["Connect to your ",t.human_readable," environment by providing the information below. Once you have saved the form, you may test the integration to confirm that it's working correctly."]}),t.user_guide&&(0,l.jsx)("div",{style:{marginTop:"12px"},children:(0,l.jsxs)(L.Z,{href:t.user_guide,children:["View docs for help with this integration ",(0,l.jsx)(F,{})]})})]}),(0,l.jsx)(el,{secretsSchema:u,defaultValues:{description:"",instance_key:"",name:"",dataset:[]},isSubmitting:h,isAuthorizing:x,onSaveClick:y,onTestConnectionClick:e=>{var s,t;r(e);let a=(null===(s=e.data)||void 0===s?void 0:s.test_status)==="succeeded"?"success":"error";d({...v.MA,status:a,description:(0,l.jsx)(O,{status:a,failure_reason:null===(t=e.data)||void 0===t?void 0:t.failure_reason})})},onTestDatasetsClick:()=>{p().push("/systems/configure/".concat(s,"/test-datasets"))},onAuthorizeConnectionClick:g,connectionOption:t,connectionConfig:a,datasetDropdownOptions:_,initialDatasets:f,isCreatingConnectionConfig:!a,onDelete:b,deleteResult:j}),a?(0,l.jsxs)(o.kCb,{mt:"4",justifyContent:"between",alignItems:"center",children:[n&&n.data&&void 0!==n.fulfilledTimeStamp?(0,l.jsx)(Z.s,{succeeded:"succeeded"===n.data.test_status,timestamp:n.fulfilledTimeStamp}):(0,l.jsx)(Z.s,{succeeded:null==a?void 0:a.last_test_succeeded,timestamp:(null==a?void 0:a.last_test_timestamp)||""}),(0,l.jsx)(o.LZC,{})]}):null]}):null};var em=e=>{let{connectionConfigs:s,systemFidesKey:t}=e,{isOpen:a,onOpen:i,onClose:n}=(0,o.qY0)(),[r,d]=(0,m.useState)(null),{successAlert:c}=(0,A.VY)(),[u,{isLoading:p}]=(0,E.qd)(),x=(0,h.C)(C.pw),{data:y}=(0,C.$I)(x),g=(0,m.useMemo)(()=>(null==y?void 0:y.items)||[],[y]),{handleError:_}=(0,A.HK)(),f=()=>{p||(r&&d(null),n())},b=async()=>{try{if(r){var e;let s={...r,instance_key:r.connection_type===q.Rj.SAAS?null===(e=r.saas_config)||void 0===e?void 0:e.fides_key:r.key},a=g.find(e=>(null==r?void 0:r.saas_config)&&e.identifier===(null==r?void 0:r.saas_config.type)||e.identifier===(null==r?void 0:r.connection_type));(await ed(s,a,t,r,u)).succeeded[0]&&c("Integration successfully linked!"),d(null),n()}}catch(e){_(e)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.wpx,{onClick:i,children:"Link integration"}),(0,l.jsxs)(o.u_l,{isCentered:!0,isOpen:a,size:"lg",onClose:f,children:[(0,l.jsx)(o.ZAr,{}),(0,l.jsxs)(o.hzk,{children:[(0,l.jsx)(o.xBx,{children:"Unlinked Integrations"}),(0,l.jsx)(o.olH,{}),(0,l.jsx)(o.fef,{pb:6,children:(0,l.jsxs)(o.Kqy,{direction:"column",spacing:"15px",children:[(0,l.jsx)(o.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:"These are all the integrations that are not linked to a system. Please select an integration to link to a system."}),(0,l.jsx)(o.xuv,{maxHeight:"350px",height:"100%",overflowY:"auto",children:s.map(e=>(0,l.jsxs)(o.kCb,{flexDirection:"row",alignItems:"center",_hover:{bg:"gray.100",color:"gray.600"},bg:(null==r?void 0:r.key)===e.key?"gray.100":"unset",color:(null==r?void 0:r.key)===e.key?"gray.600":"unset",cursor:"pointer",onClick:()=>{d(e)},className:"mb-2",children:[(0,l.jsx)(S.ZP,{data:(0,S.El)(e),className:"mr-2"}),(0,l.jsx)(o.xvT,{children:e.name})]},e.key))})]})}),(0,l.jsxs)(o.mzw,{className:"flex gap-4",children:[(0,l.jsx)(o.wpx,{onClick:f,className:"w-1/2",children:"Cancel"}),(0,l.jsx)(o.wpx,{onClick:b,loading:p,disabled:!r||p,className:"w-1/2",children:"Link integration"})]})]})]})]})},eh=t(44553);let ex=[q.Rj.WEBSITE,q.Rj.TEST_WEBSITE];var ey=e=>{let{connectionConfig:s,systemFidesKey:t}=e,{dropDownOptions:a,selectedValue:i,setSelectedValue:n}=D({connectionConfig:s,hiddenTypes:ex}),r=(0,h.C)(I.dR),{data:d}=(0,I.AZ)({...r,orphaned_from_system:!0}),[c,u]=(0,m.useState)([]);(0,m.useEffect)(()=>{d&&u(d.items.filter(e=>!ex.includes(e.connection_type)))},[d]);let p=(0,o.qY0)();return(0,l.jsxs)(o.xuv,{id:"con-wrapper",px:6,children:[(0,l.jsxs)(o.kCb,{py:5,children:[(0,l.jsxs)(o.Kqy,{direction:{base:"column",lg:"row"},children:[(0,l.jsx)(T,{list:a,label:"Integration type",selectedValue:i,onChange:n,disabled:!!(s&&null!==s)}),!s&&c.length>0?(0,l.jsx)(em,{connectionConfigs:c,systemFidesKey:t}):null,(0,l.jsx)(k.ZP,{scopes:[q.Sh.CONNECTOR_TEMPLATE_REGISTER],children:(0,l.jsx)(o.wpx,{htmlType:"submit","data-testid":"upload-btn",onClick:p.onOpen,className:"ml-2",children:"Upload integration"})})]}),(0,l.jsx)(eh.Z,{isOpen:p.isOpen,onClose:p.onClose})]}),(null==i?void 0:i.type)&&[q.Zi.DATABASE,q.Zi.DATA_CATALOG,q.Zi.SAAS,q.Zi.MANUAL,q.Zi.EMAIL].includes(i.type)?(0,l.jsx)(ep,{connectionConfig:s,connectionOption:i,setSelectedConnectionOption:n,systemFidesKey:t}):null]})},eg=t(71922),e_=t(31883);let ef=e=>{let{item:s,options:t=[],onNoticeChange:a,isChild:i}=e,{external_id:n,name:r}=s,d="".concat(n,"-notice_id"),[c,,u]=(0,U.U$)(d),{setValue:p}=u;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(o.Ugi,{flexGrow:1,children:[i&&(0,l.jsx)(o.LqM,{}),(0,l.jsx)(o.lXp,{htmlFor:d,"data-testid":"consentable-item-label".concat(i?"-child":""),m:0,fontSize:"14px",fontWeight:i?"normal":"semibold",children:r})]}),(0,l.jsx)(o.WPr,{...c,id:d,allowClear:!0,placeholder:"None",options:t,onChange:e=>{p(e),a(s={...s,notice_id:e})},className:"w-full","data-testid":"consentable-item-select"})]})},eb=e=>{let{connectionKey:s,...t}=e,a=(0,o.pmc)(),{data:i,isLoading:n}=(0,P.EQ)(s),[r,{isLoading:d}]=(0,P.Am)(),c=(0,h.C)(eg.Zp),u=(0,h.C)(eg.G1),{data:p,isLoading:x}=(0,eg.J6)({page:c,size:u}),[y,g]=(0,m.useState)(),[_,f]=(0,m.useState)([]),b=(0,m.useMemo)(()=>null==y?void 0:y.reduce((e,s)=>{var t;return s.notice_id&&(e["".concat(s.external_id,"-notice_id")]=s.notice_id),(null===(t=s.children)||void 0===t?void 0:t.length)&&s.children.forEach(s=>{s.notice_id&&(e["".concat(s.external_id,"-notice_id")]=s.notice_id)}),e},{}),[y]),j=e=>{let s=e.notice_id;if(s){let e=null==p?void 0:p.items.filter(e=>e.id===s);if(null==e?void 0:e.length){var t;let s=(null===(t=e[0].children)||void 0===t?void 0:t.map(e=>e.id))||[];return _.filter(e=>s.includes(e.value))}}return _},k=async()=>{let e=await r({connectionKey:s,consentableItems:y});(0,e_.D4)(e)?a((0,v.Vo)("Failed to save bidirectional consent")):a({variant:"subtle",position:"top",duration:3e3,status:"success",isClosable:!0,description:(0,l.jsx)(o.xvT,{"data-testid":"toast-success-msg",children:"Your bidirectional consent settings have been successfully saved and applied."}),title:"Settings updated"})};if((0,m.useEffect)(()=>{i&&g(i)},[i]),(0,m.useEffect)(()=>{p&&f(p.items.map(e=>({label:e.name,value:e.id})))},[p]),n||x)return(0,l.jsx)(o.xuv,{borderWidth:"1px",borderRadius:"md",...t,children:(0,l.jsx)(o.OdW,{height:"35px"})});if(!y||!y.length||!p)return null;let w=(e,s)=>{g(y.map(t=>{if(s?t.external_id===s.external_id:t.external_id===e.external_id){if(s){var a;return{...t,children:null===(a=t.children)||void 0===a?void 0:a.map(s=>s.external_id===e.external_id?e:s)}}return e}return t}))};return(0,l.jsx)(o.xuv,{borderWidth:"1px",borderRadius:"md",...t,children:(0,l.jsx)(o.UQy,{allowMultiple:!0,"data-testid":"accordion-consent-automation",children:(0,l.jsxs)(o.Qdk,{border:"none",children:[(0,l.jsxs)(o.KFZ,{children:[(0,l.jsx)(o.xuv,{as:"span",flex:"1",textAlign:"left",children:(0,l.jsx)(o.xvT,{as:"h2",fontWeight:"semibold",fontSize:"sm",children:"Bidirectional consent"})}),(0,l.jsx)(o.XEm,{})]}),(0,l.jsxs)(o.Hk3,{p:5,fontSize:"sm","data-testid":"accordion-panel-consent-automation",children:[(0,l.jsx)(o.xvT,{mb:7,children:"Map consentable items, such as channels and subscriptions, from your integration to Fides privacy notices. This ensures that updates to consent preferences in either location remain accurate and up-to-date."}),(0,l.jsx)(U.J9,{initialValues:b||{},onSubmit:k,children:(0,l.jsxs)(U.l0,{children:[(0,l.jsx)(o.MIq,{columns:2,spacing:3,children:y.map(e=>{var s;return(0,l.jsxs)(m.Fragment,{children:[(0,l.jsx)(ef,{item:e,options:_,onNoticeChange:w}),null===(s=e.children)||void 0===s?void 0:s.map(s=>(0,l.jsx)(ef,{item:s,options:j(e),isChild:!0,onNoticeChange:s=>w(s,e)},s.external_id))]},e.external_id)})}),(0,l.jsx)(o.Ugi,{justifyContent:"flex-end",mt:3,children:(0,l.jsx)(o.wpx,{disabled:d,loading:d,type:"primary",htmlType:"submit","data-testid":"save-consent-automation",children:"Save"})})]})})]})]})})})};var ev=t(57865),ej=t(3124),ek=t.n(ej),ew=(0,o.IUT)({displayName:"NextArrow",viewBox:"0 0 12 12",d:"M6.58584 5.99999L4.11084 3.52499L4.81784 2.81799L7.99984 5.99999L4.81784 9.18199L4.11084 8.47499L6.58584 5.99999Z"}),eC=(0,o.IUT)({displayName:"PrevArrow",viewBox:"0 0 12 12",d:"M5.414 5.99999L7.889 8.47499L7.182 9.18199L4 5.99999L7.182 2.81799L7.889 3.52499L5.414 5.99999Z"});let eS=e=>{let s=new Date(e),t=navigator.language;return{formattedTime:s.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"}),formattedDate:s.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}},eD=e=>({privacy_declarations:"data uses",ingress:"sources",egress:"destinations"})[e]||e,eT=(e,s)=>{let t=new Set([...Object.keys(e),...Object.keys(s)]),a=[],i=[],n=[];return Array.from(t).forEach(t=>{let r=eD(t),l=e[t],o=s[t];if("boolean"==typeof l||"boolean"==typeof o||"number"==typeof l||"number"==typeof o){l!==o&&n.push(r);return}!((J().isNil(l)||J().isEmpty(l))&&(J().isNil(o)||J().isEmpty(o)))&&(J().isEqual(l,o)||(J().isNil(l)||J().isEmpty(l)?a.push(r):J().isNil(o)||J().isEmpty(o)?i.push(r):n.push(r)))}),{addedFields:a,removedFields:i,changedFields:n}},eA=e=>{let{edited_by:s,before:t,after:a,created_at:i}=e,n=[],r=[],o=[];t.custom_fields||a.custom_fields?{addedFields:n,removedFields:r,changedFields:o}=eT(t.custom_fields,a.custom_fields):{addedFields:n,removedFields:r,changedFields:o}=eT(t,a);let d=[];if(n.length>0&&d.push(["added ",(0,l.jsx)("b",{children:n.join(", ")})]),r.length>0&&d.push(["removed ",(0,l.jsx)("b",{children:r.join(", ")})]),o.length>0&&d.push(["changed ",(0,l.jsx)("b",{children:o.join(", ")})]),0===d.length)return null;let c=d.pop(),u=d.length>0?(0,l.jsxs)(l.Fragment,{children:[d.map((e,s)=>(0,l.jsxs)(m.Fragment,{children:[e,s<d.length-1?", ":""]},s)),d.length>=2?", and ":" and ",c]}):c,{formattedTime:p,formattedDate:h}=eS(i);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("b",{children:s})," ",u," on ",h," at ",p]})},eE=(e,s)=>{let t=e=>e.map(e=>{let t=s.find(s=>s.fides_key===e.fides_key);return t&&t.name?t.name:e.fides_key}),a={...e.before},i={...e.after};return a.ingress&&(a.ingress=t(a.ingress)),a.egress&&(a.egress=t(a.egress)),i.ingress&&(i.ingress=t(i.ingress)),i&&i.egress&&(i.egress=t(i.egress)),{...e,before:a,after:i}},eq=(e,s)=>{if(J().isEmpty(s))return e;let t=(e,s)=>{var t,a;return null!==(a=null===(t=s.find(s=>s.value===e))||void 0===t?void 0:t.label)&&void 0!==a?a:e};return{...e,before:{...e.before,vendor_id:t(e.before.vendor_id,s)},after:{...e.after,vendor_id:t(e.after.vendor_id,s)}}},eR=e=>{let s=e.before.privacy_declarations||[],t=e.after.privacy_declarations||[],a=new Set([...s,...t].map(e=>e.data_use)),i=[],n=[];return a.forEach(e=>{let a=s.find(s=>s.data_use===e)||{data_use:"",data_categories:[]},r=t.find(s=>s.data_use===e)||{data_use:"",data_categories:[]};i.push(a),n.push(r)}),{...e,before:{...e.before,privacy_declarations:i},after:{...e.after,privacy_declarations:n}}},eI=e=>{let s={...e.before.custom_fields},t={...e.after.custom_fields};return new Set([...Object.keys(s),...Object.keys(t)]).forEach(e=>{e in s||(s[e]=null),e in t||(t[e]=null)}),{...e,before:{...e.before,custom_fields:s},after:{...e.after,custom_fields:t}}},eL=e=>{if(!e.before.privacy_declarations||!e.before.privacy_declarations[0]||!e.before.privacy_declarations[0].custom_fields)return e;let s={...e.before.privacy_declarations[0].custom_fields},t=e.after.privacy_declarations&&e.after.privacy_declarations[0]?{...e.after.privacy_declarations[0].custom_fields}:{};return new Set([...Object.keys(s),...Object.keys(t)]).forEach(e=>{e in s||(s[e]=null),e in t||(t[e]=null)}),{...e,before:{...e.before,privacy_declarations:[{...e.before.privacy_declarations[0],custom_fields:s}]},after:{...e.after,privacy_declarations:[{...e.after.privacy_declarations[0],custom_fields:t}]}}},eF=(0,m.createContext)(null),ez=()=>(0,m.useContext)(eF);var eO=e=>{let{children:s,selectedHistory:t,formType:a}=e,i=(0,m.useMemo)(()=>({selectedHistory:t,formType:a}),[t,a]);return(0,l.jsx)(eF.Provider,{value:i,children:s})},eZ=t(62165),eP=t(30320),eW=e=>{let{heading:s,children:t}=e,{selectedHistory:a}=ez(),i=m.Children.toArray(t).filter(e=>{if(m.isValidElement(e)&&e.props.name){let{name:s}=e.props,t=J().get(null==a?void 0:a.before,s),i=J().get(null==a?void 0:a.after,s),n="boolean"!=typeof t&&"number"!=typeof t&&J().isEmpty(t),r="boolean"!=typeof i&&"number"!=typeof i&&J().isEmpty(i);return!n||!r}return!1});return 0===i.length?null:(0,l.jsx)(o.Kqy,{marginTop:"0px !important",children:(0,l.jsxs)(o.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,children:[(0,l.jsx)(o.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,l.jsx)(o.X6q,{as:"h3",size:"xs",children:s})}),(0,l.jsx)(o.Kqy,{children:i})]})})},eN=t(46238),eU=e=>{var s;let{label:t,tooltip:a,...i}=e,{selectedHistory:n,formType:r}=ez(),[d]=(0,U.U$)(i.name),c={...d,value:null!==(s=d.value)&&void 0!==s?s:[]},u=(0,m.useRef)(null),[p,h]=(0,m.useState)(null),[x,y]=(0,m.useState)([]),[g,_]=(0,m.useState)(!1);(0,m.useEffect)(()=>{let e=J().get(null==n?void 0:n.before,i.name)||[],s=J().get(null==n?void 0:n.after,i.name)||[];_(!J().isEqual(e,s)),y(e.length>s.length?e:s)},[n,i.name]),(0,m.useEffect)(()=>{u.current&&h(u.current.offsetHeight)},[x]);let f={};return g&&(f="before"===r?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,l.jsx)(o.NIc,{style:f,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,l.jsxs)(o.gCW,{alignItems:"start",children:[(0,l.jsxs)(o.kCb,{alignItems:"center",children:[(0,l.jsx)(N.__,{htmlFor:i.name,fontSize:"xs",my:0,mr:1,children:t}),(0,l.jsx)(eN.b,{label:a})]}),(0,l.jsx)(o.kCb,{wrap:"wrap",alignItems:"flex-start",ref:u,style:{minHeight:"".concat(p,"px")},children:(p?c.value:x).map((e,s)=>(0,l.jsx)(o.j8w,{color:"marble",className:"m-1",children:"object"==typeof e?e.fides_key:e},s))}),"before"===r&&g&&(0,l.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eV=e=>{var s;let{label:t,tooltip:a,...i}=e,{selectedHistory:n,formType:r}=ez(),[d]=(0,U.U$)(i),c={...d,value:null!==(s=d.value)&&void 0!==s?s:""},u=(0,m.useRef)(null),[p,h]=(0,m.useState)(null),[x,y]=(0,m.useState)(!1);(0,m.useEffect)(()=>{let e=J().get(null==n?void 0:n.before,i.name)||"",s=J().get(null==n?void 0:n.after,i.name)||"";y(!J().isEqual(e,s));let t=e.length>s.length?e:s;u.current&&(u.current.textContent=t,h(u.current.offsetHeight),u.current.textContent=c.value)},[n,i.name,c.value]);let g={};return x&&(g="before"===r?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,l.jsx)(o.NIc,{style:g,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,l.jsxs)(o.gCW,{alignItems:"start",children:[(0,l.jsxs)(o.kCb,{alignItems:"center",children:[(0,l.jsx)(N.__,{htmlFor:i.id||i.name,fontSize:"xs",my:0,mr:1,children:t}),(0,l.jsx)(eN.b,{label:a})]}),(0,l.jsx)(o.xvT,{fontSize:"14px",ref:u,style:{height:"".concat(p,"px")},children:c.value}),"before"===r&&x&&(0,l.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eB=e=>{let{customFields:s={},resourceType:t}=e,{idToCustomFieldDefinition:a}=(0,eP.m)({resourceType:t}),i=e=>Array.from(a.values()).some(s=>s.name===e&&!!s.allow_list_id),n=t===q.P6.SYSTEM?"custom_fields":"privacy_declarations[0].custom_fields",r=Object.keys(s).sort();return(0,l.jsx)(eW,{heading:"Custom fields",children:r.map(e=>i(e)?(0,l.jsx)(eU,{label:e,name:"".concat(n,".").concat(e)},e):(0,l.jsx)(eV,{label:e,name:"".concat(n,".").concat(e)},e))})},eM=e=>{let{label:s,tooltip:t,...a}=e,{selectedHistory:i,formType:n}=ez(),[r]=(0,U.U$)(a),d={...r,value:r.value},[c,u]=(0,m.useState)(!1);(0,m.useEffect)(()=>{u(J().get(null==i?void 0:i.before,a.name)!==J().get(null==i?void 0:i.after,a.name))},[i,a.name,d.value]);let p={};return c&&(p="before"===n?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,l.jsx)(o.NIc,{style:p,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,l.jsxs)(o.gCW,{alignItems:"start",minHeight:"46px",children:[(0,l.jsxs)(o.kCb,{alignItems:"center",children:[(0,l.jsx)(N.__,{htmlFor:a.id||a.name,fontSize:"xs",my:0,mr:1,children:s}),(0,l.jsx)(eN.b,{label:t})]}),void 0!==d.value&&(0,l.jsx)(o.j8w,{color:"marble",className:"m-1",children:d.value?"YES":"NO"}),"before"===n&&c&&(0,l.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eK=e=>{let{initialValues:s}=e,t=(0,eZ.hz)();return(0,l.jsx)(U.J9,{enableReinitialize:!0,initialValues:s,onSubmit:()=>{},children:()=>(0,l.jsx)(U.l0,{children:(0,l.jsxs)(o.Kqy,{children:[(0,l.jsxs)(eW,{heading:"System details",children:[t.dictionaryService?(0,l.jsx)(eV,{name:"vendor_id",label:"Vendor",tooltip:"Select the vendor that matches the system"}):null,(0,l.jsx)(eV,{name:"name",label:"System name",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”"}),(0,l.jsx)(eV,{name:"fides_key",label:"Unique ID",disabled:!0,tooltip:"An auto-generated unique ID based on the system name"}),(0,l.jsx)(eV,{name:"description",label:"Description",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”"}),(0,l.jsx)(eU,{name:"tags",label:"System Tags",tooltip:"Are there any tags to associate with this system?"})]}),(0,l.jsx)(eW,{heading:"Dataset reference",children:(0,l.jsx)(eU,{name:"dataset_references",label:"Dataset references",tooltip:"Is there a dataset configured for this system"})}),(0,l.jsxs)(eW,{heading:"Data processing properties",children:[(0,l.jsx)(eM,{name:"processes_personal_data",label:"This system processes personal data",tooltip:"Does this system process personal data?"}),(0,l.jsx)(eM,{name:"exempt_from_privacy_regulations",label:"This system is exempt from privacy regulations",tooltip:"Is this system exempt from privacy regulations?"}),(0,l.jsx)(eV,{name:"reason_for_exemption",label:"Reason for exemption",tooltip:"Why is this system exempt from privacy regulation?"}),(0,l.jsx)(eM,{name:"uses_profiling",label:"This system performs profiling",tooltip:"Does this system perform profiling that could have a legal effect?"}),(0,l.jsx)(eU,{name:"legal_basis_for_profiling",label:"Legal basis for profiling",tooltip:"What is the legal basis under which profiling is performed?"}),(0,l.jsx)(eM,{name:"does_international_transfers",label:"This system transfers data",tooltip:"Does this system transfer data to other countries or international organizations?"}),(0,l.jsx)(eU,{name:"legal_basis_for_transfers",label:"Legal basis for transfer",tooltip:"What is the legal basis under which the data is transferred?"}),(0,l.jsx)(eM,{name:"requires_data_protection_assessments",label:"This system requires Data Privacy Assessments",tooltip:"Does this system require (DPA/DPIA) assessments?"}),(0,l.jsx)(eV,{label:"DPIA/DPA location",name:"dpa_location",tooltip:"Where is the DPA/DPIA stored?"})]}),(0,l.jsxs)(eW,{heading:"Administrative properties",children:[(0,l.jsx)(eV,{label:"Data stewards",name:"data_stewards",tooltip:"Who are the stewards assigned to the system?"}),(0,l.jsx)(eV,{name:"privacy_policy",label:"Privacy policy URL",tooltip:"Where can the privacy policy be located?"}),(0,l.jsx)(eV,{name:"legal_name",label:"Legal name",tooltip:"What is the legal name of the business?"}),(0,l.jsx)(eV,{name:"legal_address",label:"Legal address",tooltip:"What is the legal address for the business?"}),(0,l.jsx)(eV,{label:"Department",name:"administrating_department",tooltip:"Which department is concerned with this system?"}),(0,l.jsx)(eU,{label:"Responsibility",name:"responsibility",tooltip:"What is the role of the business with regard to data processing?"}),(0,l.jsx)(eV,{name:"dpo",label:"Legal contact (DPO)",tooltip:"What is the official privacy contact information?"}),(0,l.jsx)(eV,{label:"Joint controller",name:"joint_controller_info",tooltip:"Who are the party or parties that share responsibility for processing data?"}),(0,l.jsx)(eV,{label:"Data security practices",name:"data_security_practices",tooltip:"Which data security practices are employed to keep the data safe?"})]}),(0,l.jsx)(eB,{customFields:s.custom_fields,resourceType:q.P6.SYSTEM}),s.privacy_declarations&&s.privacy_declarations.map((e,t)=>(0,l.jsxs)(m.Fragment,{children:[(0,l.jsxs)(eW,{heading:"Data use",children:[(0,l.jsx)(eV,{label:"Declaration name (optional)",name:"privacy_declarations[".concat(t,"].name"),tooltip:"Would you like to append anything to the system name?"}),(0,l.jsx)(eV,{name:"privacy_declarations[".concat(t,"].data_use"),label:"Data use",tooltip:"For which business purposes is this data used?"}),(0,l.jsx)(eU,{name:"privacy_declarations[".concat(t,"].data_categories"),label:"Data categories",tooltip:"Which categories of personal data are collected for this purpose?"}),(0,l.jsx)(eU,{name:"privacy_declarations[".concat(t,"].data_subjects"),label:"Data subjects",tooltip:"Who are the subjects for this personal data?"}),(0,l.jsx)(eV,{name:"privacy_declarations[".concat(t,"].legal_basis_for_processing"),label:"Legal basis for processing",tooltip:"What is the legal basis under which personal data is processed for this purpose?"}),(0,l.jsx)(eV,{name:"privacy_declarations[".concat(t,"].impact_assessment_location"),label:"Impact assessment location",tooltip:"Where is the legitimate interest impact assessment stored?"}),(0,l.jsx)(eV,{name:"privacy_declarations[".concat(t,"].retention_period"),label:"Retention period (days)",tooltip:"How long is personal data retained for this purpose?"})]}),(0,l.jsx)(eW,{heading:"Features",children:(0,l.jsx)(eU,{name:"privacy_declarations[".concat(t,"].features"),label:"Features",tooltip:"What are some features of how data is processed?"})}),(0,l.jsx)(eW,{heading:"Dataset reference",children:(0,l.jsx)(eU,{name:"privacy_declarations[".concat(t,"].dataset_references"),label:"Dataset references",tooltip:"Is there a dataset configured for this system?"})}),(0,l.jsxs)(eW,{heading:"Special category data",children:[(0,l.jsx)(eM,{name:"privacy_declarations[".concat(t,"].processes_special_category_data"),label:"This system processes special category data",tooltip:"Is this system processing special category data as defined by GDPR Article 9?"}),(0,l.jsx)(eV,{name:"privacy_declarations[".concat(t,"].special_category_legal_basis"),label:"Legal basis for processing",tooltip:"What is the legal basis under which the special category data is processed?"})]}),(0,l.jsxs)(eW,{heading:"Third parties",children:[(0,l.jsx)(eM,{name:"privacy_declarations[".concat(t,"].data_shared_with_third_parties"),label:"This system shares data with 3rd parties for this purpose",tooltip:"Does this system disclose, sell, or share personal data collected for this business use with 3rd parties?"}),(0,l.jsx)(eV,{name:"privacy_declarations[".concat(t,"].third_parties"),label:"Third parties",tooltip:"Which type of third parties is the data shared with?"}),(0,l.jsx)(eU,{name:"privacy_declarations[".concat(t,"].shared_categories"),label:"Shared categories",tooltip:"Which categories of personal data does this system share with third parties?"})]}),(0,l.jsx)(eB,{customFields:s.privacy_declarations[0].custom_fields,resourceType:q.P6.PRIVACY_DECLARATION})]},t)),(0,l.jsxs)(eW,{heading:"Data flow",children:[(0,l.jsx)(eU,{name:"ingress",label:"Sources"}),(0,l.jsx)(eU,{name:"egress",label:"Destinations"})]})]})})})};let eH=(e,s)=>{let t=[],a=new Set(["egress","ingress","privacy_declarations","vendor_id"]);(e.egress||s.egress||e.ingress||s.ingress)&&t.push("Data Flow");let i=e.privacy_declarations&&e.privacy_declarations.length>0||s.privacy_declarations&&s.privacy_declarations.length>0;i&&t.push("Data Uses");let n=[...Object.keys(e),...Object.keys(s)].some(e=>!a.has(e));return!i&&n&&t.unshift("System Information"),t};var eY=e=>{let{selectedHistory:s,isOpen:t,onClose:a}=e;return(0,l.jsxs)(o.u_l,{isOpen:t,onClose:a,size:"4xl",children:[(0,l.jsx)(o.ZAr,{}),(0,l.jsxs)(o.hzk,{children:[(0,l.jsxs)(o.xBx,{backgroundColor:ek().FIDESUI_NEUTRAL_50,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0",children:[(0,l.jsxs)(o.X6q,{size:"xs",children:[(0,l.jsx)("span",{style:{verticalAlign:"middle"},children:"Change detail"}),s&&(0,l.jsx)(l.Fragment,{children:eH(s.before,s.after).map((e,s)=>(0,l.jsx)(o.j8w,{color:"minos",className:"ml-2",children:e},s))})]}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.LZC,{}),(0,l.jsx)(o.olH,{})]})]}),(0,l.jsx)(o.fef,{paddingTop:0,paddingBottom:6,children:(0,l.jsxs)(o.kCb,{justifyContent:"space-between",children:[(0,l.jsx)("div",{style:{flex:"0 50%",marginRight:"12px"},children:(0,l.jsx)(eO,{selectedHistory:s,formType:"before",children:(0,l.jsx)(eK,{initialValues:null==s?void 0:s.before})})}),(0,l.jsx)("div",{style:{flex:"0 50%",marginLeft:"12px"},children:(0,l.jsx)(eO,{selectedHistory:s,formType:"after",children:(0,l.jsx)(eK,{initialValues:null==s?void 0:s.after})})})]})})]})]})},eG=e=>{let{system:s}=e,[t,a]=(0,m.useState)(1),{data:i}=(0,P.Xc)({system_key:s.fides_key,page:t,size:10}),[n,r]=(0,m.useState)(!1),[d,c]=(0,m.useState)(null),u=(0,h.C)(P.o),{data:p=[]}=(0,W.K3)(),x=(null==i?void 0:i.items)||[],y=e=>{c(e=eL(e=eI(e=eE(e=eq(e=eR(e),u),p)))),r(!0)},{formattedTime:g,formattedDate:_}=eS(s.created_at),f=i&&i.total?Math.ceil(i.total/10):0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(o.iA_,{ml:"24px",children:[(0,l.jsx)(o.hrZ,{children:(0,l.jsx)(o.Tr,{children:(0,l.jsxs)(o.Td,{p:"16px",fontSize:"12px",border:"1px solid #E2E8F0",background:ek().FIDESUI_NEUTRAL_50,children:["System created on ",_," at ",g]})})}),(0,l.jsx)(o.p3B,{children:x.map((e,s)=>{let t=eA(e);return t?(0,l.jsx)(o.Tr,{onClick:()=>y(e),style:{cursor:"pointer"},children:(0,l.jsx)(o.Td,{pt:"10px",pb:"10px",pl:"16px",fontSize:"12px",border:"1px solid #E2E8F0",children:t})},s):null})})]}),((null==i?void 0:i.total)||0)>10&&(0,l.jsxs)(o.kCb,{alignItems:"center",justifyContent:"flex-start",marginTop:"12px",marginLeft:"24px",children:[(0,l.jsxs)(o.xvT,{fontSize:"xs",lineHeight:4,fontWeight:"600",paddingX:2,children:[(t-1)*10+1," -"," ",Math.min(10*t,(null==i?void 0:i.total)||0)," of"," ",(null==i?void 0:i.total)||0]}),(0,l.jsx)(o.wpx,{size:"small",className:"mr-2",onClick:()=>{t>1&&a(t-1)},disabled:1===t,icon:(0,l.jsx)(eC,{}),"aria-label":"Previous page"}),(0,l.jsx)(o.wpx,{size:"small",onClick:()=>{t<f&&a(t+1)},disabled:t===f||0===f,icon:(0,l.jsx)(ew,{}),"aria-label":"Next page"})]}),(0,l.jsx)(eY,{selectedHistory:d,isOpen:n,onClose:()=>{r(!1),c(null)}})]})},e$=t(52368),eQ=t(3765),eJ=e=>{let{title:s,description:t,handleAdd:a}=e;return(0,l.jsx)(o.Kqy,{backgroundColor:"gray.50",border:"1px solid",borderColor:"blue.500",borderRadius:"md",justifyContent:"space-between",py:4,px:6,"data-testid":"empty-state",children:(0,l.jsxs)(o.Ugi,{children:[(0,l.jsx)(o.iid,{alignSelf:"start",color:"blue.400",mt:.5}),(0,l.jsxs)(o.xuv,{children:[(0,l.jsx)(o.xvT,{fontWeight:"bold",fontSize:"sm",mb:1,children:s}),(0,l.jsx)(o.xvT,{fontSize:"sm",color:"gray.800",lineHeight:"5",children:t}),(0,l.jsx)(o.Ugi,{mt:4,children:(0,l.jsx)(o.wpx,{size:"small",type:"primary","data-testid":"add-btn",onClick:a,icon:(0,l.jsx)(o.jBn,{boxSize:4}),iconPosition:"end",children:"Add data use"})})]})]})})},eX=t(58452);let e0=e=>{let{declaration:s,title:t,handleDelete:a,handleEdit:i}=e,{isOpen:n,onOpen:r,onClose:d}=(0,o.qY0)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.fGe,{w:"100%",h:"100%",cursor:"pointer",_hover:{backgroundColor:"gray.50"},children:(0,l.jsx)(o.xuv,{px:6,py:4,"data-testid":"row-".concat(s.data_use),children:(0,l.jsxs)(o.Ugi,{children:[(0,l.jsx)(o.AB5,{onClick:()=>i(s),role:"button",tabIndex:0,children:(0,l.jsx)(o.xvT,{children:t||s.data_use})}),(0,l.jsx)(o.LZC,{}),a?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.wpx,{"aria-label":"delete-declaration",className:"z-[2]",onClick:r,"data-testid":"delete-btn",children:(0,l.jsx)(o.pJl,{})}),(0,l.jsx)(eX.Z,{isOpen:n,onClose:d,onConfirm:()=>a(s),title:"Delete data use declaration",message:(0,l.jsxs)(o.xvT,{children:["You are about to delete the data use declaration"," ",(0,l.jsx)(o.xvT,{color:"complimentary.500",as:"span",fontWeight:"bold",children:t||s.data_use}),", including all its cookies. Are you sure you want to continue?"]}),isCentered:!0})]}):null]})})}),(0,l.jsx)(o.izJ,{})]})},e1=e=>{let{heading:s,children:t,headerButton:a,footerButton:i}=e;return(0,l.jsx)(o.Kqy,{spacing:4,"data-testid":"privacy-declarations-table",children:(0,l.jsxs)(o.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,children:[(0,l.jsxs)(o.Ugi,{backgroundColor:"gray.50",px:6,py:4,borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:[(0,l.jsx)(o.X6q,{as:"h3",size:"xs",children:s}),(0,l.jsx)(o.LZC,{}),a||null]}),(0,l.jsx)(o.Kqy,{spacing:0,children:t}),(0,l.jsx)(o.xuv,{backgroundColor:"gray.50",px:6,py:4,borderBottomRadius:6,children:i||null})]})})},e2=e=>{let{heading:s,declarations:t,handleAdd:a,handleDelete:i,handleEdit:n,allDataUses:r}=e,d=e=>{let s=r.filter(s=>s.fides_key===e.data_use)[0];return s?e.name?"".concat(s.name," - ").concat(e.name):s.name:""},c=(0,h.C)(ev.gU);return(0,l.jsx)(e1,{heading:s,footerButton:!c&&(0,l.jsx)(o.wpx,{onClick:a,size:"small",icon:(0,l.jsx)(o.jBn,{boxSize:4}),iconPosition:"end","data-testid":"add-btn",children:"Add data use"}),children:t.map(e=>(0,l.jsx)(e0,{declaration:e,title:d(e),handleDelete:c?void 0:i,handleEdit:n},e.id))})};var e4=t(33162),e5=t(54748),e3=t(28325),e9=t(30234);let e6=V.Ry().shape({data_categories:V.IX(V.Z_()).min(1,"Must assign at least one data category").label("Data categories"),data_use:V.Z_().required().label("Data use")}),e8={name:"",data_categories:[],data_use:"",data_subjects:[],egress:void 0,ingress:void 0,features:[],legal_basis_for_processing:void 0,flexible_legal_basis_for_processing:!0,impact_assessment_location:"",retention_period:"",processes_special_category_data:!1,special_category_legal_basis:void 0,data_shared_with_third_parties:!1,third_parties:"",shared_categories:[],customFieldValues:{},id:""},e7=e=>{var s;return{...e,name:null!==(s=e.name)&&void 0!==s?s:"",special_category_legal_basis:e.processes_special_category_data?e.special_category_legal_basis:void 0,third_parties:e.data_shared_with_third_parties?e.third_parties:void 0,shared_categories:e.data_shared_with_third_parties?e.shared_categories:void 0}},se=e=>{let{allDataUses:s,allDataCategories:t,allDataSubjects:a,allDatasets:i,values:n,includeCustomFields:r,privacyDeclarationId:d,lockedForGVL:c}=e,u=!!d,{legalBasisOptions:p}=(0,e5.Z)(),{specialCategoryLegalBasisOptions:h}=(0,e3.Z)(),x=(0,m.useMemo)(()=>i?i.map(e=>({value:e.fides_key,label:e.name?e.name:e.fides_key})):[],[i]);return(0,l.jsxs)(o.Kqy,{spacing:4,children:[(0,l.jsxs)(e9.Z,{heading:"Data use declaration",children:[(0,l.jsx)(N.j0,{id:"name",label:"Declaration name (optional)",name:"name",tooltip:"Would you like to append anything to the system name?",disabled:u,variant:"stacked"}),(0,l.jsx)(B.d,{id:"data_use",label:"Data use",name:"data_use",options:s.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"For which business purposes is this data processed?",layout:"stacked",isRequired:!0,disabled:u}),(0,l.jsx)(B.d,{name:"data_categories",label:"Data categories",options:t.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Which categories of personal data are collected for this purpose?",mode:"multiple",isRequired:!0,disabled:c,layout:"stacked"}),(0,l.jsx)(B.d,{name:"data_subjects",label:"Data subjects",options:a.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Who are the subjects for this personal data?",mode:"multiple",layout:"stacked"}),(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(B.d,{name:"legal_basis_for_processing",label:"Legal basis for processing",options:p,tooltip:"What is the legal basis under which personal data is processed for this purpose?",layout:"stacked",disabled:c}),(0,l.jsx)(o.UO1,{in:"Legitimate interests"===n.legal_basis_for_processing,animateOpacity:!0,style:{overflow:"visible"},children:(0,l.jsx)(o.xuv,{mt:4,children:(0,l.jsx)(N.j0,{name:"impact_assessment_location",label:"Impact assessment location",tooltip:"Where is the legitimate interest impact assessment stored?",variant:"stacked"})})})]}),(0,l.jsx)(o.xuv,{mt:5,pl:4,children:(0,l.jsx)(N.w8,{name:"flexible_legal_basis_for_processing",label:"This legal basis is flexible",tooltip:"Has the vendor declared that the legal basis may be overridden?",variant:"stacked",isDisabled:c})}),(0,l.jsx)(N.j0,{name:"retention_period",label:"Retention period (days)",tooltip:"How long is personal data retained for this purpose?",variant:"stacked",disabled:c})]}),(0,l.jsx)(e9.Z,{heading:"Features",children:(0,l.jsx)(B.d,{name:"features",label:"Features",placeholder:"Describe features...",tooltip:"What are some features of how data is processed?",layout:"stacked",disabled:c,mode:"tags"})}),(0,l.jsx)(e9.Z,{heading:"Dataset reference",children:(0,l.jsx)(B.d,{name:"dataset_references",label:"Dataset references",options:x,tooltip:"Is there a dataset configured for this system?",mode:"multiple",layout:"stacked"})}),(0,l.jsx)(e9.Z,{heading:"Special category data",children:(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(N.w8,{name:"processes_special_category_data",label:"This system processes special category data",tooltip:"Is this system processing special category data as defined by GDPR Article 9?",variant:"stacked"}),(0,l.jsx)(o.UO1,{in:n.processes_special_category_data,animateOpacity:!0,style:{overflow:"visible"},children:(0,l.jsx)(o.xuv,{mt:4,children:(0,l.jsx)(B.d,{name:"special_category_legal_basis",label:"Legal basis for processing",options:h,isRequired:n.processes_special_category_data,tooltip:"What is the legal basis under which the special category data is processed?",layout:"stacked"})})})]})}),(0,l.jsx)(e9.Z,{heading:"Third parties",children:(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(N.w8,{name:"data_shared_with_third_parties",label:"This system shares data with 3rd parties for this purpose",tooltip:"Does this system disclose, sell, or share personal data collected for this business use with 3rd parties?",variant:"stacked"}),(0,l.jsx)(o.UO1,{in:n.data_shared_with_third_parties,animateOpacity:!0,style:{overflow:"visible"},children:(0,l.jsxs)(o.Kqy,{mt:4,spacing:4,children:[(0,l.jsx)(N.j0,{name:"third_parties",label:"Third parties",tooltip:"Which type of third parties is the data shared with?",variant:"stacked"}),(0,l.jsx)(B.d,{name:"shared_categories",label:"Shared categories",options:t.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Which categories of personal data does this system share with third parties?",layout:"stacked",mode:"multiple"})]})})]})}),r?(0,l.jsx)(e4.uc,{resourceType:q.P6.PRIVACY_DECLARATION,resourceFidesKey:d}):null]})},ss=(e,s)=>e?{...e,customFieldValues:s||{}}:e8,st=e=>{let{onSubmit:s,initialValues:t,privacyDeclarationId:a}=e,{customFieldValues:i,upsertCustomFields:n}=(0,e4.mZ)({resourceType:q.P6.PRIVACY_DECLARATION,resourceFidesKey:a});return{handleSubmit:async(e,t)=>{let{customFieldValues:a}=e,i=e7(e),r=await s(i,t);if(r){let s=r.filter(s=>s.data_use===e.data_use&&(!s.name||s.name===e.name));s.length>0&&await n({customFieldValues:a,fides_key:s[0].id})}},initialValues:(0,m.useMemo)(()=>ss(t,i),[t,i])}},sa=e=>{let{onSubmit:s,onCancel:t,initialValues:a,...i}=e,n=null==a?void 0:a.id,{handleSubmit:r,initialValues:d}=st({onSubmit:s,onCancel:t,initialValues:a,allDataUses:i.allDataUses,privacyDeclarationId:n}),c=(0,h.C)(ev.gU);return(0,l.jsx)(U.J9,{enableReinitialize:!0,initialValues:d,onSubmit:r,validationSchema:e6,children:e=>{let{dirty:s,values:a}=e;return(0,l.jsxs)(U.l0,{"data-testid":"declaration-form",children:[(0,l.jsx)(y.Gt,{id:"PrivacyDeclaration",name:"New Privacy Declaration"}),(0,l.jsxs)(o.Kqy,{spacing:4,children:[(0,l.jsx)(se,{values:a,lockedForGVL:c,privacyDeclarationId:n,...i}),(0,l.jsxs)(o.kCb,{w:"100%",children:[(0,l.jsx)(o.wpx,{onClick:t,"data-testid":"cancel-btn",children:"Cancel"}),(0,l.jsx)(o.LZC,{}),(0,l.jsx)(o.wpx,{type:"primary",htmlType:"submit",disabled:!s,"data-testid":"save-btn",children:"Save"})]})]})]})}})},si=e=>{let{isOpen:s,onClose:t,heading:a,isCentered:i=!1,testId:n="privacy-declaration-modal",children:r}=e;return(0,l.jsxs)(o.u_l,{isOpen:s,onClose:t,isCentered:i,scrollBehavior:"inside",size:"3xl",children:[(0,l.jsx)(o.ZAr,{}),(0,l.jsxs)(o.hzk,{textAlign:"left",p:0,"data-testid":n,children:[(0,l.jsx)(o.xBx,{p:0,children:(0,l.jsx)(o.xuv,{backgroundColor:"gray.50",px:6,py:4,border:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,l.jsx)(o.X6q,{as:"h3",size:"sm",children:a})})}),(0,l.jsx)(o.fef,{pb:4,children:r})]})]})};var sn=e=>{let{system:s,includeCustomFields:t,...a}=e,{isOpen:i,onClose:n,onOpen:r}=(0,o.qY0)(),[d,c]=(0,m.useState)(void 0),{createDataUse:u,updateDataUse:p,deleteDataUse:h}=(0,eQ.Z)(s),x=()=>{n(),c(void 0)},y=()=>{r(),c(void 0)},g=async e=>(x(),d)?p(d,e):u(e);return(0,m.useEffect)(()=>{n()},[n,s.fides_key]),(0,l.jsxs)(o.Kqy,{spacing:6,"data-testid":"data-use-tab",children:[0===s.privacy_declarations.length?(0,l.jsx)(eJ,{title:"You don't have a data use set up for this system yet.",description:'A Data Use is the purpose for which data is used in a system. In Fides, a system may have more than one Data Use. For example, a CRM system may be used both for "Customer Support" and also for "Email Marketing", each of these is a Data Use.',handleAdd:y}):(0,l.jsx)(e2,{heading:"Data use",declarations:s.privacy_declarations,handleAdd:y,handleEdit:e=>{r(),c(e)},handleDelete:h,allDataUses:a.allDataUses}),(0,l.jsx)(si,{isOpen:i,onClose:x,heading:"Configure data use",children:(0,l.jsx)(sa,{initialValues:d,onSubmit:g,onCancel:x,includeCustomFields:t,...a})})]})},sr=e=>{let{system:s}=e,{isLoading:t,...a}=(0,e$.f)({includeDatasets:!0,includeDisabled:!1}),i=a.allDataCategories.filter(e=>e.active),n=a.allDataUses.filter(e=>e.active),r=a.allDataSubjects.filter(e=>e.active),d={...a,allDataCategories:i,allDataUses:n,allDataSubject:r};return(0,l.jsxs)(o.Kqy,{spacing:3,"data-testid":"privacy-declaration-step",minWidth:580,children:[(0,l.jsx)(o.X6q,{as:"h3",size:"md",children:"Data uses"}),(0,l.jsxs)(o.xvT,{fontSize:"sm",fontWeight:"medium",children:["Data Uses describe the business purpose for which the personal data is processed or collected. Within a Data Use, you assign which categories of personal information are collected for this purpose and for which categories of data subjects. To update the available categories and uses, please visit"," ",(0,l.jsx)(o.rUS,{as:c(),href:"/taxonomy",color:"link.900",children:"Manage taxonomy"}),"."]}),t?(0,l.jsx)(o.$jN,{}):(0,l.jsx)(sn,{system:s,includeCustomFields:!0,...d})]})},sl=t(812),so=t(93237),sd=t(69525),sc=t(33335);let su={system_type:"",fides_key:"",tags:[],name:"",description:"",dataset_references:[],processes_personal_data:!0,exempt_from_privacy_regulations:!1,reason_for_exemption:"",uses_profiling:!1,does_international_transfers:!1,requires_data_protection_assessments:!1,privacy_policy:"",legal_name:"",legal_address:"",administrating_department:"",responsibility:[],joint_controller_info:"",data_security_practices:"",privacy_declarations:[],data_stewards:"",dpo:"",cookie_max_age_seconds:void 0,uses_cookies:!1,cookie_refresh:!1,uses_non_cookie_access:!1,legitimate_interest_disclosure_url:"",system_groups:[]},sp=(e,s)=>{var t;let a=null==e?void 0:null===(t=e.data_stewards)||void 0===t?void 0:t.map(e=>e.username).join(", ");return{...e,customFieldValues:s,description:e.description?e.description:"",legal_address:e.legal_address?e.legal_address:"",dpo:e.dpo?e.dpo:"",cookie_max_age_seconds:e.cookie_max_age_seconds?e.cookie_max_age_seconds:"",legitimate_interest_disclosure_url:e.legitimate_interest_disclosure_url?e.legitimate_interest_disclosure_url:"",vendor_deleted_date:e.vendor_deleted_date?e.vendor_deleted_date:void 0,privacy_policy:e.privacy_policy?e.privacy_policy:"",data_security_practices:e.data_security_practices?e.data_security_practices:"",legal_basis_for_profiling:e.legal_basis_for_profiling?e.legal_basis_for_profiling:"",legal_basis_for_transfers:e.legal_basis_for_transfers?e.legal_basis_for_transfers:"",data_stewards:a||"",system_groups:e.system_groups||[]}},sm=e=>{let s=e.fides_key?e.fides_key:(0,sc.E)(e.name),t=""===e.privacy_policy?void 0:e.privacy_policy,a={system_type:e.system_type,fides_key:s,name:e.name,description:e.description?e.description:"",dataset_references:e.dataset_references,tags:e.tags,processes_personal_data:e.processes_personal_data,exempt_from_privacy_regulations:e.exempt_from_privacy_regulations,reason_for_exemption:e.exempt_from_privacy_regulations?e.reason_for_exemption:void 0,privacy_declarations:e.processes_personal_data?e.privacy_declarations:[],vendor_id:e.vendor_id,ingress:e.ingress,egress:e.egress,meta:e.meta,fidesctl_meta:e.fidesctl_meta,organization_fides_key:e.organization_fides_key,dpa_progress:e.dpa_progress,previous_vendor_id:e.previous_vendor_id,cookie_max_age_seconds:e.cookie_max_age_seconds?e.cookie_max_age_seconds:void 0,uses_cookies:e.uses_cookies,cookie_refresh:e.cookie_refresh,uses_non_cookie_access:e.uses_non_cookie_access,legitimate_interest_disclosure_url:e.legitimate_interest_disclosure_url?e.legitimate_interest_disclosure_url:void 0,vendor_deleted_date:e.vendor_deleted_date?e.vendor_deleted_date:void 0,system_groups:e.system_groups};return e.processes_personal_data&&(a={...a,dataset_references:e.dataset_references,uses_profiling:e.uses_profiling,legal_basis_for_profiling:e.uses_profiling?e.legal_basis_for_profiling:void 0,does_international_transfers:e.does_international_transfers,legal_basis_for_transfers:e.does_international_transfers?e.legal_basis_for_transfers:void 0,requires_data_protection_assessments:e.requires_data_protection_assessments,dpa_location:e.requires_data_protection_assessments?e.dpa_location:void 0,privacy_policy:t,legal_name:e.legal_name,legal_address:e.legal_address,responsibility:e.responsibility,dpo:e.dpo,data_security_practices:e.data_security_practices},e.administrating_department&&(a.administrating_department=e.administrating_department),e.joint_controller_info&&(a.joint_controller_info=e.joint_controller_info)),a},{useGetSystemAssetsQuery:sh,useAddSystemAssetMutation:sx,useUpdateSystemAssetsMutation:sy,useDeleteSystemAssetsMutation:sg,usePopulateSystemAssetsMutation:s_}=t(78780).u.injectEndpoints({endpoints:e=>({getSystemAssets:e.query({query:e=>{let{fides_key:s,...t}=e;return{method:"GET",url:"/plus/system-assets/".concat(s),params:t}},providesTags:["System Assets"]}),addSystemAsset:e.mutation({query:e=>{let{systemKey:s,asset:t}=e;return{method:"POST",url:"/plus/system-assets/".concat(s,"/assets"),body:t}},invalidatesTags:["System Assets"]}),updateSystemAssets:e.mutation({query:e=>{let{systemKey:s,assets:t}=e;return{method:"PUT",url:"/plus/system-assets/".concat(s,"/assets/"),body:t}},invalidatesTags:["System Assets"]}),deleteSystemAssets:e.mutation({query:e=>{let{systemKey:s,asset_ids:t}=e;return{method:"DELETE",url:"/plus/system-assets/".concat(s,"/assets?").concat((0,w.du)(t,"asset_ids"))}},invalidatesTags:["System Assets"]}),populateSystemAssets:e.mutation({query:e=>{let{systemKey:s}=e;return{method:"POST",url:"/plus/dictionary/system-vendors/cookie-assets",body:[s]}}})})});var sf=t(69353),sb=t(36345);let sv=["Explicit consent","Contract","Authorised by law"].map(e=>({value:e,label:e})),sj=[{value:"Adequacy Decision",label:"Adequacy decision"},{value:"Supplementary measures",label:"Supplementary measures"},{value:"SCCs",label:"Standard contractual clauses"},{value:"BCRs",label:"Binding corporate rules"},{value:"Other",label:"Other"}],sk=["Controller","Processor","Sub-Processor"].map(e=>({value:e,label:e})),sw=e=>{var s;let{system:t}=e,a=t?null!==(s=t.name)&&void 0!==s?s:"this system":"your new system";return(0,l.jsxs)(o.X6q,{as:"h3",size:"lg",children:["Describe ",a]})};var sC=e=>{let{onSuccess:s,system:t,withHeader:a,children:i}=e,{data:n=[]}=(0,W.K3)(),{plus:r}=(0,eZ.hz)(),d=(0,h.T)(),c=(0,e4.mZ)({resourceType:q.P6.SYSTEM,resourceFidesKey:null==t?void 0:t.fides_key}),{...u}=(0,e$.f)({includeDatasets:!0,includeDisabled:!1}),p=(0,m.useMemo)(()=>t?sp(t,c.customFieldValues):su,[t,c.customFieldValues]),[x]=(0,W.in)(),g=(0,m.useMemo)(()=>V.Ry().shape({name:V.Z_().required().label("System name").test("is-unique","",async(e,s)=>{let{data:t}=await x({page:1,size:10,search:e});return!((null==t?void 0:t.items)||[]).filter(e=>e.name!==p.name).some(s=>s.name===e)||s.createError({message:'You already have a system called "'.concat(e,'". Please specify a unique name for this system.')})}),privacy_policy:V.Z_().min(1).url().nullable()}),[x,p.name]),_=(0,eZ.hz)(),[f,b]=(0,W.f7)(),[j,k]=(0,W.qQ)(),[w]=s_();(0,P.Rd)(void 0,{skip:!_.dictionaryService});let[C]=(0,P.qz)(),{data:S}=(0,sf.QD)(void 0,{skip:!r}),D=(0,m.useMemo)(()=>(null==S?void 0:S.map(e=>({value:e.fides_key,label:e.name})))||[],[S]),T=(0,h.C)(P.o),A=(0,h.C)(ev.gU),E=(0,m.useMemo)(()=>!!(t&&(null==n?void 0:n.some(e=>e.fides_key===(null==t?void 0:t.fides_key)))),[t,n]),R=(0,m.useMemo)(()=>u.allDatasets?u.allDatasets.map(e=>({value:e.fides_key,label:e.name?e.name:e.fides_key})):[],[u.allDatasets]),I=(0,o.pmc)(),L=async(e,t)=>{var a;let i,n;if(e.vendor_id&&0===e.privacy_declarations.length){let s=await C({vendor_id:e.vendor_id});if(s.isError){if(!((0,sl.fn)(s.error)&&404===s.error.status)){let e=(0,sl.e$)(s.error,"A problem occurred while fetching data uses from Fides Compass for your system. Please try again.");I((0,v.Vo)(e))}}else s.data&&s.data.items.length>0&&(i=s.data.items.map(e=>{var s;return{...(0,sd.U)(e),name:null!==(s=e.name)&&void 0!==s?s:""}}))}let r=sm({...e,privacy_declarations:null!=i?i:e.privacy_declarations});if(n=E?await j(r):await f(r),await c.upsertCustomFields(e),!E&&e.vendor_id&&(null===(a=n.data)||void 0===a?void 0:a.fides_key)){let e=await w({systemKey:n.data.fides_key});(0,sl.D4)(e)&&I((0,v.Vo)("An unexpected error occurred while populating the system assets from Compass. Please try again."))}(0,sl.D4)(n)?I({status:"error",description:(0,sl.e$)(n.error,"An unexpected error occurred while ".concat(E?"editing":"creating"," the system. Please try again."))}):(I.closeAll(),t.resetForm({values:e}),s(n.data),d((0,ev.b3)("initial")))},F=e=>{if(_.dictionaryService){if(!e){d((0,ev.b3)("hiding")),d((0,ev.gQ)(!1));return}d((0,ev.b3)("showing")),_.tcf&&(0,sl.cj)(e)===sl.c6.GVL?d((0,ev.gQ)(!0)):d((0,ev.gQ)(!1))}},z=k.isLoading||b.isLoading||c.isLoading;return(0,l.jsx)(U.J9,{initialValues:p,enableReinitialize:!0,onSubmit:L,validationSchema:g,children:e=>{let{dirty:s,values:n,isValid:d}=e;return(0,l.jsxs)(U.l0,{children:[(0,l.jsx)(y.Gt,{id:"SystemInfoTab",name:"System Info"}),(0,l.jsxs)(o.Kqy,{spacing:0,maxWidth:{base:"100%",lg:"70%"},children:[a?(0,l.jsx)(sw,{system:t}):null,(0,l.jsx)(o.xvT,{fontSize:"sm",fontWeight:"medium",children:"By providing a small amount of additional context for each system we can make reporting and understanding our tech stack much easier for everyone from engineering to legal teams. So let’s do this now."}),a?(0,l.jsx)(sw,{system:t}):null,(0,l.jsxs)(e9.Z,{heading:"System details",children:[_.dictionaryService?(0,l.jsx)(sb.Z,{label:"System name",options:T,onVendorSelected:F,isCreate:!t,lockedForGVL:A}):(0,l.jsx)(N.j0,{id:"name",name:"name",label:"System name",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”",variant:"stacked",isRequired:!0}),(null==t?void 0:t.fides_key)&&(0,l.jsx)(N.j0,{id:"fides_key",name:"fides_key",label:"Unique ID",disabled:!0,variant:"stacked",tooltip:"An auto-generated unique ID based on the system name"}),(0,l.jsx)(so.Sv,{id:"description",name:"description",label:"Description",tooltip:"What services does this system perform?"}),(0,l.jsx)(B.d,{mode:"tags",id:"tags",name:"tags",label:"System Tags",options:p.tags?p.tags.map(e=>({value:e,label:e})):[],layout:"stacked",tooltip:"Are there any tags to associate with this system?"}),r&&(0,l.jsx)(B.d,{name:"system_groups",label:"System groups",options:D,tooltip:"Which system groups are associated with this system?",mode:"multiple",layout:"stacked"})]}),(0,l.jsx)(e9.Z,{heading:"Dataset reference",children:(0,l.jsx)(B.d,{name:"dataset_references",label:"Dataset references",options:R,tooltip:"Is there a dataset configured for this system?",mode:"multiple",layout:"stacked"})}),(0,l.jsx)(e9.Z,{heading:"Data processing properties",children:(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(o.xuv,{mb:4,children:(0,l.jsx)(so.dQ,{name:"processes_personal_data",label:"This system processes personal data",tooltip:"Does this system process personal data?",disabled:A})}),(0,l.jsx)(o.xuv,{padding:4,borderRadius:4,backgroundColor:"gray.50",children:(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(so.dQ,{name:"exempt_from_privacy_regulations",label:"This system is exempt from privacy regulations",tooltip:"Is this system exempt from privacy regulations?",disabled:!n.processes_personal_data||A}),(0,l.jsx)(o.UO1,{in:n.exempt_from_privacy_regulations,animateOpacity:!0,children:(0,l.jsx)(o.xuv,{mt:4,children:(0,l.jsx)(N.j0,{name:"reason_for_exemption",label:"Reason for exemption",tooltip:"Why is this system exempt from privacy regulation?",variant:"stacked",isRequired:n.exempt_from_privacy_regulations,disabled:A})})})]})}),(0,l.jsx)(o.UO1,{in:n.processes_personal_data&&!n.exempt_from_privacy_regulations,style:{overflow:"visible"},animateOpacity:!0,children:(0,l.jsxs)(o.Kqy,{spacing:4,mt:4,children:[(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(so.dQ,{name:"uses_profiling",label:"This system performs profiling",tooltip:"Does this system perform profiling that could have a legal effect?",disabled:A}),(0,l.jsx)(o.UO1,{in:n.uses_profiling,animateOpacity:!0,style:{overflow:"visible"},children:(0,l.jsx)(o.xuv,{mt:4,children:(0,l.jsx)(B.d,{mode:"multiple",layout:"stacked",name:"legal_basis_for_profiling",label:"Legal basis for profiling",options:sv,tooltip:"What is the legal basis under which profiling is performed?",disabled:A,isRequired:n.uses_profiling})})})]}),(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(so.dQ,{name:"does_international_transfers",label:"This system transfers data",tooltip:"Does this system transfer data to other countries or international organizations?",disabled:A}),(0,l.jsx)(o.UO1,{in:n.does_international_transfers,animateOpacity:!0,style:{overflow:"visible"},children:(0,l.jsx)(o.xuv,{mt:4,children:(0,l.jsx)(B.d,{mode:"multiple",layout:"stacked",name:"legal_basis_for_transfers",label:"Legal basis for transfer",options:sj,tooltip:"What is the legal basis under which the data is transferred?",isRequired:n.does_international_transfers,disabled:A})})})]}),(0,l.jsxs)(o.Kqy,{spacing:0,children:[(0,l.jsx)(N.w8,{name:"requires_data_protection_assessments",label:"This system requires Data Privacy Assessments",tooltip:"Does this system require (DPA/DPIA) assessments?",variant:"stacked",isDisabled:A}),(0,l.jsx)(o.UO1,{in:n.requires_data_protection_assessments,animateOpacity:!0,children:(0,l.jsx)(o.xuv,{mt:4,children:(0,l.jsx)(N.j0,{label:"DPIA/DPA location",name:"dpa_location",tooltip:"Where is the DPA/DPIA stored?",variant:"stacked",disabled:A,isRequired:n.requires_data_protection_assessments})})})]})]})})]})}),(0,l.jsxs)(o.UO1,{in:n.processes_personal_data&&!n.exempt_from_privacy_regulations,animateOpacity:!0,children:[(0,l.jsxs)(e9.Z,{heading:"Cookie properties",children:[(0,l.jsx)(so.dQ,{name:"uses_cookies",label:"This system uses cookies",tooltip:"Does this system use cookies?",disabled:A}),(0,l.jsx)(so.dQ,{name:"cookie_refresh",label:"This system refreshes cookies",tooltip:"Does this system automatically refresh cookies?",disabled:A}),(0,l.jsx)(so.dQ,{name:"uses_non_cookie_access",label:"This system uses non-cookie trackers",tooltip:"Does this system use other types of trackers?",disabled:A}),(0,l.jsx)(so.lm,{name:"cookie_max_age_seconds",label:"Maximum duration (seconds)",tooltip:"What is the maximum amount of time a cookie will live?",disabled:A})]}),(0,l.jsxs)(e9.Z,{heading:"Administrative properties",children:[(0,l.jsx)(N.j0,{label:"Data stewards",name:"data_stewards",tooltip:"Who are the stewards assigned to the system?",variant:"stacked",disabled:!0}),(0,l.jsx)(so.Yb,{id:"privacy_policy",name:"privacy_policy",label:"Privacy policy URL",tooltip:"Where can the privacy policy be located?",disabled:A}),(0,l.jsx)(so.Yb,{id:"legal_name",name:"legal_name",label:"Legal name",tooltip:"What is the legal name of the business?"}),(0,l.jsx)(so.Sv,{id:"legal_address",name:"legal_address",label:"Legal address",tooltip:"What is the legal address for the business?"}),(0,l.jsx)(N.j0,{label:"Department",name:"administrating_department",tooltip:"Which department is concerned with this system?",variant:"stacked",disabled:!n.processes_personal_data||n.exempt_from_privacy_regulations}),(0,l.jsx)(B.d,{mode:"multiple",layout:"stacked",label:"Responsibility",name:"responsibility",options:sk,tooltip:"What is the role of the business with regard to data processing?",disabled:!n.processes_personal_data||n.exempt_from_privacy_regulations}),(0,l.jsx)(so.Yb,{name:"dpo",id:"dpo",label:"Legal contact (DPO)",tooltip:"What is the official privacy contact information?",disabled:A}),(0,l.jsx)(N.j0,{label:"Joint controller",name:"joint_controller_info",tooltip:"Who are the party or parties that share responsibility for processing data?",variant:"stacked",disabled:!n.processes_personal_data||n.exempt_from_privacy_regulations}),(0,l.jsx)(so.Yb,{label:"Data security practices",name:"data_security_practices",id:"data_security_practices",tooltip:"Which data security practices are employed to keep the data safe?"}),(0,l.jsx)(so.Yb,{label:"Legitimate interest disclosure URL",name:"legitimate_interest_disclosure_url",id:"legitimate_interest_disclosure_url",disabled:A}),(0,l.jsx)(so.Yb,{label:"Vendor deleted date",name:"vendor_deleted_date",id:"vendor_deleted_date",tooltip:"If this vendor is no longer active, it will be 'soft' deleted. When that occurs, it's deleted date will be recorded here for reporting.",disabled:!0})]}),n.fides_key?(0,l.jsx)(e4.uc,{resourceType:q.P6.SYSTEM,resourceFidesKey:n.fides_key}):null]})]}),(0,l.jsx)(o.xuv,{mt:6,children:(0,l.jsx)(o.wpx,{htmlType:"submit",type:"primary",disabled:z||!s||!d,loading:z,"data-testid":"save-btn",children:"Save"})}),i]})}})},sS=t(59003),sD=t(92222),sT=t(30952),sA=t(47935),sE=t(90111),sq=t(8133),sR=t(83099),sI=e=>{let{name:s,label:t,labelProps:a,tooltip:i}=e,[n,r,{setValue:d,setTouched:c}]=(0,U.U$)(s),u=!!(r.touched&&r.error);return(0,l.jsx)(o.NIc,{isInvalid:u,isRequired:!0,children:(0,l.jsxs)(o.jqI,{vertical:!0,children:[(0,l.jsxs)(o.jqI,{align:"center",children:[t&&(0,l.jsx)(N.__,{htmlFor:s,fontSize:"xs",mr:1,...a,children:t}),i&&(0,l.jsx)(eN.b,{label:i})]}),(0,l.jsx)(sR.Z,{...n,mode:"multiple",selectedTaxonomies:[],onChange:e=>{d(e)},onBlur:()=>c(!0),variant:"outlined",autoFocus:!1,status:u?"error":void 0,"data-testid":"controlled-select-".concat(s)}),(0,l.jsx)(N.Bc,{isInvalid:u,message:r.error,fieldName:s})]})})};(a=n||(n={})).COOKIE="Cookie",a.BROWSER_REQUEST="Browser Request",a.I_FRAME="iFrame",a.JAVASCRIPT_TAG="Javascript tag",a.IMAGE="Image";let sL=V.Ry().shape({name:V.Z_().required("Enter a name for this asset"),domain:V.Z_().required("Enter a valid domain for this asset"),asset_type:V.Z_().required("Select an asset type"),data_uses:V.IX().min(1,"Select at least one data use"),base_url:V.Z_().when("asset_type",{is:e=>"Cookie"!==e,then:e=>e.required("Base URL is required"),otherwise:e=>e.notRequired()})}),sF={name:"",description:"",duration:"",data_uses:[],domain:"",asset_type:"",id:"",system_id:""};var sz=e=>{let{isOpen:s,onClose:t,systemKey:a,asset:i,...r}=e,d=!i,[c,{isLoading:u}]=sx(),[p,{isLoading:m}]=sy(),h=(0,o.pmc)(),x=async e=>{let s=await c({systemKey:a,asset:e});if((0,sl.D4)(s)){let e=(0,sl.e$)(s.error,"An unexpected error occurred while saving this asset. Please try again.");h((0,v.Vo)(e))}else h((0,v.t5)("Asset added successfully")),t()},y=async e=>{let s=await p({systemKey:a,assets:[e]});if((0,sl.D4)(s)){let e=(0,sl.e$)(s.error,"An unexpected error occurred while saving this asset. Please try again.");h((0,v.Vo)(e))}else h((0,v.t5)("Asset updated successfully")),t()};return(0,l.jsx)(sq.Z,{title:d?"Add asset":"Edit asset",onClose:t,isOpen:s,...r,children:(0,l.jsx)(U.J9,{initialValues:null!=i?i:sF,onSubmit:e=>{d?x(e):y(e)},validationSchema:sL,children:e=>{let{values:s,isValid:a,dirty:i}=e,r=!!s.asset_type&&"Cookie"===s.asset_type,c=!!s.asset_type&&"Cookie"!==s.asset_type;return(0,l.jsxs)(U.l0,{children:[(0,l.jsxs)(o.jqI,{vertical:!0,className:"pb-6 pt-4",children:[(0,l.jsx)(sE.Z,{children:(0,l.jsx)(o.xvT,{fontSize:"sm",children:"Create and configure assets (e.g. cookies, pixels, tags) for this system to ensure proper consent enforcement. Adding assets manually allows you to define key attributes, assign categories, and align them with compliance requirements."})}),(0,l.jsxs)(o.jqI,{vertical:!0,gap:20,children:[(0,l.jsx)(N.j0,{id:"name",name:"name",label:"Name",variant:"stacked",isRequired:!0,disabled:!d}),(0,l.jsx)(B.d,{isRequired:!0,id:"asset_type",name:"asset_type",label:"Asset type",options:(0,sl.MM)(n),layout:"stacked",disabled:!d}),(0,l.jsx)(sI,{name:"data_uses",label:"Data uses",layout:"stacked"}),(0,l.jsx)(N.j0,{id:"domain",name:"domain",label:"Domain",variant:"stacked",isRequired:!0,disabled:!d}),(0,l.jsx)(N.Ks,{id:"description",name:"description",label:"Description",variant:"stacked"}),(0,l.jsx)(o.UO1,{in:r,children:(0,l.jsx)(N.j0,{id:"duration",name:"duration",label:"Duration",variant:"stacked",placeholder:"e.g. '1 day', '30 minutes', '1 year'",tooltip:"Cookie duration is how long a cookie stays stored in the user's browser before automatically expiring and being deleted.",isRequired:r})}),(0,l.jsx)(o.UO1,{in:c,children:(0,l.jsx)(N.j0,{id:"base_url",name:"base_url",label:"Base URL",variant:"stacked",isRequired:c})})]})]}),(0,l.jsxs)(o.jqI,{justify:"space-between",children:[(0,l.jsx)(o.wpx,{onClick:t,children:"Cancel"}),(0,l.jsx)(o.wpx,{type:"primary",htmlType:"submit",loading:u||m,disabled:!a||!i,"data-testid":"save-btn",children:"Save"})]})]})}})})},sO=t(8411),sZ=t(72625),sP=t(26092),sW=t.n(sP),sN=t(29850),sU=t(77685),sV=e=>{let{systemKey:s,systemName:t,asset:a,readonly:i}=e,[n,r]=(0,m.useState)(!1),[d,c]=(0,m.useState)(),[u,p]=(0,m.useState)(!1),[h,{isLoading:x}]=sy(),{successAlert:y,errorAlert:g}=(0,A.VY)(),_=(0,o.qY0)(),{asset_type:f,name:b}=a,v=sW()(b||"",{length:50}),j=(0,m.useCallback)(e=>{e.preventDefault(),p(!0)},[]),k=async e=>{if(!e)return;let{newSystemKey:t,newSystemName:i,isNewSystem:n}=e,l=sW()(i,{length:50}),o=await h({systemKey:s,assets:[{id:a.id,system_key:t}]});(0,e_.D4)(o)?g((0,sl.e$)(o.error)):y(n?"".concat(l," has been added to your system inventory and the ").concat(f,' "').concat(v,'" has been assigned to that system.'):"".concat(f,' "').concat(v,'" has been assigned to ').concat(l)),r(!1),c(void 0)},w=e=>{c(e),_.onOpen()};return i?(0,l.jsx)(o.j8w,{"data-testid":"system-badge",color:"white",children:t}):(0,l.jsxs)(l.Fragment,{children:[!n&&(0,l.jsxs)(o.j8w,{"data-testid":"system-badge",color:"white",onClick:()=>r(!0),children:[t," ",(0,l.jsx)(o.PJP.I8b,{})]}),!!n&&(0,l.jsx)(sN.R,{variant:"borderless",className:"w-full",autoFocus:!0,defaultOpen:!0,defaultValue:s,onBlur:e=>{var s;(null===(s=e.relatedTarget)||void 0===s?void 0:s.getAttribute("id"))!=="add-new-system"&&r(!1)},onAddSystem:j,onSelect:(e,s)=>w({newSystemKey:e,newSystemName:s.label}),loading:x}),u&&(0,l.jsx)(sU.i,{isOpen:!0,onClose:()=>p(!1),onSuccessfulSubmit:(e,s)=>w({newSystemKey:e,newSystemName:s,isNewSystem:!0})}),(0,l.jsx)(o.cVQ,{isOpen:_.isOpen,onClose:_.onClose,onConfirm:()=>{k(d)},title:"Reassign asset",message:"Are you sure you want to reassign this asset to ".concat(null==d?void 0:d.newSystemName,"?"),isCentered:!0})]})},sB=e=>{let{asset:s,systemKey:t,onEditClick:a}=e,[i,{isLoading:n}]=sg(),r=(0,o.pmc)(),{isOpen:d,onClose:c,onOpen:u}=(0,o.qY0)(),p=async()=>{let e=await i({systemKey:t,asset_ids:[s.id]});(0,e_.D4)(e)?r((0,v.Vo)((0,sl.e$)(e.error,"A problem occurred removing this asset. Please try again"))):r((0,v.t5)("Asset removed successfully"))};return(0,l.jsxs)(o.jqI,{className:"gap-1",children:[(0,l.jsx)(o.wpx,{size:"small",onClick:a,"data-testid":"edit-btn",children:"Edit"}),(0,l.jsx)(o.wpx,{size:"small",onClick:u,loading:n,"data-testid":"remove-btn",children:"Remove"}),(0,l.jsx)(o.cVQ,{isOpen:d,onClose:c,onConfirm:p,title:"Remove asset",message:"Are you sure you want to ignore the selected assets? This action cannot be undone and may impact Bidirectional consent.",isCentered:!0})]})},sM=t(34929),sK=t(26183),sH=e=>{var s,t;let{asset:a,systemId:i,readonly:n}=e,{getDataUseDisplayName:r}=(0,sM.Z)(),[d]=sy(),{errorAlert:c,successAlert:u}=(0,R.V)(),[p,h]=(0,m.useState)(!1),x=async e=>{let s=[...a.data_uses||[],e],t=await d({systemKey:i,assets:[{id:a.id,data_uses:s}]});(0,e_.D4)(t)?c((0,sl.e$)(t.error)):u("Consent category added to ".concat(a.asset_type,' "').concat(a.name,'".'),"Confirmed")},y=async e=>{var s;let t=null===(s=a.data_uses)||void 0===s?void 0:s.filter(s=>s!==e),n=await d({systemKey:i,assets:[{id:a.id,data_uses:t}]});(0,e_.D4)(n)?c((0,sl.e$)(n.error)):u("Consent category removed from ".concat(a.asset_type,' "').concat(a.name,'".'),"Confirmed")},g=null!==(t=null===(s=a.data_uses)||void 0===s?void 0:s.map(e=>({label:r(e),key:e})))&&void 0!==t?t:[];return n?(0,l.jsx)(sK.Z,{children:g.map(e=>(0,l.jsx)(o.j8w,{"data-testid":"data-use-".concat(e.key),color:"white",children:e.label},e.key))}):(0,l.jsxs)(sK.Z,{children:[!p&&(0,l.jsxs)(l.Fragment,{children:[g.map(e=>(0,l.jsx)(o.j8w,{"data-testid":"data-use-".concat(e.key),color:"white",closable:!0,onClose:()=>y(e.key),closeButtonLabel:"Remove data use",children:e.label},e.key)),(0,l.jsx)(o.j8w,{onClick:()=>h(!0),"data-testid":"taxonomy-add-btn",addable:!0,"aria-label":"Add data use"})]}),p&&(0,l.jsx)(o.xuv,{className:"select-wrapper",position:"absolute",zIndex:10,top:"0",left:"0",width:"100%",height:"max",bgColor:"#fff",children:(0,l.jsx)(sR.Z,{selectedTaxonomies:a.data_uses||[],onSelect:x,onBlur:()=>h(!1),open:!0})})]})},sY=e=>{let{systemKey:s,systemName:t,lockedForGVL:a,onEditClick:i}=e,r=(0,sD.Cl)(),d=r.display({id:"select",cell:e=>{let{row:s}=e;return(0,l.jsx)(sZ.k,{isChecked:s.getIsSelected(),onChange:s.getToggleSelectedHandler(),dataTestId:"select-".concat(s.original.name||s.id)})},header:e=>{let{table:s}=e;return(0,l.jsx)(sZ.k,{isChecked:s.getIsAllPageRowsSelected(),isIndeterminate:s.getIsSomeRowsSelected(),onChange:s.getToggleAllRowsSelectedHandler(),dataTestId:"select-all-rows"})},maxSize:40,meta:{cellProps:{borderRight:"none",paddingRight:0}}}),c=r.accessor(e=>e.name,{id:"name",cell:e=>(0,l.jsx)(sA.G3,{value:e.getValue()}),header:"Asset"}),u=r.accessor(e=>e.asset_type,{id:"resource_type",cell:e=>(0,l.jsx)(sA.G3,{value:e.getValue()}),header:"Type"}),p=r.display({id:"system",cell:e=>(0,l.jsx)(sV,{systemKey:s,systemName:t,asset:e.row.original,readonly:a}),header:"System"}),m=r.accessor(e=>e.data_uses,{id:"data_uses",cell:e=>(0,l.jsx)(sH,{asset:e.row.original,systemId:s,readonly:a}),header:"Categories of consent",size:200}),h=r.accessor(e=>e.locations,{id:"locations",cell:e=>(0,l.jsx)(sZ.mb,{values:e.getValue().map(e=>{let s=(0,o.QCN)(e);return{label:s?(0,o.c1K)({isoEntry:s,showFlag:!0}):sO.Z8[e],key:e}})}),header:"Locations",size:300}),x=r.accessor(e=>e.domain,{id:"domain",cell:e=>(0,l.jsx)(sA.G3,{value:e.getValue()}),header:"Domain"}),y=r.accessor(e=>e.duration,{id:"duration",cell:e=>e.row.original.asset_type===n.COOKIE?(0,l.jsx)(sA.G3,{value:e.getValue()}):null,header:"Duration"}),g=r.accessor(e=>e.page,{id:"page",cell:e=>(0,l.jsx)(sZ.tc,{values:e.getValue(),valueSuffix:"pages",cellProps:e}),header:e=>(0,l.jsx)(sZ.Rr,{value:"Detected on",...e}),meta:{showHeaderMenu:!0,disableRowClick:!0}}),_=r.display({id:"actions",cell:e=>{let{row:t}=e;return(0,l.jsx)(sB,{asset:t.original,systemKey:s,onEditClick:()=>i(t.original)})},header:"Actions"}),f=[c,u,p,m,h,x,y,g];return a?f:[d,...f,_]},sG=e=>{var s;let{system:t}=e,{PAGE_SIZES:a,pageSize:i,setPageSize:n,onPreviousPageClick:r,isPreviousPageDisabled:d,onNextPageClick:c,isNextPageDisabled:u,startRange:p,endRange:x,pageIndex:y,setTotalPages:g,resetPageIndexToDefault:_}=(0,sA.oi)(),[f,b]=(0,m.useState)(""),[j,k]=(0,m.useState)(void 0),[w,C]=(0,m.useState)({}),[S]=sg(),D=(0,h.C)(ev.gU),T=(0,o.pmc)(),{data:A,isLoading:E,isFetching:q}=sh({fides_key:t.fides_key,search:f,page:y,size:i}),{isOpen:R,onClose:I,onOpen:L}=(0,o.qY0)(),{isOpen:F,onClose:z,onOpen:O}=(0,o.qY0)();(0,m.useEffect)(()=>{_()},[f,_]),(0,m.useEffect)(()=>{g(null==A?void 0:A.pages)},[A,g]);let Z=sY({systemName:null!==(s=t.name)&&void 0!==s?s:t.fides_key,systemKey:t.fides_key,onEditClick:e=>{k(e),L()},lockedForGVL:D}),P=(0,sS.b7)({getCoreRowModel:(0,sD.sC)(),columns:Z,manualPagination:!0,data:(null==A?void 0:A.items)||[],columnResizeMode:"onChange",onRowSelectionChange:C,state:{rowSelection:w}}),W=P.getSelectedRowModel().rows.map(e=>e.original.id),N=async()=>{let e=await S({systemKey:t.fides_key,asset_ids:W});(0,e_.D4)(e)?T((0,v.Vo)((0,sl.e$)(e.error,"A problem occurred removing these assets. Please try again."))):(P.resetRowSelection(),T((0,v.t5)("Assets removed successfully"))),z()};return t?E?(0,l.jsx)(sA.I4,{rowHeight:36,numRows:36}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.xvT,{fontSize:"sm",mb:4,children:D?"This page displays all assets associated with this system. Use the table below to review these technologies for compliance and detailed insights.":"This page displays all assets associated with this system. Use the table below to review and manage these technologies for compliance and detailed insights."}),(0,l.jsxs)(sA.Q$,{children:[(0,l.jsx)(sT.f,{value:f,onChange:b}),!D&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.LZC,{}),(0,l.jsx)(o.wpx,{icon:(0,l.jsx)(o.PJP.mm_,{}),iconPosition:"end",onClick:L,"data-testid":"add-asset-btn",children:"Add asset"}),(0,l.jsx)(sz,{isOpen:R,onClose:()=>{k(void 0),I()},systemKey:t.fides_key,asset:j}),(0,l.jsx)(o.wpx,{icon:(0,l.jsx)(o.PJP.ZNm,{}),iconPosition:"end",onClick:O,disabled:!W.length,"data-testid":"bulk-delete-btn",children:"Remove"}),(0,l.jsx)(o.cVQ,{isOpen:F,onClose:z,onConfirm:N,title:"Remove assets",message:"Are you sure you want to remove the selected assets? This action cannot be undone and may impact Bidirectional consent.",isCentered:!0})]})]}),(0,l.jsx)(sA.ZK,{tableInstance:P,emptyTableNotice:(0,l.jsx)(o.oj8,{image:o.oj8.PRESENTED_IMAGE_SIMPLE,description:"No assets found","data-testid":"empty-state"})}),(0,l.jsx)(sA.s8,{totalRows:(null==A?void 0:A.total)||0,pageSizes:a,setPageSize:n,onPreviousPageClick:r,isPreviousPageDisabled:d||q,onNextPageClick:c,isNextPageDisabled:u||q,startRange:p,endRange:x})]}):null},s$=e=>{let{setActiveTab:s}=e,t=(0,u.useRouter)(),a=(0,o.pmc)();(0,m.useEffect)(()=>{let{status:e}=t.query;if(e&&t.isReady){s("integrations"),"succeeded"===e?a((0,v.t5)("Integration successfully authorized.")):a((0,v.Vo)("Failed to authorize integration."));let i={...t.query};delete i.status,t.replace({pathname:t.pathname,query:i,hash:"integrations"},void 0,{shallow:!0})}},[t.query,s,t,a])};(i=r||(r={})).INFORMATION="information",i.DATA_USES="data-uses",i.DATA_FLOW="data-flow",i.INTEGRATIONS="integrations",i.ASSETS="assets",i.HISTORY="history";let sQ=e=>{let{onViewDatamap:s,onAddPrivacyDeclaration:t}=e;return(0,l.jsxs)(o.xuv,{children:[(0,l.jsx)(o.xvT,{fontWeight:"700",children:"System has been saved successfully"}),(0,l.jsxs)(o.xvT,{textColor:"gray.700",whiteSpace:"inherit",children:["Your system has been added to your data map. You can"," ",(0,l.jsx)(j.Z,{onClick:s,children:"view it now"})," or"," ",(0,l.jsx)(j.Z,{onClick:t,children:"add privacy declarations in the next tab"}),"."]})]})};var sJ=e=>{var s,t;let{isCreate:a}=e,i=(0,u.useRouter)(),{activeTab:n,onTabChange:d,setActiveTab:p}=(0,b.Z)({tabKeys:Object.values(r)}),[j,k]=(0,m.useState)(!1),{systemOrDatamapRoute:w}=(0,g.V)(),C=(0,o.pmc)(),S=(0,h.T)(),[D,T]=(0,m.useState)(void 0),{plus:A}=(0,x.hz)(),E=i.query.id,{data:q}=(0,W.rn)(E,{skip:!E||a});(0,m.useEffect)(()=>{q&&T(q.processes_personal_data)},[q]);let R=(0,m.useCallback)(e=>{void 0===q&&k(!0),i.push({pathname:_.Dv,query:{id:e.fides_key}});let s={...v.MA,description:(0,l.jsx)(sQ,{onViewDatamap:()=>{i.push(w).then(()=>{C.closeAll()})},onAddPrivacyDeclaration:()=>{d("data-uses"),C.closeAll()}})};C({...s})},[q,i,w,C,d]);(0,m.useEffect)(()=>{a&&(S((0,ev.b3)("initial")),S((0,ev.gQ)(!1)))},[S,a]);let{attemptAction:I}=(0,y.oI)(),L=(0,m.useCallback)(e=>{I().then(async s=>{s&&d(e)})},[I,d]);s$({setActiveTab:p});let F=[{label:"Information",key:"information",children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(o.xuv,{px:6,mb:9,children:[(0,l.jsx)(y.eB,{}),(0,l.jsx)(sC,{onSuccess:R,system:q})]}),j?(0,l.jsx)(o.xuv,{backgroundColor:"gray.100",px:6,py:3,children:(0,l.jsxs)(o.xvT,{color:"primary.900",fontSize:"sm","data-testid":"save-help-message",children:["Now that you have saved this new system it is"," ",(0,l.jsx)(o.rUS,{as:c(),href:w,textDecor:"underline",children:"ready to view in your data map"}),". You can return to this setup at any time to add privacy declarations to this system."]})}):null]})},{label:"Data uses",key:"data-uses",children:q?(0,l.jsx)(o.xuv,{px:6,width:{base:"100%",lg:"70%"},children:(0,l.jsx)(sr,{system:q})}):null,disabled:!q||!D},{label:"Data flow",key:"data-flow",children:q?(0,l.jsxs)(o.xuv,{width:{base:"100%",lg:"70%"},children:[(0,l.jsxs)(o.xuv,{px:6,paddingBottom:2,children:[(0,l.jsx)(o.xvT,{fontSize:"md",lineHeight:6,fontWeight:"bold",marginBottom:3,children:"Data flow"}),(0,l.jsx)(o.xvT,{fontSize:"sm",lineHeight:5,fontWeight:"medium",children:"Data flow describes the flow of data between systems in your Data Map. Below, you can configure Source and Destination systems and the corresponding links will be drawn in the Data Map graph. Source systems are systems that send data to this system while Destination systems receive data from this system."})]}),(0,l.jsx)(f.q,{system:q,isSystemTab:!0})]}):null,disabled:!q},{label:"Integrations",key:"integrations",children:q?(0,l.jsxs)(o.xuv,{width:{base:"100%",lg:"70%"},children:[(0,l.jsx)(o.xuv,{px:6,paddingBottom:2,children:(0,l.jsx)(o.xvT,{fontSize:"sm",lineHeight:5,children:A?(0,l.jsxs)(l.Fragment,{children:["Add an integration to start managing privacy requests and consent. Visit"," ",(0,l.jsx)(o.rUS,{href:_.KH,color:"link.900",children:"Integration Management"})," ","to set up monitoring on databases."]}):"Integrations are used to process privacy requests for access erasure, portability, rectification, and consent."})}),(0,l.jsx)(ey,{connectionConfig:q.connection_configs,systemFidesKey:q.fides_key}),(null===(s=q.connection_configs)||void 0===s?void 0:s.key)&&(0,l.jsx)(eb,{m:6,connectionKey:null===(t=q.connection_configs)||void 0===t?void 0:t.key})]}):null,disabled:!q}];return A&&F.push({label:"Assets",key:"assets",children:q?(0,l.jsx)(sG,{system:q}):null,disabled:!q}),A&&F.push({label:"History",key:"history",children:q?(0,l.jsxs)(o.xuv,{width:{base:"100%",lg:"70%"},children:[(0,l.jsx)(o.xuv,{px:6,paddingBottom:6,children:(0,l.jsx)(o.xvT,{fontSize:"sm",lineHeight:5,fontWeight:"medium",children:"All changes to this system are tracked here in this audit table by date and by user. You can inspect the changes by selecting any of the events listed."})}),(0,l.jsx)(eG,{system:q})]}):null,disabled:!q}),{tabData:F,activeKey:n,onTabChange:L}}},54748:function(e,s,t){"use strict";var a=t(27378),i=t(39449);s.Z=()=>({legalBasisOptions:(0,a.useMemo)(()=>Object.keys(i.gP).map(e=>({value:i.gP[e],label:i.gP[e]})),[])})},28325:function(e,s,t){"use strict";var a=t(27378),i=t(39449);s.Z=()=>({specialCategoryLegalBasisOptions:(0,a.useMemo)(()=>Object.keys(i.nV).map(e=>({value:i.nV[e],label:i.nV[e]})),[])})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[401],{97181:function(e,a,l){l.d(a,{d:function(){return d}});var n=l(24246),t=l(20595),s=l(34090),i=l(27378),r=l(46238),o=l(40324);let d=e=>{let{name:a,label:l,labelProps:d,tooltip:c,isRequired:u,layout:v="inline",helperText:h,...m}=e,[x,j,{setValue:g}]=(0,s.U$)(a),p=!!(j.touched&&j.error),[f,b]=(0,i.useState)("");x.value||"tags"!==m.mode&&"multiple"!==m.mode||(x.value=[]),"tags"===m.mode&&"string"==typeof x.value&&(x.value=[x.value]);let y="tags"===m.mode?(e,a)=>e?e.value!==f||x.value.includes(f)?m.optionRender?m.optionRender(e,a):e.label:'Create "'.concat(f,'"'):void 0:m.optionRender||void 0,C=e=>{b(e),m.onSearch&&m.onSearch(e)},w=(e,a)=>{g(e),m.onChange&&m.onChange(e,a)};return"inline"===v?(0,n.jsx)(t.NIc,{isInvalid:p,isRequired:u,children:(0,n.jsxs)(t.rjZ,{templateColumns:l?"1fr 3fr":"1fr",children:[l?(0,n.jsx)(o.__,{htmlFor:m.id||a,...d,children:l}):null,(0,n.jsxs)(t.jqI,{align:"center",children:[(0,n.jsxs)(t.jqI,{vertical:!0,flex:1,className:"mr-2",children:[(0,n.jsx)(t.WPr,{...x,id:m.id||a,"data-testid":"controlled-select-".concat(x.name),...m,optionRender:y,onSearch:"tags"===m.mode?C:void 0,onChange:w,value:x.value||void 0,status:p?"error":void 0}),h&&(0,n.jsx)(t.Q6r,{children:h}),(0,n.jsx)(o.Bc,{isInvalid:p,message:j.error,fieldName:x.name})]}),(0,n.jsx)(r.b,{label:c,className:p?"mt-2 self-start":void 0})]})]})}):(0,n.jsx)(t.NIc,{isInvalid:p,isRequired:u,children:(0,n.jsxs)(t.gCW,{alignItems:"start",children:[(0,n.jsxs)(t.jqI,{align:"center",children:[l?(0,n.jsx)(o.__,{htmlFor:m.id||a,fontSize:"xs",my:0,mr:1,...d,children:l}):null,(0,n.jsx)(r.b,{label:c})]}),(0,n.jsx)(t.WPr,{...x,id:m.id||a,"data-testid":"controlled-select-".concat(x.name),...m,optionRender:y,onSearch:"tags"===m.mode?C:void 0,onChange:w,value:x.value||void 0,status:p?"error":void 0}),h&&(0,n.jsx)(t.Q6r,{style:{marginTop:0},children:h}),(0,n.jsx)(o.Bc,{isInvalid:p,message:j.error,fieldName:x.name})]})})}},8133:function(e,a,l){var n=l(24246),t=l(20595);a.Z=e=>{let{title:a,children:l,isOpen:s,onClose:i,modalContentProps:r,showCloseButton:o=!1,footer:d,...c}=e;return(0,n.jsxs)(t.u_l,{isOpen:s,onClose:i,isCentered:!0,scrollBehavior:"inside",size:"xl",id:"add-modal",...c,children:[(0,n.jsx)(t.ZAr,{}),(0,n.jsxs)(t.hzk,{textAlign:"left",p:0,"data-testid":"add-modal-content",...r,children:[o&&(0,n.jsx)(t.olH,{}),(0,n.jsx)(t.xBx,{p:0,children:(0,n.jsx)(t.xuv,{backgroundColor:"gray.50",px:6,py:4,border:"1px",borderColor:"gray.200",borderTopRadius:6,display:"flex",justifyContent:"space-between",alignItems:"center",children:(0,n.jsx)(t.X6q,{as:"h3",size:"sm",children:a})})}),(0,n.jsx)(t.fef,{pb:4,overflow:"auto",children:l}),d&&(0,n.jsx)(t.mzw,{children:d})]})]})}},33335:function(e,a,l){l.d(a,{E:function(){return n}});let n=e=>e.toLowerCase().replace(/[ .]/g,"_").replace(/[^a-zA-Z0-9_<>-]/g,"")},36345:function(e,a,l){l.d(a,{Z:function(){return j}});var n=l(24246),t=l(20595),s=l(34090),i=l(27378),r=l(16134),o=l(40324);let d=(0,t.IUT)({displayName:"CompassIcon",viewBox:"0 0 512 512",path:(0,n.jsx)("path",{fill:"currentColor",d:"M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm306.7 69.1L162.4 380.6c-19.4 7.5-38.5-11.6-31-31l55.5-144.3c3.3-8.5 9.9-15.1 18.4-18.4l144.3-55.5c19.4-7.5 38.5 11.6 31 31L325.1 306.7c-3.2 8.5-9.9 15.1-18.4 18.4zM288 256a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})});var c=l(46238),u=l(57865);let{Text:v}=t.AntTypography,h=e=>{let{searchText:a,suggestion:l,...t}=e;return a&&l?(0,n.jsxs)(v,{"aria-hidden":!0,style:{pointerEvents:"none",position:"absolute",zIndex:10,top:"var(--ant-line-width)",bottom:"var(--ant-line-width)",left:"var(--ant-padding-sm)",lineHeight:"calc(var(--ant-control-height) - var(--ant-line-width))"},...t,children:[(0,n.jsx)(v,{className:"text-transparent",children:a}),(0,n.jsx)(v,{type:"secondary",children:l.substring(a.length)})]}):null},m="Create new system",x=e=>{let{active:a,disabled:l,onRefreshSuggestions:s}=e,i={bg:a?"complimentary.500":"gray.100"};return(0,n.jsxs)(t.gCW,{children:[(0,n.jsx)(t.LZC,{minHeight:"18px"}),(0,n.jsxs)(t.v2r,{children:[(0,n.jsx)(t.j2t,{as:t.hU,size:"sm",isDisabled:l,icon:(0,n.jsx)(d,{color:a?"white":"gray.700",boxSize:4}),"aria-label":"Update information from Compass","data-testid":"refresh-suggestions-btn",_hover:{_disabled:i},...i}),(0,n.jsx)(t.qyq,{children:(0,n.jsx)(t.sNh,{onClick:s,children:(0,n.jsx)(t.xvT,{fontSize:"xs",lineHeight:4,children:"Reset to Compass defaults"})})})]})]})};var j=e=>{var a,l;let{label:d,isCreate:v,lockedForGVL:j,options:g,isLoading:p,onVendorSelected:f}=e,b=(0,r.C)(u.bN),[y,C,{setValue:w}]=(0,s.U$)("name"),_=!!(C.touched&&C.error),I={...y,value:null!==(a=y.value)&&void 0!==a?a:""},{touched:N,values:z,setTouched:S,setFieldValue:R,validateForm:k}=(0,s.u6)(),[q,E]=(0,i.useState)(!0),W=null!==(l=g.find(e=>e.value===I.value))&&void 0!==l?l:{label:I.value,value:I.value,description:""},B=(e,a)=>!!(null==a?void 0:a.label.toLowerCase().startsWith(e.toLowerCase())),[T,U]=(0,i.useState)(""),Z=(0,i.useMemo)(()=>g.filter(e=>B(T,e)),[g,T]),A=(0,i.useMemo)(()=>{let e=g;return v&&T&&(e=[...g,{label:"".concat(m,' "').concat(T,'"...'),value:T}]),e},[v,g,T]),F=!!T&&Z.length>0,L=j&&!v;(0,i.useEffect)(()=>{E(!I.value&&!z.vendor_id)},[I.value,z.vendor_id,E]),(0,i.useEffect)(()=>{k()},[q,k]);let M=async()=>{U(""),R("vendor_id",void 0),await w(""),S({...N,vendor_id:!1,name:!1}),f(void 0)},P=async e=>{if(e){let a=g.some(a=>a.value===e.value)?e.value:void 0;R("vendor_id",a),await w(e.label.startsWith(m)?e.value:e.label),S({...N,vendor_id:!0,name:!0}),f(a)}},H=async e=>{I.onBlur(e),T&&await w(T),S({...N,name:!0})},D=async e=>{Z.length>0&&T!==Z[0].label?(e.preventDefault(),U(Z[0].label),R("vendor_id",Z[0].value),await w(Z[0].label),f(Z[0].value)):(R("vendor_id",void 0),await w(T)),S({...N,name:!0})},O=(0,n.jsx)(t.NIc,{isInvalid:_,isRequired:!0,width:"100%",children:(0,n.jsxs)(t.gCW,{alignItems:"start",position:"relative",width:"100%",children:[(0,n.jsxs)(t.Ugi,{spacing:1,children:[(0,n.jsx)(o.__,{htmlFor:"vendorName",fontSize:"xs",my:0,mr:1,children:d}),(0,n.jsx)(c.b,{label:"Enter the system name"})]}),(0,n.jsxs)(t.xuv,{width:"100%",className:"relative",children:[(0,n.jsx)(t.WPr,{id:"vendorName",labelInValue:!0,autoFocus:!0,allowClear:!0,options:A,loading:p,filterOption:(e,a)=>B(e,a)||!!(null==a?void 0:a.label.startsWith(m)),optionFilterProp:"label",value:W,placeholder:"Enter system name...","aria-label":"Select a system",disabled:L,onChange:P,onSearch:U,onClear:M,onBlur:H,onInputKeyDown:e=>{T&&"Tab"===e.key&&D(e)},status:_?"error":void 0,"data-testid":"vendor-name-select"}),(0,n.jsx)(h,{searchText:T,suggestion:Z.length?Z[0].label:""})]}),(0,n.jsx)(o.Bc,{isInvalid:_,message:C.error,fieldName:"name"})]})});return(0,n.jsxs)(t.Ugi,{alignItems:"flex-start",width:"full",children:[q?O:(0,n.jsx)(o.j0,{autoFocus:!0,id:"name",name:"name",label:"System name",tooltip:"Enter the system name",variant:"stacked",disabled:L,isRequired:!0,inputRightElement:L?null:(0,n.jsx)(t.PZ7,{onClick:M,size:"sm","data-testid":"clear-btn"})}),(0,n.jsx)(x,{active:!!z.vendor_id||F,disabled:!z.vendor_id||"showing"===b,onRefreshSuggestions:()=>f(z.vendor_id)})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4496],{12197:function(e){var t;t=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(s,n,i){var a,l=function(e,s,n){void 0===n&&(n={});var i,a,l,r,o=new Date(e);return(void 0===(i=n)&&(i={}),(r=t[l=s+"|"+(a=i.timeZoneName||"short")])||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:a}),t[l]=r),r).formatToParts(o)},r=function(t,s){for(var n=l(t,s),a=[],r=0;r<n.length;r+=1){var o=n[r],d=o.type,u=o.value,c=e[d];c>=0&&(a[c]=parseInt(u,10))}var m=a[3],f=a[0]+"-"+a[1]+"-"+a[2]+" "+(24===m?0:m)+":"+a[4]+":"+a[5]+":000",h=+t;return(i.utc(f).valueOf()-(h-=h%1e3))/6e4},o=n.prototype;o.tz=function(e,t){void 0===e&&(e=a);var s,n=this.utcOffset(),l=this.toDate(),r=l.toLocaleString("en-US",{timeZone:e}),o=Math.round((l-new Date(r))/1e3/60),d=-(15*Math.round(l.getTimezoneOffset()/15))-o;if(Number(d)){if(s=i(r,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(d,!0),t){var u=s.utcOffset();s=s.add(n-u,"minute")}}else s=this.utcOffset(0,t);return s.$x.$timezone=e,s},o.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),s=l(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return s&&s.value};var d=o.startOf;o.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return d.call(this,e,t);var s=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(s,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,s){var n=s&&t,l=s||t||a,o=r(+i(),l);if("string"!=typeof e)return i(e).tz(l);var d=function(e,t,s){var n=e-60*t*1e3,i=r(n,s);if(t===i)return[n,t];var a=r(n-=60*(i-t)*1e3,s);return i===a?[n,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(i.utc(e,n).valueOf(),o,l),u=d[0],c=d[1],m=i(u).utcOffset(c);return m.$x.$timezone=l,m},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}},e.exports=t()},4496:function(e,t,s){"use strict";s.d(t,{Z:function(){return w}});var n=s(24246),i=s(20595),a=s(86677),l=s(27378),r=s(812),o=s(58452),d=s(77830),u=s(19904),c=s(39449),m=s(35493),f=s(40822),h=s(54458),g=s(27693),p=s.n(g),y=s(12197),x=s.n(y),v=s(96600),j=s.n(v),D=s(81179);p().extend(j()),p().extend(x());let{Text:S}=i.AntTypography,N="09:00",_=D.eO.MONDAY,b=[{label:"Daily",value:D.Di.DAILY},{label:"Weekly",value:D.Di.WEEKLY},{label:"Weekdays",value:D.Di.WEEKDAYS},{label:"Monthly",value:D.Di.MONTHLY}];var T=e=>{let{value:t,onChange:s,onTimezoneChange:a,timezone:r}=e,[o,d]=(0,l.useState)(D.Di.WEEKLY),[u,c]=(0,l.useState)(1),[m,f]=(0,l.useState)(!1),g=(0,l.useRef)(!1),y=p().tz.guess(),x=r||y,v=(0,l.useMemo)(()=>{let e=new Date,t=(0,h.WU)(e,"O",{timeZone:x}),s=x.split("/");return{cityName:s[s.length-1].replace(/_/g," "),gmtOffset:t}},[x]);(0,l.useEffect)(()=>{r||null==a||a(y)},[y,a,r]),(0,l.useEffect)(()=>{if(t&&!g.current){let e=(0,D.se)(t);e?(f(!1),d(e.frequency),void 0!==e.dayOfMonth&&c(e.dayOfMonth)):f(!0),g.current=!0}},[t]),(0,l.useEffect)(()=>{let e={frequency:o,time:N,...o===D.Di.WEEKLY&&{dayOfWeek:_},...o===D.Di.MONTHLY&&{dayOfMonth:u}};try{let t=(0,D.Ns)(e);null==s||s(t)}catch(e){console.error("Error generating cron expression:",e)}},[o,u,s]);let j={frequency:o,time:N,...o===D.Di.WEEKLY&&{dayOfWeek:_},...o===D.Di.MONTHLY&&{dayOfMonth:u}};return(0,n.jsxs)(i.vyj,{direction:"vertical",size:"middle",className:"w-full",children:[m&&(0,n.jsx)(i.DUx,{message:"Custom Cron Expression",description:"This digest uses a custom cron expression that cannot be edited with the picker. Changing the schedule will replace the custom expression.",type:"warning",closable:!0,onClose:()=>f(!1)}),(0,n.jsxs)("div",{children:[(0,n.jsx)(S,{strong:!0,className:"mb-1 block",children:"Frequency"}),(0,n.jsx)(i.WPr,{value:o,onChange:d,options:b,"data-testid":"select-frequency",className:"w-full",id:"select-frequency","aria-label":"Frequency"})]}),o===D.Di.MONTHLY&&(0,n.jsxs)("div",{children:[(0,n.jsx)(S,{strong:!0,className:"mb-1 block",children:"Day of Month"}),(0,n.jsx)(i.W7D,{value:u,onChange:e=>{null!==e&&(0,D.Ch)(e)&&c(e)},min:1,max:31,"data-testid":"input-day-of-month",className:"w-full"}),u>28&&(0,n.jsx)(S,{type:"secondary",className:"mt-1 block text-xs",children:"Note: Days 29-31 will not trigger in all months"})]}),(0,n.jsx)("div",{className:"rounded-md bg-gray-50 p-3",children:(0,n.jsxs)(S,{type:"secondary",className:"text-xs",children:["Schedule: ",(0,D.qV)(j)," ",v.cityName," (",v.gmtOffset,")"]})})]})},P=e=>{let{isOpen:t,onClose:s,digestConfigId:a,digestType:l}=e,[o]=i.PPS.useForm(),[d,u]=i.Pg3.useMessage(),[c,{isLoading:m}]=(0,f.ch)(),h=async e=>{let t=await c({digest_config_id:a,digest_config_type:l,test_email:e.email});if((0,r.D4)(t)){d.error((0,r.e$)(t.error));return}d.success("Test email sent to ".concat(e.email)),o.resetFields(),s()},g=()=>{o.resetFields(),s()};return(0,n.jsxs)(i.$zI,{title:"Send Test Email",open:t,onCancel:g,footer:null,destroyOnClose:!0,children:[u,(0,n.jsxs)(i.PPS,{form:o,layout:"vertical",onFinish:h,initialValues:{email:""},children:[(0,n.jsx)(i.PPS.Item,{label:"Email Address",name:"email",rules:[{required:!0,message:"Please enter an email address"},{type:"email",message:"Please enter a valid email address"}],children:(0,n.jsx)(i.AntInput,{type:"email",placeholder:"user@example.com","data-testid":"test-email-input"})}),(0,n.jsx)(i.PPS.Item,{children:(0,n.jsxs)(i.vyj,{className:"w-full justify-end",children:[(0,n.jsx)(i.wpx,{onClick:g,"data-testid":"cancel-test-btn",children:"Cancel"}),(0,n.jsx)(i.wpx,{type:"primary",htmlType:"submit",loading:m,"data-testid":"send-test-btn",children:"Send Test"})]})})]})]})},w=e=>{let{initialValues:t,isLoading:s}=e,[h]=i.PPS.useForm(),g=(0,a.useRouter)(),[p,y]=i.Pg3.useMessage(),[x,v]=(0,l.useState)(!1),[j,D]=(0,l.useState)(!1),[S,N]=(0,l.useState)((null==t?void 0:t.timezone)||m.EW),[_,{isLoading:b}]=(0,f.m1)(),[w,{isLoading:A}]=(0,f.zb)(),[M]=(0,f.yG)(),O=!!(null==t?void 0:t.id),C=(0,u.Tg)([c.Sh.DIGEST_CONFIG_DELETE])&&O,E=async()=>{let e=await M({config_id:null==t?void 0:t.id,digest_config_type:c.tB.MANUAL_TASKS});if((0,r.D4)(e)){p.error((0,r.e$)(e.error)),D(!1);return}p.success("Digest configuration deleted successfully",void 0,()=>{g.push(d.DN)})},L=async e=>{var s;let{id:n,...i}=e,a={...i,messaging_service_type:i.messaging_service_type||c.qr.EMAIL,enabled:null===(s=null==t?void 0:t.enabled)||void 0===s||s,timezone:S};if(O&&n){let e=await w({config_id:n,digest_config_type:c.tB.MANUAL_TASKS,data:a});if((0,r.D4)(e)){p.error((0,r.e$)(e.error));return}p.success({content:"Digest configuration updated successfully",duration:3}),setTimeout(()=>{g.push(d.DN)},500)}else{let e=await _({digest_config_type:c.tB.MANUAL_TASKS,data:a});if((0,r.D4)(e)){p.error((0,r.e$)(e.error));return}p.success({content:"Digest configuration created successfully",duration:3}),setTimeout(()=>{g.push(d.DN)},500)}},z=t||{name:"",digest_type:c.tB.MANUAL_TASKS,messaging_service_type:c.qr.EMAIL,cron_expression:m.by,timezone:m.EW,config_metadata:null};return s?(0,n.jsx)("div",{children:"Loading..."}):(0,n.jsxs)(n.Fragment,{children:[y,(0,n.jsxs)(i.PPS,{form:h,layout:"vertical",initialValues:z,onFinish:L,className:"max-w-2xl",children:[(0,n.jsx)(i.PPS.Item,{label:"Digest Type",name:"digest_type",tooltip:"Type of content this digest will contain",children:(0,n.jsx)(i.WPr,{disabled:!0,options:[{label:"Manual Tasks",value:c.tB.MANUAL_TASKS}],"data-testid":"select-digest-type","aria-label":"Digest Type"})}),(0,n.jsx)(i.PPS.Item,{label:"Name",name:"name",rules:[{required:!0,message:"Please enter a name"}],tooltip:"A descriptive name for this digest configuration",children:(0,n.jsx)(i.AntInput,{"data-testid":"input-name",placeholder:"e.g., Weekly Manual Tasks Summary"})}),(0,n.jsx)(i.PPS.Item,{name:"id",hidden:!0,children:(0,n.jsx)(i.AntInput,{})}),(0,n.jsx)(i.PPS.Item,{name:"messaging_service_type",hidden:!0,children:(0,n.jsx)(i.AntInput,{})}),(0,n.jsx)(i.PPS.Item,{name:"cron_expression",rules:[{required:!0,message:"Please configure a schedule"}],tooltip:"Configure when the digest should be sent",children:(0,n.jsx)(T,{onTimezoneChange:N,timezone:null==t?void 0:t.timezone})}),(0,n.jsx)(i.PPS.Item,{children:(0,n.jsxs)(i.vyj,{className:"w-full justify-between",children:[(0,n.jsxs)(i.vyj,{children:[O&&(0,n.jsx)(i.wpx,{onClick:()=>v(!0),"data-testid":"test-email-btn",children:"Send test"}),C&&(0,n.jsx)(i.wpx,{danger:!0,onClick:()=>{D(!0)},"data-testid":"delete-btn",children:"Delete"})]}),(0,n.jsxs)(i.vyj,{children:[(0,n.jsx)(i.wpx,{onClick:()=>g.push(d.DN),"data-testid":"cancel-btn",children:"Cancel"}),(0,n.jsx)(i.wpx,{type:"primary",htmlType:"submit",loading:b||A,"data-testid":"submit-btn",children:O?"Update":"Create"})]})]})})]}),O&&(null==t?void 0:t.id)&&(0,n.jsx)(P,{isOpen:x,onClose:()=>v(!1),digestConfigId:t.id,digestType:c.tB.MANUAL_TASKS}),(0,n.jsx)(o.Z,{isOpen:j,onClose:()=>{D(!1)},onConfirm:E,title:"Delete digest configuration",message:(0,n.jsxs)("span",{className:"text-gray-500",children:['Are you sure you want to delete the digest "',null==t?void 0:t.name,'"? This action cannot be undone.']}),continueButtonText:"Delete",isCentered:!0,icon:(0,n.jsx)(i.aNP,{})})]})}}}]);
|