diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 9e5b99b980..bec229dc7f 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -42,6 +42,7 @@ - https://github.com/eclipse-sirius/sirius-web/issues/3557[#3550] [app] Add ProjectSettings tab extension point - https://github.com/eclipse-sirius/sirius-web/issues/3557[#3563] [app] Improve NavigationBar extensibility - https://github.com/eclipse-sirius/sirius-web/issues/3557[#3587] [app] Add CreateProjectCard extension point +- https://github.com/eclipse-sirius/sirius-web/issues/3557[#3591] [app] Add EditProject subtitle extension point === Improvements diff --git a/packages/sirius-web/frontend/sirius-web-application/src/index.ts b/packages/sirius-web/frontend/sirius-web-application/src/index.ts index 09010f4e2f..04de36b10c 100644 --- a/packages/sirius-web/frontend/sirius-web-application/src/index.ts +++ b/packages/sirius-web/frontend/sirius-web-application/src/index.ts @@ -40,6 +40,8 @@ export { navigationBarRightContributionExtensionPoint, } from './navigationBar/NavigationBarExtensionPoints'; export { routerExtensionPoint } from './router/RouterExtensionPoints'; +export { type EditProjectNavbarSubtitleProps } from './views/edit-project/EditProjectNavbar/EditProjectNavbar.types'; +export { editProjectNavbarSubtitleExtensionPoint } from './views/edit-project/EditProjectNavbar/EditProjectNavbarExtensionPoints'; export { type CreateProjectAreaCardProps } from './views/project-browser/create-projects-area/CreateProjectArea.types'; export { createProjectAreaCardExtensionPoint } from './views/project-browser/create-projects-area/CreateProjectAreaExtensionPoints'; export { projectActionButtonMenuItemExtensionPoint } from './views/project-browser/list-projects-area/ProjectActionButtonExtensionPoints'; diff --git a/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.tsx b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.tsx index a8d3a7936d..0bc5293354 100644 --- a/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.tsx +++ b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.tsx @@ -11,7 +11,7 @@ * Obeo - initial API and implementation *******************************************************************************/ import { gql, useSubscription } from '@apollo/client'; -import { ServerContext, ServerContextValue, Toast } from '@eclipse-sirius/sirius-components-core'; +import { ServerContext, ServerContextValue, Toast, useComponent } from '@eclipse-sirius/sirius-components-core'; import IconButton from '@material-ui/core/IconButton'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; @@ -32,6 +32,7 @@ import { RenameProjectModal } from '../../../modals/rename-project/RenameProject import { NavigationBar } from '../../../navigationBar/NavigationBar'; import { EditProjectNavbarProps, GQLProjectEventSubscription } from './EditProjectNavbar.types'; +import { editProjectNavbarSubtitleExtensionPoint } from './EditProjectNavbarExtensionPoints'; import { EditProjectNavbarContext, EditProjectNavbarEvent, @@ -63,10 +64,15 @@ const projectEventSubscription = gql` const useEditProjectViewNavbarStyles = makeStyles((theme) => ({ center: { display: 'flex', - flexDirection: 'row', + flexDirection: 'column', alignItems: 'center', }, title: { + display: 'flex', + flexDirection: 'row', + alignItems: 'center', + }, + titleLabel: { marginRight: theme.spacing(2), overflow: 'hidden', textOverflow: 'ellipsis', @@ -163,24 +169,30 @@ export const EditProjectNavbar = ({ project }: EditProjectNavbarProps) => { modal = ; } } + + const { Component: ProjectSubtitle } = useComponent(editProjectNavbarSubtitleExtensionPoint); return ( <>
- - {projectName} - - - - +
+ + {projectName} + + + + +
+
diff --git a/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.types.ts b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.types.ts index b5613dc9e5..542a858fd9 100644 --- a/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.types.ts +++ b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbar.types.ts @@ -17,6 +17,8 @@ export interface EditProjectNavbarProps { project: Project; } +export interface EditProjectNavbarSubtitleProps {} + export interface GQLProjectEventSubscription { projectEvent: GQLProjectEventPayload; } diff --git a/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbarExtensionPoints.tsx b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbarExtensionPoints.tsx new file mode 100644 index 0000000000..bfa2278802 --- /dev/null +++ b/packages/sirius-web/frontend/sirius-web-application/src/views/edit-project/EditProjectNavbar/EditProjectNavbarExtensionPoints.tsx @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2021, 2024 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ + +import { ComponentExtensionPoint } from '@eclipse-sirius/sirius-components-core'; +import { EditProjectNavbarSubtitleProps } from './EditProjectNavbar.types'; + +export const editProjectNavbarSubtitleExtensionPoint: ComponentExtensionPoint = { + identifier: 'editProjectNavbar#subtitle', + FallbackComponent: () => null, +};