Skip to content

Commit 7c7453a

Browse files
committed
refactor: update styling and structure for AuditLogs and ExecutionLogs components, including table height adjustments and pagination improvements
1 parent 804ed93 commit 7c7453a

File tree

5 files changed

+111
-84
lines changed

5 files changed

+111
-84
lines changed

ui/src/components/AuditLogs/index.scss

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,21 @@
1616
width: calc(100% - 15rem);
1717
}
1818

19-
.Table__head__column {
20-
align-items: center;
21-
display: flex;
22-
justify-content: space-between;
23-
}
19+
.PageLayout__body {
20+
.table-height {
21+
.Table {
22+
height: calc(100vh - 12.75rem) !important;
23+
}
2424

25+
.Table.TableWithPaginated {
26+
.Table__body {
27+
height: calc(100vh - 20rem) !important;
28+
}
29+
}
30+
}
31+
}
2532

26-
.Table:has(.custom-empty-state) {
27-
height: 40.5rem;
33+
.TablePagination {
34+
position: sticky;
35+
bottom: 0px;
2836
}

ui/src/components/AuditLogs/index.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const AuditLogs: React.FC = () => {
3333
const [isFilterApplied, setIsFilterApplied] = useState(false);
3434
const [isFilterDropdownOpen, setIsFilterDropdownOpen] = useState(false);
3535
const [dropDownOptions, setDropDownOptions] = useState<string>();
36+
// const [tableHeight, setTableHeight] = useState<number>(window.innerHeight);
3637
const selectedOrganisation = useSelector(
3738
(state: RootState) => state?.authentication?.selectedOrganisation
3839
);
@@ -87,6 +88,16 @@ const AuditLogs: React.FC = () => {
8788
setFilterOption('all');
8889
setIsFilterApplied(false);
8990
};
91+
// useEffect(() => {
92+
// const handleResize = () => {
93+
// setTableHeight(window.innerHeight - 275);
94+
// };
95+
// // console.info(window.innerHeight)
96+
// // console.info(tableHeight)
97+
// window.addEventListener("resize", handleResize);
98+
// handleResize();
99+
// return () => window.removeEventListener("resize", handleResize);
100+
// }, [window.innerHeight]);
90101
const fetchTableData = async ({
91102
skip = 0,
92103
limit = 30,
@@ -380,8 +391,6 @@ const AuditLogs: React.FC = () => {
380391
value={selectedStack}
381392
onChange={handleStackChange}
382393
options={stackOptions}
383-
width="220px"
384-
maxWidth="220px"
385394
placeholder={auditLogsConstants.placeholders.selectStack}
386395
isSearchable
387396
version="v2"
@@ -394,8 +403,6 @@ const AuditLogs: React.FC = () => {
394403
value={selectedFile}
395404
onChange={handleFileChange}
396405
options={fileOptions}
397-
width="220px"
398-
maxWidth="220px"
399406
placeholder={auditLogsConstants.placeholders.selectModule}
400407
isSearchable
401408
version="v2"
@@ -406,10 +413,9 @@ const AuditLogs: React.FC = () => {
406413
</div>
407414
);
408415
return (
409-
<div className="audit-logs-Table">
416+
<div className='table-height'>
410417
<InfiniteScrollTable
411418
key={tableKey}
412-
tableHeight={580}
413419
itemSize={80}
414420
data={tableData}
415421
columns={dropDownOptions == 'content-types' || dropDownOptions == 'global-fields' ? contentTypeHeader : entryHeader}

ui/src/components/Common/Settings/Settings.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@
33
#setting-page {
44
display: flex;
55
width: 100%;
6+
67
.SectionHeader {
78
color: $color-stepper-title;
89
font-weight: $font-weight-semi-bold;
910
margin-bottom: 2rem;
1011
}
12+
1113
.PageLayout {
1214
width: 100%;
1315
}
16+
1417
.PageLayout__head,
1518
.PageLayout__leftSidebar {
16-
border-top: 0 none;
19+
border-top: 1;
1720
}
21+
1822
.PageLayout--primary {
1923
.PageLayout__content {
2024
.PageLayout__body {
@@ -24,10 +28,12 @@
2428
}
2529
}
2630
}
31+
2732
.action-component-title {
2833
justify-content: space-between;
2934
width: calc(100vw - 326px);
3035
}
36+
3137
.content-block {
3238
margin-right: 0;
3339
padding: 1.5rem;
@@ -97,14 +103,15 @@
97103
.PageLayout__leftSidebar {
98104
background-color: #f7f9fc !important;
99105
}
106+
100107
.ListRowV2--active {
101108
background-color: #fff;
102109
border-left: 0.125rem solid;
103110
color: #6c5ce7 !important;
104111
font-weight: 600;
105112
}
106113

107-
.back-button{
114+
.back-button {
108115
cursor: pointer;
109-
margin-bottom: 20px ;
116+
margin-bottom: 20px;
110117
}

ui/src/components/ExecutionLogs/index.scss

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.Search-input-show {
2-
margin-bottom: 8px;
3-
width: 300px;
4-
}
51
.Search .Search__search-icon {
62
top: calc(50% - 10px);
73
width: 20px;
@@ -15,7 +11,7 @@
1511
margin-bottom: 8px;
1612
}
1713

18-
.PageLayout--primary .PageLayout__leftSidebar + .PageLayout__content .PageLayout__body {
14+
.PageLayout--primary .PageLayout__leftSidebar+.PageLayout__content .PageLayout__body {
1915
width: calc(100% - 15.4rem);
2016
}
2117

@@ -25,15 +21,10 @@
2521
justify-content: space-between;
2622
}
2723

28-
.Table__head{
24+
.Table__head {
2925
height: auto;
3026
}
3127

32-
.Table:has(.custom-empty-state) {
33-
height: 40.5rem;
34-
}
35-
36-
3728
.custom-empty-state {
3829
.Icon--original {
3930
width: 207px !important;
@@ -47,3 +38,19 @@
4738
.select-container {
4839
margin-bottom: 8px;
4940
}
41+
42+
43+
44+
.PageLayout__body {
45+
.table-height {
46+
.Table {
47+
height: calc(100vh - 20rem) !important;
48+
}
49+
50+
.Table.TableWithPaginated {
51+
.Table__body {
52+
height: calc(100vh - 25rem) !important;
53+
}
54+
}
55+
}
56+
}

ui/src/components/ExecutionLogs/index.tsx

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const ExecutionLogs = ({ projectId }: { projectId: string }) => {
5555

5656
const [selectedStack, setSelectedStack] = useState<DropdownOption>(
5757
{
58-
label: stackIds?.[stackIds?.length - 1]?.label ?? '' ,
59-
value: stackIds?.[stackIds?.length - 1]?.value ?? ''
58+
label: stackIds?.[stackIds?.length - 1]?.label ?? '',
59+
value: stackIds?.[stackIds?.length - 1]?.value ?? ''
6060
}
6161
);
6262

@@ -276,63 +276,62 @@ const ExecutionLogs = ({ projectId }: { projectId: string }) => {
276276
};
277277

278278
return (
279-
<div>
279+
<div className='table-height'>
280280
<InfiniteScrollTable
281-
tableHeight={590}
282-
itemSize={60}
283-
columns={columns}
284-
data={data ?? []}
285-
uniqueKey={'timestamp'}
286-
fetchTableData={fetchData}
287-
totalCounts={totalCounts ?? 0}
288-
loading={loading}
289-
rowPerPageOptions={[10, 30, 50, 100]}
290-
minBatchSizeToFetch={30}
291-
v2Features={{
292-
pagination: true,
293-
isNewEmptyState: true
294-
}}
295-
isResizable={true}
296-
isRowSelect={false}
297-
columnSelector={false}
298-
canSearch={true}
299-
searchPlaceholder={EXECUTION_LOGS_UI_TEXT.SEARCH_PLACEHOLDER}
300-
searchValue={searchText ?? ''}
301-
onSearchChangeEvent={(value: string) => setSearchText(value)}
302-
withExportCta={{
303-
component: (
304-
<Select
305-
className='dropdown-wrapper'
306-
width="250px"
307-
version="v2"
308-
value={testStacks?.length ? selectedStack : ''}
309-
options={stackIds ?? []}
310-
placeholder={EXECUTION_LOGS_UI_TEXT.SELECT_PLACEHOLDER}
311-
onChange={(s: DropdownOption) => {
312-
setSelectedStack({
313-
label: s?.label ?? '',
314-
value: s?.value ?? ''
315-
});
316-
setSearchText('');
317-
}}
318-
/>
319-
),
320-
showExportCta: true
321-
}}
322-
customEmptyState={
323-
<EmptyState
324-
forPage="list"
325-
heading={searchText === '' ? EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_HEADING.NO_LOGS : EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_HEADING.NO_MATCH}
326-
description={
327-
searchText === ''
328-
? EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_DESCRIPTION.NO_LOGS
329-
: EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_DESCRIPTION.NO_RESULT
281+
itemSize={60}
282+
columns={columns}
283+
data={data ?? []}
284+
uniqueKey={'timestamp'}
285+
fetchTableData={fetchData}
286+
totalCounts={totalCounts ?? 0}
287+
loading={loading}
288+
rowPerPageOptions={[10, 30, 50, 100]}
289+
minBatchSizeToFetch={30}
290+
v2Features={{
291+
pagination: true,
292+
isNewEmptyState: true
293+
}}
294+
isResizable={true}
295+
isRowSelect={false}
296+
columnSelector={false}
297+
canSearch={true}
298+
searchPlaceholder={EXECUTION_LOGS_UI_TEXT.SEARCH_PLACEHOLDER}
299+
searchValue={searchText ?? ''}
300+
onSearchChangeEvent={(value: string) => setSearchText(value)}
301+
withExportCta={{
302+
component: (
303+
<Select
304+
className='dropdown-wrapper'
305+
width="250px"
306+
version="v2"
307+
value={testStacks?.length ? selectedStack : ''}
308+
options={stackIds ?? []}
309+
placeholder={EXECUTION_LOGS_UI_TEXT.SELECT_PLACEHOLDER}
310+
onChange={(s: DropdownOption) => {
311+
setSelectedStack({
312+
label: s?.label ?? '',
313+
value: s?.value ?? ''
314+
});
315+
setSearchText('');
316+
}}
317+
/>
318+
),
319+
showExportCta: true
320+
}}
321+
customEmptyState={
322+
<EmptyState
323+
forPage="list"
324+
heading={searchText === '' ? EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_HEADING.NO_LOGS : EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_HEADING.NO_MATCH}
325+
description={
326+
searchText === ''
327+
? EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_DESCRIPTION.NO_LOGS
328+
: EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_DESCRIPTION.NO_RESULT
329+
}
330+
moduleIcon={searchText === '' ? EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_ICON.NO_LOGS : EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_ICON.NO_MATCH}
331+
type="secondary"
332+
className="custom-empty-state"
333+
/>
330334
}
331-
moduleIcon={searchText === '' ? EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_ICON.NO_LOGS : EXECUTION_LOGS_UI_TEXT.EMPTY_STATE_ICON.NO_MATCH}
332-
type="secondary"
333-
className="custom-empty-state"
334-
/>
335-
}
336335
/>
337336
</div>
338337
);

0 commit comments

Comments
 (0)