Check if user is in EU (#2143)
This commit is contained in:
@@ -27,6 +27,7 @@ import { ErrorResponseHandler } from "../../../common/types";
|
||||
import InputBoxWrapper from "../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
|
||||
import { setErrorSnackMessage, setSnackBarMessage } from "../../../systemSlice";
|
||||
import { useAppDispatch } from "../../../store";
|
||||
import { euTimezones } from "./euTimezones";
|
||||
|
||||
const styles = (theme: Theme) =>
|
||||
createStyles({
|
||||
@@ -70,9 +71,15 @@ const SetEmailModal = ({ open, closeModal }: ISetEmailModalProps) => {
|
||||
};
|
||||
|
||||
const onConfirm = () => {
|
||||
invokeApi("POST", "/api/v1/mp-integration", { email });
|
||||
const isInEU = isEU();
|
||||
invokeApi("POST", "/api/v1/mp-integration", { email, isInEU});
|
||||
};
|
||||
|
||||
const isEU = () => {
|
||||
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
return euTimezones.includes(tz.toLocaleLowerCase());
|
||||
}
|
||||
|
||||
return open ? (
|
||||
<ConfirmDialog
|
||||
title={"Register Email"}
|
||||
@@ -89,15 +96,30 @@ const SetEmailModal = ({ open, closeModal }: ISetEmailModalProps) => {
|
||||
}}
|
||||
confirmationContent={
|
||||
<Fragment>
|
||||
Would you like to register an email for your account?
|
||||
<p>
|
||||
Your Marketplace subscription includes support access from the
|
||||
<a
|
||||
href="https://min.io/product/subnet"
|
||||
target="_blank"
|
||||
rel="noreferrer">
|
||||
MinIO Subscription Network (SUBNET)
|
||||
</a>.
|
||||
<br />
|
||||
Enter your email to register now.
|
||||
</p>
|
||||
<p>
|
||||
To register later, contact <a href="mailto: support@min.io">support@min.io</a>.
|
||||
</p>
|
||||
<InputBoxWrapper
|
||||
id="set-mp-email"
|
||||
name="set-mp-email"
|
||||
onChange={handleInputChange}
|
||||
label=""
|
||||
label={""}
|
||||
placeholder="Enter email"
|
||||
type={"email"}
|
||||
value={email}
|
||||
/>
|
||||
|
||||
</Fragment>
|
||||
}
|
||||
/>
|
||||
|
||||
78
portal-ui/src/screens/Console/Marketplace/euTimezones.ts
Normal file
78
portal-ui/src/screens/Console/Marketplace/euTimezones.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2022 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
export const euTimezones = [
|
||||
"europe/amsterdam",
|
||||
"europe/andorra",
|
||||
"europe/astrakhan",
|
||||
"europe/athens",
|
||||
"europe/belgrade",
|
||||
"europe/berlin",
|
||||
"europe/bratislava",
|
||||
"europe/brussels",
|
||||
"europe/bucharest",
|
||||
"europe/budapest",
|
||||
"europe/busingen",
|
||||
"europe/chisinau",
|
||||
"europe/copenhagen",
|
||||
"europe/dublin",
|
||||
"europe/gibraltar",
|
||||
"europe/guernsey",
|
||||
"europe/helsinki",
|
||||
"europe/isle_of_man",
|
||||
"europe/istanbul",
|
||||
"europe/jersey",
|
||||
"europe/kaliningrad",
|
||||
"europe/kiev",
|
||||
"europe/kirov",
|
||||
"europe/lisbon",
|
||||
"europe/ljubljana",
|
||||
"europe/london",
|
||||
"europe/luxembourg",
|
||||
"europe/madrid",
|
||||
"europe/malta",
|
||||
"europe/mariehamn",
|
||||
"europe/minsk",
|
||||
"europe/monaco",
|
||||
"europe/moscow",
|
||||
"europe/oslo",
|
||||
"europe/paris",
|
||||
"europe/podgorica",
|
||||
"europe/prague",
|
||||
"europe/riga",
|
||||
"europe/rome",
|
||||
"europe/samara",
|
||||
"europe/san_marino",
|
||||
"europe/sarajevo",
|
||||
"europe/saratov",
|
||||
"europe/simferopol",
|
||||
"europe/skopje",
|
||||
"europe/sofia",
|
||||
"europe/stockholm",
|
||||
"europe/tallinn",
|
||||
"europe/tirane",
|
||||
"europe/ulyanovsk",
|
||||
"europe/uzhgorod",
|
||||
"europe/vaduz",
|
||||
"europe/vatican",
|
||||
"europe/vienna",
|
||||
"europe/vilnius",
|
||||
"europe/volgograd",
|
||||
"europe/warsaw",
|
||||
"europe/zagreb",
|
||||
"europe/zaporozhye",
|
||||
"europe/zurich"
|
||||
];
|
||||
Reference in New Issue
Block a user