bug fixes

This commit is contained in:
Swetha-Josh 2026-06-12 11:18:30 +05:30
parent 01be34ae6f
commit 32d87c634a
3 changed files with 50 additions and 37 deletions

View File

@ -434,21 +434,29 @@ export const SelectField = ({
className={`w-full text-sm focus:outline-none ${className}`} className={`w-full text-sm focus:outline-none ${className}`}
style={{ style={{
...inputStyle, ...inputStyle,
height: 'auto', // override fixed height
minHeight: '40px',
cursor: readOnly ? 'not-allowed' : 'pointer', cursor: readOnly ? 'not-allowed' : 'pointer',
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', justifyContent: 'space-between',
minHeight: '40px', padding: '8px 16px',
padding: '0 16px' }}
}}
onClick={toggleDropdown} onClick={toggleDropdown}
onFocus={handleFocus} onFocus={handleFocus}
onBlur={handleBlur} onBlur={handleBlur}
tabIndex={readOnly ? -1 : 0} tabIndex={readOnly ? -1 : 0}
> >
<span style={{ color: hasValue ? '#232528' : '#9CA3AF' }}> <span
style={{
color: hasValue ? '#232528' : '#9CA3AF',
flex: 1,
whiteSpace: 'normal',
lineHeight: '20px'
}}
>
{getDisplayValue()} {getDisplayValue()}
</span> </span>
{showClear ? ( {showClear ? (
<button <button
type="button" type="button"

View File

@ -398,7 +398,7 @@ React.useEffect(() => {
const term = search.trim().toLowerCase(); const term = search.trim().toLowerCase();
const filteredItems = submissions.filter((item) => { const filteredItems = submissions.filter((item) => {
if (!item) return false; if (!item || item.status === 'Draft') return false;
const allValues = Object.values(item) const allValues = Object.values(item)
.map((v) => String(v ?? '').toLowerCase()) .map((v) => String(v ?? '').toLowerCase())
@ -423,16 +423,21 @@ React.useEffect(() => {
return filteredItems; return filteredItems;
}, [submissions, search, year, quarter, emirate, status]); }, [submissions, search, year, quarter, emirate, status]);
const summaryCounts = React.useMemo( const nonDraftSubmissions = React.useMemo(
() => ({ () => submissions.filter((i) => i.status !== 'Draft'),
total: submissions.length,
approved: submissions.filter((i) => i.status === 'Approved').length,
submitted: submissions.filter((i) => i.status === 'Submitted').length,
rejected: submissions.filter((i) => i.status === 'Rejected').length,
resubmitted: submissions.filter((i) => i.status === 'Resubmitted').length,
}),
[submissions] [submissions]
); );
const summaryCounts = React.useMemo(
() => ({
total: nonDraftSubmissions.length,
approved: nonDraftSubmissions.filter((i) => i.status === 'Approved').length,
submitted: nonDraftSubmissions.filter((i) => i.status === 'Submitted').length,
rejected: nonDraftSubmissions.filter((i) => i.status === 'Rejected').length,
resubmitted: nonDraftSubmissions.filter((i) => i.status === 'Resubmitted').length,
}),
[nonDraftSubmissions]
);
const headers = [ const headers = [
'Establishment', 'Establishment',

View File

@ -1775,7 +1775,7 @@ const displayedRows = sortedProfiles.map((item) => {
item.establishmentName || "-", item.establishmentName || "-",
// Contact Name (userProfileName contactPersonName createdBy "-") // Contact Name (userProfileName contactPersonName createdBy "-")
item.userProfileName || item.contactPersonName || "-", // item.userProfileName || item.contactPersonName || "-",
// Emirate // Emirate
item.emirate || "-", item.emirate || "-",
@ -2617,7 +2617,7 @@ const handleView = async (id) => {
const requiredFields = [ const requiredFields = [
{ field: 'userProfileName', label: 'Name' }, { field: 'userProfileName', label: 'Name' },
{ field: 'userProfileEmail', label: 'Email' }, { field: 'userProfileEmail', label: 'Email' },
{ field: 'contactName', label: 'Contact Name' }, // { field: 'contactName', label: 'Contact Name' },
{ field: 'contactAddress', label: 'Contact Address' }, { field: 'contactAddress', label: 'Contact Address' },
{ field: 'contactEmirate', label: 'Emirate' }, { field: 'contactEmirate', label: 'Emirate' },
{ field: 'contactMobileNumber', label: 'Mobile Number' }, { field: 'contactMobileNumber', label: 'Mobile Number' },
@ -3411,7 +3411,7 @@ const handleImport = async () => {
<Table <Table
headers={[ headers={[
{ name: 'Establishment Name', key: 'establishmentName', sortable: true, className: 'whitespace-nowrap' }, { name: 'Establishment Name', key: 'establishmentName', sortable: true, className: 'whitespace-nowrap' },
{ name: 'Contact Name', key: 'contactName', sortable: true, className: 'whitespace-nowrap' }, // { name: 'Contact Name', key: 'contactName', sortable: true, className: 'whitespace-nowrap' },
{ name: 'Emirate', key: 'emirate', sortable: true, className: 'whitespace-nowrap' }, { name: 'Emirate', key: 'emirate', sortable: true, className: 'whitespace-nowrap' },
{ name: 'ISIC Code', key: 'isicCode', sortable: false, className: 'whitespace-nowrap' }, { name: 'ISIC Code', key: 'isicCode', sortable: false, className: 'whitespace-nowrap' },
{ name: 'Establishment ID', key: 'establishmentId', sortable: true, className: 'whitespace-nowrap' }, { name: 'Establishment ID', key: 'establishmentId', sortable: true, className: 'whitespace-nowrap' },
@ -3467,7 +3467,7 @@ const handleImport = async () => {
}} }}
columnWidths={[ columnWidths={[
300, // Establishment Name (increased from 250) 300, // Establishment Name (increased from 250)
180, // Contact Name (increased from 150) // 180, // Contact Name (increased from 150)
150, // Emirate (increased from 120) 150, // Emirate (increased from 120)
150, // ISIC Code (increased from 120) 150, // ISIC Code (increased from 120)
200, // Establishment ID (increased from 150) 200, // Establishment ID (increased from 150)