Merge branch 'release/v0.1.0' of github.com:ONLYOFFICE/AppServer into release/v0.1.0

This commit is contained in:
Viktor Fomin 2021-04-05 16:54:48 +03:00
commit 27eb32d296
9 changed files with 53 additions and 24 deletions

View File

@ -44,9 +44,9 @@ export function deleteGroup(id) {
});
}
export function getGroupListFull() {
/*export function getGroupListFull() {
return request({
method: "get",
url: "/group/full",
});
}
}*/ //TODO: use after fixing problems on the server

View File

@ -45,6 +45,7 @@ class ContextMenuSub extends Component {
if (item.onClick) {
item.onClick({
originalEvent: e,
action: item.action,
});
}

View File

@ -110,7 +110,7 @@ const RootFolderContainer = (props) => {
</Text>
{!isDesktop && (
<Text fontSize="12px">
<Trans t={this.props.t} i18nKey="PrivateRoomSupport" ns="Home">
<Trans t={t} i18nKey="PrivateRoomSupport" ns="Home">
Work in Private Room is available via {{ organizationName }} desktop
app.{" "}
<Link isBold isHovered color="#116d9d" href={privacyInstructions}>

View File

@ -201,7 +201,9 @@ const SimpleFilesRow = (props) => {
finalizeVersionAction(id).catch((err) => toastr.error(err));
const onClickFavorite = (e) => {
const { action } = e.currentTarget.dataset;
const data = (e.currentTarget && e.currentTarget.dataset) || e;
const { action } = data;
setFavoriteAction(action, id)
.then(() =>
action === "mark"
@ -324,6 +326,7 @@ const SimpleFilesRow = (props) => {
onClick: onClickFavorite,
disabled: false,
"data-action": "mark",
action: "mark",
};
case "block-unblock-version":
return {
@ -452,6 +455,7 @@ const SimpleFilesRow = (props) => {
onClick: onClickFavorite,
disabled: false,
"data-action": "remove",
action: "remove",
};
default:
break;

View File

@ -444,9 +444,9 @@ class FilesStore {
!isThirdPartyFolder && this.userAccess && options.push("move");
options.push("copy");
if (isFile) {
options.push("duplicate");
}
// if (isFile) {
// options.push("duplicate");
// }
this.userAccess && options.push("rename");
isThirdPartyFolder &&

View File

@ -287,7 +287,7 @@ const SectionBodyContent = ({
opened={isHeadSelectorOpen}
selectedOption={
newGroupManager.default ||
newGroupManager.id === ID_NO_GROUP_MANAGER ||
newGroupManager.key === ID_NO_GROUP_MANAGER ||
newGroupManager.displayName === "profile removed"
? { ...newGroupManager, label: t("LblSelect") }
: newGroupManager

View File

@ -11,6 +11,11 @@ import toastr from "studio/toastr";
import Loaders from "@appserver/common/components/Loaders";
import { inject, observer } from "mobx-react";
import { showLoader, hideLoader } from "@appserver/common/utils";
import { withRouter } from "react-router";
import { AppServerConfig } from "@appserver/common/constants";
import { combineUrl } from "@appserver/common/utils";
import config from "../../../../../../package.json";
const InfoContainer = styled.div`
margin-bottom: 24px;
@ -99,12 +104,22 @@ class ProfileInfo extends React.PureComponent {
onGroupClick = (e) => {
const group = e.currentTarget.dataset.id;
const { filter, setIsLoading, fetchPeople } = this.props;
const { filter, setIsLoading, fetchPeople, history } = this.props;
const newFilter = filter.clone();
newFilter.group = group;
setIsLoading(true);
const urlFilter = newFilter.toUrlParams();
const url = combineUrl(
AppServerConfig.proxyURL,
config.homepage,
`/filter?${urlFilter}`
);
history.push(url);
fetchPeople(newFilter).finally(() => setIsLoading(false));
};
@ -351,15 +366,17 @@ class ProfileInfo extends React.PureComponent {
}
}
export default inject(({ auth, peopleStore }) => ({
groupCaption: auth.settingsStore.customNames.groupCaption,
regDateCaption: auth.settingsStore.customNames.regDateCaption,
userPostCaption: auth.settingsStore.customNames.userPostCaption,
userCaption: auth.settingsStore.customNames.userCaption,
guestCaption: auth.settingsStore.customNames.guestCaption,
fetchPeople: peopleStore.usersStore.getUsersList,
filter: peopleStore.filterStore.filter,
setIsLoading: peopleStore.setIsLoading,
isLoading: peopleStore.isLoading,
updateProfileCulture: peopleStore.targetUserStore.updateProfileCulture,
}))(observer(withTranslation("Profile")(ProfileInfo)));
export default withRouter(
inject(({ auth, peopleStore }) => ({
groupCaption: auth.settingsStore.customNames.groupCaption,
regDateCaption: auth.settingsStore.customNames.regDateCaption,
userPostCaption: auth.settingsStore.customNames.userPostCaption,
userCaption: auth.settingsStore.customNames.userCaption,
guestCaption: auth.settingsStore.customNames.guestCaption,
fetchPeople: peopleStore.usersStore.getUsersList,
filter: peopleStore.filterStore.filter,
setIsLoading: peopleStore.setIsLoading,
isLoading: peopleStore.isLoading,
updateProfileCulture: peopleStore.targetUserStore.updateProfileCulture,
}))(observer(withTranslation("Profile")(ProfileInfo)))
);

View File

@ -16,7 +16,7 @@ class GroupsStore {
}
getGroupList = async () => {
const res = await api.groups.getGroupListFull();
const res = await api.groups.getGroupList(); //TODO: replace with getGroupListFull() after fixing problems on the server
this.groups = res;
};

View File

@ -59,8 +59,15 @@ class SelectedGroupStore {
const { group, search, role, activationStatus, employeeStatus } = filter;
let countMembers;
groups.filter((el) => {
if (el.id === group) countMembers = el.members.length;
groups.filter(async (el) => {
if (el.id === group) {
if (!el.members) {
const currGroup = await getGroup(el.id);
countMembers = currGroup.members.length; // TODO: simplify after fixing server issues with getGroupListFull
} else {
countMembers = el.members.length;
}
}
});
const filterIsClear =