From 15d5338b9135f8bd277b1189e7849a9c8842cbf7 Mon Sep 17 00:00:00 2001 From: Miguel Cabrerizo <30386061+doncicuto@users.noreply.github.com> Date: Mon, 13 May 2024 16:01:50 +0200 Subject: [PATCH] feat(cnsl): docs link can be customized and custom button is available (#7840) * feat: customize doc link and additional custom link * feat: add e2e tests * fix: update docs * fix: add @peintnermax changes about cache * fix: golangci-lint complains preparation.PrepareCommands --------- Co-authored-by: Max Peintner --- cmd/defaults.yaml | 15 +- .../app/modules/footer/footer.component.html | 6 +- .../app/modules/footer/footer.component.ts | 11 +- .../app/modules/header/header.component.html | 6 +- .../app/modules/header/header.component.scss | 3 +- .../app/modules/header/header.component.ts | 27 ++- .../privacy-policy.component.html | 20 +- .../privacy-policy.component.ts | 31 +++ .../app/modules/settings-grid/settinglinks.ts | 2 +- .../src/app/modules/settings-list/settings.ts | 2 +- console/src/app/services/grpc-auth.service.ts | 50 ++++- console/src/assets/i18n/bg.json | 5 +- console/src/assets/i18n/cs.json | 5 +- console/src/assets/i18n/de.json | 5 +- console/src/assets/i18n/en.json | 7 +- console/src/assets/i18n/es.json | 5 +- console/src/assets/i18n/fr.json | 5 +- console/src/assets/i18n/it.json | 5 +- console/src/assets/i18n/ja.json | 6 +- console/src/assets/i18n/mk.json | 5 +- console/src/assets/i18n/nl.json | 5 +- console/src/assets/i18n/pl.json | 5 +- console/src/assets/i18n/pt.json | 5 +- console/src/assets/i18n/ru.json | 5 +- console/src/assets/i18n/zh.json | 5 +- .../manage/console/default-settings.mdx | 18 +- .../guides/manage/console/organizations.mdx | 2 +- .../img/guides/console/external_links_1.png | Bin 0 -> 52578 bytes .../img/guides/console/external_links_2.png | Bin 0 -> 6527 bytes .../img/guides/console/privacypolicy.png | Bin 28895 -> 0 bytes .../settings/external-links-settings.cy.ts | 104 ++++++++++ .../support/api/external-links-settings.ts | 32 +++ internal/api/grpc/admin/export.go | 11 +- .../grpc/admin/privacy_policy_converter.go | 11 +- .../management/policy_privacy_converter.go | 22 +- internal/api/grpc/policy/privacy_policy.go | 3 + .../grpc/settings/v2/settings_converter.go | 3 + .../settings/v2/settings_converter_test.go | 16 +- .../eventsourcing/eventstore/auth_request.go | 15 +- internal/command/instance.go | 13 +- internal/command/instance_converter.go | 13 +- internal/command/instance_policy_privacy.go | 33 ++- .../command/instance_policy_privacy_model.go | 10 + .../command/instance_policy_privacy_test.go | 132 ++++++++---- internal/command/org_converter.go | 13 +- internal/command/org_policy_privacy.go | 7 +- internal/command/org_policy_privacy_model.go | 10 + internal/command/org_policy_privacy_test.go | 196 ++++++++++++------ internal/command/policy_privacy_model.go | 25 ++- internal/domain/policy_privacy.go | 11 +- internal/query/privacy_policy.go | 42 +++- internal/query/privacy_policy_test.go | 58 ++++-- internal/query/projection/privacy_policy.go | 46 ++-- .../query/projection/privacy_policy_test.go | 38 +++- .../repository/instance/policy_privacy.go | 6 +- internal/repository/org/policy_privacy.go | 6 +- internal/repository/policy/policy_privacy.go | 54 +++-- proto/zitadel/admin.proto | 17 ++ proto/zitadel/management.proto | 36 ++++ proto/zitadel/policy.proto | 19 ++ .../settings/v2beta/legal_settings.proto | 18 ++ 61 files changed, 1000 insertions(+), 286 deletions(-) create mode 100644 docs/static/img/guides/console/external_links_1.png create mode 100644 docs/static/img/guides/console/external_links_2.png delete mode 100644 docs/static/img/guides/console/privacypolicy.png create mode 100644 e2e/cypress/e2e/settings/external-links-settings.cy.ts create mode 100644 e2e/cypress/support/api/external-links-settings.ts diff --git a/cmd/defaults.yaml b/cmd/defaults.yaml index b8d7952be3..ae6b815037 100644 --- a/cmd/defaults.yaml +++ b/cmd/defaults.yaml @@ -14,16 +14,16 @@ Tracing: # for type 'otel' is used for standard [open telemetry](https://opentelemetry.io) # Fraction: 1.0 # Endpoint: 'otel.collector.endpoint' - # + # # type 'log' or '' disables tracing - # + # # for type 'google' # ProjectID: '' # Fraction: 1.0 Type: none # ZITADEL_TRACING_TYPE Fraction: 1.0 # ZITADEL_TRACING_FRACTION # The endpoint of the otel collector endpoint - Endpoint: '' #ZITADEL_TRACING_ENDPOINT + Endpoint: "" #ZITADEL_TRACING_ENDPOINT Telemetry: # As long as Enabled is true, ZITADEL tries to send usage data to the configured Telemetry.Endpoints. @@ -200,7 +200,7 @@ AssetStorage: # The Projections section defines the behavior for the scheduled and synchronous events projections. Projections: - # The maximum duration a transaction remains open + # The maximum duration a transaction remains open # before it spots left folding additional events # and updates the table. TransactionDuration: 500ms # ZITADEL_PROJECTIONS_TRANSACTIONDURATION @@ -264,7 +264,7 @@ Auth: # See Projections.BulkLimit SearchLimit: 1000 # ZITADEL_AUTH_SEARCHLIMIT Spooler: - # See Projections.TransationDuration + # See Projections.TransationDuration TransactionDuration: 10s #ZITADEL_AUTH_SPOOLER_TRANSACTIONDURATION # See Projections.BulkLimit BulkLimit: 100 #ZITADEL_AUTH_SPOOLER_BULKLIMIT @@ -704,6 +704,9 @@ DefaultInstance: PrivacyLink: https://zitadel.com/docs/legal/privacy-policy # ZITADEL_DEFAULTINSTANCE_PRIVACYPOLICY_PRIVACYLINK HelpLink: "" # ZITADEL_DEFAULTINSTANCE_PRIVACYPOLICY_HELPLINK SupportEmail: "" # ZITADEL_DEFAULTINSTANCE_PRIVACYPOLICY_SUPPORTEMAIL + DocsLink: https://zitadel.com/docs # ZITADEL_DEFAULTINSTANCE_PRIVACYPOLICY_DOCSLINK + CustomLink: "" # ZITADEL_DEFAULTINSTANCE_PRIVACYPOLICY_CUSTOMLINK + CustomLinkText: "" # ZITADEL_DEFAULTINSTANCE_PRIVACYPOLICY_CUSTOMLINKTEXT NotificationPolicy: PasswordChange: true # ZITADEL_DEFAULTINSTANCE_NOTIFICATIONPOLICY_PASSWORDCHANGE LabelPolicy: @@ -1432,4 +1435,4 @@ InitProjections: Enabled: true # ZITADEL_INITPROJECTIONS_ENABLED RetryFailedAfter: 100ms # ZITADEL_INITPROJECTIONS_RETRYFAILEDAFTER MaxFailureCount: 2 # ZITADEL_INITPROJECTIONS_MAXFAILURECOUNT - BulkLimit: 1000 # ZITADEL_INITPROJECTIONS_BULKLIMIT \ No newline at end of file + BulkLimit: 1000 # ZITADEL_INITPROJECTIONS_BULKLIMIT diff --git a/console/src/app/modules/footer/footer.component.html b/console/src/app/modules/footer/footer.component.html index fdf2924441..26d863d129 100644 --- a/console/src/app/modules/footer/footer.component.html +++ b/console/src/app/modules/footer/footer.component.html @@ -1,11 +1,11 @@