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

Console redesign fixes - 16 aug #7245

Merged
merged 16 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
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
4 changes: 3 additions & 1 deletion cypress/e2e/smoke/devices/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const checkCollapsingFields = defineSmokeTest('check all end device sub pages',

cy.findByRole('link', { name: /Applications/ }).click()
cy.findByRole('cell', { name: application.ids.application_id }).click()
cy.findByRole('link', { name: /End devices/ }).click()
cy.get('#sidebar').within(() => {
cy.findByRole('link', { name: /End devices/ }).click()
})
cy.findByRole('cell', { name: `Test Device Name ${deviceId}` }).click()

cy.get('#stage').within(() => {
Expand Down
2 changes: 1 addition & 1 deletion pkg/webui/components/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ DropdownItem.propTypes = {
active: PropTypes.bool,
exact: PropTypes.bool,
external: PropTypes.bool,
icon: PropTypes.shape({}),
icon: PropTypes.icon,
messageClassName: PropTypes.string,
path: PropTypes.string,
showActive: PropTypes.bool,
Expand Down
5 changes: 5 additions & 0 deletions pkg/webui/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import ProfileDropdown from '@ttn-lw/components/profile-dropdown'
import AppStatusBadge from '@console/containers/app-status-badge'

import PropTypes from '@ttn-lw/lib/prop-types'
import sharedMessages from '@ttn-lw/lib/shared-messages'

import style from './header.styl'

Expand Down Expand Up @@ -101,6 +102,8 @@ const Header = ({
icon={IconPlus}
dropdownItems={addDropdownItems}
dropdownPosition="below left"
tooltip={sharedMessages.addEntity}
tooltipPlacement="bottom"
className="md-lg:d-none"
/>
<Button
Expand All @@ -109,6 +112,8 @@ const Header = ({
dropdownItems={bookmarkDropdownItems}
dropdownClassName={style.bookmarksDropdown}
dropdownPosition="below left"
tooltip={sharedMessages.bookmarks}
tooltipPlacement="bottom"
ryaplots marked this conversation as resolved.
Show resolved Hide resolved
className="md-lg:d-none"
/>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

.dedicated-entity
text-decoration: none
line-height: 1.6rem
line-height: $lh.xs3
ryaplots marked this conversation as resolved.
Show resolved Hide resolved
color: var(--c-text-neutral-heavy)
position: relative
height: 2.5rem
Expand Down
2 changes: 2 additions & 0 deletions pkg/webui/components/sidebar/section-label/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const SectionLabel = ({
dropdownPosition="below right"
noDropdownIcon
portalledDropdown
tooltip={sharedMessages.addEntity}
tooltipPlacement="top"
ryaplots marked this conversation as resolved.
Show resolved Hide resolved
/>
</div>
)
Expand Down
3 changes: 3 additions & 0 deletions pkg/webui/components/table/table/table.styl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
width: 100%
display: table

+media-query($bp.lg)
margin-top: 8rem

.empty-message
display: table-caption
caption-side: bottom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@
.chart-date
color: var(--c-text-neutral-light)
font-size: $fs.s

.upgrade-button
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, .09)
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ const BlurryNetworkActivityPanel = () => {
content={sharedMessages.quicklyTroubleshoot}
/>
<Button.AnchorLink
primary
naked
message={sharedMessages.upgradeNow}
icon={IconBolt}
href={upgradeUrl}
target="_blank"
className={classnames(
style.upgradeButton,
'c-bg-brand-extralight c-text-brand-normal fw-bold',
)}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const EntityTitleSection = props => {
EntityTitleSection.propTypes = {
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
className: PropTypes.string,
icon: PropTypes.string.isRequired,
icon: PropTypes.icon.isRequired,
iconAlt: PropTypes.message.isRequired,
id: PropTypes.string.isRequired,
name: PropTypes.string,
Expand Down
2 changes: 1 addition & 1 deletion pkg/webui/console/containers/account-select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const SingleValue = props => (

SingleValue.propTypes = {
data: PropTypes.shape({
icon: PropTypes.string.isRequired,
icon: PropTypes.icon.isRequired,
description: PropTypes.string,
label: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
font-weight: $fw.bold
font-size: $fs.l
margin: 0
overflow: hidden
text-overflow: ellipsis

.id
color: var(--c-text-neutral-semilight)
Expand Down
58 changes: 36 additions & 22 deletions pkg/webui/console/containers/application-overview-header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import toast from '@ttn-lw/components/toast'
import DocTooltip from '@ttn-lw/components/tooltip/doc'
import Status from '@ttn-lw/components/status'
import Dropdown from '@ttn-lw/components/dropdown'
import Link from '@ttn-lw/components/link'

import Message from '@ttn-lw/lib/components/message'
import RequireRequest from '@ttn-lw/lib/components/require-request'
Expand Down Expand Up @@ -142,35 +143,42 @@ const ApplicationOverviewHeader = () => {
let node
if (showLastSeen) {
node = (
<DocTooltip
interactive
docPath="/getting-started/console/troubleshooting"
content={<Message content={m.lastSeenAvailableTooltip} />}
>
<LastSeen lastSeen={lastSeen} className="c-text-neutral-semilight" />
</DocTooltip>
<Link to={`/applications/${application_id}/data`}>
<DocTooltip
interactive
docPath="/getting-started/console/troubleshooting"
content={<Message content={m.lastSeenAvailableTooltip} />}
>
<LastSeen lastSeen={lastSeen} className="c-text-neutral-semilight" />
</DocTooltip>
</Link>
)
} else {
node = (
<DocTooltip
content={<Message content={m.noActivityTooltip} />}
docPath="/getting-started/console/troubleshooting"
>
<Status
status="mediocre"
label={sharedMessages.noRecentActivity}
className={style.status}
/>
</DocTooltip>
<Link to={`/applications/${application_id}/data`}>
<DocTooltip
content={<Message content={m.noActivityTooltip} />}
docPath="/getting-started/console/troubleshooting"
>
<Status
status="mediocre"
label={sharedMessages.noRecentActivity}
className={style.status}
/>
</DocTooltip>
</Link>
)
}
return (
<div className="d-inline-flex al-center gap-cs-xxs md-lg:d-none">
<Link
to={`/applications/${application_id}/data`}
className="d-inline-flex al-center gap-cs-xxs md-lg:d-none"
>
<Icon icon={IconBroadcast} small className="c-text-neutral-semilight" />
{node}
</div>
</Link>
)
}, [lastSeen, showLastSeen])
}, [lastSeen, showLastSeen, application_id])

const handleOpenDeleteApplicationModal = useCallback(() => {
setDeleteApplicationModalVisible(true)
Expand Down Expand Up @@ -202,14 +210,17 @@ const ApplicationOverviewHeader = () => {
{recentActivity}
{mayViewDevices && (
<RequireRequest requestAction={getApplicationDeviceCount(application_id)}>
<div className="d-inline-flex al-center gap-cs-xxs md-lg:d-none">
<Link
to={`/applications/${application_id}/devices`}
className="d-inline-flex al-center gap-cs-xxs md-lg:d-none"
>
<Icon icon={IconCpu} small className="c-text-neutral-semilight" />
<Message
content={m.deviceCount}
className="c-text-neutral-semilight"
values={{ devices: devicesTotalCount }}
/>
</div>
</Link>
</RequireRequest>
)}
<div className={classnames(style.divider, 'md-lg:d-none')} />
Expand All @@ -221,6 +232,9 @@ const ApplicationOverviewHeader = () => {
disabled={
(!isBookmarked && addBookmarkLoading) || (isBookmarked && deleteBookmarkLoading)
}
tooltip={
isBookmarked ? sharedMessages.removeFromBookmarks : sharedMessages.addToBookmarks
}
/>
<Button
secondary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
font-weight: $fw.bold
font-size: $fs.l
margin: 0
overflow: hidden
text-overflow: ellipsis

.id
color: var(--c-text-neutral-semilight)
Expand Down Expand Up @@ -63,3 +65,9 @@

.messages-count > div
margin-right: 0

.status
color: var(--c-text-neutral-semilight)
display: flex
align-items: center
white-space: nowrap
8 changes: 6 additions & 2 deletions pkg/webui/console/containers/gateway-connection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Icon, { IconArrowsSort, IconBroadcast } from '@ttn-lw/components/icon'
import Status from '@ttn-lw/components/status'
import DocTooltip from '@ttn-lw/components/tooltip/doc'
import Tooltip from '@ttn-lw/components/tooltip'
import Link from '@ttn-lw/components/link'

import Message from '@ttn-lw/lib/components/message'

Expand Down Expand Up @@ -202,10 +203,13 @@ const GatewayConnection = props => {
}, [statistics])

return (
<div className={classnames(className, 'd-flex', 'al-center', 'gap-cs-m')}>
<Link
to={`/gateways/${gtwId}/data`}
className={classnames(className, 'd-flex', 'al-center', 'gap-cs-m')}
>
{status}
{messages}
</div>
</Link>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
font-weight: $fw.bold
font-size: $fs.l
margin: 0
overflow: hidden
text-overflow: ellipsis

.id
color: var(--c-text-neutral-semilight)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ const GatewayOverviewHeader = ({ gateway }) => {
disabled={
(!isBookmarked && addBookmarkLoading) || (isBookmarked && deleteBookmarkLoading)
}
tooltip={
isBookmarked ? sharedMessages.removeFromBookmarks : sharedMessages.addToBookmarks
}
/>
<Button
secondary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
.gtw-status-panel-upgrade-button
background: var(--c-bg-brand-extralight)
color: var(--c-text-brand-normal)
font-weight: $fw.medium
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, .05)
font-weight: $fw.bold
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, .09)
margin-top: $cs.m
width: fit-content

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { useSelector } from 'react-redux'
import classnames from 'classnames'
import { defineMessages } from 'react-intl'

import Icon, { IconKey } from '@ttn-lw/components/icon'
import Link from '@ttn-lw/components/link'
import Status from '@ttn-lw/components/status'

Expand Down Expand Up @@ -79,7 +78,10 @@ const NotificationsDropdown = () => {
className={classnames(style.notificationsDropdownLink, 'd-flex')}
>
<div className={style.notificationsDropdownLinkIcon}>
<Icon icon={IconKey} />
<Notification.Icon
data={notification}
notificationType={notification.notification_type}
/>
</div>
<div className={style.notificationContainer}>
<div className={classnames(style.title, 'fw-bold')}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const m = defineMessages({
seeInLiveData: 'See in live data',
up: '{up} up',
rssi: `{rssi}dBm RSSI`,
snr: `{snr}dB SNR`,
snr: `{snr}dBm SNR`,
noRecentActivityDescription: "There haven't been any uplinks recently in this application",
})

Expand Down Expand Up @@ -289,6 +289,8 @@ const LatestDecodedPayloadPanel = ({ appId, events, shortCutLinkPath, className,
small
className={style.maximize}
onClick={handleOpenMaximizeCodeModal}
tooltip={sharedMessages.expand}
tooltipPlacement="top"
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useSelector } from 'react-redux'
import { createSelector } from 'reselect'
import { defineMessages } from 'react-intl'

import { IconInbox } from '@ttn-lw/components/icon'
import Icon, { IconInbox } from '@ttn-lw/components/icon'
import Panel from '@ttn-lw/components/panel'
import Status from '@ttn-lw/components/status'
import ScrollFader from '@ttn-lw/components/scroll-fader'
Expand Down Expand Up @@ -117,7 +117,8 @@ const NotificationsDashboardPanel = () => {
className={style.notificationPanel}
>
{notifications && notifications.length === 0 ? (
<div className="d-flex direction-column flex-grow j-center">
<div className="d-flex direction-column flex-grow j-center al-center">
<Icon size={64} icon={IconInbox} className="c-icon-neutral-extralight" />
<Message
content={sharedMessages.noNotifications}
className="d-block text-center fs-l fw-bold"
Expand Down
2 changes: 1 addition & 1 deletion pkg/webui/console/containers/sidebar/sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $sidebar-width = 22rem

.sidebar
border-normal(right)
line-height: 1
line-height: 1.2
font-size: $fs.s
width: $sidebar-width
flex-shrink: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const RoutingConfigurationView = () => {
</Routes>
</>
)}
<SubmitBar align="end">
<SubmitBar align="end" className="mt-cs-xl3">
<Form.Submit component={SubmitButton} message={'Save routing configuration'} />
</SubmitBar>
</Form>
Expand Down
2 changes: 1 addition & 1 deletion pkg/webui/containers/collaborator-select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Suggest.propTypes = {
PropTypes.shape({
label: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
icon: PropTypes.shape({}).isRequired,
icon: PropTypes.icon.isRequired,
}),
),
isResctrictedUser: PropTypes.bool,
Expand Down
Loading
Loading