mirror of
https://github.com/TautvydasDerzinskas/Thingport.git
synced 2026-10-21 22:22:24 -05:00
feat: open What's new from the Update Checker instead of the user menu
It sits beside the version an admin checks rather than in every user's menu; members still get it from the update notification.
This commit is contained in:
1 parent
514113e2c5
commit
508c224e25
4 files changed
+11
-16
No files matched your search
+1
-1
@@ -259,7 +259,7 @@ ordinary notification (the System tab). To post one, add an entry to `entries` a
|
||||
## Release notes (What's new)
|
||||
|
||||
The first time a backend starts on a newer version than it last ran, every user gets a notification that opens
|
||||
the What's new dialog (also in the user menu). A fresh install isn't told. There's no need to add a "Welcome to
|
||||
the What's new dialog (admins can reopen it from Update Checker in Administration). A fresh install isn't told. There's no need to add a "Welcome to
|
||||
X.Y.Z" entry to `system-notifications.json` for this any more.
|
||||
|
||||
The dialog fetches its content from `main`, so it can be written after the release is out:
|
||||
|
||||
@@ -15,7 +15,6 @@ import PersonIcon from "@mui/icons-material/Person";
|
||||
import ViewInArIcon from "@mui/icons-material/ViewInAr";
|
||||
import SettingsIcon from "@mui/icons-material/Settings";
|
||||
import LogoutIcon from "@mui/icons-material/Logout";
|
||||
import NewReleasesOutlinedIcon from "@mui/icons-material/NewReleasesOutlined";
|
||||
import type { AuthUser } from "../../api/auth";
|
||||
import type { ConfigurationTab } from "./ConfigurationDialog";
|
||||
import { IMPORT_PROVIDER_INFO } from "../../constants/importProviders";
|
||||
@@ -25,7 +24,6 @@ import { useGravatarUrl } from "../../hooks/useGravatarUrl";
|
||||
import { settingsApi, type Cults3dSettings } from "../../api/settings";
|
||||
import { cults3dReady, cults3dStatus } from "./ConfigurationDialog/cults3dStatus";
|
||||
import { useDisabledProviders } from "../../hooks/useDisabledProviders";
|
||||
import { useWhatsNew } from "../whatsNew/WhatsNewProvider";
|
||||
|
||||
type ServiceChipDef = {
|
||||
key:
|
||||
@@ -57,7 +55,6 @@ type Props = {
|
||||
export function UserMenu({ user, onOpenConfiguration, onOpenProfile, onLogout }: Props) {
|
||||
const { t } = useTranslation(["app", "common"]);
|
||||
const navigate = useNavigate();
|
||||
const openWhatsNew = useWhatsNew();
|
||||
const avatarUrl = useGravatarUrl(user?.email, 128);
|
||||
const [anchorEl, setAnchorEl] = React.useState<HTMLElement | null>(null);
|
||||
const [makerworldConfigured, setMakerworldConfigured] = React.useState(false);
|
||||
@@ -312,17 +309,6 @@ export function UserMenu({ user, onOpenConfiguration, onOpenProfile, onLogout }:
|
||||
</ListItemIcon>
|
||||
<ListItemText>{t("configuration.title")}</ListItemText>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
closeMenu();
|
||||
openWhatsNew();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<NewReleasesOutlinedIcon fontSize="small" />
|
||||
</ListItemIcon>
|
||||
<ListItemText>{t("whatsNew.label")}</ListItemText>
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
<Box sx={{ px: 1.5, py: 1, display: "flex", flexWrap: "wrap", gap: 0.5, maxWidth: 260 }}>
|
||||
{services.map((svc) => (
|
||||
|
||||
@@ -7,11 +7,14 @@ import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Alert from "@mui/material/Alert";
|
||||
import AlertTitle from "@mui/material/AlertTitle";
|
||||
import Box from "@mui/material/Box";
|
||||
import Button from "@mui/material/Button";
|
||||
import NewReleasesOutlinedIcon from "@mui/icons-material/NewReleasesOutlined";
|
||||
import { UnauthorizedError } from "../../api/client";
|
||||
import { settingsApi, FRONTEND_GIT_SHA, FRONTEND_VERSION } from "../../api/settings";
|
||||
import SectionHeader from "../../components/SectionHeader";
|
||||
import { AnimatedTile } from "../../components/storageAnimations/parts";
|
||||
import UpdateCheckAnimation, { type UpdateCheckState } from "../../components/adminAnimations/UpdateCheckAnimation";
|
||||
import { useWhatsNew } from "../../components/whatsNew/WhatsNewProvider";
|
||||
|
||||
type Props = {
|
||||
onUnauthorized?: () => void;
|
||||
@@ -37,6 +40,7 @@ export default function UpdateCheckSection({ onUnauthorized }: Props) {
|
||||
const { t } = useTranslation("app");
|
||||
const [status, setStatus] = React.useState<Status>({ kind: "checking" });
|
||||
const [backendVersion, setBackendVersion] = React.useState<string | null>(null);
|
||||
const openWhatsNew = useWhatsNew();
|
||||
|
||||
React.useEffect(() => {
|
||||
let active = true;
|
||||
@@ -72,6 +76,11 @@ export default function UpdateCheckSection({ onUnauthorized }: Props) {
|
||||
<SectionHeader
|
||||
title={t("adminSettings.updateCheck.heading")}
|
||||
subtitle={t("adminSettings.updateCheck.subtitle")}
|
||||
actions={
|
||||
<Button variant="outlined" startIcon={<NewReleasesOutlinedIcon />} onClick={() => openWhatsNew()}>
|
||||
{t("whatsNew.label")}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
<Paper variant="outlined" sx={{ p: 2.5 }}>
|
||||
<Stack direction="row" spacing={2.5} alignItems="center">
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
{
|
||||
"type": "feature",
|
||||
"title": "What's new after every update",
|
||||
"description": "You're reading it. Open it again any time from your user menu."
|
||||
"description": "You're reading it. Admins can open it again any time from Update Checker in Administration."
|
||||
},
|
||||
{
|
||||
"type": "improvement",
|
||||
|
||||
Reference in new issue
Block a user