Skip to content

Commit b3d7624

Browse files
fix: CSS on "All Applications" Page as well as Tasks Page (#1047)
* Fix CSS on "All Applications" Page as well as Tasks Page * formatting --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com>
1 parent 3950902 commit b3d7624

File tree

16 files changed

+271
-420
lines changed

16 files changed

+271
-420
lines changed

cats-frontend/src/app/components/common/icon.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545
FaPaperPlane,
4646
FaFilePdf,
4747
FaPaperclip,
48+
FaFileContract,
4849
} from 'react-icons/fa6';
4950

5051
import {
@@ -117,3 +118,4 @@ export const MessageIcon = FaMessage;
117118
export const PaperPlaneIcon = FaPaperPlane;
118119
export const FilePdfIcon = FaFilePdf;
119120
export const PaperclipIcon = FaPaperclip;
121+
export const FileContractIcon = FaFileContract;

cats-frontend/src/app/components/navigation/dto/SideNav.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
ListCheckIcon,
1212
UserTie,
1313
AddressBookIcon,
14+
FileContractIcon,
1415
} from '../../common/icon';
1516
import { UserRoleType } from '../../../helpers/utility';
1617

@@ -88,6 +89,7 @@ const icons = {
8889
srReference: ListCheckIcon,
8990
userTie: UserTie,
9091
AddressBook: AddressBookIcon,
92+
tasks: FileContractIcon,
9193
};
9294

9395
// Refactored role-based navigation lists using a Record type
@@ -114,7 +116,7 @@ const roleBasedSideBarList: Record<string, SideNav[]> = {
114116
createSideNav({
115117
displayText: 'My Tasks',
116118
hasChildren: false,
117-
icon: icons.folios,
119+
icon: icons.tasks,
118120
linkTo: '/mytasks',
119121
}),
120122
],
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
.custom-app-container {
2+
font-weight: 700;
3+
font-style: Bold;
4+
font-size: 36px;
5+
line-height: 100%;
6+
letter-spacing: 0%;
7+
vertical-align: middle;
8+
color: var(--typography-color-primary, #2d2d2d);
9+
}
10+
.custom-app-childern-container {
11+
border-bottom: 1px solid var(--surface-border-light, #d8d8d8);
12+
}
13+
14+
.custom-applications-input-txt {
15+
font-size: 12px !important;
16+
font-weight: 400 !important;
17+
line-height: 16px !important;
18+
text-align: left !important;
19+
}
20+
21+
a.custom-applications-input-txt:hover {
22+
color: var(--typography-color-link-hover, #1a3f6b) !important;
23+
}
24+
25+
a.custom-applications-input-txt {
26+
color: var(--typography-color-link, #255a90) !important;
27+
text-decoration: underline !important;
28+
justify-content: left !important;
29+
}
30+
31+
.custom-applications-link-wrapper:hover .custom-applications-input-txt,
32+
.custom-applications-link-wrapper:hover .custom-applications-external-link {
33+
color: var(--typography-color-link-hover, #1a3f6b) !important;
34+
}
35+
36+
.custom-applications-header {
37+
font-family: Noto Sans !important;
38+
vertical-align: middle !important;
39+
min-width: 100px !important;
40+
}
41+
42+
.custom-applications-edit-lbl {
43+
font-size: 12px;
44+
font-weight: 400;
45+
line-height: 16px;
46+
color: var(--typography-color-primary, #2d2d2d);
47+
}
48+
49+
a.custom-applications-edit-lbl {
50+
font-size: 12px;
51+
font-weight: 700;
52+
line-height: 16px;
53+
gap: var(--layout-margin-xsmall);
54+
align-items: center;
55+
justify-content: center;
56+
text-decoration: none;
57+
color: var(--surface-color-primary-default, #053662);
58+
}
59+
60+
.custom-applications-tbl-header {
61+
font-family: Noto Sans;
62+
text-align: center;
63+
vertical-align: middle;
64+
min-width: 100px;
65+
}
66+
67+
@media (max-width: 1360px) {
68+
.custom-applications-column-position {
69+
position: sticky;
70+
right: 0;
71+
z-index: 1;
72+
box-shadow:
73+
-3px 0 3px 0 #00000021,
74+
-0.6px 0 1.8px 0 #0000001a !important;
75+
}
76+
}

cats-frontend/src/app/features/applications/search/Search.tsx

Lines changed: 98 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import debounce from 'lodash/debounce';
33
import PageContainer from '../../../components/simple/PageContainer';
44
import SearchInput from '../../../components/search/SearchInput';
55
import { RequestStatus } from '../../../helpers/requests/status';
6-
import ApplicationResultsTable from './applicationResults/table';
76
import { TableColumn } from '../../../components/table/TableColumn';
8-
import { applicationResultColumns } from './applicationResults/tableColumnConfig';
97
import {
108
Filter,
119
ApplicationResultDto,
@@ -15,6 +13,12 @@ import {
1513
import { useSearchApplicationsQuery } from './hooks/SearchApplications.generated';
1614
import ModalDialog from '../../../components/modaldialog/ModalDialog';
1715
import Assignment from '../../assignment/Assignment';
16+
import Widget from '@cats/components/widget/Widget';
17+
import FilterControls from '@cats/components/filter/FilterControls';
18+
import { IFilterOption } from '@cats/components/filter/IFilterControls';
19+
import { TableColumnsIcon } from '@cats/components/common/icon';
20+
import { applicationResultColumns } from './SearchConfig';
21+
import './Search.css';
1822

1923
interface SearchProps {
2024
filterMyTasks?: boolean;
@@ -40,7 +44,7 @@ const Search: React.FC<SearchProps> = ({ filterMyTasks = false }) => {
4044
const [sortByDir, setSortByDir] = useState<ApplicationSortByDirection>(
4145
ApplicationSortByDirection.Asc,
4246
);
43-
47+
const [showColumnSelect, setShowColumnSelect] = useState(false);
4448
const [searchParams, setSearchParams] = useState({
4549
searchTerm: '',
4650
page: 1,
@@ -168,32 +172,108 @@ const Search: React.FC<SearchProps> = ({ filterMyTasks = false }) => {
168172
debouncedSearch(searchTerm, page, pageSize, filter, sortBy, sortByDir);
169173
};
170174

175+
const sharedOptions: IFilterOption[] = [
176+
{
177+
label: 'Columns',
178+
value: Filter.Assigned, // Or use a custom string if needed
179+
onClick: () => setShowColumnSelect(!showColumnSelect),
180+
icon: <TableColumnsIcon />,
181+
},
182+
// You can add more shared items here (e.g., Filter icon toggle)
183+
// {
184+
// label: 'Filter',
185+
// value: 'filter',
186+
// onClick: () => setShowFilterSelect(prev => !prev),
187+
// icon: <FilterIcon />,
188+
// },
189+
];
190+
191+
const tasksOptions: IFilterOption[] = [
192+
{
193+
label: 'Action Required',
194+
value: Filter.All,
195+
onClick: () => handleFilterChange(Filter.All),
196+
isSelected: filter === Filter.All,
197+
},
198+
{
199+
label: 'Assigned to Me',
200+
value: Filter.Assigned,
201+
onClick: () => handleFilterChange(Filter.Assigned),
202+
isSelected: filter === Filter.Assigned,
203+
},
204+
];
205+
206+
const generalOptions: IFilterOption[] = [
207+
{
208+
label: 'All',
209+
value: Filter.All,
210+
onClick: () => handleFilterChange(Filter.All),
211+
isSelected: filter === Filter.All,
212+
},
213+
{
214+
label: 'Unassigned',
215+
value: Filter.Unassigned,
216+
onClick: () => handleFilterChange(Filter.Unassigned),
217+
isSelected: filter === Filter.Unassigned,
218+
},
219+
{
220+
label: 'Overcapacity',
221+
value: Filter.Overcapacity,
222+
onClick: () => handleFilterChange(Filter.Overcapacity),
223+
isSelected: filter === Filter.Overcapacity,
224+
},
225+
];
226+
227+
const options: IFilterOption[] = [
228+
...(filterMyTasks ? tasksOptions : generalOptions),
229+
// ...sharedOptions, uncomment once filter and columns are implemented
230+
];
231+
171232
return (
172233
<PageContainer role="Search">
173-
<h1> {filterMyTasks ? 'My Tasks' : ' All Applications'}</h1>
234+
<div className="custom-app-container">
235+
{' '}
236+
{filterMyTasks ? 'My Tasks' : ' All Applications'}
237+
</div>
174238
<SearchInput
175239
searchTerm={searchTerm}
176240
handleSearchChange={handleSearchChange}
177241
clearSearch={() => setSearchTerm('')}
178242
placeHolderText="Search"
179243
/>
180-
<ApplicationResultsTable
181-
columns={columns}
182-
results={results}
183-
requestStatus={requestStatus}
244+
{/* Widget for applications and tasks */}
245+
<Widget
246+
customWidgetCss="gap-4"
247+
widgetLabelContainerCss={`${showColumnSelect ? '' : ''}`}
248+
title="Applications"
249+
aria-label="Applications Widget"
250+
tableIsLoading={requestStatus}
251+
tableColumns={columns}
252+
tableData={results}
253+
sortHandler={handleSortChange}
184254
changeHandler={handleChangeEventHandler}
185-
handleColumnChange={setColumns}
186-
handleFilterChange={handleFilterChange}
187-
page={page}
188-
pageSize={pageSize}
189-
handlePageChange={handlePageChange}
190-
handlePageSizeChange={handlePageSizeChange}
255+
currentPage={page}
256+
allowRowsSelect={false}
257+
primaryKeycolumnName="id"
191258
showPageOptions={true}
259+
selectPage={handlePageChange}
260+
changeResultsPerPage={handlePageSizeChange}
261+
resultsPerPage={pageSize}
192262
totalResults={totalResults}
193-
filter={filter}
194-
sortHandler={handleSortChange}
195-
filterMyTasks={filterMyTasks}
196-
/>
263+
filter={<FilterControls options={options} />}
264+
>
265+
{/* uncomment it once the column and filter design is created */}
266+
{/* {
267+
showColumnSelect &&
268+
<div className="custom-app-childern-container">
269+
<ColumnSelect
270+
columns={columns}
271+
handleColumnChange={setColumns}
272+
/>
273+
</div>
274+
} */}
275+
</Widget>
276+
197277
{assignStaffModalOpen && (
198278
<ModalDialog
199279
headerLabel="Assign Application to Staff"

cats-frontend/src/app/features/applications/search/applicationResults/tableColumnConfig.tsx renamed to cats-frontend/src/app/features/applications/search/SearchConfig.tsx

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
import {
2-
ExternalLink,
3-
FileLinesIcon,
4-
} from '../../../../components/common/icon';
5-
import { FormFieldType } from '../../../../components/input-controls/IFormField';
6-
import {
7-
TableColumn,
8-
ColumnSize,
9-
} from '../../../../components/table/TableColumn';
10-
import { formatDateUTC } from '../../../../helpers/utility';
11-
import StaffAssigned from './staffAssigned';
12-
import './table.css';
1+
import { ExternalLink, FileLinesIcon } from '@cats/components/common/icon';
2+
import { FormFieldType } from '@cats/components/input-controls/IFormField';
3+
import { ColumnSize } from '@cats/components/table/TableColumn';
4+
import { formatDateUTC } from '@cats/helpers/utility';
5+
import StaffAssigned from './StaffAssigned';
6+
137
export const applicationResultColumns = (fromMyTasks: boolean = false) => [
148
{
159
id: 1,
@@ -185,11 +179,11 @@ export const applicationResultColumns = (fromMyTasks: boolean = false) => [
185179
customLinkValue: 'View',
186180
customIcon: <FileLinesIcon />,
187181
componentName: fromMyTasks ? 'My Tasks' : 'Applications',
188-
customInputTextCss: 'application-results__view-link',
182+
customInputTextCss: 'custom-applications-edit-lbl',
189183
},
190-
dynamicColumn: false,
184+
dynamicColumn: true,
191185
columnSize: ColumnSize.Default,
192-
customHeaderCss: '',
186+
customHeaderCss: 'custom-applications-tbl-header',
193187
},
194188
{
195189
id: 9,
@@ -202,19 +196,21 @@ export const applicationResultColumns = (fromMyTasks: boolean = false) => [
202196
sortOrder: 10,
203197
isChecked: true,
204198
displayType: {
205-
type: FormFieldType.IconButton,
199+
type: FormFieldType.Link,
206200
label: 'Manage Staff',
207201
graphQLPropertyName: 'assignStaff',
208202
value: '',
209203
tableMode: true,
210-
href: '/applications/',
204+
href: '#',
211205
customLinkValue: 'Manage Staff',
212206
customIcon: <FileLinesIcon />,
213207
componentName: 'Applications',
214-
customInputTextCss: 'application-results__view-link',
208+
customInputTextCss: 'custom-applications-edit-lbl',
209+
customContainerCss: 'custom-applications-column-position',
215210
},
216-
dynamicColumn: false,
211+
dynamicColumn: true,
217212
columnSize: ColumnSize.Default,
218-
customHeaderCss: '',
213+
customHeaderCss:
214+
'custom-applications-tbl-header custom-applications-column-position',
219215
},
220216
];

cats-frontend/src/app/features/applications/search/applicationResults/staffAssigned.css renamed to cats-frontend/src/app/features/applications/search/StaffAssigned.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,13 @@
7070
align-items: center;
7171
margin-left: auto; /* Pushes the element to the far right */
7272
}
73+
74+
/* Hide the arrow entirely */
75+
.popover .popover-arrow {
76+
display: none !important;
77+
}
78+
79+
.popover .popover-arrow::before,
80+
.popover .popover-arrow::after {
81+
display: none !important;
82+
}

0 commit comments

Comments
 (0)