Skip to content

Commit

Permalink
Use href for Dashboard List "view" link.
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Fitzgibbons <pjfitz@amazon.com>
  • Loading branch information
Peter Fitzgibbons authored and pjfitzgibbons committed Mar 29, 2023
1 parent b1aab11 commit 5e23be7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/plugins/dashboard/public/application/legacy_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ export function initDashboardApp(app, deps) {
};
};

$scope.editItem = ({ appId, editUrl }) => {
deps.core.application.navigateToApp(appId, { path: editUrl });
$scope.editItem = ({ editUrl }) => {
history.push(deps.addBasePath(editUrl));
};
$scope.viewItem = ({ appId, viewUrl }) => {
deps.core.application.navigateToApp(appId, { path: viewUrl });
$scope.viewItem = ({ viewUrl }) => {
history.push(deps.addBasePath(viewUrl));
};
$scope.delete = (dashboards) => {
return service.delete(dashboards.map((d) => d.id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ export class DashboardListing extends React.Component {
getTableColumns() {
const dateFormat = this.props.core.uiSettings.get('dateFormat');

const urlLinkProps = (record) =>
this.props.getUrl
? { href: () => this.props.getUrl(record) }
: { onClick: () => this.props.viewItem(record) };

return [
{
field: 'title',
Expand All @@ -185,7 +180,7 @@ export class DashboardListing extends React.Component {
sortable: true,
render: (field, record) => (
<EuiLink
{...urlLinkProps(record)}
href={record.viewUrl}
data-test-subj={`dashboardListingTitleLink-${record.title.split(' ').join('-')}`}
>
{field}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export class DashboardPlugin
savedObjectsName: 'Dashboard',
appId: 'dashboards',
viewUrlPathFn: (obj) => `#/view/${obj.id}`,
editUrlPathFn: (obj) => `#/view/${obj.id}?_a=(viewMode:edit)`,
editUrlPathFn: (obj) => `/view/${obj.id}?_a=(viewMode:edit)`,
createUrl: core.http.basePath.prepend('/app/dashboards#/create'),
createSortText: 'Dashboard',
createLinkText: (
Expand Down

0 comments on commit 5e23be7

Please sign in to comment.