- {this.current ? (
-
-
-
+ {current ? (
+
+
-
+
-
+
) : ''}
@@ -86,7 +94,7 @@ class PopupPreview extends React.Component
{
this.swiper = swiper}
initialSlide={initial}
- spaceBetween={8}
+ spaceBetween={0}
slidesPerView={1}
centeredSlides={true}
keyboard={{ enabled: true }}
@@ -94,10 +102,10 @@ class PopupPreview extends React.Component {
thumbs={{ swiper: this.thumbs }}
navigation={true}
modules={[ Mousewheel, Keyboard, Thumbs, Navigation ]}
- onTransitionEnd={(data) => this.setCurrent(data.activeIndex)}
+ onTransitionEnd={data => this.setCurrent(data.activeIndex)}
>
{gallery.map((item: any, i: number) => (
-
+ close()}>
{getContent(item, i)}
))}
@@ -111,7 +119,7 @@ class PopupPreview extends React.Component {
onSwiper={swiper => this.thumbs = swiper}
initialSlide={initial}
spaceBetween={8}
- slidesPerView={'auto'}
+ slidesPerView="auto"
modules={[ Thumbs ]}
>
{gallery.map((item: any, i: number) => (
@@ -167,8 +175,7 @@ class PopupPreview extends React.Component {
const item = gallery[idx];
if (item && item.object) {
- this.current = item.object;
- this.forceUpdate();
+ this.setState({ current: item.object });
};
};
@@ -176,26 +183,41 @@ class PopupPreview extends React.Component {
keyboard.shortcut('escape', e, () => this.props.close());
};
- onMore () {
- const { getId, close } = this.props;
+ onExpand (e: any) {
+ e.stopPropagation();
+ e.preventDefault();
- if (!this.current) {
+ const { current } = this.state;
+
+ S.Popup.closeAll(null, () => {
+ if (current) {
+ U.Object.openAuto(current);
+ };
+ });
+ };
+
+ onMore (e: any) {
+ e.stopPropagation();
+ e.preventDefault();
+
+ const { getId, close } = this.props;
+ const { current } = this.state;
+
+ if (!current) {
return;
};
- const cb = () => {
- close();
- };
+ const cb = () => close();
S.Menu.open('object', {
element: `#${getId()} #button-header-more`,
horizontal: I.MenuDirection.Right,
subIds: J.Menu.object,
data: {
- rootId: this.current.id,
- blockId: this.current.id,
- blockIds: [ this.current.id ],
- object: this.current,
+ rootId: current.id,
+ blockId: current.id,
+ blockIds: [ current.id ],
+ object: current,
isFilePreview: true,
onArchive: cb,
onDelete: cb,
@@ -207,8 +229,12 @@ class PopupPreview extends React.Component {
const { getId } = this.props;
const node = $(`#${getId()}-innerWrap`);
const wrap = node.find(`#itemPreview-${idx}`);
- const obj = this.galleryMap.get(idx);
+ if (!wrap.length) {
+ return;
+ };
+
+ const obj = this.galleryMap.get(idx);
if (!obj) {
return;
};
diff --git a/src/ts/component/popup/search.tsx b/src/ts/component/popup/search.tsx
index 93d43042e5..36af27c12b 100644
--- a/src/ts/component/popup/search.tsx
+++ b/src/ts/component/popup/search.tsx
@@ -589,7 +589,6 @@ const PopupSearch = observer(class PopupSearch extends React.Component {
+ C.ObjectSearchWithMeta(space, filters, sorts, J.Relation.default.concat([ 'links', 'backlinks', '_score' ]), filter, this.offset, limit, (message) => {
if (message.error.code) {
this.setState({ isLoading: false });
return;
diff --git a/src/ts/component/popup/settings/onboarding.tsx b/src/ts/component/popup/settings/onboarding.tsx
index d930834732..85c985a344 100644
--- a/src/ts/component/popup/settings/onboarding.tsx
+++ b/src/ts/component/popup/settings/onboarding.tsx
@@ -133,7 +133,7 @@ const PopupSettingsOnboarding = observer(class PopupSettingsOnboarding extends R
};
onUpload () {
- Action.openFileDialog([ 'yml' ], (paths: string[]) => this.onChange('path', paths[0]));
+ Action.openFileDialog({ extensions: [ 'yml' ] }, (paths: string[]) => this.onChange('path', paths[0]));
};
onSave () {
diff --git a/src/ts/component/widget/buttons.tsx b/src/ts/component/widget/buttons.tsx
index ed4d6098af..e258944b82 100644
--- a/src/ts/component/widget/buttons.tsx
+++ b/src/ts/component/widget/buttons.tsx
@@ -64,6 +64,10 @@ const WidgetButtons = observer(class WidgetSpace extends React.Component void) {
+ openFileDialog (param: any, callBack?: (paths: string[]) => void) {
+ param = Object.assign({
+ extensions: [],
+ properties: [],
+ }, param);
+
+ const properties = param.properties || [];
+ const extensions = param.extensions || [];
+
const options: any = {
- properties: [ 'openFile' ],
+ properties: [ 'openFile' ].concat(properties),
};
- if (extensions && extensions.length) {
+ if (extensions.length) {
options.filters = [
{ name: 'Filtered extensions', extensions },
];
@@ -400,7 +408,7 @@ class Action {
const { dataPath } = S.Common;
const { mode, path } = networkConfig;
- this.openFileDialog([ 'zip' ], paths => {
+ this.openFileDialog({ extensions: [ 'zip' ] }, paths => {
C.AccountRecoverFromLegacyExport(paths[0], dataPath, U.Common.rand(1, J.Constant.count.icon), (message: any) => {
if (onError(message.error)) {
return;
diff --git a/src/ts/lib/api/command.ts b/src/ts/lib/api/command.ts
index f8b39fd715..a1d6cecac7 100644
--- a/src/ts/lib/api/command.ts
+++ b/src/ts/lib/api/command.ts
@@ -1544,9 +1544,10 @@ export const ObjectListModifyDetailValues = (objectIds: string[], operations: an
dispatcher.request(ObjectListModifyDetailValues.name, request, callBack);
};
-export const ObjectSearch = (filters: I.Filter[], sorts: I.Sort[], keys: string[], fullText: string, offset: number, limit: number, callBack?: (message: any) => void) => {
+export const ObjectSearch = (spaceId: string, filters: I.Filter[], sorts: I.Sort[], keys: string[], fullText: string, offset: number, limit: number, callBack?: (message: any) => void) => {
const request = new Rpc.Object.Search.Request();
+ request.setSpaceid(spaceId);
request.setFiltersList(filters.map(Mapper.To.Filter));
request.setSortsList(sorts.map(Mapper.To.Sort));
request.setFulltext(fullText);
@@ -1557,9 +1558,10 @@ export const ObjectSearch = (filters: I.Filter[], sorts: I.Sort[], keys: string[
dispatcher.request(ObjectSearch.name, request, callBack);
};
-export const ObjectSearchWithMeta = (filters: I.Filter[], sorts: I.Sort[], keys: string[], fullText: string, offset: number, limit: number, callBack?: (message: any) => void) => {
+export const ObjectSearchWithMeta = (spaceId: string, filters: I.Filter[], sorts: I.Sort[], keys: string[], fullText: string, offset: number, limit: number, callBack?: (message: any) => void) => {
const request = new Rpc.Object.SearchWithMeta.Request();
+ request.setSpaceid(spaceId);
request.setFiltersList(filters.map(Mapper.To.Filter));
request.setSortsList(sorts.map(Mapper.To.Sort));
request.setFulltext(fullText);
@@ -1570,9 +1572,10 @@ export const ObjectSearchWithMeta = (filters: I.Filter[], sorts: I.Sort[], keys:
dispatcher.request(ObjectSearchWithMeta.name, request, callBack);
};
-export const ObjectSearchSubscribe = (subId: string, filters: I.Filter[], sorts: I.Sort[], keys: string[], sources: string[], offset: number, limit: number, afterId: string, beforeId: string, noDeps: boolean, collectionId: string, callBack?: (message: any) => void) => {
+export const ObjectSearchSubscribe = (spaceId: string, subId: string, filters: I.Filter[], sorts: I.Sort[], keys: string[], sources: string[], offset: number, limit: number, afterId: string, beforeId: string, noDeps: boolean, collectionId: string, callBack?: (message: any) => void) => {
const request = new Rpc.Object.SearchSubscribe.Request();
+ request.setSpaceid(spaceId);
request.setSubid(subId);
request.setFiltersList(filters.map(Mapper.To.Filter));
request.setSortsList(sorts.map(Mapper.To.Sort));
@@ -1601,9 +1604,10 @@ export const ObjectGroupsSubscribe = (spaceId: string, subId: string, relationKe
dispatcher.request(ObjectGroupsSubscribe.name, request, callBack);
};
-export const ObjectSubscribeIds = (subId: string, ids: string[], keys: string[], noDeps: boolean, callBack?: (message: any) => void) => {
+export const ObjectSubscribeIds = (spaceId: string, subId: string, ids: string[], keys: string[], noDeps: boolean, callBack?: (message: any) => void) => {
const request = new Rpc.Object.SubscribeIds.Request();
+ request.setSpaceid(spaceId);
request.setSubid(subId);
request.setIdsList(ids);
request.setKeysList(keys);
diff --git a/src/ts/lib/api/dispatcher.ts b/src/ts/lib/api/dispatcher.ts
index 7e7c72c2b1..714383b103 100644
--- a/src/ts/lib/api/dispatcher.ts
+++ b/src/ts/lib/api/dispatcher.ts
@@ -797,7 +797,7 @@ class Dispatcher {
// Added space should be subscribed to my participant
if (U.Object.isSpaceViewLayout(details.layout) && details.targetSpaceId) {
- U.Data.createMyParticipantSubscriptions([ details.targetSpaceId ]);
+ U.Data.createSubSpaceSubscriptions([ details.targetSpaceId ]);
};
updateMarkup = true;
diff --git a/src/ts/lib/api/mapper.ts b/src/ts/lib/api/mapper.ts
index c2b6cdd1ca..4f19061676 100644
--- a/src/ts/lib/api/mapper.ts
+++ b/src/ts/lib/api/mapper.ts
@@ -76,6 +76,7 @@ export const Mapper = {
deviceId: obj.getDeviceid(),
localStoragePath: obj.getLocalstoragepath(),
accountSpaceId: obj.getAccountspaceid(),
+ techSpaceId: obj.getTechspaceid(),
spaceViewId: obj.getSpaceviewid(),
widgetsId: obj.getWidgetsid(),
analyticsId: obj.getAnalyticsid(),
diff --git a/src/ts/lib/dataview.ts b/src/ts/lib/dataview.ts
index 0fba1d5df3..9d30bdc29f 100644
--- a/src/ts/lib/dataview.ts
+++ b/src/ts/lib/dataview.ts
@@ -101,7 +101,6 @@ class Dataview {
keys: J.Relation.default,
offset: 0,
limit: 0,
- ignoreWorkspace: false,
sources: [],
clear: false,
collectionId: '',
diff --git a/src/ts/lib/util/data.ts b/src/ts/lib/util/data.ts
index 217b5fe470..cf4915a63f 100644
--- a/src/ts/lib/util/data.ts
+++ b/src/ts/lib/util/data.ts
@@ -2,6 +2,7 @@ import * as Sentry from '@sentry/browser';
import { I, C, M, S, J, U, keyboard, translate, Storage, analytics, dispatcher, Mark, focus, Renderer, Action, Survey, Onboarding, Preview } from 'Lib';
type SearchSubscribeParams = Partial<{
+ spaceId: string;
subId: string;
idField: string;
filters: I.Filter[];
@@ -13,7 +14,6 @@ type SearchSubscribeParams = Partial<{
beforeId: string;
offset: number;
limit: number;
- ignoreWorkspace: boolean;
ignoreHidden: boolean;
ignoreDeleted: boolean;
withArchived: boolean;
@@ -289,17 +289,20 @@ class UtilData {
return;
};
+ const { techSpaceId } = account.info;
const list: any[] = [
{
+ spaceId: techSpaceId,
subId: J.Constant.subId.profile,
+ keys: this.profileRelationKeys(),
filters: [
{ relationKey: 'id', condition: I.FilterCondition.Equal, value: account.info.profileObjectId },
],
noDeps: true,
- ignoreWorkspace: true,
ignoreHidden: false,
},
{
+ spaceId: techSpaceId,
subId: J.Constant.subId.space,
keys: this.spaceRelationKeys(),
filters: [
@@ -308,17 +311,16 @@ class UtilData {
sorts: [
{ relationKey: 'createdDate', type: I.SortType.Desc },
],
- ignoreWorkspace: true,
ignoreHidden: false,
},
];
this.createSubscriptions(list, () => {
- this.createMyParticipantSubscriptions(null, callBack);
+ this.createSubSpaceSubscriptions(null, callBack);
});
};
- createMyParticipantSubscriptions (ids: string[], callBack?: () => void) {
+ createSubSpaceSubscriptions (ids: string[], callBack?: () => void) {
const { account } = S.Auth;
if (!account) {
@@ -343,15 +345,23 @@ class UtilData {
const list = [];
spaces.forEach(space => {
+ const ids = [
+ space.creator,
+ U.Space.getParticipantId(space.targetSpaceId, account.id),
+ ];
+
+ if (![ I.HomePredefinedId.Graph, I.HomePredefinedId.Last ].includes(space.spaceDashboardId)) {
+ ids.push(space.spaceDashboardId);
+ };
+
list.push({
- subId: [ J.Constant.subId.myParticipant, space.targetSpaceId ].join('-'),
+ spaceId: space.targetSpaceId,
+ subId: U.Space.getSubSpaceSubId(space.targetSpaceId),
keys: this.participantRelationKeys(),
filters: [
- { relationKey: 'spaceId', condition: I.FilterCondition.Equal, value: space.targetSpaceId },
- { relationKey: 'id', condition: I.FilterCondition.Equal, value: U.Space.getParticipantId(space.targetSpaceId, account.id) },
+ { relationKey: 'id', condition: I.FilterCondition.In, value: ids },
],
noDeps: true,
- ignoreWorkspace: true,
ignoreDeleted: true,
ignoreHidden: false,
});
@@ -376,37 +386,58 @@ class UtilData {
subId: J.Constant.subId.type,
keys: this.typeRelationKeys(),
filters: [
- { relationKey: 'spaceId', condition: I.FilterCondition.In, value: [ J.Constant.storeSpaceId, space ] },
{ relationKey: 'layout', condition: I.FilterCondition.In, value: I.ObjectLayout.Type },
],
sorts: [
- { relationKey: 'spaceId', type: I.SortType.Desc },
{ relationKey: 'lastUsedDate', type: I.SortType.Desc },
{ relationKey: 'name', type: I.SortType.Asc },
],
noDeps: true,
- ignoreWorkspace: true,
ignoreDeleted: true,
ignoreHidden: false,
onSubscribe: () => {
S.Record.getTypes().forEach(it => S.Record.typeKeyMapSet(it.spaceId, it.uniqueKey, it.id));
}
},
+ {
+ spaceId: J.Constant.storeSpaceId,
+ subId: J.Constant.subId.typeStore,
+ keys: this.typeRelationKeys(),
+ filters: [
+ { relationKey: 'layout', condition: I.FilterCondition.In, value: I.ObjectLayout.Type },
+ ],
+ sorts: [
+ { relationKey: 'lastUsedDate', type: I.SortType.Desc },
+ { relationKey: 'name', type: I.SortType.Asc },
+ ],
+ noDeps: true,
+ ignoreDeleted: true,
+ ignoreHidden: false,
+ },
{
subId: J.Constant.subId.relation,
keys: J.Relation.relation,
filters: [
- { relationKey: 'spaceId', condition: I.FilterCondition.In, value: [ J.Constant.storeSpaceId, space ] },
{ relationKey: 'layout', condition: I.FilterCondition.In, value: I.ObjectLayout.Relation },
],
noDeps: true,
- ignoreWorkspace: true,
ignoreDeleted: true,
ignoreHidden: false,
onSubscribe: () => {
S.Record.getRelations().forEach(it => S.Record.relationKeyMapSet(it.spaceId, it.relationKey, it.id));
},
},
+ {
+ spaceId: J.Constant.storeSpaceId,
+ subId: J.Constant.subId.relationStore,
+ keys: J.Relation.relation,
+ filters: [
+ { relationKey: 'layout', condition: I.FilterCondition.In, value: I.ObjectLayout.Relation },
+ ],
+ noDeps: true,
+ ignoreDeleted: true,
+ ignoreHidden: false,
+ },
{
subId: J.Constant.subId.option,
keys: J.Relation.option,
@@ -463,6 +494,10 @@ class UtilData {
ids.forEach(id => Action.dbClearRoot(id));
};
+ profileRelationKeys () {
+ return J.Relation.default.concat('sharedSpacesLimit');
+ };
+
spaceRelationKeys () {
return J.Relation.default.concat(J.Relation.space).concat(J.Relation.participant);
};
@@ -765,17 +800,13 @@ class UtilData {
};
searchDefaultFilters (param: any) {
- const { config, space } = S.Common;
- const { ignoreWorkspace, ignoreHidden, ignoreDeleted, withArchived } = param;
+ const { config } = S.Common;
+ const { ignoreHidden, ignoreDeleted, withArchived } = param;
const filters = param.filters || [];
const chatDerivedType = S.Record.getChatDerivedType();
filters.push({ relationKey: 'uniqueKey', condition: I.FilterCondition.NotEqual, value: J.Constant.typeKey.chatDerived });
- if (!ignoreWorkspace) {
- filters.push({ relationKey: 'spaceId', condition: I.FilterCondition.Equal, value: space });
- };
-
if (ignoreHidden && !config.debug.hiddenObject) {
filters.push({ relationKey: 'isHidden', condition: I.FilterCondition.NotEqual, value: true });
filters.push({ relationKey: 'isHiddenDiscovery', condition: I.FilterCondition.NotEqual, value: true });
@@ -829,9 +860,10 @@ class UtilData {
};
searchSubscribe (param: SearchSubscribeParams, callBack?: (message: any) => void) {
- const { config, space } = S.Common;
+ const { space } = S.Common;
param = Object.assign({
+ spaceId: space,
subId: '',
idField: 'id',
filters: [],
@@ -840,7 +872,6 @@ class UtilData {
sources: [],
offset: 0,
limit: 0,
- ignoreWorkspace: false,
ignoreHidden: true,
ignoreDeleted: true,
withArchived: false,
@@ -850,7 +881,7 @@ class UtilData {
collectionId: ''
}, param);
- const { subId, idField, sorts, sources, offset, limit, ignoreWorkspace, afterId, beforeId, noDeps, collectionId } = param;
+ const { spaceId, subId, idField, sorts, sources, offset, limit, afterId, beforeId, noDeps, collectionId } = param;
const keys: string[] = [ ...new Set(param.keys as string[]) ];
const filters = this.searchDefaultFilters(param);
@@ -863,7 +894,7 @@ class UtilData {
keys.push(idField);
};
- C.ObjectSearchSubscribe(subId, filters, sorts.map(this.sortMapper), keys, sources, offset, limit, afterId, beforeId, noDeps, collectionId, (message: any) => {
+ C.ObjectSearchSubscribe(spaceId, subId, filters, sorts.map(this.sortMapper), keys, sources, offset, limit, afterId, beforeId, noDeps, collectionId, (message: any) => {
this.onSubscribe(subId, idField, keys, message);
if (callBack) {
@@ -873,7 +904,10 @@ class UtilData {
};
subscribeIds (param: any, callBack?: (message: any) => void) {
+ const { space } = S.Common;
+
param = Object.assign({
+ spaceId: space,
subId: '',
ids: [],
keys: J.Relation.default,
@@ -881,7 +915,7 @@ class UtilData {
idField: 'id',
}, param);
- const { subId, keys, noDeps, idField } = param;
+ const { spaceId, subId, keys, noDeps, idField } = param;
const ids = U.Common.arrayUnique(param.ids.filter(it => it));
if (!subId) {
@@ -897,7 +931,7 @@ class UtilData {
keys.push(idField);
};
- C.ObjectSubscribeIds(subId, ids, keys, noDeps, (message: any) => {
+ C.ObjectSubscribeIds(spaceId, subId, ids, keys, noDeps, (message: any) => {
(message.records || []).sort((c1: any, c2: any) => {
const i1 = ids.indexOf(c1.id);
const i2 = ids.indexOf(c2.id);
@@ -915,7 +949,10 @@ class UtilData {
};
search (param: SearchSubscribeParams & { fullText?: string }, callBack?: (message: any) => void) {
+ const { space } = S.Common;
+
param = Object.assign({
+ spaceId: space,
idField: 'id',
fullText: '',
filters: [],
@@ -923,13 +960,12 @@ class UtilData {
keys: J.Relation.default,
offset: 0,
limit: 0,
- ignoreWorkspace: false,
ignoreHidden: true,
ignoreDeleted: true,
withArchived: false,
}, param);
- const { idField, sorts, offset, limit } = param;
+ const { spaceId, idField, sorts, offset, limit } = param;
const keys: string[] = [ ...new Set(param.keys as string[]) ];
const filters = this.searchDefaultFilters(param);
@@ -937,7 +973,7 @@ class UtilData {
keys.push(idField);
};
- C.ObjectSearch(filters, sorts.map(this.sortMapper), keys, param.fullText, offset, limit, (message: any) => {
+ C.ObjectSearch(spaceId, filters, sorts.map(this.sortMapper), keys, param.fullText, offset, limit, (message: any) => {
if (message.records) {
message.records = message.records.map(it => S.Detail.mapper(it));
};
@@ -985,7 +1021,6 @@ class UtilData {
{ relationKey: 'isDeleted', condition: I.FilterCondition.NotEqual, value: true },
{ relationKey: 'layout', condition: I.FilterCondition.NotIn, value: U.Object.getFileAndSystemLayouts() },
{ relationKey: 'id', condition: I.FilterCondition.NotEqual, value: J.Constant.anytypeProfileId },
- { relationKey: 'spaceId', condition: I.FilterCondition.In, value: [ space ] },
];
if (templateType) {
diff --git a/src/ts/lib/util/menu.ts b/src/ts/lib/util/menu.ts
index 8196ee6c16..7ceb730cc9 100644
--- a/src/ts/lib/util/menu.ts
+++ b/src/ts/lib/util/menu.ts
@@ -558,12 +558,14 @@ class UtilMenu {
S.Detail.update(J.Constant.subId.space, { id: spaceview, details: { spaceDashboardId: object.id } }, false);
if (update) {
- S.Detail.update(J.Constant.subId.space, { id: object.id, details: object }, false);
+ S.Detail.update(U.Space.getSubSpaceSubId(space), { id: object.id, details: object }, false);
};
- if (openRoute) {
- U.Space.openDashboard('route');
- };
+ U.Data.createSubSpaceSubscriptions([ space ], () => {
+ if (openRoute) {
+ U.Space.openDashboard('route');
+ };
+ });
});
};
diff --git a/src/ts/lib/util/object.ts b/src/ts/lib/util/object.ts
index c25a51ea45..8830aa594a 100644
--- a/src/ts/lib/util/object.ts
+++ b/src/ts/lib/util/object.ts
@@ -256,13 +256,9 @@ class UtilObject {
{ relationKey: 'id', condition: I.FilterCondition.In, value: ids }
];
- C.ObjectSearch(filters, [], [], '', 0, 0, (message: any) => {
- if (message.error.code || !message.records.length) {
- return;
- };
-
+ U.Data.search({ filters }, (message: any) => {
if (callBack) {
- callBack(message.records.map(it => S.Detail.mapper(it)).filter(it => !it._empty_));
+ callBack((message.records || []).filter(it => !it._empty_));
};
});
};
diff --git a/src/ts/lib/util/space.ts b/src/ts/lib/util/space.ts
index 382c2ffac3..2fcaf50c05 100644
--- a/src/ts/lib/util/space.ts
+++ b/src/ts/lib/util/space.ts
@@ -45,7 +45,7 @@ class UtilSpace {
if (id == I.HomePredefinedId.Last) {
ret = this.getLastOpened();
} else {
- ret = S.Detail.get(J.Constant.subId.space, id);
+ ret = S.Detail.get(U.Space.getSubSpaceSubId(space.targetSpaceId), id);
};
if (!ret || ret._empty_ || ret.isDeleted) {
@@ -113,6 +113,10 @@ class UtilSpace {
return object._empty_ ? null : object;
};
+ getSubSpaceSubId (spaceId: string) {
+ return [ J.Constant.subId.subSpace, spaceId ].join('-');
+ };
+
getMyParticipant (spaceId?: string) {
const { account } = S.Auth;
const { space } = S.Common;
@@ -123,12 +127,16 @@ class UtilSpace {
spaceId = spaceId || space;
- const subId = [ J.Constant.subId.myParticipant, spaceId ].join('-');
+ const subId = this.getSubSpaceSubId(spaceId);
const object = S.Detail.get(subId, this.getParticipantId(spaceId, account.id));
return object._empty_ ? null : object;
};
+ getCreator (spaceId: string, id: string) {
+ return S.Detail.get(this.getSubSpaceSubId(spaceId), id);
+ };
+
canMyParticipantWrite (spaceId?: string): boolean {
const participant = this.getMyParticipant(spaceId);
return participant ? (participant.isWriter || participant.isOwner) : true;
diff --git a/src/ts/model/account.ts b/src/ts/model/account.ts
index ce2e2af723..affb32956b 100644
--- a/src/ts/model/account.ts
+++ b/src/ts/model/account.ts
@@ -9,6 +9,7 @@ class AccountInfo implements I.AccountInfo {
deviceId = '';
localStoragePath = '';
accountSpaceId = '';
+ techSpaceId = '';
spaceViewId = '';
widgetsId = '';
analyticsId = '';
@@ -21,6 +22,7 @@ class AccountInfo implements I.AccountInfo {
this.deviceId = String(props.deviceId || '');
this.localStoragePath = String(props.localStoragePath || '');
this.accountSpaceId = String(props.accountSpaceId || '');
+ this.techSpaceId = String(props.techSpaceId || '');
this.spaceViewId = String(props.spaceViewId || '');
this.widgetsId = String(props.widgetsId || '');
this.analyticsId = String(props.analyticsId || '');
@@ -33,6 +35,7 @@ class AccountInfo implements I.AccountInfo {
deviceId: observable,
localStoragePath: observable,
accountSpaceId: observable,
+ techSpaceId: observable,
spaceViewId: observable,
widgetsId: observable,
analyticsId: observable,
diff --git a/src/ts/store/detail.ts b/src/ts/store/detail.ts
index 6d9c9f48d8..84e8db21b5 100644
--- a/src/ts/store/detail.ts
+++ b/src/ts/store/detail.ts
@@ -285,8 +285,8 @@ class DetailStore {
object.spaceLocalStatus = Number(object.spaceLocalStatus) || I.SpaceStatus.Unknown;
object.readersLimit = Number(object.readersLimit) || 0;
object.writersLimit = Number(object.writersLimit) || 0;
- object.sharedSpacesLimit = Number(object.sharedSpacesLimit) || 0;
object.spaceId = Relation.getStringValue(object.spaceId);
+ object.spaceMainChatId = Relation.getStringValue(object.spaceMainChatId);
object.spaceDashboardId = Relation.getStringValue(object.spaceDashboardId);
object.targetSpaceId = Relation.getStringValue(object.targetSpaceId);
object.iconOption = Number(object.iconOption) || 1;
@@ -343,4 +343,4 @@ class DetailStore {
};
-export const Detail: DetailStore = new DetailStore();
\ No newline at end of file
+export const Detail: DetailStore = new DetailStore();