Skip to content

Commit 4f04ebc

Browse files
chore: remove card/dashboard feature flag (#7512) (#7514)
* chore: remove dashboard feature flag * chore: remove card feature flag (#7503) Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
1 parent b2133cb commit 4f04ebc

File tree

13 files changed

+2
-369
lines changed

13 files changed

+2
-369
lines changed

vaadin-card-flow-parent/vaadin-card-flow-integration-tests/src/main/resources/vaadin-featureflags.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

vaadin-card-flow-parent/vaadin-card-flow/src/main/java/com/vaadin/flow/component/card/Card.java

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@
2424

2525
import org.slf4j.LoggerFactory;
2626

27-
import com.vaadin.experimental.FeatureFlags;
28-
import com.vaadin.flow.component.AttachEvent;
2927
import com.vaadin.flow.component.Component;
3028
import com.vaadin.flow.component.HasAriaLabel;
3129
import com.vaadin.flow.component.HasComponents;
3230
import com.vaadin.flow.component.HasSize;
3331
import com.vaadin.flow.component.Tag;
34-
import com.vaadin.flow.component.UI;
3532
import com.vaadin.flow.component.dependency.JsModule;
3633
import com.vaadin.flow.component.dependency.NpmPackage;
3734
import com.vaadin.flow.component.shared.HasThemeVariant;
@@ -64,8 +61,6 @@ public class Card extends Component implements HasSize,
6461

6562
private Element contentRoot;
6663

67-
private boolean featureFlagEnabled;
68-
6964
/**
7065
* Sets the component used as the card's media. The media slot is typically
7166
* used to display an image, icon, or other visual element.
@@ -394,47 +389,6 @@ public Optional<String> getAriaRole() {
394389
return Optional.ofNullable(getElement().getAttribute("role"));
395390
}
396391

397-
@Override
398-
protected void onAttach(AttachEvent attachEvent) {
399-
super.onAttach(attachEvent);
400-
checkFeatureFlag();
401-
}
402-
403-
/**
404-
* Gets the feature flags for the current UI.
405-
* <p>
406-
* Not private in order to support mocking
407-
*
408-
* @return the current set of feature flags
409-
*/
410-
FeatureFlags getFeatureFlags() {
411-
return FeatureFlags
412-
.get(UI.getCurrent().getSession().getService().getContext());
413-
}
414-
415-
/**
416-
* Only for test use.
417-
*/
418-
void setFeatureFlagEnabled() {
419-
featureFlagEnabled = true;
420-
}
421-
422-
/**
423-
* Checks whether the Card component feature flag is active. Succeeds if the
424-
* flag is enabled, and throws otherwise.
425-
*
426-
* @throws ExperimentalFeatureException
427-
* when the {@link FeatureFlags#CARD_COMPONENT} feature is not
428-
* enabled
429-
*/
430-
private void checkFeatureFlag() {
431-
boolean enabled = featureFlagEnabled
432-
|| getFeatureFlags().isEnabled(FeatureFlags.CARD_COMPONENT);
433-
if (!enabled) {
434-
throw new ExperimentalFeatureException();
435-
}
436-
}
437-
438392
private void initContentRoot() {
439393
contentRoot = new Element("div");
440394
contentRoot.getStyle().set("display", "contents");

vaadin-card-flow-parent/vaadin-card-flow/src/main/java/com/vaadin/flow/component/card/ExperimentalFeatureException.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

vaadin-card-flow-parent/vaadin-card-flow/src/test/java/com/vaadin/flow/component/card/CardTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public void setup() {
4444
var ui = new UI();
4545
UI.setCurrent(ui);
4646
card = new Card();
47-
card.setFeatureFlagEnabled();
4847
ui.add(card);
4948
}
5049

vaadin-card-flow-parent/vaadin-card-flow/src/test/java/com/vaadin/flow/component/card/FeatureFlagTest.java

Lines changed: 0 additions & 64 deletions
This file was deleted.

vaadin-dashboard-flow-parent/vaadin-dashboard-flow-integration-tests/src/main/resources/vaadin-featureflags.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

vaadin-dashboard-flow-parent/vaadin-dashboard-flow/src/main/java/com/vaadin/flow/component/dashboard/Dashboard.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@
2222

2323
import org.slf4j.LoggerFactory;
2424

25-
import com.vaadin.experimental.FeatureFlags;
2625
import com.vaadin.flow.component.AttachEvent;
2726
import com.vaadin.flow.component.Component;
2827
import com.vaadin.flow.component.ComponentEventListener;
2928
import com.vaadin.flow.component.HasSize;
3029
import com.vaadin.flow.component.Tag;
31-
import com.vaadin.flow.component.UI;
3230
import com.vaadin.flow.component.dependency.JsModule;
3331
import com.vaadin.flow.component.dependency.NpmPackage;
3432
import com.vaadin.flow.component.shared.HasThemeVariant;
@@ -77,8 +75,6 @@ public class Dashboard extends Component
7775

7876
private boolean pendingUpdate = false;
7977

80-
private boolean featureFlagEnabled;
81-
8278
/**
8379
* Creates an empty dashboard.
8480
*/
@@ -548,7 +544,6 @@ public void setRootHeadingLevel(Integer rootHeadingLevel) {
548544
@Override
549545
protected void onAttach(AttachEvent attachEvent) {
550546
super.onAttach(attachEvent);
551-
checkFeatureFlag();
552547
getElement().executeJs(
553548
"Vaadin.FlowComponentHost.patchVirtualContainer(this);");
554549
customizeItemMovedEvent();
@@ -834,41 +829,6 @@ private static JsonArray getSectionItems(JsonArray items,
834829
return null;
835830
}
836831

837-
/**
838-
* Checks whether the Dashboard component feature flag is active. Succeeds
839-
* if the flag is enabled, and throws otherwise.
840-
*
841-
* @throws ExperimentalFeatureException
842-
* when the {@link FeatureFlags#DASHBOARD_COMPONENT} feature is
843-
* not enabled
844-
*/
845-
private void checkFeatureFlag() {
846-
boolean enabled = featureFlagEnabled || getFeatureFlags()
847-
.isEnabled(FeatureFlags.DASHBOARD_COMPONENT);
848-
if (!enabled) {
849-
throw new ExperimentalFeatureException();
850-
}
851-
}
852-
853-
/**
854-
* Gets the feature flags for the current UI.
855-
* <p>
856-
* Not private in order to support mocking
857-
*
858-
* @return the current set of feature flags
859-
*/
860-
FeatureFlags getFeatureFlags() {
861-
return FeatureFlags
862-
.get(UI.getCurrent().getSession().getService().getContext());
863-
}
864-
865-
/**
866-
* Only for test use.
867-
*/
868-
void setFeatureFlagEnabled(boolean featureFlagEnabled) {
869-
this.featureFlagEnabled = featureFlagEnabled;
870-
}
871-
872832
/**
873833
* The internationalization properties for {@link Dashboard}.
874834
*/

vaadin-dashboard-flow-parent/vaadin-dashboard-flow/src/main/java/com/vaadin/flow/component/dashboard/DashboardWidget.java

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
*/
99
package com.vaadin.flow.component.dashboard;
1010

11-
import com.vaadin.experimental.FeatureFlags;
12-
import com.vaadin.flow.component.AttachEvent;
1311
import com.vaadin.flow.component.Component;
1412
import com.vaadin.flow.component.Tag;
15-
import com.vaadin.flow.component.UI;
1613
import com.vaadin.flow.component.dependency.JsModule;
1714
import com.vaadin.flow.component.dependency.NpmPackage;
1815
import com.vaadin.flow.component.shared.SlotUtils;
@@ -37,8 +34,6 @@ public class DashboardWidget extends Component {
3734

3835
private int rowspan = 1;
3936

40-
private boolean featureFlagEnabled;
41-
4237
/**
4338
* Creates an empty widget.
4439
*/
@@ -226,12 +221,6 @@ public boolean isVisible() {
226221
return true;
227222
}
228223

229-
@Override
230-
protected void onAttach(AttachEvent attachEvent) {
231-
super.onAttach(attachEvent);
232-
checkFeatureFlag();
233-
}
234-
235224
private void notifyParentDashboardOrSection() {
236225
getParent().ifPresent(parent -> {
237226
if (parent instanceof Dashboard dashboard) {
@@ -241,39 +230,4 @@ private void notifyParentDashboardOrSection() {
241230
}
242231
});
243232
}
244-
245-
/**
246-
* Checks whether the Dashboard component feature flag is active. Succeeds
247-
* if the flag is enabled, and throws otherwise.
248-
*
249-
* @throws ExperimentalFeatureException
250-
* when the {@link FeatureFlags#DASHBOARD_COMPONENT} feature is
251-
* not enabled
252-
*/
253-
private void checkFeatureFlag() {
254-
boolean enabled = featureFlagEnabled || getFeatureFlags()
255-
.isEnabled(FeatureFlags.DASHBOARD_COMPONENT);
256-
if (!enabled) {
257-
throw new ExperimentalFeatureException();
258-
}
259-
}
260-
261-
/**
262-
* Gets the feature flags for the current UI.
263-
* <p>
264-
* Not private in order to support mocking
265-
*
266-
* @return the current set of feature flags
267-
*/
268-
FeatureFlags getFeatureFlags() {
269-
return FeatureFlags
270-
.get(UI.getCurrent().getSession().getService().getContext());
271-
}
272-
273-
/**
274-
* Only for test use.
275-
*/
276-
void setFeatureFlagEnabled(boolean featureFlagEnabled) {
277-
this.featureFlagEnabled = featureFlagEnabled;
278-
}
279233
}

vaadin-dashboard-flow-parent/vaadin-dashboard-flow/src/main/java/com/vaadin/flow/component/dashboard/ExperimentalFeatureException.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

vaadin-dashboard-flow-parent/vaadin-dashboard-flow/src/test/java/com/vaadin/flow/component/dashboard/DashboardItemMoveTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class DashboardItemMoveTest extends DashboardTestBase {
3535
public void setup() {
3636
super.setup();
3737
dashboard = getNewDashboard();
38-
dashboard.setFeatureFlagEnabled(true);
3938
dashboard.add(getNewWidget(), getNewWidget());
4039
dashboard.setEditable(true);
4140
DashboardSection section = dashboard.addSection();

vaadin-dashboard-flow-parent/vaadin-dashboard-flow/src/test/java/com/vaadin/flow/component/dashboard/DashboardTestBase.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,10 @@ protected static void assertSectionWidgets(DashboardSection section,
110110
}
111111

112112
protected DashboardWidget getNewWidget() {
113-
var widget = new DashboardWidget();
114-
widget.setFeatureFlagEnabled(true);
115-
return widget;
113+
return new DashboardWidget();
116114
}
117115

118116
protected Dashboard getNewDashboard() {
119-
var dashboard = new Dashboard();
120-
dashboard.setFeatureFlagEnabled(true);
121-
return dashboard;
117+
return new Dashboard();
122118
}
123119
}

0 commit comments

Comments
 (0)