diff --git a/docs/de/user/alerts/assets/alerts-list.png b/docs/de/user/alerts/assets/alerts-list.png index e4c0340fb2..a47778c189 100644 Binary files a/docs/de/user/alerts/assets/alerts-list.png and b/docs/de/user/alerts/assets/alerts-list.png differ diff --git a/docs/en/user/alerts/assets/alerts-list.png b/docs/en/user/alerts/assets/alerts-list.png index afd27cbfba..5b0a5fd662 100644 Binary files a/docs/en/user/alerts/assets/alerts-list.png and b/docs/en/user/alerts/assets/alerts-list.png differ diff --git a/gradle/changelog/alert_styling.yaml b/gradle/changelog/alert_styling.yaml new file mode 100644 index 0000000000..60f8d3dc5c --- /dev/null +++ b/gradle/changelog/alert_styling.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Incorrect alert message styling for long version conditions diff --git a/scm-ui/ui-webapp/src/components/HeaderDropDown.tsx b/scm-ui/ui-webapp/src/components/HeaderDropDown.tsx index cc81112913..859ee7974d 100644 --- a/scm-ui/ui-webapp/src/components/HeaderDropDown.tsx +++ b/scm-ui/ui-webapp/src/components/HeaderDropDown.tsx @@ -35,12 +35,6 @@ const DropDownMenu = styled.div` } @media screen and (max-width: ${devices.mobile.width}px) { - ${(props) => - props.mobilePosition === "right" && - css` - right: -1.5rem; - left: auto; - `}; position: fixed; top: auto; } @@ -80,8 +74,11 @@ const DropDownMenu = styled.div` props.mobilePosition === "right" && css` @media screen and (max-width: ${devices.mobile.width}px) { - left: auto; - right: 1.75rem; + left: 21.75rem; + } + + @media screen and (min-width: ${devices.mobile.width + 1}px) and (max-width: ${devices.tablet.width - 1}px) { + left: 19.65rem; } `}; } diff --git a/scm-ui/ui-webapp/src/containers/Alerts.tsx b/scm-ui/ui-webapp/src/containers/Alerts.tsx index 0d642fe5d9..9b62d92207 100644 --- a/scm-ui/ui-webapp/src/containers/Alerts.tsx +++ b/scm-ui/ui-webapp/src/containers/Alerts.tsx @@ -18,17 +18,23 @@ import React, { FC } from "react"; import { useTranslation } from "react-i18next"; import classNames from "classnames"; import styled from "styled-components"; -import { Alert } from "@scm-manager/ui-types"; -import { DateFromNow, Icon } from "@scm-manager/ui-components"; import { useAlerts } from "@scm-manager/ui-api"; -import HeaderDropDown, { Column, OnlyMobileWrappingColumn, Table } from "../components/HeaderDropDown"; +import { DateFromNow } from "@scm-manager/ui-components"; +import { Icon } from "@scm-manager/ui-core"; +import { Alert } from "@scm-manager/ui-types"; +import HeaderDropDown from "../components/HeaderDropDown"; -const FullHeightTable = styled(Table)` - height: 100%; +const AlertDropdown = styled.div` + @media screen and (max-width: 768px) { + width: 100vw; + } `; -const RightColumn = styled(OnlyMobileWrappingColumn)` - height: 100%; +const AlertContainer = styled.ul` + > *:not(:last-child) { + border-bottom: solid 2px var(--scm-border-color); + } + border-left: 3px solid var(--scm-danger-color); `; type EntryProps = { @@ -36,27 +42,18 @@ type EntryProps = { }; const AlertsEntry: FC = ({ alert }) => { - const navigateTo = () => { - if (alert.link) { - window.open(alert.link)?.focus(); - } - }; - return ( - - -

{alert.title}

-

{alert.description}

-
- -
-

- {alert.component} {alert.affectedVersions} -

+
  • + +
    +

    + {alert.title} ({alert.component} {alert.affectedVersions}) +

    +

    {alert.description}

    -
  • -
    - + + + ); }; @@ -65,20 +62,22 @@ type Props = { }; const AlertsList: FC = ({ data }) => ( -
    - - - {data.map((a, i) => ( - - ))} - - -
    + + + {data.map((a, i) => ( + + ))} + + ); const ShieldNotificationIcon: FC = () => { const [t] = useTranslation("commons"); - return ; + return ( + + shield-alt + + ); }; type ComponentAlert = Alert & { @@ -89,8 +88,8 @@ const useFlattenedAlerts = () => { const { data, error } = useAlerts(); if (data) { - const flattenedAlerts: ComponentAlert[] = data.alerts?.map(a => ({ ...a, component: "core" })) || []; - data.plugins?.forEach(p => flattenedAlerts.push(...(p.alerts || []).map(a => ({ ...a, component: p.name })))); + const flattenedAlerts: ComponentAlert[] = data.alerts?.map((a) => ({ ...a, component: "core" })) || []; + data.plugins?.forEach((p) => flattenedAlerts.push(...(p.alerts || []).map((a) => ({ ...a, component: p.name })))); flattenedAlerts.sort((a, b) => { if (new Date(a.issuedAt) < new Date(b.issuedAt)) { return 1; @@ -99,13 +98,13 @@ const useFlattenedAlerts = () => { }); return { data: flattenedAlerts, - error + error, }; } return { data, - error + error, }; };