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(PaymentFilter)));
config.Filters.Add(new TypeFilterAttribute(typeof(IpSecurityFilter)));
config.Filters.Add(new TypeFilterAttribute(typeof(ProductSecurityFilter)));
config.Filters.Add(new CustomResponseFilterAttribute());
config.Filters.Add(new CustomExceptionFilterAttribute());
config.Filters.Add(new TypeFilterAttribute(typeof(WebhooksGlobalFilterAttribute)));

View File

@ -38,9 +38,28 @@ public class ProductSecurityFilter : IResourceFilter
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>
{
{ "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": [
{
"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 = () => {
const { email } = this.state;
const {
user,
updateProfileInUsers,
updateProfile,
profile,
fromList,
} = this.props;
const { user, updateProfileInUsers, updateProfile, fromList } = this.props;
const { id } = user;
const newProfile = profile;
const newProfile = user;
newProfile.email = email;
this.setState({ isRequestRunning: true }, () => {
sendInstructionsToChangeEmail(id, email)

View File

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

View File

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

View File

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

View File

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