Merge branch 'develop' into bugfix/fix-close-modal-dialog

This commit is contained in:
TimofeyBoyko 2022-10-26 12:39:26 +05:00
commit 60b38e4508
10 changed files with 219 additions and 25 deletions

View File

@ -16,7 +16,8 @@
"DowngradeNow": "Downgrade now",
"FreeStartupPlan": "Free {{planName}} plan",
"GracePeriodActivated": "Grace period activated",
"GracePeriodActivatedDescription": "Grace period is effective from <1>{{fromDate}}</1> to <1>{{byDate}}</1> ({{delayDaysCount}}). During the grace period, admins cannot create new rooms and add new users. After the due date of the grace period, DocSpace will become unavailable until the payment is made.",
"GracePeriodActivatedInfo": "Grace period is effective <1>from {{fromDate}} to {{byDate}}</1> ({{delayDaysCount}}).",
"GracePeriodActivatedDescription": "During the grace period, admins cannot create new rooms and add new users. After the due date of the grace period, DocSpace will become unavailable until the payment is made.",
"InvalidEmail": "Invalid email",
"LatePayment": "Late payment",
"ManagerTypesDescription": "Admin account types and their privileges",
@ -38,5 +39,10 @@
"TotalPricePerMonth": "<1>{{currencySymbol}}</1><2>{{price}}</2><3>/month</3>",
"UpgradeNow": "Upgrade now",
"UserNotFound": "User <1>«{{email}}»</1> is not found",
"YourPrice": "Your price"
"YourPrice": "Your price",
"PaymentOverdue": "Cannot add new users.",
"BusinessPlanPaymentOverdue": "Cannot add new users. Business plan payment overdue",
"UpgradePlan": "Upgrade plan",
"UpgradePlanInfo": "Adding new users will exceed the maximum number of room members allowed by your current pricing plan.",
"ChooseNewPlan": "Would you like to choose a new pricing plan?"
}

View File

@ -15,7 +15,8 @@
"DowngradeNow": "Понизить прямо сейчас",
"FreeStartupPlan": "Бесплатный {{planName}} план",
"GracePeriodActivated": "Активирован льготный период",
"GracePeriodActivatedDescription": "Льготный период действует с <1>{{fromDate}}</1> по <1>{{byDate}}</1> ({{delayDaysCount}}). В течение льготного периода администраторы не могут создавать новые комнаты и добавлять новых пользователей. По истечении срока действия льготного периода DocSpace станет недоступным до тех пор, пока не будет произведен платеж.",
"GracePeriodActivatedInfo": "Льготный период действует <1>с {{fromDate}} по {{byDate}}</1> ({{delayDaysCount}}).",
"GracePeriodActivatedDescription": "В течение льготного периода администраторы не могут создавать новые комнаты и добавлять новых пользователей. По истечении срока действия льготного периода DocSpace станет недоступным до тех пор, пока не будет произведен платеж.",
"InvalidEmail": "Неверный email",
"LatePayment": "Просрочка платежа",
"ManagerTypesDescription": "Типы учетных записей администратора и их привилегии",

View File

@ -23,6 +23,7 @@ import {
ConflictResolveDialog,
ConvertDialog,
CreateRoomDialog,
InviteUsersWarningDialog,
} from "../dialogs";
import ConvertPasswordDialog from "../dialogs/ConvertPasswordDialog";
import RestoreAllArchiveDialog from "../dialogs/RestoreAllArchiveDialog";
@ -54,6 +55,7 @@ const Panels = (props) => {
createRoomDialogVisible,
restoreAllPanelVisible,
restoreAllArchiveDialogVisible,
inviteUsersWarningDialogVisible,
} = props;
const { t } = useTranslation(["Translations", "SelectFile"]);
@ -122,6 +124,9 @@ const Panels = (props) => {
restoreAllArchiveDialogVisible && (
<RestoreAllArchiveDialog key="restore-all-archive-dialog" />
),
inviteUsersWarningDialogVisible && (
<InviteUsersWarningDialog key="invite-users-warning-dialog" />
),
];
};
@ -152,6 +157,7 @@ export default inject(
selectFileDialogVisible,
setSelectFileDialogVisible,
invitePanelOptions,
inviteUsersWarningDialogVisible,
} = dialogsStore;
const { uploadPanelVisible } = uploadDataStore;
@ -184,6 +190,7 @@ export default inject(
restoreAllPanelVisible,
invitePanelVisible: invitePanelOptions.visible,
restoreAllArchiveDialogVisible,
inviteUsersWarningDialogVisible,
};
}
)(observer(Panels));

View File

@ -0,0 +1,147 @@
import React, { useState, useEffect } from "react";
import { inject, observer } from "mobx-react";
import { withTranslation, Trans } from "react-i18next";
import { withRouter } from "react-router";
import moment from "moment";
import { combineUrl } from "@docspace/common/utils";
import AppServerConfig from "@docspace/common/constants/AppServerConfig";
import ModalDialog from "@docspace/components/modal-dialog";
import Button from "@docspace/components/button";
import Text from "@docspace/components/text";
const PROXY_BASE_URL = combineUrl(AppServerConfig.proxyURL, "/portal-settings");
const InviteUsersWarningDialog = (props) => {
const {
t,
tReady,
history,
language,
dueDate,
delayDueDate,
visible,
setIsVisible,
isGracePeriod,
} = props;
const [datesData, setDatesData] = useState({});
const { fromDate, byDate, delayDaysCount } = datesData;
useEffect(() => {
moment.locale(language);
gracePeriodDays();
}, [language, gracePeriodDays]);
const gracePeriodDays = () => {
const fromDateMoment = moment(dueDate);
const byDateMoment = moment(delayDueDate);
setDatesData({
fromDate: fromDateMoment.format("LL"),
byDate: byDateMoment.format("LL"),
delayDaysCount: fromDateMoment.to(byDateMoment, true),
});
};
const onClose = () => setIsVisible(false);
const onUpgradePlan = () => {
onClose();
const paymentPageUrl = combineUrl(
PROXY_BASE_URL,
"/payments/portal-payments"
);
history.push(paymentPageUrl);
};
return (
<ModalDialog
isLarge={isGracePeriod}
isLoading={!tReady}
visible={visible}
onClose={onClose}
displayType="modal"
>
<ModalDialog.Header>{t("Common:Warning")}</ModalDialog.Header>
<ModalDialog.Body>
{isGracePeriod ? (
<>
<Text fontWeight={700} noSelect>
{t("BusinessPlanPaymentOverdue")}
</Text>
<br />
<Text noSelect as="div">
<Trans t={t} i18nKey="GracePeriodActivatedInfo" ns="Payments">
Grace period activated
<strong>
from {{ fromDate }} to {{ byDate }}
</strong>
({{ delayDaysCount }})
</Trans>
</Text>
<br />
<Text>{t("GracePeriodActivatedDescription")}</Text>
</>
) : (
<>
<Text fontWeight={700} noSelect>
{t("PaymentOverdue")}
</Text>
<br />
<Text>{t("UpgradePlanInfo")}</Text>
<br />
<Text>{t("ChooseNewPlan")}</Text>
</>
)}
</ModalDialog.Body>
<ModalDialog.Footer>
<Button
key="OkButton"
label={t("UpgradePlan")}
size="normal"
primary
onClick={onUpgradePlan}
scale
/>
<Button
key="CancelButton"
label={t("Common:CancelButton")}
size="normal"
onClick={onClose}
scale
/>
</ModalDialog.Footer>
</ModalDialog>
);
};
export default inject(({ auth, dialogsStore }) => {
const {
dueDate,
delayDueDate,
isGracePeriod,
} = auth.currentTariffStatusStore;
const {
inviteUsersWarningDialogVisible,
setInviteUsersWarningDialogVisible,
} = dialogsStore;
return {
language: auth.language,
visible: inviteUsersWarningDialogVisible,
setIsVisible: setInviteUsersWarningDialogVisible,
dueDate,
delayDueDate,
isGracePeriod,
};
})(
observer(
withTranslation(["Payments", "Common"])(
withRouter(InviteUsersWarningDialog)
)
)
);

View File

@ -26,6 +26,7 @@ import ChangePortalOwnerDialog from "./ChangePortalOwnerDialog";
import ChangeNameDialog from "./ChangeNameDialog";
import AvatarEditorDialog from "./AvatarEditorDialog";
import DeletePortalDialog from "./DeletePortalDialog";
import InviteUsersWarningDialog from "./InviteUsersWarningDialog";
export {
EmptyTrashDialog,
@ -56,4 +57,5 @@ export {
ChangeNameDialog,
AvatarEditorDialog,
DeletePortalDialog,
InviteUsersWarningDialog,
};

View File

@ -43,7 +43,9 @@ export const LanguageTimeSettingsTooltip = ({
learnMore={learnMore}
save={save}
>
To make the parameters you set take effect click the
<div className="bold display-inline font-size"> {{ save }}</div>
button at the bottom of the section.
<Link
color={theme.client.settings.common.linkColorHelp}
className="display-block font-size"
@ -75,8 +77,11 @@ export const CustomTitlesTooltip = ({ t }) => {
from={from}
>
<div className="bold display-inline font-size">{{ welcomeText }}</div>
is a way to change the default portal title to be displayed on the
<div className="bold display-inline font-size"> {{ text }}</div>
of your portal. The same name is also used for the
<div className="bold display-inline font-size"> {{ from }}</div>
field of your portal email notifications.
</Trans>
</div>
<div className="font-size">
@ -85,14 +90,21 @@ export const CustomTitlesTooltip = ({ t }) => {
i18nKey="CustomTitlesSettingsTooltipDescription"
header={header}
>
Enter the name you like in the
<div className="bold display-inline font-size">{{ header }}</div>
field.
</Trans>
</div>
</StyledTooltip>
);
};
export const DNSSettingsTooltip = ({ t, theme, helpLink }) => {
export const DNSSettingsTooltip = ({
t,
theme,
helpLink,
organizationName,
}) => {
const text = t("Settings:DNSSettingsTooltip");
const learnMore = t("Common:LearnMore");
@ -105,6 +117,9 @@ export const DNSSettingsTooltip = ({ t, theme, helpLink }) => {
text={text}
learnMore={learnMore}
>
DNS Settings allow you to set an alternative URL address for your
{{ organizationName }} portal. Send your request to our support team,
and our specialists will help you with the settings.
<div className="display-inline font-size"> {{ text }}</div>
<Link
color={theme.client.settings.common.linkColorHelp}
@ -135,6 +150,8 @@ export const PortalRenamingTooltip = ({ t }) => {
text={text}
>
<div className="display-inline font-size"> {{ text }}</div>
Enter the part that will appear next to the
onlyoffice.com/onlyoffice.eu portal address.
</Trans>
</div>
<div className="font-size">
@ -145,7 +162,10 @@ export const PortalRenamingTooltip = ({ t }) => {
save={save}
>
<div className="bold display-inline font-size"> {{ pleaseNote }}</div>
: your old portal address will become available to new users once you
click the
<div className="bold display-inline font-size"> {{ save }}</div>
button.
</Trans>
</div>
</StyledTooltip>

View File

@ -333,15 +333,16 @@ const PaymentsPage = ({
{isGracePeriod && (
<Text noSelect fontSize={"14px"} lineHeight={"16px"}>
<Trans
t={t}
i18nKey="GracePeriodActivatedDescription"
ns="Payments"
>
Grace period activated from <strong>{{ fromDate }}</strong> -
<strong>{{ byDate }}</strong> ({{ delayDaysCount }}
).
</Trans>
<Trans t={t} i18nKey="GracePeriodActivatedInfo" ns="Payments">
Grace period activated
<strong>
from {{ fromDate }} to {{ byDate }}
</strong>
({{ delayDaysCount }})
</Trans>{" "}
<Text as="span" fontSize="14px" lineHeight="16px">
{t("GracePeriodActivatedDescription")}
</Text>
</Text>
)}

View File

@ -416,12 +416,19 @@ class ContextOptionsStore {
const { action } = data;
this.dialogsStore.setInvitePanelOptions({
visible: true,
roomId: action ? action : e,
hideSelector: false,
defaultAccess: ShareAccessRights.ReadOnly,
});
const { isGracePeriod } = this.authStore.currentTariffStatusStore;
const { isFreeTariff } = this.authStore.currentQuotaStore;
if (isGracePeriod || isFreeTariff) {
this.dialogsStore.setInviteUsersWarningDialogVisible(true);
} else {
this.dialogsStore.setInvitePanelOptions({
visible: true,
roomId: action ? action : e,
hideSelector: false,
defaultAccess: ShareAccessRights.ReadOnly,
});
}
};
onClickPin = (e, id, t) => {

View File

@ -26,6 +26,7 @@ class DialogsStore {
convertDialogVisible = false;
selectFileDialogVisible = false;
convertPasswordDialogVisible = false;
inviteUsersWarningDialogVisible = false;
isFolderActions = false;
roomCreation = false;
invitePanelOptions = {
@ -287,6 +288,10 @@ class DialogsStore {
this.inviteItems[index] = { ...this.inviteItems[index], ...item };
});
setInviteUsersWarningDialogVisible = (inviteUsersWarningDialogVisible) => {
this.inviteUsersWarningDialogVisible = inviteUsersWarningDialogVisible;
};
get someDialogIsOpen() {
return (
this.sharingPanelVisible ||
@ -309,7 +314,8 @@ class DialogsStore {
this.eventDialogVisible ||
this.invitePanelOptions.visible ||
this.restoreAllArchiveDialogVisible ||
this.restoreAllPanelVisible
this.restoreAllPanelVisible ||
this.inviteUsersWarningDialogVisible
);
}

View File

@ -24,9 +24,6 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
using ASC.Geolocation;
using ASC.MessagingSystem;
namespace ASC.Web.Api;
[Scope]
@ -128,7 +125,7 @@ public class ConnectionsController : ControllerBase
}
[HttpPut("activeconnections/logoutallchangepassword")]
public async Task<string> LogOutAllActiveConnectionsChangePassword()
public async Task<object> LogOutAllActiveConnectionsChangePassword()
{
try
{
@ -166,7 +163,7 @@ public class ConnectionsController : ControllerBase
}
[HttpPut("activeconnections/logoutallexceptthis")]
public async Task<string> LogOutAllExceptThisConnection()
public async Task<object> LogOutAllExceptThisConnection()
{
try
{