forked from enviPath/enviPy
Initial bayer app Show Pack Classification Adjusted docker compose to bayer specifics Adjusted Dockerfile for Bayer Adding secret flags to group, add secret pools to packages Adjusted View for Package creation Prep configs, added Package Create Modal wip More on PES wip wip Wip minor PW interactions API PES wip Make Select Widget reflect required make required generallay available Update UI if pathway mode is set to build Added ais circle adjustments Initial Zoom, fix AD Creation wip auth log, bb4g fix missing import Added viz hint if PES is part of reaction Add Edge check for pes flip boolean ... pes Added extra ... In / Out Edges Viz, Submitting Button Text ... Make PES Link clickable Return proper http response instead of error Fixed error return, removed unused options Fix PES Link HTML for other entities Fixed molfile assignment, adjusted Export Package Export/Import cycle highlight Description links implemented non persistent Harmonised proposed field in Json output Added pesLink field to PW Api output PES Fields in API Output removed debug Fix Classification import, Fix PES Deserialization underline pes link in templates Fix alter name/desc for node, make /node /edge funcitonal provide setting link and copy button Implemented Compound Names / Reaction Names View Option Unconnected Nodes Make links thicker, reduce timeout trigger time Show proposed info in popover Pathway Build no stereo removal Include probs in reaction name option viz Detect clicks outside nodes/edges
175 lines
4.7 KiB
HTML
175 lines
4.7 KiB
HTML
{% load static %}
|
|
|
|
<dialog
|
|
id="new_package_modal"
|
|
class="modal"
|
|
x-data="{
|
|
isSubmitting: false,
|
|
packageClassification: null,
|
|
|
|
reset() {
|
|
this.isSubmitting = false;
|
|
this.packageClassification = null;
|
|
},
|
|
|
|
setFormData(data) {
|
|
this.formData = data;
|
|
},
|
|
|
|
get isSecret() {
|
|
return this.packageClassification === '20';
|
|
},
|
|
|
|
submit(formId) {
|
|
const form = document.getElementById(formId);
|
|
|
|
// Remove previously injected inputs
|
|
form.querySelectorAll('.dynamic-param').forEach(el => el.remove());
|
|
|
|
// Add values from dynamic form into the html form
|
|
if (this.formData) {
|
|
Object.entries(this.formData).forEach(([key, value]) => {
|
|
const input = document.createElement('input');
|
|
input.type = 'hidden';
|
|
input.name = key;
|
|
input.value = value;
|
|
input.classList.add('dynamic-param');
|
|
|
|
form.appendChild(input);
|
|
});
|
|
}
|
|
|
|
if (form && form.checkValidity()) {
|
|
this.isSubmitting = true;
|
|
form.submit();
|
|
} else if (form) {
|
|
form.reportValidity();
|
|
}
|
|
}
|
|
|
|
}"
|
|
@close="reset()"
|
|
>
|
|
<div class="modal-box max-w-3xl">
|
|
<!-- Header -->
|
|
<h3 class="text-lg font-bold">New Package</h3>
|
|
|
|
<!-- Close button (X) -->
|
|
<form method="dialog">
|
|
<button
|
|
class="btn btn-sm btn-circle btn-ghost absolute top-2 right-2"
|
|
:disabled="isSubmitting"
|
|
>
|
|
✕
|
|
</button>
|
|
</form>
|
|
|
|
<!-- Body -->
|
|
<div class="py-4">
|
|
<form
|
|
id="new_package_form"
|
|
accept-charset="UTF-8"
|
|
action=""
|
|
method="post"
|
|
>
|
|
{% csrf_token %}
|
|
|
|
<!-- Name -->
|
|
<div class="form-control mb-3">
|
|
<label class="label" for="package-name">
|
|
<span class="label-text">Name</span>
|
|
</label>
|
|
<input
|
|
id="package-name"
|
|
class="input input-bordered w-full"
|
|
name="package-name"
|
|
placeholder="Name"
|
|
required
|
|
/>
|
|
</div>
|
|
|
|
<!-- Description -->
|
|
<div class="form-control mb-3">
|
|
<label class="label" for="package-description">
|
|
<span class="label-text">Description</span>
|
|
</label>
|
|
<input
|
|
id="package-description"
|
|
type="text"
|
|
class="input input-bordered w-full"
|
|
placeholder="Description..."
|
|
name="package-description"
|
|
/>
|
|
</div>
|
|
|
|
<!-- Classification Level -->
|
|
<div class="form-control mb-3">
|
|
<label class="label" for="package-classification">
|
|
<span class="label-text">Package Classification</span>
|
|
</label>
|
|
<select
|
|
id="package-classification"
|
|
name="package-classification"
|
|
class="select select-bordered w-full"
|
|
x-model="packageClassification"
|
|
required
|
|
>
|
|
<option value="null" disabled selected>Select Classification</option>
|
|
<option value="0">Internal</option>
|
|
<option value="10">Restricted</option>
|
|
<option value="20">Secret</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Secret Groups -->
|
|
<div class="form-control mb-3" x-show="isSecret" x-cloak>
|
|
<label class="label" for="package-data-pool">
|
|
<span class="label-text">Data Pool for SECRET Package</span>
|
|
</label>
|
|
<p>Only users with this role can be granted access to this package</p>
|
|
<select
|
|
id="package-data-pool"
|
|
name="package-data-pool"
|
|
class="select select-bordered w-full"
|
|
>
|
|
<option value="" disabled selected>Select Data Pool</option>
|
|
{% for obj in meta.secret_groups %}
|
|
<option value="{{ obj.url }}">{{ obj.name|safe }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<div class="modal-action">
|
|
<button
|
|
type="button"
|
|
class="btn"
|
|
onclick="this.closest('dialog').close()"
|
|
:disabled="isSubmitting"
|
|
>
|
|
Cancel
|
|
</button>
|
|
<button
|
|
type="button"
|
|
class="btn btn-primary"
|
|
@click="submit('new_package_form')"
|
|
:disabled="isSubmitting || !selectedType || loadingSchemas"
|
|
>
|
|
<span x-show="!isSubmitting">Submit</span>
|
|
<span
|
|
x-show="isSubmitting"
|
|
class="loading loading-spinner loading-sm"
|
|
></span>
|
|
<span x-show="isSubmitting">Creating...</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Backdrop -->
|
|
<form method="dialog" class="modal-backdrop">
|
|
<button :disabled="isSubmitting">close</button>
|
|
</form>
|
|
</dialog> |