From ac068c0c07c4e343a1e09d6fddd5ffc1bfb3435b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 9 Sep 2023 23:41:48 -0400 Subject: [PATCH] fix observability regression, from 5c839998 --- app/models/AuthenticationProvider.ts | 1 + app/models/Collection.ts | 2 ++ app/models/Comment.ts | 1 + app/models/Document.ts | 4 ++++ app/models/FileOperation.ts | 3 ++- app/models/Group.ts | 1 + app/models/Integration.ts | 1 + app/models/Policy.ts | 2 ++ app/models/Share.ts | 4 ++++ app/models/Team.ts | 2 ++ app/models/User.ts | 5 +++++ app/models/View.ts | 4 +++- app/models/base/Model.ts | 1 + 13 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/models/AuthenticationProvider.ts b/app/models/AuthenticationProvider.ts index 6d5dd62a5..2e80dd151 100644 --- a/app/models/AuthenticationProvider.ts +++ b/app/models/AuthenticationProvider.ts @@ -9,6 +9,7 @@ class AuthenticationProvider extends Model { name: string; + @observable isConnected: boolean; @Field diff --git a/app/models/Collection.ts b/app/models/Collection.ts index 8831d3130..7a81eed0e 100644 --- a/app/models/Collection.ts +++ b/app/models/Collection.ts @@ -62,8 +62,10 @@ export default class Collection extends ParanoidModel { @observable documents?: NavigationNode[]; + @observable url: string; + @observable urlId: string; constructor(fields: Partial, store: CollectionsStore) { diff --git a/app/models/Comment.ts b/app/models/Comment.ts index e92ea2111..5e3707886 100644 --- a/app/models/Comment.ts +++ b/app/models/Comment.ts @@ -46,6 +46,7 @@ class Comment extends Model { createdById: string; + @observable resolvedAt: string; @Relation(() => User) diff --git a/app/models/Document.ts b/app/models/Document.ts index bd3da68f3..60bb92c8d 100644 --- a/app/models/Document.ts +++ b/app/models/Document.ts @@ -122,15 +122,19 @@ export default class Document extends ParanoidModel { @observable archivedAt: string; + @observable url: string; + @observable urlId: string; + @observable tasks: { completed: number; total: number; }; + @observable revision: number; /** diff --git a/app/models/FileOperation.ts b/app/models/FileOperation.ts index b4a1f0776..d531f153a 100644 --- a/app/models/FileOperation.ts +++ b/app/models/FileOperation.ts @@ -1,4 +1,4 @@ -import { computed } from "mobx"; +import { computed, observable } from "mobx"; import { FileOperationFormat, FileOperationType } from "@shared/types"; import { bytesToHumanReadable } from "@shared/utils/files"; import User from "./User"; @@ -7,6 +7,7 @@ import Model from "./base/Model"; class FileOperation extends Model { id: string; + @observable state: string; name: string; diff --git a/app/models/Group.ts b/app/models/Group.ts index 3c6e20ef3..63772e0c2 100644 --- a/app/models/Group.ts +++ b/app/models/Group.ts @@ -11,6 +11,7 @@ class Group extends Model { @observable name: string; + @observable memberCount: number; } diff --git a/app/models/Integration.ts b/app/models/Integration.ts index c73a4d5b6..508647c31 100644 --- a/app/models/Integration.ts +++ b/app/models/Integration.ts @@ -20,6 +20,7 @@ class Integration extends Model { @observable events: string[]; + @observable settings: IntegrationSettings; } diff --git a/app/models/Policy.ts b/app/models/Policy.ts index b6517d2a1..ebfea332c 100644 --- a/app/models/Policy.ts +++ b/app/models/Policy.ts @@ -1,8 +1,10 @@ +import { observable } from "mobx"; import Model from "./base/Model"; class Policy extends Model { id: string; + @observable abilities: Record; } diff --git a/app/models/Share.ts b/app/models/Share.ts index eee75412c..d52ac44c6 100644 --- a/app/models/Share.ts +++ b/app/models/Share.ts @@ -24,12 +24,16 @@ class Share extends Model { @observable urlId: string; + @observable documentTitle: string; + @observable documentUrl: string; + @observable lastAccessedAt: string | null | undefined; + @observable url: string; createdBy: User; diff --git a/app/models/Team.ts b/app/models/Team.ts index 4d4cc7c60..09179143c 100644 --- a/app/models/Team.ts +++ b/app/models/Team.ts @@ -58,8 +58,10 @@ class Team extends Model { @observable preferences: TeamPreferences | null; + @observable domain: string | null | undefined; + @observable url: string; @Field diff --git a/app/models/User.ts b/app/models/User.ts index aa0dcdc19..4c32c5e0e 100644 --- a/app/models/User.ts +++ b/app/models/User.ts @@ -44,14 +44,19 @@ class User extends ParanoidModel { @observable notificationSettings: NotificationSettings; + @observable email: string; + @observable isAdmin: boolean; + @observable isViewer: boolean; + @observable lastActiveAt: string; + @observable isSuspended: boolean; @computed diff --git a/app/models/View.ts b/app/models/View.ts index 4a9816892..dd045a42e 100644 --- a/app/models/View.ts +++ b/app/models/View.ts @@ -1,4 +1,4 @@ -import { action } from "mobx"; +import { action, observable } from "mobx"; import User from "./User"; import Model from "./base/Model"; @@ -9,8 +9,10 @@ class View extends Model { firstViewedAt: string; + @observable lastViewedAt: string; + @observable count: number; user: User; diff --git a/app/models/base/Model.ts b/app/models/base/Model.ts index d8fba82dc..dba1635c4 100644 --- a/app/models/base/Model.ts +++ b/app/models/base/Model.ts @@ -16,6 +16,7 @@ export default abstract class Model { createdAt: string; + @observable updatedAt: string; store: Store;