From 142512c12353479cd175cd8f4b4f6f5e606b36b4 Mon Sep 17 00:00:00 2001 From: Martastain Date: Thu, 9 May 2024 18:27:26 +0200 Subject: [PATCH 1/3] feat(table): support for row highlight style --- frontend/src/components/table/cells.jsx | 4 ++++ frontend/src/components/table/index.jsx | 2 ++ 2 files changed, 6 insertions(+) diff --git a/frontend/src/components/table/cells.jsx b/frontend/src/components/table/cells.jsx index 940d6e13..d26fdbda 100644 --- a/frontend/src/components/table/cells.jsx +++ b/frontend/src/components/table/cells.jsx @@ -46,6 +46,7 @@ const DataRow = ({ columns, onRowClick, rowHighlightColor, + rowHighlightStyle, selected = false, }) => { const handleClick = (event) => { @@ -61,8 +62,11 @@ const DataRow = ({ // Left-border highlight color let highlightColor = null + let highlightStyle = null if (rowHighlightColor) highlightColor = rowHighlightColor(rowData) + if (rowHighlightStyle) highlightStyle = rowHighlightStyle(rowData) if (highlightColor) rowStyle['borderLeftColor'] = highlightColor + if (highlightStyle) rowStyle['borderLeftStyle'] = highlightStyle // Embedded progress bar if (rowData.progress && 100 > rowData.progress > 0) { diff --git a/frontend/src/components/table/index.jsx b/frontend/src/components/table/index.jsx index 1cdfa4f9..a8876af3 100644 --- a/frontend/src/components/table/index.jsx +++ b/frontend/src/components/table/index.jsx @@ -15,6 +15,7 @@ const Table = ({ onKeyDown, selection, rowHighlightColor, + rowHighlightStyle, sortBy, sortDirection, onSort, @@ -55,6 +56,7 @@ const Table = ({ columns={columns} onRowClick={onRowClick} rowHighlightColor={rowHighlightColor} + rowHighlightStyle={rowHighlightStyle} selected={selection && selection.includes(rowData[keyField])} key={keyField ? rowData[keyField] : idx} /> From 1b35a8f430e61f832a16894fd89c896ab3264acd Mon Sep 17 00:00:00 2001 From: Martastain Date: Thu, 9 May 2024 18:28:02 +0200 Subject: [PATCH 2/3] feat(browser): use dashed red border for assets with corrupted media --- frontend/src/containers/Browser/Browser.jsx | 2 ++ frontend/src/containers/Browser/Formatting.jsx | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/src/containers/Browser/Browser.jsx b/frontend/src/containers/Browser/Browser.jsx index 8bb5b144..f65123a1 100644 --- a/frontend/src/containers/Browser/Browser.jsx +++ b/frontend/src/containers/Browser/Browser.jsx @@ -20,6 +20,7 @@ import { getColumnWidth, getFormatter, formatRowHighlightColor, + formatRowHighlightStyle, } from './Formatting.jsx' const ROWS_PER_PAGE = 200 @@ -274,6 +275,7 @@ const BrowserTable = () => { onRowClick={onRowClick} onKeyDown={onKeyDown} rowHighlightColor={formatRowHighlightColor} + rowHighlightStyle={formatRowHighlightStyle} loading={loading} sortBy={sortBy} sortDirection={sortDirection} diff --git a/frontend/src/containers/Browser/Formatting.jsx b/frontend/src/containers/Browser/Formatting.jsx index 37b9df78..433c81f1 100644 --- a/frontend/src/containers/Browser/Formatting.jsx +++ b/frontend/src/containers/Browser/Formatting.jsx @@ -39,6 +39,18 @@ const formatRowHighlightColor = (rowData) => { } } +const formatRowHighlightStyle = (rowData) => { + switch (rowData['status']) { + case 5: + return 'dashed' + case 6: + return 'dashed' + default: + return 'solid' + } +} + + // Column width const getColumnWidth = (key) => { @@ -139,4 +151,4 @@ const getFormatter = (key) => { } // end switch key } // end getFormatter -export { getColumnWidth, getFormatter, formatRowHighlightColor } +export { getColumnWidth, getFormatter, formatRowHighlightColor, formatRowHighlightStyle } From da1eb622b42c35b7055b6cc23bed0f5860d4021d Mon Sep 17 00:00:00 2001 From: Martastain Date: Thu, 9 May 2024 18:29:13 +0200 Subject: [PATCH 3/3] feat(setup): add corrupted state to production views --- backend/setup/defaults/views.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/backend/setup/defaults/views.py b/backend/setup/defaults/views.py index 61e227fe..31f47427 100644 --- a/backend/setup/defaults/views.py +++ b/backend/setup/defaults/views.py @@ -1,12 +1,21 @@ +from nebula.enum import ObjectStatus from nebula.settings.models import ViewSettings +normal_states = [ + ObjectStatus.OFFLINE, + ObjectStatus.ONLINE, + ObjectStatus.CREATING, + ObjectStatus.RESET, + ObjectStatus.CORRUPTED, +] + VIEWS: list[ViewSettings] = [ ViewSettings( id=1, name="Main", position=1, folders=[1, 2], - states=[0, 1, 2, 5, 11], + states=normal_states, columns=[ "qc/state", "title", @@ -22,7 +31,7 @@ name="Fill", position=2, folders=[5, 6, 7, 8], - states=[0, 1, 2, 5, 11], + states=normal_states, columns=[ "qc/state", "title", @@ -37,7 +46,7 @@ name="Music", position=3, folders=[4], - states=[0, 1, 2, 5, 11], + states=normal_states, columns=[ "qc/state", "title", @@ -51,7 +60,7 @@ name="Stories", position=4, folders=[3], - states=[0, 1, 2, 5, 11], + states=normal_states, columns=[ "qc/state", "title", @@ -64,7 +73,7 @@ name="Commercials", position=5, folders=[9, 10], - states=[0, 1, 2, 5, 11], + states=normal_states, columns=[ "qc/state", "title", @@ -90,7 +99,7 @@ name="Trash", separator=True, position=50, - states=[3], + states=[ObjectStatus.TRASHED], columns=[ "title", "subtitle", @@ -103,7 +112,7 @@ id=51, name="Archive", position=51, - states=[4, 11], + states=[ObjectStatus.ARCHIVED, ObjectStatus.RETRIEVING], columns=[ "title", "subtitle",