Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-2025 Add Data Limits dashboard announcement #612

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "CyVerse will begin enforcing data storage limits on March 1, 2025. Please see the <infoLink>announcement</infoLink> for more details.",
"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";
64 changes: 64 additions & 0 deletions src/components/dashboard/dashboardItem/Announcement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* 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={{
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
Loading