-
Notifications
You must be signed in to change notification settings - Fork 18
PM-1612 Update visible columns on copilot applications #1185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ const tableColumns: TableColumn<CopilotApplication>[] = [ | |
}, | ||
{ | ||
label: 'Actions', | ||
propertyName: '', | ||
propertyName: 'actions', | ||
renderer: CopilotApplicationAction, | ||
type: 'element', | ||
}, | ||
|
@@ -78,6 +78,7 @@ const CopilotApplications: FC<{ | |
members?: FormattedMembers[] | ||
opportunity: CopilotOpportunity | ||
onApplied: () => void | ||
isAdminOrPM: boolean | ||
}> = props => { | ||
const getData = (): CopilotApplication[] => (props.copilotApplications ? props.copilotApplications.map(item => { | ||
const member = props.members && props.members.find(each => each.userId === item.userId) | ||
|
@@ -96,12 +97,18 @@ const CopilotApplications: FC<{ | |
|
||
const tableData = useMemo(getData, [props.copilotApplications, props.members]) | ||
|
||
const visibleColumns = props.isAdminOrPM | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider renaming |
||
? tableColumns | ||
: tableColumns.filter(col => ![ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The filter logic could be extracted into a separate function for better readability and maintainability. For example, |
||
'fulfilment', 'activeProjects', 'pastProjects', 'notes', 'actions', | ||
].includes(col.propertyName ?? '')) | ||
|
||
return ( | ||
<div> | ||
{ | ||
tableData.length > 0 ? ( | ||
<Table | ||
columns={tableColumns} | ||
columns={visibleColumns} | ||
data={tableData} | ||
disableSorting | ||
removeDefaultSort | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
isAdminOrPM
prop is being passed toCopilotApplications
, but the conditionisAdminOrPM
has been removed from the check for rendering this component. Ensure that the logic for selectively visible columns is correctly implemented withinCopilotApplications
based on this prop.