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

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "OrganizationSettings" ADD COLUMN "lockEventTypeCreationForUsers" BOOLEAN NOT NULL DEFAULT false;
+8 -7
View File
@@ -374,13 +374,14 @@ model Team {
}
model OrganizationSettings {
id Int @id @default(autoincrement())
organization Team @relation(fields: [organizationId], references: [id], onDelete: Cascade)
organizationId Int @unique
isOrganizationConfigured Boolean @default(false)
isOrganizationVerified Boolean @default(false)
orgAutoAcceptEmail String
dSyncData DSyncData?
id Int @id @default(autoincrement())
organization Team @relation(fields: [organizationId], references: [id], onDelete: Cascade)
organizationId Int @unique
isOrganizationConfigured Boolean @default(false)
isOrganizationVerified Boolean @default(false)
orgAutoAcceptEmail String
lockEventTypeCreationForUsers Boolean @default(false)
dSyncData DSyncData?
}
enum MembershipRole {
+45
View File
@@ -852,6 +852,51 @@ async function main() {
},
],
},
{
memberData: {
email: "[email protected]",
password: {
create: {
hash: "member1-acme",
},
},
username: "member1-acme",
name: "Member 1",
},
orgMembership: {
role: "MEMBER",
accepted: true,
},
orgProfile: {
username: "member1",
},
inTeams: [
{
slug: "team1",
role: "ADMIN",
},
],
},
{
memberData: {
email: "[email protected]",
password: {
create: {
hash: "member2-acme",
},
},
username: "member2-acme",
name: "Member 2",
},
orgMembership: {
role: "MEMBER",
accepted: true,
},
orgProfile: {
username: "member2",
},
inTeams: [],
},
],
},
teams: [