changes
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
Part of the Fusion Plating product family.
|
||||
|
||||
OWL template for the part-scoped Process Composer client action.
|
||||
Sub 9 — multi-variant Composer.
|
||||
-->
|
||||
<templates xml:space="preserve">
|
||||
|
||||
@@ -36,53 +37,105 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="o_fp_part_composer_loader">
|
||||
<label>Load Existing Process:</label>
|
||||
<select class="form-select" t-on-change="onSelectTemplate">
|
||||
<t t-foreach="state.templates" t-as="tpl" t-key="tpl.id">
|
||||
<option t-att-value="tpl.id"
|
||||
t-att-selected="tpl.id == state.selectedTemplateId">
|
||||
<t t-esc="tpl.name"/>
|
||||
</option>
|
||||
</t>
|
||||
</select>
|
||||
<button class="btn btn-primary"
|
||||
t-on-click="onLoadTemplate"
|
||||
t-att-disabled="state.loadingTemplate or !state.selectedTemplateId">
|
||||
<t t-if="state.loadingTemplate">
|
||||
<i class="fa fa-spinner fa-spin"/>
|
||||
<span> Loading…</span>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<t t-if="state.hasTree">Replace with Selected</t>
|
||||
<t t-else="">Load</t>
|
||||
</t>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="o_fp_part_composer_tree">
|
||||
<t t-if="state.hasTree">
|
||||
<div class="o_fp_part_composer_hint">
|
||||
<p>This part has a composed process tree. Click below to open the
|
||||
full tree editor where you can add, remove, reorder, and configure
|
||||
the process nodes.</p>
|
||||
<button class="btn btn-primary o_fp_part_composer_editor_btn"
|
||||
t-on-click="() => this.openRecipeEditor()">
|
||||
<i class="fa fa-sitemap"/>
|
||||
<span>Open Process Editor</span>
|
||||
</button>
|
||||
<div class="o_fp_part_composer_variants mt-3">
|
||||
<h4>Process Variants</h4>
|
||||
<p class="text-muted small">
|
||||
Add as many variants as you need (e.g. "Standard", "Selective Masking", "Rework").
|
||||
One variant is the default; order lines may pick another at entry time.
|
||||
</p>
|
||||
<t t-if="state.variants.length === 0">
|
||||
<div class="o_fp_part_composer_empty">
|
||||
<i class="fa fa-cogs fa-2x"/>
|
||||
<p>No variants yet. Pick a template below and add the first one.</p>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div class="o_fp_part_composer_empty">
|
||||
<i class="fa fa-cogs fa-3x"/>
|
||||
<p>No process composed yet.</p>
|
||||
<p class="text-muted">
|
||||
Pick a template above and click <strong>Load</strong> to get started.
|
||||
</p>
|
||||
</div>
|
||||
<table class="table table-sm align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Default</th>
|
||||
<th>Label</th>
|
||||
<th>Recipe Name</th>
|
||||
<th class="text-end">Nodes</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-foreach="state.variants" t-as="v" t-key="v.id">
|
||||
<tr>
|
||||
<td>
|
||||
<t t-if="v.is_default">
|
||||
<span class="badge bg-success">Default</span>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<button class="btn btn-link btn-sm p-0"
|
||||
t-att-disabled="state.busy"
|
||||
t-on-click="() => this.onSetDefaultVariant(v.id)">
|
||||
Set Default
|
||||
</button>
|
||||
</t>
|
||||
</td>
|
||||
<td>
|
||||
<strong t-esc="v.label"/>
|
||||
</td>
|
||||
<td class="text-muted" t-esc="v.name"/>
|
||||
<td class="text-end" t-esc="v.node_count"/>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-sm btn-primary me-1"
|
||||
t-att-disabled="state.busy"
|
||||
t-on-click="() => this.openRecipeEditor(v.id)">
|
||||
<i class="fa fa-pencil"/> Edit
|
||||
</button>
|
||||
<button class="btn btn-sm btn-secondary me-1"
|
||||
t-att-disabled="state.busy"
|
||||
t-on-click="() => this.onDuplicateVariant(v.id)">
|
||||
<i class="fa fa-copy"/> Duplicate
|
||||
</button>
|
||||
<button class="btn btn-sm btn-secondary me-1"
|
||||
t-att-disabled="state.busy"
|
||||
t-on-click="() => this.onRenameVariant(v.id)">
|
||||
<i class="fa fa-i-cursor"/> Rename
|
||||
</button>
|
||||
<button class="btn btn-sm btn-outline-danger"
|
||||
t-att-disabled="state.busy"
|
||||
t-on-click="() => this.onDeleteVariant(v.id)">
|
||||
<i class="fa fa-trash"/>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<div class="o_fp_part_composer_loader mt-4">
|
||||
<h4>Add Variant from Template</h4>
|
||||
<div class="d-flex gap-2 align-items-center flex-wrap">
|
||||
<label class="me-2">Template:</label>
|
||||
<select class="form-select" style="max-width: 280px;"
|
||||
t-on-change="onSelectTemplate">
|
||||
<t t-foreach="state.templates" t-as="tpl" t-key="tpl.id">
|
||||
<option t-att-value="tpl.id"
|
||||
t-att-selected="tpl.id == state.selectedTemplateId">
|
||||
<t t-esc="tpl.name"/>
|
||||
</option>
|
||||
</t>
|
||||
</select>
|
||||
<input class="form-control" style="max-width: 240px;"
|
||||
placeholder="Variant label (e.g. Standard ENP)"
|
||||
t-att-value="state.newVariantLabel"
|
||||
t-on-input="onNewLabelInput"/>
|
||||
<button class="btn btn-primary"
|
||||
t-on-click="onAddVariantFromTemplate"
|
||||
t-att-disabled="state.busy or !state.selectedTemplateId">
|
||||
<i class="fa fa-plus"/> Add Variant
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-muted small mt-1">
|
||||
Leave the label blank to use the template name. The first variant added becomes the default automatically.
|
||||
</p>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user