Search in sources :

Example 1 with FeatureDescriptor

use of com.aire.features.FeatureDescriptor in project aire-components by aire-ux.

the class InMemoryFeatureManagerTest method ensureDisablingViewPreventsItFromBeingRegistered.

@ViewTest
void ensureDisablingViewPreventsItFromBeingRegistered(@Context TestContext $) {
    val descriptor = new FeatureDescriptor("test.view.feature", "Test View Feature", ":application:modules:module-management:test-view", "Cool feature descriptor");
    featureManager.registerFeature(descriptor);
    assertTrue(featureManager.enable("test.view.feature"));
    $.navigate(TestFeatureView.class);
    $.flush();
    var button = $.selectFirst("vaadin-button[text*=test]", Button.class);
    assertTrue(button.isPresent());
    featureManager.disable("test.view.feature");
    $.navigate(MainView.class);
    $.navigate(TestFeatureView.class);
    button = $.selectFirst("vaadin-button[text*=test]", Button.class);
    assertFalse(button.isPresent());
}
Also used : lombok.val(lombok.val) FeatureDescriptor(com.aire.features.FeatureDescriptor) Button(com.vaadin.flow.component.button.Button) ViewTest(com.aire.ux.test.ViewTest)

Example 2 with FeatureDescriptor

use of com.aire.features.FeatureDescriptor in project aire-components by aire-ux.

the class AddFeatureFlagOverlay method onSuccess.

private void onSuccess(ClickEvent<Button> buttonClickEvent) {
    value = new FeatureDescriptor(keyInputField.getValue(), nameInputField.getValue(), pathInputField.getValue(), descriptionInput.getValue());
    val tagValue = tagInputField.getValue();
    if (tagValue != null) {
        val tags = tagValue.split(",");
        for (val tag : tags) {
            if (!tag.isBlank()) {
                value.addTag(tag);
            }
        }
    }
    close();
}
Also used : lombok.val(lombok.val) FeatureDescriptor(com.aire.features.FeatureDescriptor)

Aggregations

FeatureDescriptor (com.aire.features.FeatureDescriptor)2 lombok.val (lombok.val)2 ViewTest (com.aire.ux.test.ViewTest)1 Button (com.vaadin.flow.component.button.Button)1