[Canvas] Removes link from workpad breadcrumb (#103793)
* Removes link from workpad title breadcrumb * Fixed ts error
This commit is contained in:
parent
bf54eec22b
commit
428eba425d
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue