Merge branch 'hotfix/v1.0.1' of https://github.com/ONLYOFFICE/DocSpace into hotfix/v1.0.1

This commit is contained in:
Maria Sukhova 2023-05-11 19:12:33 +03:00
commit 0c5fa3ca49
8 changed files with 53 additions and 65 deletions

View File

@ -197,6 +197,7 @@ public abstract class BaseStartup
config.Filters.Add(new TypeFilterAttribute(typeof(TenantStatusFilter))); config.Filters.Add(new TypeFilterAttribute(typeof(TenantStatusFilter)));
config.Filters.Add(new TypeFilterAttribute(typeof(PaymentFilter))); config.Filters.Add(new TypeFilterAttribute(typeof(PaymentFilter)));
config.Filters.Add(new TypeFilterAttribute(typeof(IpSecurityFilter))); config.Filters.Add(new TypeFilterAttribute(typeof(IpSecurityFilter)));
config.Filters.Add(new TypeFilterAttribute(typeof(ProductSecurityFilter)));
config.Filters.Add(new CustomResponseFilterAttribute()); config.Filters.Add(new CustomResponseFilterAttribute());
config.Filters.Add(new CustomExceptionFilterAttribute()); config.Filters.Add(new CustomExceptionFilterAttribute());
config.Filters.Add(new TypeFilterAttribute(typeof(WebhooksGlobalFilterAttribute))); config.Filters.Add(new TypeFilterAttribute(typeof(WebhooksGlobalFilterAttribute)));

View File

@ -38,9 +38,28 @@ public class ProductSecurityFilter : IResourceFilter
static ProductSecurityFilter() static ProductSecurityFilter()
{ {
var blog = new Guid("6a598c74-91ae-437d-a5f4-ad339bd11bb2");
var bookmark = new Guid("28b10049-dd20-4f54-b986-873bc14ccfc7");
var forum = new Guid("853b6eb9-73ee-438d-9b09-8ffeedf36234");
var news = new Guid("3cfd481b-46f2-4a4a-b55c-b8c0c9def02c");
var wiki = new Guid("742cf945-cbbc-4a57-82d6-1600a12cf8ca");
var photo = new Guid("9d51954f-db9b-4aed-94e3-ed70b914e101");
_products = new Dictionary<string, Guid> _products = new Dictionary<string, Guid>
{ {
{ "files", WebItemManager.DocumentsProductID } { "blog", blog },
{ "bookmark", bookmark },
{ "event", news },
{ "forum", forum },
{ "photo", photo },
{ "wiki", wiki },
{ "birthdays", WebItemManager.BirthdaysProductID },
{ "community", WebItemManager.CommunityProductID },
{ "crm", WebItemManager.CRMProductID },
{ "files", WebItemManager.DocumentsProductID },
{ "project", WebItemManager.ProjectsProductID },
{ "calendar", WebItemManager.CalendarProductID },
{ "mail", WebItemManager.MailProductID },
}; };
} }

View File

@ -1,4 +1,22 @@
{ {
"components": [ "components": [
{
"type": "ASC.People.PeopleProduct, ASC.People",
"services": [
{
"type": "ASC.Web.Core.IWebItem, ASC.Web.Core"
}
],
"instanceScope": "InstancePerLifetimeScope"
},
{
"type": "ASC.Files.ApiProductEntryPoint, ASC.Files",
"services": [
{
"type": "ASC.Web.Core.IWebItem, ASC.Web.Core"
}
],
"instanceScope": "InstancePerLifetimeScope"
}
] ]
} }

View File

@ -45,15 +45,10 @@ class ChangeEmailDialogComponent extends React.Component {
onSendEmailChangeInstructions = () => { onSendEmailChangeInstructions = () => {
const { email } = this.state; const { email } = this.state;
const { const { user, updateProfileInUsers, updateProfile, fromList } = this.props;
user,
updateProfileInUsers,
updateProfile,
profile,
fromList,
} = this.props;
const { id } = user; const { id } = user;
const newProfile = profile; const newProfile = user;
newProfile.email = email;
this.setState({ isRequestRunning: true }, () => { this.setState({ isRequestRunning: true }, () => {
sendInstructionsToChangeEmail(id, email) sendInstructionsToChangeEmail(id, email)

View File

@ -43,7 +43,6 @@ const Dialogs = ({
visible={changeEmail} visible={changeEmail}
onClose={closeDialogs} onClose={closeDialogs}
user={data} user={data}
profile={profile}
fromList fromList
/> />
)} )}
@ -140,10 +139,8 @@ export default inject(({ auth, peopleStore }) => {
const { user: profile } = auth.userStore; const { user: profile } = auth.userStore;
const { const { changeNameVisible, setChangeNameVisible } =
changeNameVisible, peopleStore.targetUserStore;
setChangeNameVisible,
} = peopleStore.targetUserStore;
const { tfaStore } = auth; const { tfaStore } = auth;

View File

@ -438,7 +438,6 @@ const MainProfile = (props) => {
visible={changeEmailVisible} visible={changeEmailVisible}
onClose={() => setChangeEmailVisible(false)} onClose={() => setChangeEmailVisible(false)}
user={profile} user={profile}
profile={profile}
/> />
)} )}
@ -471,13 +470,8 @@ const MainProfile = (props) => {
export default inject(({ auth, peopleStore }) => { export default inject(({ auth, peopleStore }) => {
const { withActivationBar, sendActivationLink } = auth.userStore; const { withActivationBar, sendActivationLink } = auth.userStore;
const { const { theme, helpLink, culture, currentColorScheme, documentationEmail } =
theme, auth.settingsStore;
helpLink,
culture,
currentColorScheme,
documentationEmail,
} = auth.settingsStore;
const { setIsLoading } = peopleStore.loadingStore; const { setIsLoading } = peopleStore.loadingStore;
const { const {

View File

@ -1,4 +1,4 @@
import React, { useEffect } from "react"; import React from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { withRouter } from "react-router"; import { withRouter } from "react-router";
import { useTranslation, Trans } from "react-i18next"; import { useTranslation, Trans } from "react-i18next";
@ -15,28 +15,13 @@ const PROXY_BASE_URL = combineUrl(
); );
const ArticlePaymentAlert = ({ const ArticlePaymentAlert = ({
pricePerManager,
isFreeTariff, isFreeTariff,
theme, theme,
currencySymbol,
setPortalPaymentQuotas,
currentTariffPlanTitle, currentTariffPlanTitle,
toggleArticleOpen, toggleArticleOpen,
tariffPlanTitle,
isQuotaLoaded,
isQuotasLoaded,
}) => { }) => {
const { t, ready } = useTranslation("Common"); const { t, ready } = useTranslation("Common");
useEffect(async () => {
if (isFreeTariff && isQuotaLoaded)
try {
await setPortalPaymentQuotas();
} catch (e) {
console.error(e);
}
}, [isQuotaLoaded]);
const onClick = () => { const onClick = () => {
const paymentPageUrl = combineUrl( const paymentPageUrl = combineUrl(
PROXY_BASE_URL, PROXY_BASE_URL,
@ -55,16 +40,11 @@ const ArticlePaymentAlert = ({
); );
const description = isFreeTariff const description = isFreeTariff
? pricePerManager && ( ? t("Common:GetMoreOptions")
<Trans t={t} i18nKey="PerUserMonth" ns="Common">
From {{ currencySymbol }}
{{ price: pricePerManager }} per admin/power user /month
</Trans>
)
: t("Common:PayBeforeTheEndGracePeriod"); : t("Common:PayBeforeTheEndGracePeriod");
const additionalDescription = isFreeTariff const additionalDescription = isFreeTariff
? t("Common:ActivateBusinessPlan", { planName: tariffPlanTitle }) ? t("Common:ActivatePremiumFeatures")
: t("Common:GracePeriodActivated"); : t("Common:GracePeriodActivated");
const color = isFreeTariff const color = isFreeTariff
@ -73,9 +53,6 @@ const ArticlePaymentAlert = ({
const isShowLoader = !ready; const isShowLoader = !ready;
if (!isQuotaLoaded) return <></>;
if (isFreeTariff && !isQuotasLoaded) return <></>;
return isShowLoader ? ( return isShowLoader ? (
<Loaders.Rectangle width="210px" height="88px" /> <Loaders.Rectangle width="210px" height="88px" />
) : ( ) : (
@ -95,29 +72,14 @@ const ArticlePaymentAlert = ({
export default withRouter( export default withRouter(
inject(({ auth }) => { inject(({ auth }) => {
const { paymentQuotasStore, currentQuotaStore, settingsStore } = auth; const { currentQuotaStore, settingsStore } = auth;
const { const { currentTariffPlanTitle } = currentQuotaStore;
currentTariffPlanTitle,
isLoaded: isQuotaLoaded,
} = currentQuotaStore;
const { theme, toggleArticleOpen } = settingsStore; const { theme, toggleArticleOpen } = settingsStore;
const {
setPortalPaymentQuotas,
planCost,
tariffPlanTitle,
isLoaded: isQuotasLoaded,
} = paymentQuotasStore;
return { return {
toggleArticleOpen, toggleArticleOpen,
setPortalPaymentQuotas,
pricePerManager: planCost.value,
theme, theme,
currencySymbol: planCost.currencySymbol,
currentTariffPlanTitle, currentTariffPlanTitle,
tariffPlanTitle,
isQuotaLoaded,
isQuotasLoaded,
}; };
})(observer(ArticlePaymentAlert)) })(observer(ArticlePaymentAlert))
); );

View File

@ -7,6 +7,7 @@
"Actions": "Actions", "Actions": "Actions",
"Activate": "Activate", "Activate": "Activate",
"ActivateBusinessPlan": "Activate {{planName}} plan?", "ActivateBusinessPlan": "Activate {{planName}} plan?",
"ActivatePremiumFeatures": "Activate premium features?",
"Active": "Active", "Active": "Active",
"AddButton": "Add", "AddButton": "Add",
"AddFilter": "Add filter", "AddFilter": "Add filter",
@ -109,6 +110,7 @@
"FullAccess": "Full access", "FullAccess": "Full access",
"Gigabyte": "GB", "Gigabyte": "GB",
"GracePeriodActivated": "Grace period activated", "GracePeriodActivated": "Grace period activated",
"GetMoreOptions": "Get more security and branding options",
"HasFullAccess": "He has full access to the room", "HasFullAccess": "He has full access to the room",
"HelpCenter": "Help Center", "HelpCenter": "Help Center",
"HideArticleMenu": "Hide menu", "HideArticleMenu": "Hide menu",