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
9 changes: 9 additions & 0 deletions addon/components/order-config-manager/activity-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ export default class OrderConfigManagerActivityFlowComponent extends Component {
* and creates links from the parent to each child. It then calls itself to add any children of the current child activities.
* Finally, it repositions all child activities to maintain visual consistency.
*
* A flow is a graph, not a tree: an activity may be reachable from several parents, and a
* configured lifecycle can loop back (e.g. active -> extended -> active). An activity that is
* already on the graph only gets a link from this parent; it is never placed or walked twice.
*
* @param {Object} parentActivity - The parent activity to which child activities will be added.
* @param {Array} [childActivities=[]] - An array of child activity objects to be added. Defaults to an empty array.
*/
Expand All @@ -463,6 +467,11 @@ export default class OrderConfigManagerActivityFlowComponent extends Component {
return;
}
childActivities.forEach((childActivityObject) => {
if (childActivityObject.get('node')) {
this.addLinkToGraph(parentActivity, childActivityObject);
return;
}

const childPositionals = this.getActivityPositioning(childActivityObject, parentActivity);
const childActivity = this.createActivityNode(childActivityObject, childPositionals);
childActivity.set('parentId', parentActivity.get('id'));
Expand Down
29 changes: 14 additions & 15 deletions addon/components/order-config-manager/lifecycle.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@
{{else}}
<p class="text-sm text-gray-600 dark:text-gray-300">{{t "order-config-manager.lifecycle.default-lifecycle"}}</p>
{{/if}}

{{#if this.canEdit}}
<div class="flex justify-end pt-4">
<Button
@type="primary"
@icon="save"
@text={{t "common.save-changes"}}
@onClick={{perform this.save}}
@isLoading={{this.save.isRunning}}
@disabled={{not this.canSave}}
@permission="fleet-ops update order-config"
/>
</div>
{{/if}}
</ContentPanel>

{{#if this.saved}}
Expand Down Expand Up @@ -157,19 +171,4 @@
</ContentPanel>
{{/if}}

{{#if this.canEdit}}
<ContentPanel @title={{t "order-config-manager.details.controls"}} @open={{true}}>
<div class="flex flex-row items-center py-2 space-x-4">
<Button
@type="primary"
@icon="save"
@text={{t "common.save-changes"}}
@onClick={{perform this.save}}
@isLoading={{this.save.isRunning}}
@disabled={{not this.canSave}}
@permission="fleet-ops update order-config"
/>
</div>
</ContentPanel>
{{/if}}
</div>
Loading