Skip to content

Commit

Permalink
Merge pull request #612 from psarando/CORE-2025-data-limits-announcement
Browse files Browse the repository at this point in the history
CORE-2025 Add Data Limits dashboard announcement
  • Loading branch information
psarando authored Dec 18, 2024
2 parents ff9b9b9 + 982bf28 commit 9eb9b0d
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions public/static/locales/en/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dataConsumptionError": "Unable to get data storage info.",
"dataConsumptionTimestamp": "{{distance}} ago.",
"dataOverageNote": "Need more resources? There's a <dataStoreFormLink>form</dataStoreFormLink> for that!",
"dataStorageLimits": "Data Storage Limits",
"detailsAction": "Show Details",
"dismiss": "Dismiss",
"editedBy": "Edited by",
Expand Down Expand Up @@ -54,6 +55,7 @@
"popularFeaturedApps": "Featured Apps",
"publicApps": "Public Apps",
"publishedBy": "Published by",
"quotaEnforceAnnouncement": "Starting <b>March 1, 2025</b>, we will begin to enforce data storage quotas on all Basic (free) and paid subscription accounts. <infoLink>More information and FAQ here</infoLink>.",
"quotaLimit": "{{limit}} (Limit)",
"recentAnalyses": "Recent Analyses",
"recentlyAddedApps": "Recently Added Apps",
Expand Down
1 change: 1 addition & 0 deletions src/components/dashboard/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ export const XS_NUM_COLUMNS = 1;
export const XS_PIXELS = 0;

export const FEATURE_MATRIX_URL = "https://cyverse.org/subscribe";
export const QUOTA_ENFORCE_URL = "https://cyverse.org/quota-enforce";
65 changes: 65 additions & 0 deletions src/components/dashboard/dashboardItem/Announcement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* A dashboard item for displaying important announcements.
*
* @author psarando
*/
import React from "react";

import { useTranslation, Trans } from "i18n";

import { QUOTA_ENFORCE_URL } from "../constants";
import ExternalLink from "components/utils/ExternalLink";

import {
Card,
CardHeader,
CardContent,
Typography,
useTheme,
} from "@mui/material";

import AnnounceIcon from "@mui/icons-material/Warning";

export default function Announcement() {
const theme = useTheme();
const { t } = useTranslation("dashboard");

return (
<Card
style={{
marginTop: theme.spacing(2),
marginBottom: theme.spacing(2),
}}
>
<CardHeader
avatar={
<AnnounceIcon
style={{ color: theme.palette.gold }}
fontSize="large"
/>
}
title={
<Typography variant="subtitle2">
{t("dataStorageLimits")}
</Typography>
}
style={{
backgroundColor: theme.palette.secondary.main,
color: theme.palette.secondary.contrastText,
}}
/>
<CardContent>
<Typography variant="body2" gutterBottom>
<Trans
t={t}
i18nKey="quotaEnforceAnnouncement"
components={{
b: <b />,
infoLink: <ExternalLink href={QUOTA_ENFORCE_URL} />,
}}
/>
</Typography>
</CardContent>
</Card>
);
}
2 changes: 2 additions & 0 deletions src/components/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { useSavePreferences } from "serviceFacades/users";

import withErrorAnnouncer from "components/error/withErrorAnnouncer";
import { useUserProfile } from "contexts/userProfile";
import Announcement from "./dashboardItem/Announcement";
import Banner from "./dashboardItem/Banner";
import Tour from "./dashboardItem/Tour";
import TerminateAnalysisDialog from "components/analyses/TerminateAnalysisDialog";
Expand Down Expand Up @@ -311,6 +312,7 @@ const Dashboard = (props) => {
mutatePreferences({ preferences: updatedPref });
}}
/>,
<Announcement key="Announcement" />,
<ResourceUsageItem
key="ResourceUsage"
resourceUsageSummary={resourceUsageSummary}
Expand Down

0 comments on commit 9eb9b0d

Please sign in to comment.