Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 14 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
= Changelog

== v2026.1.0

=== Dependency update

=== New features

=== Improvements

- https://github.com/ObeoNetwork/pepper/issues/13[#13] Add checkbox cells to WorkpackageArtefactPageDescription instead of the old text field

=== Bug fixes



== v2024.11.0

=== Dependency update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EObject;
Expand Down Expand Up @@ -59,6 +60,8 @@
import org.eclipse.sirius.components.tables.elements.MultiSelectCellElementProps;
import org.eclipse.sirius.components.tables.elements.SelectCellElementProps;
import org.eclipse.sirius.components.tables.elements.TextfieldCellElementProps;
import org.eclipse.sirius.web.application.table.customcells.CheckboxCellDescription;
import org.eclipse.sirius.web.application.table.customcells.CheckboxCellElementProps;

/**
* This class is used to provide the project page description for the project workpackage artefact.
Expand Down Expand Up @@ -228,6 +231,15 @@ List<ICellDescription> buildCellDescription() {
.cellValueProvider(this.getCellValueProvider())
.cellTooltipValueProvider((vm, o) -> "")
.build());
iCellDescriptionList.add(
CheckboxCellDescription.newCheckboxCellDescription("checkboxCells")
.canCreatePredicate(this.canCreateCellProvider(CheckboxCellElementProps.TYPE))
.targetObjectIdProvider(vm -> "")
.targetObjectKindProvider(vm -> "")
.cellValueProvider(this.getCheckboxCellValueProvider())
.cellTooltipValueProvider((vm, o) -> "")
.build()
);
return iCellDescriptionList;
}

Expand Down Expand Up @@ -282,6 +294,21 @@ private BiFunction<VariableManager, Object, String> getCellValueProvider() {
};
}

private BiFunction<VariableManager, Object, Boolean> getCheckboxCellValueProvider() {
return (variableManager, columnTargetObject) -> {
boolean value = false;
Optional<EObject> optionalEObject = variableManager.get(VariableManager.SELF, EObject.class);
if (optionalEObject.isPresent() && columnTargetObject instanceof EStructuralFeature eStructuralFeature) {
EObject eObject = optionalEObject.get();
Object objectValue = eObject.eGet(eStructuralFeature);
if (objectValue != null) {
value = Boolean.parseBoolean(objectValue.toString());
}
}
return value;
};
}

Predicate<VariableManager> canCreateCellProvider(String requiredCellType) {
return (variableManager) -> {
Optional<String> optionalString = variableManager.get("columnTargetObject", String.class);
Expand All @@ -301,6 +328,9 @@ Predicate<VariableManager> canCreateCellProvider(String requiredCellType) {
if (eType instanceof EEnum) {
type = SelectCellElementProps.TYPE;
}
else if (eType instanceof EDataType eDataType && eDataType.getInstanceClass().equals(Boolean.class)) {
type = CheckboxCellElementProps.TYPE;
}
} else {
EReference eReference = (EReference) eStructuralFeature;
if (eReference.isMany() && !eReference.isContainment()) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-changelog.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022, 2023 Obeo.
* Copyright (c) 2022, 2026 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 Down Expand Up @@ -57,7 +57,7 @@ for (let index = 0; index < lines.length; index++) {

const tagAsNumber = Number(tag);
if (!isNaN(tagAsNumber)) {
const issueURL = `https://github.com/eclipse-sirius/sirius-web/issues/${tagAsNumber}`;
const issueURL = `https://github.com/ObeoNetwork/pepper/issues/${tagAsNumber}`;

if (!changelog.includes(issueURL)) {
missingIssuesInChangelog.push(issueURL);
Expand Down
Loading