Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3649] [3630] Fix some remaining issues with the new architecture #3660

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ More existing APIs will be migrated to this new common pattern.
- https://github.com/eclipse-sirius/sirius-web/issues/3624[#3624] [diagram] Fix an issue where the header separator does not fill the entire width of the node
- https://github.com/eclipse-sirius/sirius-web/issues/3531[#3531] [diagram] Fix unnecessary edges label re render
- https://github.com/eclipse-sirius/sirius-web/issues/3650[#3650] [diagram] Fix potential NPE in DiagramNavigator and Node toString method
- https://github.com/eclipse-sirius/sirius-web/issues/3649[#3649] [sirius-web] Restore support for Related elements view icons

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.eclipse.sirius.components.trees.TreeItem;
import org.eclipse.sirius.components.trees.description.TreeDescription;
import org.eclipse.sirius.components.trees.renderer.TreeRenderer;
import org.eclipse.sirius.web.application.images.ImageConstants;
import org.eclipse.sirius.web.application.views.explorer.services.api.IDeleteTreeItemHandler;
import org.eclipse.sirius.web.application.views.explorer.services.api.IExplorerChildrenProvider;
import org.eclipse.sirius.web.application.views.explorer.services.api.IExplorerElementsProvider;
Expand Down Expand Up @@ -222,7 +221,7 @@ private List<String> getImageURL(VariableManager variableManager) {
.flatMap(Optional::stream)
.toList();
} else if (self instanceof Resource) {
imageURL = List.of(ImageConstants.RESOURCE_SVG);
imageURL = List.of("/explorer/Resource.svg");
}
return imageURL;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024 Obeo.
* Copyright (c) 2024, 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 @@ -10,7 +10,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.web.application.images.services;
package org.eclipse.sirius.web.application.views.explorer.services;

import java.util.List;

Expand All @@ -26,6 +26,6 @@
public class ExplorerImagePathService implements IImagePathService {
@Override
public List<String> getPaths() {
return List.of("/icons/svg");
return List.of("/explorer");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public class CurrentTreeDescriptionProvider implements ICurrentTreeDescriptionPr

private static final String TITLE = "Current";

private static final String WIDGET_ICON_URL = "/icons/svg/arrow_downward_black_24dp.svg";
private static final String WIDGET_ICON_URL = "/related-elements/arrow_downward_black_24dp.svg";

private static final String FOLDER_ICON_URL = "/icons/svg/folder_black_24dp.svg";
private static final String FOLDER_ICON_URL = "/related-elements/folder_black_24dp.svg";

private static final String CHILDREN_CATEGORY_ICON_URL = "/icons/svg/subdirectory_arrow_right_black_24dp.svg";
private static final String CHILDREN_CATEGORY_ICON_URL = "/related-elements/subdirectory_arrow_right_black_24dp.svg";

private static final String CATEGORY_KIND = "siriusWeb://category";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public class IncomingTreeDescriptionProvider implements IIncomingTreeDescription

private static final String TITLE = "Incoming";

private static final String WIDGET_ICON_URL = "/images/west_black_24dp.svg";
private static final String WIDGET_ICON_URL = "/related-elements/west_black_24dp.svg";

private static final String INCOMING_REFERENCE_ICON_URL = "/images/west_black_24dp.svg";
private static final String INCOMING_REFERENCE_ICON_URL = "/related-elements/west_black_24dp.svg";

private static final String INCOMING_REFERENCES_KIND = "siriusWeb://category/incoming-references";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public class OutgoingTreeDescriptionProvider implements IOutgoingTreeDescription

private static final String TITLE = "Outgoing";

private static final String WIDGET_ICON_URL = "/icons/svg/east_black_24dp.svg";
private static final String WIDGET_ICON_URL = "/related-elements/east_black_24dp.svg";

private static final String OUTGOING_REFERENCE_ICON_URL = "/icons/svg/east_black_24dp.svg";
private static final String OUTGOING_REFERENCE_ICON_URL = "/related-elements/east_black_24dp.svg";

private static final String OUTGOING_REFERENCE_KIND = "siriusWeb://category/outgoing-references";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.web.application.images;
package org.eclipse.sirius.web.application.views.relatedelements.services;

import java.util.List;

import org.eclipse.sirius.components.core.api.IImagePathService;
import org.springframework.stereotype.Service;

/**
* Utility class containing constants for the images of Sirius Web.
* Used to allow access to the images of the related elements view.
*
* @author sbegaudeau
*/
public final class ImageConstants {
public static final String IMAGES_ROOT_FOLDER = "/icons/svg";

public static final String RESOURCE_SVG = IMAGES_ROOT_FOLDER + "/Resource.svg";

private ImageConstants() {
// Prevent instantiation
@Service
public class RelatedElementsImagePathService implements IImagePathService {
@Override
public List<String> getPaths() {
return List.of("/related-elements");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void givenProjectWhenItsImagesAreRequestedThenTheImagesAreReturned() {
public void givenTheURLOfAnImageWhichExistsWhenItsContentIsRequestedThenTheImageIsReturned() {
this.givenCommittedTransaction.commit();

var uri = "http://localhost:" + port + "/api/images/icons/svg/Resource.svg";
var uri = "http://localhost:" + port + "/api/images/explorer/Resource.svg";

HttpEntity<String> entity = new HttpEntity<>(null, new HttpHeaders());
var response = new TestRestTemplate().exchange(uri, HttpMethod.GET, entity, Resource.class);
Expand Down
Loading