[Canvas] Removes link from workpad breadcrumb (#103793)

* Removes link from workpad title breadcrumb

* Fixed ts error
This commit is contained in:
Catherine Liu 2021-06-29 19:52:02 -07:00 committed by GitHub
parent bf54eec22b
commit 428eba425d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -7,18 +7,13 @@
import { ChromeBreadcrumb } from '../../../../../src/core/public';
export const getBaseBreadcrumb = () => ({
export const getBaseBreadcrumb = (): ChromeBreadcrumb => ({
text: 'Canvas',
href: '#/',
});
export const getWorkpadBreadcrumb = ({
name = 'Workpad',
id,
}: { name?: string; id?: string } = {}) => {
const output: ChromeBreadcrumb = { text: name };
if (id != null) {
output.href = `#/workpad/${id}`;
}
return output;
};
}: { name?: string } = {}): ChromeBreadcrumb => ({
text: name,
});

View file

@ -26,7 +26,7 @@ export const WorkpadPresentationHelper: FC = ({ children }) => {
useEffect(() => {
services.platform.setBreadcrumbs([
getBaseBreadcrumb(),
getWorkpadBreadcrumb({ name: workpad.name, id: workpad.id }),
getWorkpadBreadcrumb({ name: workpad.name }),
]);
}, [workpad.name, workpad.id, services.platform]);