Merge branch 'feature/workspaces' of github.com:ONLYOFFICE/AppServer into feature/workspaces
This commit is contained in:
commit
d07f234d86
@ -1,4 +1,4 @@
|
||||
import { action, computed, makeObservable, observable } from "mobx";
|
||||
import { makeAutoObservable } from "mobx";
|
||||
import api from "../api";
|
||||
import { setWithCredentialsStatus } from "../api/client";
|
||||
import history from "../history";
|
||||
@ -23,28 +23,7 @@ class AuthStore {
|
||||
this.moduleStore = new ModuleStore();
|
||||
this.settingsStore = new SettingsStore();
|
||||
|
||||
makeObservable(this, {
|
||||
isLoading: observable,
|
||||
isAuthenticated: observable,
|
||||
isAdmin: computed,
|
||||
isLoaded: computed,
|
||||
language: computed,
|
||||
product: computed,
|
||||
availableModules: computed,
|
||||
userStore: observable,
|
||||
moduleStore: observable,
|
||||
settingsStore: observable,
|
||||
version: observable,
|
||||
init: action,
|
||||
login: action,
|
||||
logout: action,
|
||||
setIsAuthenticated: action,
|
||||
replaceFileStream: action,
|
||||
getEncryptionAccess: action,
|
||||
setEncryptionAccess: action,
|
||||
setProductVersion: action,
|
||||
reset: action,
|
||||
});
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
init = async () => {
|
||||
@ -93,9 +72,11 @@ class AuthStore {
|
||||
}
|
||||
|
||||
get product() {
|
||||
return this.moduleStore.modules.find(
|
||||
(item) => item.id === this.settingsStore.currentProductId
|
||||
) || "";
|
||||
return (
|
||||
this.moduleStore.modules.find(
|
||||
(item) => item.id === this.settingsStore.currentProductId
|
||||
) || ""
|
||||
);
|
||||
}
|
||||
|
||||
get availableModules() {
|
||||
@ -107,7 +88,9 @@ class AuthStore {
|
||||
|
||||
const isUserAdmin = user.isAdmin;
|
||||
const customModules = this.getCustomModules(isUserAdmin);
|
||||
const products = modules.map((m) => toModuleWrapper(m, false));
|
||||
|
||||
const newModules = JSON.parse(JSON.stringify(modules));
|
||||
const products = newModules.map((m) => toModuleWrapper(m, false));
|
||||
const primaryProducts = products.filter((m) => m.isPrimary === true);
|
||||
const dummyProducts = products.filter((m) => m.isPrimary === false);
|
||||
|
||||
|
@ -50,7 +50,12 @@ class ModuleStore {
|
||||
this.setModules(extendedModules);
|
||||
};
|
||||
|
||||
toModuleWrapper = (item, noAction = true, iconName = null, iconUrl = null) => {
|
||||
toModuleWrapper = (
|
||||
item,
|
||||
noAction = true,
|
||||
iconName = null,
|
||||
iconUrl = null
|
||||
) => {
|
||||
switch (item.id) {
|
||||
case "6743007c-6f95-4d20-8c88-a8601ce5e76d":
|
||||
item.iconName = "CrmIcon";
|
||||
|
Loading…
Reference in New Issue
Block a user