Skip to content

Commit 74c23f8

Browse files
UI - Changes (expand/collapse panels)
1 parent 61dc660 commit 74c23f8

9 files changed

Lines changed: 255 additions & 32 deletions

File tree

src/ContentProcessorWeb/src/Components/UploadContent/UploadFilesModal.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ import "./UploadFilesModal.styles.scss";
1515

1616
import { CheckmarkCircle16Filled, DismissCircle16Filled } from "@fluentui/react-icons";
1717

18+
import {
19+
MessageBar,
20+
MessageBarTitle,
21+
MessageBarBody,
22+
MessageBarIntent,
23+
Link,
24+
} from "@fluentui/react-components";
25+
1826
const useStyles = makeStyles({
1927
container: {
2028
margin: "10px 0px",
@@ -29,6 +37,15 @@ const useStyles = makeStyles({
2937
}
3038
});
3139

40+
const useClasses = makeStyles({
41+
messageContainer: {
42+
display: "flex",
43+
flexDirection: "column",
44+
gap: "10px",
45+
marginBottom: "10px"
46+
},
47+
});
48+
3249

3350
interface UploadFilesModalProps {
3451
open: boolean;
@@ -48,6 +65,7 @@ interface FileErrors {
4865
const UploadFilesModal: React.FC<UploadFilesModalProps> = ({ open, onClose }) => {
4966

5067
const styles = useStyles();
68+
const classes = useClasses();
5169

5270
const [files, setFiles] = useState<File[]>([]);
5371
const [startUpload, setStartUpload] = useState(false);
@@ -61,6 +79,7 @@ const UploadFilesModal: React.FC<UploadFilesModalProps> = ({ open, onClose }) =>
6179
const [uploadCompleted, setUploadCompleted] = useState(false);
6280

6381

82+
const intents: MessageBarIntent[] = ["warning"];
6483
const store = useSelector((state: RootState) => ({
6584
schemaSelectedOption: state.leftPanel.schemaSelectedOption,
6685
page_size: state.leftPanel.gridData.page_size,
@@ -202,6 +221,16 @@ const UploadFilesModal: React.FC<UploadFilesModalProps> = ({ open, onClose }) =>
202221
<DialogTitle>Import Content</DialogTitle>
203222
<DialogContent>
204223
<div className="dialogBody">
224+
<div className={classes.messageContainer}>
225+
{intents.map((intent) => (
226+
<MessageBar key={intent} intent={intent}>
227+
<MessageBarBody>
228+
<MessageBarTitle>Selected Schema : {store.schemaSelectedOption.optionText} </MessageBarTitle>
229+
<br />Please upload files specific to "{store.schemaSelectedOption.optionText}"
230+
</MessageBarBody>
231+
</MessageBar>
232+
))}
233+
</div>
205234
{/* Drag & Drop Area with Centered Button & Message */}
206235
<div
207236
className={`drop-area ${dragging ? "dragging" : ""}`}

src/ContentProcessorWeb/src/Pages/DefaultPage/Components/ProcessSteps/ProcessSteps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const ProcessSteps = () => {
8484
restrictEdit={true}
8585
restrictDelete={true}
8686
restrictAdd={true}
87-
rootName=""
87+
rootName={step.step_name.toLowerCase()}
8888
collapseAnimationTime={300}
8989
theme={[{
9090
styles: {

src/ContentProcessorWeb/src/Pages/DefaultPage/PanelCenter.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ import { fetchContentJsonData, setActiveProcessId } from '../../store/slices/cen
1212
import ProcessSteps from './Components/ProcessSteps/ProcessSteps';
1313
import { setRefreshGrid } from "../../store/slices/leftPanelSlice.ts";
1414

15+
import { bundleIcon, ChevronDoubleLeft20Filled, ChevronDoubleLeft20Regular } from "@fluentui/react-icons";
16+
const ChevronDoubleLeft = bundleIcon(ChevronDoubleLeft20Regular, ChevronDoubleLeft20Filled);
17+
1518
interface PanelCenterProps {
16-
19+
togglePanel: (panel: string) => void;
1720
}
1821

1922
const useStyles = makeStyles({
@@ -52,7 +55,7 @@ const useStyles = makeStyles({
5255
overflow: 'auto',
5356
background: '#f6f6f6',
5457
padding: '10px 5px',
55-
boxSizing:'border-box'
58+
boxSizing: 'border-box'
5659
},
5760

5861
processTabItemCotnent: {
@@ -61,7 +64,7 @@ const useStyles = makeStyles({
6164
overflow: 'auto',
6265
background: '#f6f6f6',
6366
padding: '5px',
64-
boxSizing:'border-box'
67+
boxSizing: 'border-box'
6568
},
6669
fieldLabel: {
6770
fontWeight: 'bold',
@@ -86,7 +89,7 @@ const useStyles = makeStyles({
8689
}
8790
})
8891

89-
const PanelCenter: React.FC<PanelCenterProps> = () => {
92+
const PanelCenter: React.FC<PanelCenterProps> = ({ togglePanel }) => {
9093

9194
const styles = useStyles();
9295
const dispatch = useDispatch<AppDispatch>();
@@ -182,8 +185,10 @@ const PanelCenter: React.FC<PanelCenterProps> = () => {
182185
}
183186

184187
return (
185-
<div className={styles.panelCenter}>
186-
<PanelToolbar icon={null} header="Output Review"></PanelToolbar>
188+
<div className={`pc ${styles.panelCenter}`}>
189+
<PanelToolbar icon={null} header="Output Review">
190+
<Button icon={<ChevronDoubleLeft />} title="Collapse Panel" onClick={() => togglePanel('Center')} />
191+
</PanelToolbar>
187192
<div className={styles.panelCenterTopSection} >
188193
<div className={styles.tabContainer}>
189194
<TabList selectedValue={selectedTab} onTabSelect={onTabSelect} className="custom-test" >

src/ContentProcessorWeb/src/Pages/DefaultPage/PanelLeft.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useEffect } from "react";
22
import { Button } from "@fluentui/react-components";
3-
import { ArrowClockwiseRegular, ArrowUploadRegular } from "@fluentui/react-icons";
3+
import { ArrowClockwiseRegular, ArrowUploadRegular, ChevronDoubleLeft20Regular, ChevronDoubleLeft20Filled, bundleIcon } from "@fluentui/react-icons";
44
import PanelToolbar from "../../Hooks/usePanelHooks.tsx";
55
import ProcessQueueGrid from './Components/ProcessQueueGrid/ProcessQueueGrid.tsx';
66
import SchemaDropdown from './Components/SchemaDropdown/SchemaDropdown';
@@ -12,10 +12,13 @@ import { AppDispatch, RootState } from '../../store/index.ts';
1212
import { startLoader, stopLoader } from "../../store/slices/loaderSlice.ts";
1313
import { toast } from "react-toastify";
1414

15+
const ChevronDoubleLeft = bundleIcon(ChevronDoubleLeft20Regular, ChevronDoubleLeft20Filled);
16+
1517
interface PanelLeftProps {
18+
togglePanel: (panel: string) => void;
1619
}
1720

18-
const PanelLeft: React.FC<PanelLeftProps> = () => {
21+
const PanelLeft: React.FC<PanelLeftProps> = ({ togglePanel }) => {
1922

2023
const [isModalOpen, setIsModalOpen] = useState(false);
2124
const dispatch = useDispatch<AppDispatch>();
@@ -24,7 +27,7 @@ const PanelLeft: React.FC<PanelLeftProps> = () => {
2427
schemaSelectedOption: state.leftPanel.schemaSelectedOption,
2528
page_size: state.leftPanel.gridData.page_size,
2629
pageSize: state.leftPanel.pageSize,
27-
isGridRefresh: state.leftPanel.isGridRefresh
30+
isGridRefresh: state.leftPanel.isGridRefresh,
2831
}), shallowEqual);
2932

3033
useEffect(() => {
@@ -68,14 +71,17 @@ const PanelLeft: React.FC<PanelLeftProps> = () => {
6871
const { schemaSelectedOption } = store;
6972
if (Object.keys(schemaSelectedOption).length === 0) {
7073
toast.error("Please Select Schema");
71-
return;
74+
return;
7275
}
7376
setIsModalOpen(true);
7477
};
7578

7679
return (
7780
<div className="panelLeft">
78-
<PanelToolbar icon={null} header="Processing Queue"></PanelToolbar>
81+
<PanelToolbar icon={null} header="Processing Queue">
82+
<Button icon={<ChevronDoubleLeft />} title="Collapse Panel" onClick={() => togglePanel('Left')}>
83+
</Button>
84+
</PanelToolbar>
7985
<div className="topContainer">
8086
<SchemaDropdown />
8187
<Button appearance="primary" icon={<ArrowUploadRegular />} onClick={handleImportContent}>

src/ContentProcessorWeb/src/Pages/DefaultPage/PanelRight.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ import DocumentViewer from '../../Components/DocumentViewer/DocumentViewer.tsx'
44
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
55
import { AppDispatch, RootState } from '../../store';
66
import { fetchContentFileData } from '../../store/slices/rightPanelSlice'
7-
7+
import { updatePanelCollapse } from "../../store/slices/defaultPageSlice.ts";
8+
import { bundleIcon, ChevronDoubleLeft20Filled, ChevronDoubleLeft20Regular } from "@fluentui/react-icons";
9+
import { Button } from "@fluentui/react-components";
10+
const ChevronDoubleLeft = bundleIcon(ChevronDoubleLeft20Regular, ChevronDoubleLeft20Filled);
811
interface PanelRightProps {
12+
togglePanel: (panel: string) => void;
913
}
1014

11-
const PanelRight: React.FC<PanelRightProps> = () => {
15+
const PanelRight: React.FC<PanelRightProps> = ({ togglePanel }) => {
1216

1317
const dispatch = useDispatch<AppDispatch>();
1418
const [fileData, setFileData] = useState({ 'urlWithSasToken': '', 'mimeType': '' })
@@ -41,10 +45,11 @@ const PanelRight: React.FC<PanelRightProps> = () => {
4145
}
4246
}, [store.processId, store.fileResponse])
4347

44-
4548
return (
46-
<div className="panelRight">
47-
<PanelToolbar icon={null} header="Source Document"></PanelToolbar>
49+
<div className="pr panelRight">
50+
<PanelToolbar icon={null} header="Source Document">
51+
<Button icon={<ChevronDoubleLeft />} title="Collapse Panel" onClick={() => togglePanel('Right')} />
52+
</PanelToolbar>
4853
<div className="panelRightContent">
4954
{
5055
store.rLoader ? <div className={"right-loader"}><p>Loading...</p></div>

src/ContentProcessorWeb/src/Pages/DefaultPage/Panels.styles.scss

Lines changed: 95 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/* Panel container styling */
66

7-
.panelLeft {
7+
.panelLeftLayout {
88
/* background-color: var(--colorNeutralBackground4); */
99
position: relative;
1010
display: flex;
@@ -18,6 +18,23 @@
1818
flex: 37%;
1919
min-width: 300px;
2020

21+
.collapseButtonDiv {
22+
display: none;
23+
}
24+
25+
26+
.panelLeft {
27+
position: relative;
28+
display: flex;
29+
height: 100%;
30+
box-sizing: border-box;
31+
flex-direction: column;
32+
overflow-y: auto;
33+
background-color: white;
34+
border: 1px solid #D6D6D6;
35+
border-width: 1px 1px 0px 0px;
36+
}
37+
2138
.leftcontent {
2239
display: flex;
2340
flex-direction: column;
@@ -31,14 +48,31 @@
3148
overflow-x: hidden;
3249
overflow-y: auto;
3350
}
34-
51+
3552
.topContainer {
3653
display: flex;
3754
flex-wrap: wrap;
3855
align-items: end;
3956
gap: 10px;
4057
padding: 0px 16px 16px 16px;
4158
}
59+
60+
61+
}
62+
63+
.panelLeftLayout.collapse {
64+
flex: none;
65+
width: auto;
66+
min-width: 20px;
67+
transition: width 0.3s ease;
68+
69+
.collapseButtonDiv {
70+
display: block !important;
71+
}
72+
73+
.panelLeft {
74+
display: none !important;
75+
}
4276
}
4377

4478
.panelCenter {
@@ -61,18 +95,39 @@
6195
padding: 5px 12px 12px 10px !important
6296
}
6397

64-
.saveBtnDiv {
98+
.saveBtnDiv {
6599
display: flex;
66-
justify-content: flex-end;
100+
justify-content: flex-end;
67101
align-items: center;
68102

69-
.msgp {
103+
.msgp {
70104
margin: auto;
71-
color: red;
105+
color: red;
72106
}
73107
}
108+
109+
.collapseButtonDiv {
110+
display: none;
111+
}
112+
}
113+
114+
.panelCenter.collapse {
115+
flex: none;
116+
width: auto;
117+
min-width: 20px;
118+
border: 1px solid #d6d6d6;
119+
border-width: 1px 1px 0 0;
120+
121+
.collapseButtonDiv {
122+
display: block !important;
123+
}
124+
125+
.pc {
126+
display: none !important;
127+
}
74128
}
75129

130+
76131
.panelRight {
77132
/* background-color: var(--colorNeutralBackground4); */
78133
position: relative;
@@ -113,7 +168,24 @@
113168
height: 100%;
114169
}
115170

116-
171+
.collapseButtonDiv {
172+
display: none;
173+
}
174+
175+
}
176+
177+
.panelRight.collapse {
178+
flex: none;
179+
width: auto;
180+
min-width: 20px;
181+
182+
.collapseButtonDiv {
183+
display: block !important;
184+
}
185+
186+
.pr {
187+
display: none !important;
188+
}
117189
}
118190

119191
.panelToolbar {
@@ -130,4 +202,20 @@
130202

131203
.fullHeight {
132204
height: 100vh;
205+
}
206+
207+
.rotate-button {
208+
writing-mode: vertical-rl;
209+
/* Makes text go top to bottom */
210+
text-orientation: mixed;
211+
/* Keeps letters upright */
212+
height: auto;
213+
/* Automatically adjusts height */
214+
width: fit-content;
215+
/* Adjust width based on content */
216+
background-color: #f0f0f0;
217+
cursor: pointer;
218+
min-width: 10px !important;
219+
height: 170px;
220+
padding: 10px !important;
133221
}

0 commit comments

Comments
 (0)