Support user and team preferences (#4081)
* feat: support user preferences * feat: support team preferences * fix: update snapshots * feat: update last visited url by user * fix: update snapshots * fix: use path instead of complete url * fix: do not expose preferences to other users with the exception of admin * feat: support defaultDocumentStatus as a team preference * feat: allow edit even when collaborative editing is enabled * Revert "feat: allow edit even when collaborative editing is enabled" This reverts commit a22a02a406d01eb418dab32249b8b846bf77c59b. * Revert "feat: support defaultDocumentStatus as a team preference" This reverts commit 4928cffe5c682952b1e469a3e50a1a34d05dcc58. * fix: keep preference as a boolean
This commit is contained in:
@@ -36,6 +36,8 @@ import NotContainsUrl from "./validators/NotContainsUrl";
|
||||
|
||||
const readFile = util.promisify(fs.readFile);
|
||||
|
||||
export type TeamPreferences = Record<string, unknown>;
|
||||
|
||||
@Scopes(() => ({
|
||||
withDomains: {
|
||||
include: [{ model: TeamDomain }],
|
||||
@@ -124,6 +126,10 @@ class Team extends ParanoidModel {
|
||||
@Column
|
||||
defaultUserRole: string;
|
||||
|
||||
@AllowNull
|
||||
@Column(DataType.JSONB)
|
||||
preferences: TeamPreferences | null;
|
||||
|
||||
// getters
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user