Skip to content

Commit bb12a74

Browse files
authored
UI bug fixes and aesthetic updates (#492)
Major fixes - MAJOR PATCH: Disallowed editing of usernames as discussed - MAJOR BUGFIX: Adding existing user to workspace did not actually use the selected role! Layouts - `Layout.tsx` files updated to properly treat page contents as children so that we could correctly use `height:"100%"` in the pages instead of having to use things like `height: "96vh"` - BUGFIX: Content cards overflow when sidebar is open is fixed - UD page now also always fills the screen and doesn't scroll (only rules scroll) - Updated Workspace Management page to match UD page styles. Made the edit name button into an IconButton. - - Many modals have been cleaned up and standardised. Fabs and buttons - Content test sidebar fabs updated and repositioned to inline with page nav - UD rules page test sidebar tab is updated and repositioned - Search bar and tag filter and add buttons cleaned up and made sleeker Navbar resizing fixes - BUGFIX: On smaller windows, nav bar items overflowed the screen and could not be seen (since the introduction of the workspace button). - Large navbar now switches to small navbar earlier. - Large navbar items always stay single-line now too. - AAQ logo disappear on small navbar if the screen is too small to show the logo AND workspace button Other bug fixes - BUGFIX: Integrations page wording changed to "Workspace API Key" instead of the legacy "Your" - BUGFIX: Clicking "Edit" on a card no longer opens the card preview modal first
1 parent 50fbd3d commit bb12a74

25 files changed

+687
-622
lines changed

admin_app/src/app/content/components/ChatSideBar.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const ChatSideBar = ({
133133
flexDirection: "column",
134134
padding: 3,
135135
paddingTop: 4,
136-
height: "94vh",
136+
height: "100%",
137137
}}
138138
>
139139
<Box
@@ -149,8 +149,14 @@ const ChatSideBar = ({
149149
</Box>
150150
<Box
151151
sx={{
152-
overflowY: "auto",
152+
display: "flex",
153+
flexDirection: "column",
153154
flexGrow: 1,
155+
flexShrink: 1,
156+
height: 0,
157+
minHeight: "200px",
158+
padding: 2,
159+
overflowY: "auto",
154160
}}
155161
>
156162
{messages.map((message, index) => (

admin_app/src/app/content/components/ContentCard.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import React from "react";
77
import { Layout } from "../../../components/Layout";
88
import { Tag } from "@/app/content/page";
99

10+
const CARD_HEIGHT = 210;
11+
const CARD_MIN_WIDTH = 280;
12+
1013
const ContentCard = ({
1114
title,
1215
text,
@@ -42,12 +45,12 @@ const ContentCard = ({
4245
sx={[
4346
{
4447
cursor: "pointer",
45-
m: sizes.smallGap,
4648
p: sizes.baseGap,
4749
display: "flex",
4850
flexDirection: "column",
4951
justifyContent: "space-between",
50-
maxHeight: "250px",
52+
height: CARD_HEIGHT,
53+
minWidth: CARD_MIN_WIDTH,
5154
},
5255
appStyles.hoverShadow,
5356
appStyles.shadow,
@@ -108,6 +111,7 @@ const ContentCard = ({
108111
disabled={!editAccess}
109112
component={Link}
110113
href={`/content/edit?content_id=${content_id}`}
114+
onClick={(event) => event.stopPropagation()}
111115
>
112116
<Edit fontSize="small" />
113117
<Layout.Spacer horizontal multiplier={0.3} />
@@ -151,4 +155,4 @@ const ContentCard = ({
151155
);
152156
};
153157

154-
export default ContentCard;
158+
export { ContentCard, CARD_HEIGHT, CARD_MIN_WIDTH };

admin_app/src/app/content/components/PageNavigation.tsx

-73
This file was deleted.

admin_app/src/app/content/components/SearchBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export const SearchBar: React.FC<SearchBarProps> = ({ searchTerm, setSearchTerm
1515
<TextField
1616
sx={{
1717
backgroundColor: appColors.white,
18-
borderRadius: "5px",
1918
}}
2019
variant="outlined"
20+
size="small"
2121
placeholder="Search"
2222
value={searchTerm}
2323
onChange={(e) => {

admin_app/src/app/content/edit/page.tsx

+23-22
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const AddEditContentPage = () => {
7979
flexDirection: "row",
8080
justifyContent: "center",
8181
alignItems: "center",
82-
height: "100vh",
82+
height: "100%",
8383
width: "100%",
8484
}}
8585
>
@@ -90,34 +90,35 @@ const AddEditContentPage = () => {
9090
return (
9191
<FullAccessComponent>
9292
<Layout.FlexBox
93-
flexDirection={"column"}
94-
sx={{ p: sizes.doubleBaseGap, marginTop: 5 }}
93+
sx={{
94+
flexDirection: "column",
95+
marginTop: 2,
96+
marginBottom: 1,
97+
p: sizes.doubleBaseGap,
98+
gap: sizes.baseGap,
99+
}}
95100
>
96101
<Header
97102
content_id={content_id}
98103
onBack={() =>
99104
isSaved ? router.push("/content") : setOpenDiscardChangesModal(true)
100105
}
101106
/>
102-
<Layout.FlexBox flexDirection={"column"}>
103-
<Layout.Spacer multiplier={2} />
104-
<ContentBox
105-
content={content}
106-
setContent={setContent}
107-
getTagList={() => {
108-
return getTagList(token!);
109-
}}
110-
addTag={(tag: string) => {
111-
return createTag(tag, token!);
112-
}}
113-
deleteTag={(tag_id: number) => {
114-
return deleteTag(tag_id, token!);
115-
}}
116-
isSaved={isSaved}
117-
setIsSaved={setIsSaved}
118-
/>
119-
<Layout.Spacer multiplier={1} />
120-
</Layout.FlexBox>
107+
<ContentBox
108+
content={content}
109+
setContent={setContent}
110+
getTagList={() => {
111+
return getTagList(token!);
112+
}}
113+
addTag={(tag: string) => {
114+
return createTag(tag, token!);
115+
}}
116+
deleteTag={(tag_id: number) => {
117+
return deleteTag(tag_id, token!);
118+
}}
119+
isSaved={isSaved}
120+
setIsSaved={setIsSaved}
121+
/>
121122
</Layout.FlexBox>
122123
<DiscardChangesModal
123124
open={openDiscardChangesModal}

admin_app/src/app/content/layout.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export default function RootLayout({
1010
}>) {
1111
return (
1212
<ProtectedComponent>
13-
<NavBar />
14-
<Box paddingTop={"60px"}>{children}</Box>
13+
<Box sx={{ display: "flex", flexDirection: "column", height: "100vh" }}>
14+
<NavBar />
15+
<Box sx={{ flexGrow: 1, overflow: "auto", paddingTop: "60px" }}>{children}</Box>
16+
</Box>
1517
</ProtectedComponent>
1618
);
1719
}

0 commit comments

Comments
 (0)