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:
Apoorv Mishra
2022-09-14 16:07:39 +05:30
committed by GitHub
parent 607a795dd0
commit ce410c4bf3
10 changed files with 171 additions and 3 deletions

View File

@@ -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
/**