Skip to content

Commit c8a39f9

Browse files
authored
update logo as per mineos plans (#3383)
1 parent e77d1be commit c8a39f9

File tree

9 files changed

+91
-14
lines changed

9 files changed

+91
-14
lines changed

api/license.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const (
3030
PlanAGPL SubnetPlan = iota
3131
PlanStandard
3232
PlanEnterprise
33+
PlanEnterpriseLite
34+
PlanEnterprisePlus
3335
)
3436

3537
func (sp SubnetPlan) String() string {
@@ -38,6 +40,10 @@ func (sp SubnetPlan) String() string {
3840
return "standard"
3941
case PlanEnterprise:
4042
return "enterprise"
43+
case PlanEnterpriseLite:
44+
return "enterprise-lite"
45+
case PlanEnterprisePlus:
46+
return "enterprise-plus"
4147
default:
4248
return "agpl"
4349
}
@@ -65,6 +71,10 @@ func fetchLicensePlan() {
6571
InstanceLicensePlan = PlanStandard
6672
case "ENTERPRISE":
6773
InstanceLicensePlan = PlanEnterprise
74+
case "ENTERPRISE-LITE":
75+
InstanceLicensePlan = PlanEnterpriseLite
76+
case "ENTERPRISE-PLUS":
77+
InstanceLicensePlan = PlanEnterprisePlus
6878
default:
6979
InstanceLicensePlan = PlanAGPL
7080
}

web-app/src/config.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,34 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
import { ApplicationLogoProps } from "mds";
18+
1719
export const MinIOPlan =
1820
(
1921
document.head.querySelector(
2022
"[name~=minio-license][content]",
2123
) as HTMLMetaElement
2224
)?.content || "AGPL";
2325

24-
type LogoVar = "simple" | "AGPL" | "standard" | "enterprise";
26+
type LogoVar =
27+
| "AGPL"
28+
| "simple"
29+
| "standard"
30+
| "enterprise"
31+
| "new"
32+
| "enterpriseos"
33+
| "enterpriseosvertical"
34+
| undefined;
2535

2636
export const getLogoVar = (): LogoVar => {
2737
let logoVar: LogoVar = "AGPL";
2838
switch (MinIOPlan.toLowerCase()) {
39+
case "enterprise-lite":
40+
logoVar = "enterpriseos";
41+
break;
42+
case "enterprise-plus":
43+
logoVar = "enterpriseos";
44+
break;
2945
case "enterprise":
3046
logoVar = "enterprise";
3147
break;
@@ -39,7 +55,26 @@ export const getLogoVar = (): LogoVar => {
3955
return logoVar;
4056
};
4157

58+
export const getLogoApplicationVariant =
59+
(): ApplicationLogoProps["applicationName"] => {
60+
switch (MinIOPlan.toLowerCase()) {
61+
case "enterprise-lite":
62+
case "enterprise-plus":
63+
return "minio";
64+
default:
65+
return "console";
66+
}
67+
};
68+
4269
export const registeredCluster = (): boolean => {
4370
const plan = getLogoVar();
44-
return plan === "standard" || plan === "enterprise";
71+
return [
72+
"AGPL",
73+
"simple",
74+
"standard",
75+
"enterprise",
76+
"new",
77+
"enterpriseos",
78+
"enterpriseosvertical",
79+
].includes(plan || "AGPL");
4580
};

web-app/src/screens/AnonymousAccess/AnonymousAccess.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { IAM_PAGES } from "../../common/SecureComponent/permissions";
2121
import { resetSession } from "../Console/consoleSlice";
2222
import { useAppDispatch } from "../../store";
2323
import { resetSystem } from "../../systemSlice";
24-
import { getLogoVar } from "../../config";
24+
import { getLogoApplicationVariant, getLogoVar } from "../../config";
2525
import ObjectBrowser from "../Console/ObjectBrowser/ObjectBrowser";
2626
import LoadingComponent from "../../common/LoadingComponent";
2727
import ObjectManager from "../Console/Common/ObjectManager/ObjectManager";
@@ -46,7 +46,7 @@ const AnonymousAccess = () => {
4646
>
4747
<div style={{ width: 200, flexShrink: 1 }}>
4848
<ApplicationLogo
49-
applicationName={"console"}
49+
applicationName={getLogoApplicationVariant()}
5050
subVariant={getLogoVar()}
5151
inverse={true}
5252
/>

web-app/src/screens/Console/License/License.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ const License = () => {
8989
if (res) {
9090
if (res.plan === "STANDARD") {
9191
setCurrentPlanID(1);
92-
} else if (res.plan === "ENTERPRISE") {
92+
} else if (
93+
["ENTERPRISE", "ENTERPRISE-LITE", "ENTERPRISE-PLUS"].includes(
94+
res.plan,
95+
)
96+
) {
9397
setCurrentPlanID(2);
9498
} else {
9599
setCurrentPlanID(1);

web-app/src/screens/Console/License/LicensePlans.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,23 @@ const LicensePlans = ({ licenseInfo }: IRegisterStatus) => {
385385

386386
const isCommunityPlan = currentPlan === LICENSE_PLANS.COMMUNITY;
387387
const isStandardPlan = currentPlan === LICENSE_PLANS.STANDARD;
388-
const isEnterprisePlan = currentPlan === LICENSE_PLANS.ENTERPRISE;
388+
const isEnterprisePlan = [
389+
LICENSE_PLANS.ENTERPRISE,
390+
LICENSE_PLANS.ENTERPRISE_LITE,
391+
LICENSE_PLANS.ENTERPRISE_PLUS,
392+
].includes(currentPlan);
389393

390394
const isPaidPlan = PAID_PLANS.includes(currentPlan);
391395

392396
/*In smaller screen use tabbed view to show features*/
393397
const [xsPlanView, setXsPlanView] = useState("");
394398
let isXsViewCommunity = xsPlanView === LICENSE_PLANS.COMMUNITY;
395399
let isXsViewStandard = xsPlanView === LICENSE_PLANS.STANDARD;
396-
let isXsViewEnterprise = xsPlanView === LICENSE_PLANS.ENTERPRISE;
400+
let isXsViewEnterprise = [
401+
LICENSE_PLANS.ENTERPRISE,
402+
LICENSE_PLANS.ENTERPRISE_LITE,
403+
LICENSE_PLANS.ENTERPRISE_PLUS,
404+
].includes(xsPlanView);
397405

398406
const getCommunityPlanHeader = () => {
399407
return (

web-app/src/screens/Console/License/utils.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export const LICENSE_PLANS = {
2424
COMMUNITY: "community",
2525
STANDARD: "standard",
2626
ENTERPRISE: "enterprise",
27+
ENTERPRISE_LITE: "enterprise-lite",
28+
ENTERPRISE_PLUS: "enterprise-plus",
2729
};
2830

2931
type FeatureItem = {
@@ -439,7 +441,12 @@ export const ENTERPRISE_PLAN_FEATURES = [
439441
},
440442
];
441443

442-
export const PAID_PLANS = [LICENSE_PLANS.STANDARD, LICENSE_PLANS.ENTERPRISE];
444+
export const PAID_PLANS = [
445+
LICENSE_PLANS.STANDARD,
446+
LICENSE_PLANS.ENTERPRISE,
447+
LICENSE_PLANS.ENTERPRISE_LITE,
448+
LICENSE_PLANS.ENTERPRISE_PLUS,
449+
];
443450

444451
export const getRenderValue = (val: any) => {
445452
return typeof val === "function" ? val() : val;

web-app/src/screens/Console/Menu/MenuWrapper.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ import { AppState, useAppDispatch } from "../../../store";
2121
import { validRoutes } from "../valid-routes";
2222
import { menuOpen } from "../../../systemSlice";
2323
import { selFeatures } from "../consoleSlice";
24-
import { getLogoVar, registeredCluster } from "../../../config";
24+
import {
25+
getLogoApplicationVariant,
26+
getLogoVar,
27+
registeredCluster,
28+
} from "../../../config";
2529
import { useLocation, useNavigate } from "react-router-dom";
2630
import { getLicenseConsent } from "../License/utils";
2731

@@ -55,7 +59,10 @@ const MenuWrapper = () => {
5559
isOpen={sidebarOpen}
5660
displayGroupTitles
5761
options={allowedMenuItems}
58-
applicationLogo={{ applicationName: "console", subVariant: getLogoVar() }}
62+
applicationLogo={{
63+
applicationName: getLogoApplicationVariant(),
64+
subVariant: getLogoVar(),
65+
}}
5966
callPathAction={(path) => {
6067
navigate(path);
6168
}}

web-app/src/screens/LoginPage/Login.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { useSelector } from "react-redux";
2424
import { getFetchConfigurationAsync } from "./loginThunks";
2525
import { resetForm } from "./loginSlice";
2626
import StrategyForm from "./StrategyForm";
27-
import { getLogoVar } from "../../config";
27+
import { getLogoApplicationVariant, getLogoVar } from "../../config";
2828
import { RedirectRule } from "api/consoleApi";
2929
import { redirectRules } from "./login.utils";
3030
import { setHelpName } from "../../systemSlice";
@@ -149,7 +149,10 @@ const Login = () => {
149149
<Fragment>
150150
<MainError />
151151
<LoginWrapper
152-
logoProps={{ applicationName: "console", subVariant: getLogoVar() }}
152+
logoProps={{
153+
applicationName: getLogoApplicationVariant(),
154+
subVariant: getLogoVar(),
155+
}}
153156
form={loginComponent}
154157
formFooter={
155158
<Box

web-app/src/screens/LoginPage/LoginCallback.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { useNavigate } from "react-router-dom";
2020
import api from "../../common/api";
2121
import { baseUrl } from "../../history";
2222
import { Box, Button, LoginWrapper, WarnIcon } from "mds";
23-
import { getLogoVar } from "../../config";
23+
import { getLogoApplicationVariant, getLogoVar } from "../../config";
2424
import get from "lodash/get";
2525

2626
const CallBackContainer = styled.div(({ theme }) => ({
@@ -107,7 +107,10 @@ const LoginCallback = () => {
107107
return error !== "" || errorDescription !== "" ? (
108108
<Fragment>
109109
<LoginWrapper
110-
logoProps={{ applicationName: "console", subVariant: getLogoVar() }}
110+
logoProps={{
111+
applicationName: getLogoApplicationVariant(),
112+
subVariant: getLogoVar(),
113+
}}
111114
form={
112115
<CallBackContainer>
113116
<div className={"errorTitle"}>

0 commit comments

Comments
 (0)