Compare commits

...

5 Commits

Author SHA1 Message Date
YannC
4d2728a3f6 chore(version): update to version 'v0.15.2' 2024-03-04 21:52:07 +01:00
Loïc Mathieu
87f7cde742 fix(ui): missing check permission to display flow CREATE and EXECUTE button
When a user didn't have FLOW CREATE permission, the 'Create' buton will disapear from the Dashboard and the Flows pages.
When a user didn't have EXECUTION CREATE permission, the 'Execute' button will disapear from the Flow detail and Execution detail pages.
2024-03-04 18:21:03 +01:00
YannC
2e18c87907 fix(ui): change editor width storage key 2024-03-04 18:17:07 +01:00
YannC
58352411b5 fix(controller): fix 404 issue when flow of a trigger has been deleted (#3209) 2024-03-04 17:53:13 +01:00
Ludovic DEHON
438619dd8c chore(version): update to version 'v0.15.1'. 2024-03-01 23:38:36 +01:00
8 changed files with 40 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
version=0.15.0
version=0.15.2
jacksonVersion=2.16.1
micronautVersion=4.3.4

View File

@@ -120,6 +120,7 @@
<el-table-column column-key="disable" class-name="row-action">
<template #default="scope">
<el-switch
v-if="!scope.row.missingSource"
size="small"
:active-text="$t('enabled')"
:model-value="!scope.row.disabled"
@@ -127,6 +128,9 @@
class="switch-text"
:active-action-icon="Check"
/>
<el-tooltip v-else :content="'flow source not found'">
<AlertCircle class="trigger-issue-icon" />
</el-tooltip>
</template>
</el-table-column>
</el-table>
@@ -154,6 +158,7 @@
import action from "../../models/action";
import TopNavBar from "../layout/TopNavBar.vue";
import Check from "vue-material-design-icons/Check.vue";
import AlertCircle from "vue-material-design-icons/AlertCircle.vue";
</script>
<script>
import NamespaceSelect from "../namespace/NamespaceSelect.vue";
@@ -251,9 +256,21 @@
},
triggersMerged() {
return this.triggers.map(triggers => {
return {...triggers.abstractTrigger, ...triggers.triggerContext, codeDisabled: triggers.abstractTrigger.disabled}
return {
...triggers?.abstractTrigger,
...triggers.triggerContext,
codeDisabled: triggers?.abstractTrigger?.disabled,
// if we have no abstract trigger, it means that flow or trigger definition hasn't been found
missingSource: !triggers.abstractTrigger
}
})
}
}
};
</script>
</script>
<style>
.trigger-issue-icon{
color: var(--bs-warning);
font-size: 1.4em;
}
</style>

View File

@@ -9,7 +9,7 @@
</li>
<li>
<router-link v-if="flow" :to="{name: 'flows/create', query: {copy: true}}">
<router-link v-if="flow && canCreate" :to="{name: 'flows/create', query: {copy: true}}">
<el-button :icon="icon.ContentCopy" size="large">
{{ $t('copy') }}
</el-button>

View File

@@ -27,7 +27,7 @@
</router-link>
</li>
<li>
<router-link :to="{name: 'flows/create'}">
<router-link :to="{name: 'flows/create'}" v-if="canCreate">
<el-button :icon="Plus" type="primary">
{{ $t('create') }}
</el-button>
@@ -290,6 +290,9 @@
canCheck() {
return this.canRead || this.canDelete || this.canUpdate;
},
canCreate() {
return this.user && this.user.isAllowed(permission.FLOW, action.CREATE, this.$route.query.namespace);
},
canRead() {
return this.user && this.user.isAllowed(permission.FLOW, action.READ, this.$route.query.namespace);
},

View File

@@ -1,6 +1,6 @@
<template>
<top-nav-bar v-if="!embed" :title="routeInfo.title">
<template #additional-right>
<template #additional-right v-if="canCreate">
<ul>
<li>
<router-link :to="{name: 'flows/create'}">
@@ -333,6 +333,9 @@
title: this.$t("homeDashboard.title"),
};
},
canCreate() {
return this.user.isAllowedGlobal(permission.FLOW, action.CREATE)
},
defaultFilters() {
return {
startDate: this.$moment(this.startDate).toISOString(true),

View File

@@ -167,7 +167,7 @@
}
const editorDomElement = ref(null);
const editorWidthStorageKey = "editor-width";
const editorWidthStorageKey = "editor-size";
const editorWidth = ref(localStorage.getItem(editorWidthStorageKey));
const validationDomElement = ref(null);
const isLoading = ref(false);

View File

@@ -44,6 +44,9 @@ export default {
canSave() {
return canSaveFlowTemplate(true, this.user, this.item, this.dataType);
},
canCreate() {
return this.dataType === "flow" && this.user.isAllowed(permission.FLOW, action.CREATE, this.item.namespace)
},
canExecute() {
return this.dataType === "flow" && this.user.isAllowed(permission.EXECUTION, action.CREATE, this.item.namespace)
},

View File

@@ -81,6 +81,13 @@ public class TriggerController {
if (flow.isEmpty()) {
// Warn instead of throwing to avoid blocking the trigger UI
log.warn(String.format("Flow %s not found for trigger %s", tc.getFlowId(), tc.getTriggerId()));
triggers.add(Triggers.builder()
.abstractTrigger(null)
.triggerContext(tc)
.build()
);
return;
}
AbstractTrigger abstractTrigger = flow.get().getTriggers().stream().filter(t -> t.getId().equals(tc.getTriggerId())).findFirst().orElse(null);