* feat: workspace start of week column * feat(l10n): add workspace setting for the first day of the week Fixes #361 * feat: add Saturday as option * chore: fix migration order * chore: fix merge --------- Co-authored-by: Henry <henry_ball@hotmail.co.uk>
This commit is contained in:
@@ -4,11 +4,10 @@ import { z } from "zod";
|
||||
|
||||
import * as workspaceRepo from "@kan/db/repository/workspace.repo";
|
||||
import * as workspaceSlugRepo from "@kan/db/repository/workspaceSlug.repo";
|
||||
import { generateUID } from "@kan/shared/utils";
|
||||
import { generateAvatarUrl, generateUID } from "@kan/shared/utils";
|
||||
|
||||
import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";
|
||||
import { assertPermission } from "../utils/permissions";
|
||||
import { generateAvatarUrl } from "@kan/shared/utils";
|
||||
|
||||
export const workspaceRouter = createTRPCRouter({
|
||||
all: protectedProcedure
|
||||
@@ -84,8 +83,7 @@ export const workspaceRouter = createTRPCRouter({
|
||||
const isAdmin = userMember?.role === "admin";
|
||||
|
||||
// Show emails if user is admin OR workspace setting allows it
|
||||
const shouldShowEmails =
|
||||
isAdmin || result.showEmailsToMembers === true;
|
||||
const shouldShowEmails = isAdmin || result.showEmailsToMembers === true;
|
||||
|
||||
// Generate presigned URLs for member avatars
|
||||
const membersWithAvatarUrls = await Promise.all(
|
||||
@@ -295,6 +293,9 @@ export const workspaceRouter = createTRPCRouter({
|
||||
.optional(),
|
||||
description: z.string().min(3).max(280).optional(),
|
||||
showEmailsToMembers: z.boolean().optional(),
|
||||
weekStartDay: z
|
||||
.union([z.literal(0), z.literal(1), z.literal(6)])
|
||||
.optional(),
|
||||
}),
|
||||
)
|
||||
.output(z.custom<Awaited<ReturnType<typeof workspaceRepo.update>>>())
|
||||
@@ -356,6 +357,7 @@ export const workspaceRouter = createTRPCRouter({
|
||||
slug: input.slug,
|
||||
description: input.description,
|
||||
showEmailsToMembers: input.showEmailsToMembers,
|
||||
weekStartDay: input.weekStartDay,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ export async function sendWebhooksForWorkspace(
|
||||
db,
|
||||
workspaceId,
|
||||
);
|
||||
const webhooks = allWebhooks.filter((w) =>
|
||||
const webhooksForEvent = allWebhooks.filter((w) =>
|
||||
w.events.includes(payload.event),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user