mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: remove app name and logo customization feature
Users can no longer customize the app name or logo. The branding API endpoints, permission, frontend UI, env vars (APP_NAME, MAX_LOGO_SIZE_KB), and all related tests are removed. Includes a migration to clean up branding data from existing databases.
This commit is contained in:
@@ -55,7 +55,6 @@ describe("hasEffectivePermission", () => {
|
||||
expect(hasEffectivePermission(editor, "users:manage")).toBe(false);
|
||||
expect(hasEffectivePermission(editor, "settings:write")).toBe(false);
|
||||
expect(hasEffectivePermission(editor, "teams:manage")).toBe(false);
|
||||
expect(hasEffectivePermission(editor, "branding:manage")).toBe(false);
|
||||
expect(hasEffectivePermission(editor, "features:manage")).toBe(false);
|
||||
expect(hasEffectivePermission(editor, "system:health")).toBe(false);
|
||||
expect(hasEffectivePermission(editor, "audit:read")).toBe(false);
|
||||
@@ -185,8 +184,8 @@ describe("hasEffectivePermission", () => {
|
||||
|
||||
describe("getPermissions", () => {
|
||||
describe("exact counts for built-in roles", () => {
|
||||
it("admin has exactly 15 permissions", () => {
|
||||
expect(getPermissions("admin")).toHaveLength(15);
|
||||
it("admin has exactly 14 permissions", () => {
|
||||
expect(getPermissions("admin")).toHaveLength(14);
|
||||
});
|
||||
|
||||
it("editor has exactly 7 permissions", () => {
|
||||
|
||||
@@ -19,9 +19,9 @@ import { getPermissions, hasPermission } from "../../../apps/api/src/permissions
|
||||
|
||||
describe("permissions", () => {
|
||||
describe("getPermissions", () => {
|
||||
it("returns all 15 permissions for admin", () => {
|
||||
it("returns all 14 permissions for admin", () => {
|
||||
const perms = getPermissions("admin");
|
||||
expect(perms).toHaveLength(15);
|
||||
expect(perms).toHaveLength(14);
|
||||
expect(perms).toContain("tools:use");
|
||||
expect(perms).toContain("files:own");
|
||||
expect(perms).toContain("files:all");
|
||||
@@ -33,7 +33,6 @@ describe("permissions", () => {
|
||||
expect(perms).toContain("settings:write");
|
||||
expect(perms).toContain("users:manage");
|
||||
expect(perms).toContain("teams:manage");
|
||||
expect(perms).toContain("branding:manage");
|
||||
expect(perms).toContain("features:manage");
|
||||
expect(perms).toContain("system:health");
|
||||
expect(perms).toContain("audit:read");
|
||||
@@ -58,7 +57,6 @@ describe("permissions", () => {
|
||||
expect(perms).not.toContain("settings:write");
|
||||
expect(perms).not.toContain("users:manage");
|
||||
expect(perms).not.toContain("teams:manage");
|
||||
expect(perms).not.toContain("branding:manage");
|
||||
});
|
||||
|
||||
it("returns empty array for unknown role", () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
|
||||
import { getPermissions, hasPermission } from "../../../apps/api/src/permissions.js";
|
||||
|
||||
describe("role permissions", () => {
|
||||
it("admin has all 15 permissions", () => {
|
||||
it("admin has all 14 permissions", () => {
|
||||
const perms = getPermissions("admin");
|
||||
expect(perms).toContain("tools:use");
|
||||
expect(perms).toContain("files:all");
|
||||
@@ -10,7 +10,7 @@ describe("role permissions", () => {
|
||||
expect(perms).toContain("features:manage");
|
||||
expect(perms).toContain("system:health");
|
||||
expect(perms).toContain("audit:read");
|
||||
expect(perms.length).toBe(15);
|
||||
expect(perms.length).toBe(14);
|
||||
});
|
||||
|
||||
it("editor has collaborative but not admin permissions", () => {
|
||||
|
||||
@@ -752,7 +752,6 @@ describe("loadEnv", () => {
|
||||
"WORKSPACE_PATH",
|
||||
"DEFAULT_THEME",
|
||||
"DEFAULT_LOCALE",
|
||||
"APP_NAME",
|
||||
];
|
||||
for (const key of keysToClean) {
|
||||
delete process.env[key];
|
||||
@@ -794,7 +793,6 @@ describe("loadEnv", () => {
|
||||
expect(typeof env.WORKSPACE_PATH).toBe("string");
|
||||
expect(["light", "dark"]).toContain(env.DEFAULT_THEME);
|
||||
expect(typeof env.DEFAULT_LOCALE).toBe("string");
|
||||
expect(typeof env.APP_NAME).toBe("string");
|
||||
});
|
||||
|
||||
it("parses custom PORT as a number via coercion", async () => {
|
||||
@@ -862,12 +860,10 @@ describe("loadEnv", () => {
|
||||
});
|
||||
|
||||
it("accepts string values for string fields", async () => {
|
||||
process.env.APP_NAME = "My Custom App";
|
||||
process.env.DB_PATH = "/var/data/mydb.sqlite";
|
||||
process.env.DEFAULT_LOCALE = "fr";
|
||||
const { loadEnv } = await import("../../../apps/api/src/lib/env.js");
|
||||
const env = loadEnv();
|
||||
expect(env.APP_NAME).toBe("My Custom App");
|
||||
expect(env.DB_PATH).toBe("/var/data/mydb.sqlite");
|
||||
expect(env.DEFAULT_LOCALE).toBe("fr");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user