Skip to content

Commit

Permalink
Undo changes to dashboard picker
Browse files Browse the repository at this point in the history
  • Loading branch information
Heenawter committed Jul 14, 2023
1 parent 60cf98b commit 263d338
Showing 1 changed file with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import {
EuiSelectable,
EuiFieldSearch,
EuiSelectableOption,
EuiInputPopover,
EuiComboBox,
EuiComboBoxOptionOption,
} from '@elastic/eui';
import { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container';

Expand All @@ -39,7 +36,7 @@ export const DashboardLinkDestinationPicker = ({
initialSelection?: string;
}) => {
const [searchString, setSearchString] = useState<string>('');
const [dashboardListOptions, setDashboardListOptions] = useState<EuiComboBoxOptionOption[]>([]);
const [dashboardListOptions, setDashboardListOptions] = useState<EuiSelectableOption[]>([]);

const parentDashboardId = parentDashboard?.select((state) => state.componentState.lastSavedId);

Expand All @@ -63,14 +60,15 @@ export const DashboardLinkDestinationPicker = ({
return {
data: dashboard,
label: dashboard.attributes.title,
checked: dashboard.id === initialSelection ? 'on' : undefined,
...(dashboard.id === parentDashboardId
? {
prepend: (
<EuiBadge>{DashboardLinkEmbeddableStrings.getCurrentDashboardLabel()}</EuiBadge>
),
}
: {}),
} as EuiComboBoxOptionOption;
} as EuiSelectableOption;
}) ?? [];

setDashboardListOptions(dashboardOptions);
Expand All @@ -87,17 +85,7 @@ export const DashboardLinkDestinationPicker = ({
/* {...other} is needed so all inner elements are treated as part of the form */
return (
<div {...other}>
<EuiComboBox
fullWidth
aria-label="Accessible screen reader label"
placeholder="Select a single option"
singleSelection={{ asPlainText: true }}
options={dashboardListOptions}
// selectedOptions={selectedOptions}
// onChange={onChange}
customOptionText="Add {searchValue} as your occupation"
/>
{/* <EuiFieldSearch
<EuiFieldSearch
isClearable={true}
placeholder={DashboardLinkEmbeddableStrings.getSearchPlaceholder()}
onChange={(e) => {
Expand All @@ -124,7 +112,7 @@ export const DashboardLinkDestinationPicker = ({
}}
>
{(list) => list}
</EuiSelectable> */}
</EuiSelectable>
</div>
);
};

0 comments on commit 263d338

Please sign in to comment.