Skip to content

Commit

Permalink
upcoming: [DI-19062] - Updated placeholder in dashboard select component
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhagra-akamai committed Jun 19, 2024
1 parent 9ccb32e commit 8c09319
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const CloudPulseDashboardSelect = React.memo((props: CloudPulseDashboardS

const errorText: string = error ? 'Error loading dashboards' : '';

const placeHolder = "Select Dashboard";

// sorts dashboards by service type. Required due to unexpected autocomplete grouping behaviour
const getSortedDashboardsList = (options: Dashboard[]) => {
return options.sort(
Expand All @@ -36,9 +38,10 @@ export const CloudPulseDashboardSelect = React.memo((props: CloudPulseDashboardS
options={[]}
label=''
disabled={true}
onChange={() => {}}
onChange={() => { }}
data-testid="cloudview-dashboard-select"
placeholder='Select Dashboard'
placeholder={placeHolder}
errorText={errorText}
/>
)
}
Expand All @@ -48,9 +51,7 @@ export const CloudPulseDashboardSelect = React.memo((props: CloudPulseDashboardS
onChange={(_: any, dashboard: Dashboard) => {
props.handleDashboardChange(dashboard);
}}
options={
!dashboardsList ? [] : getSortedDashboardsList(dashboardsList.data)
}
options={ getSortedDashboardsList(dashboardsList.data) }
renderGroup={(params) => (
<Box key={params.key}>
<Typography
Expand All @@ -72,7 +73,7 @@ export const CloudPulseDashboardSelect = React.memo((props: CloudPulseDashboardS
label=""
loading={isLoading}
noMarginTop
placeholder="Select a Dashboard"
placeholder={placeHolder}
/>
);
});

0 comments on commit 8c09319

Please sign in to comment.