feat: lock event types for org users (#14000)

* chroe: org settings schema

* wip: UI work + modal on toggle

* chore: update i18n

* fix: list handler

* fix: update handler on untoggle

* chore: extract

* feat: update handler for hide and delete logic

* chore: radio translations

* chore: fix modal state from flickering

* feat: update copy & add danger colour on delete focus

* chore: update copy

* design: remove modal icon

* chore: include more seeds

* fix: update handler

* feat: hide create for profile user

* feat: use readonly instead

* feat: hide personal event type header when read only

* chore: move away form readOnly as it was used in other ways

* chore: fix read-only bug

* fix: hide readonly create screen

* fix: show managed event types when events are locked

* fix: hide if not admin

* Update packages/trpc/server/routers/viewer/eventTypes/create.handler.ts

Co-authored-by: Carina Wollendorfer <[email protected]>

* fix: feedback

* fix: lock eventtype single switch

* fix: empty state create button

* fix: more profileGroup check outside CTA to pass value to filter too

---------

Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-03-14 09:07:37 +00:00
1 parent 3aff79e7d1
commit 09ca75eb1f
15 files changed
+397 -58

No files matched your search

@@ -204,6 +204,7 @@ function EventTypeSingleLayout({
activeWebhooksNumber,
}: Props) {
const { t } = useLocale();
const eventTypesLockedByOrg = eventType.team?.parent?.organizationSettings?.lockEventTypeCreationForUsers;
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
@@ -341,6 +342,7 @@ function EventTypeSingleLayout({
<div className="self-center rounded-md p-2">
<Switch
id="hiddenSwitch"
disabled={eventTypesLockedByOrg}
checked={!formMethods.watch("hidden")}
onCheckedChange={(e) => {
formMethods.setValue("hidden", !e, { shouldDirty: true });