Skip to content

Commit

Permalink
[3756] Add an extension point to contribute custom footer
Browse files Browse the repository at this point in the history
Bug: #3756
Signed-off-by: Florian ROUËNÉ <[email protected]>
  • Loading branch information
frouene authored and sbegaudeau committed Jul 15, 2024
1 parent 11bdab6 commit 879ffdd
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@

=== Improvements

- https://github.com/eclipse-sirius/sirius-web/issues/3744[#3744] [diagram] Add support for helper lines during multi selection move.
- https://github.com/eclipse-sirius/sirius-web/issues/3770[#3770] [diagram] Enable helper lines by default.
- https://github.com/eclipse-sirius/sirius-web/issues/3744[#3744] [diagram] Add support for helper lines during multi selection move
- https://github.com/eclipse-sirius/sirius-web/issues/3770[#3770] [diagram] Enable helper lines by default
- https://github.com/eclipse-sirius/sirius-web/issues/3756[#3756] [sirius-web] Add an extension point to contribute custom footer


== v2024.7.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*******************************************************************************
* Copyright (c) 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
*******************************************************************************/

export interface FooterProps {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright (c) 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 { FooterProps } from './Footer.types';
import { SiriusWebFooter } from './SiriusWebFooter';

export const footerExtensionPoint: ComponentExtensionPoint<FooterProps> = {
identifier: 'footer',
FallbackComponent: SiriusWebFooter,
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import Link from '@material-ui/core/Link';
import { makeStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import { FooterProps } from './Footer.types';

const useFooterStyles = makeStyles((theme) => ({
footer: {
Expand All @@ -26,7 +27,7 @@ const useFooterStyles = makeStyles((theme) => ({
},
}));

export const Footer = () => {
export const SiriusWebFooter = ({}: FooterProps) => {
const classes = useFooterStyles();
return (
<footer className={classes.footer}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export { SiriusWebApplication } from './application/SiriusWebApplication';
export type { SiriusWebApplicationProps } from './application/SiriusWebApplication.types';
export { DiagramRepresentationConfiguration } from './diagrams/DiagramRepresentationConfiguration';
export type { NodeTypeRegistry } from './diagrams/DiagramRepresentationConfiguration.types';
export type { FooterProps } from './footer/Footer.types';
export { footerExtensionPoint } from './footer/FooterExtensionPoints';
export { DefaultExtensionRegistryMergeStrategy } from './extension/DefaultExtensionRegistryMergeStrategy';
export {
type ApolloClientOptionsConfigurer,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2023 Obeo.
* Copyright (c) 2019, 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
Expand All @@ -11,7 +11,7 @@
* Obeo - initial API and implementation
*******************************************************************************/
import { gql, useMutation } from '@apollo/client';
import { Toast } from '@eclipse-sirius/sirius-components-core';
import { Toast, useComponent } from '@eclipse-sirius/sirius-components-core';
import Button from '@material-ui/core/Button';
import Container from '@material-ui/core/Container';
import Paper from '@material-ui/core/Paper';
Expand All @@ -21,7 +21,7 @@ import { makeStyles } from '@material-ui/core/styles';
import { useMachine } from '@xstate/react';
import { useEffect } from 'react';
import { Redirect } from 'react-router-dom';
import { Footer } from '../../footer/Footer';
import { footerExtensionPoint } from '../../footer/FooterExtensionPoints';
import { NavigationBar } from '../../navigationBar/NavigationBar';
import { GQLCreateProjectMutationData, GQLCreateProjectPayload, GQLErrorPayload } from './NewProjectView.types';
import {
Expand Down Expand Up @@ -99,6 +99,7 @@ export const NewProjectView = () => {
const { newProjectView, toast } = value as SchemaValue;
const { name, nameMessage, nameIsInvalid, message, newProjectId } = context;
const [createProject, { loading, data, error }] = useMutation<GQLCreateProjectMutationData>(createProjectMutation);
const { Component: Footer } = useComponent(footerExtensionPoint);

const onNameChange = (event) => {
const value = event.target.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
import { useComponent } from '@eclipse-sirius/sirius-components-core';
import Container from '@material-ui/core/Container';
import Grid from '@material-ui/core/Grid';
import { makeStyles } from '@material-ui/core/styles';
import { Footer } from '../../footer/Footer';
import { footerExtensionPoint } from '../../footer/FooterExtensionPoints';
import { NavigationBar } from '../../navigationBar/NavigationBar';
import { CreateProjectArea } from './create-projects-area/CreateProjectArea';
import { ListProjectsArea } from './list-projects-area/ListProjectsArea';
Expand All @@ -36,6 +37,8 @@ const useProjectsViewStyles = makeStyles((theme) => ({

export const ProjectBrowser = () => {
const classes = useProjectsViewStyles();
const { Component: Footer } = useComponent(footerExtensionPoint);

return (
<div className={classes.projectsView}>
<NavigationBar />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
import { useComponent } from '@eclipse-sirius/sirius-components-core';
import Container from '@material-ui/core/Container';
import Grid from '@material-ui/core/Grid';
import { makeStyles } from '@material-ui/core/styles';
import { Footer } from '../../footer/Footer';
import { footerExtensionPoint } from '../../footer/FooterExtensionPoints';
import { NavigationBar } from '../../navigationBar/NavigationBar';
import { ProjectImagesSettings } from './images/ProjectImagesSettings';

Expand All @@ -32,7 +33,7 @@ const useProjectSettingsViewStyles = makeStyles((theme) => ({

export const ProjectSettingsView = () => {
const classes = useProjectSettingsViewStyles();

const { Component: Footer } = useComponent(footerExtensionPoint);
return (
<div className={classes.projectSettingsView}>
<NavigationBar />
Expand Down

0 comments on commit 879ffdd

Please sign in to comment.