Bug 32030: Add 'Loading' to EHoldingsLocalPackageAgreements

To prevent the cypress test to fail random, and it also remove a blink
code/value in the dropdown list, which is nicer for the end-user.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-11-01 08:29:23 +01:00 committed by Tomas Cohen Arazi
parent 4803c4ff44
commit 5fbdfa08cc
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -1,7 +1,10 @@
<template>
<fieldset class="rows" id="package_agreements">
<legend>{{ $__("Agreements") }}</legend>
<div v-if="!initialized">{{ $__("Loading") }}</div>
<fieldset
v-else
:id="`package_agreement_${counter}`"
class="rows"
v-for="(package_agreement, counter) in package_agreements"
@ -40,12 +43,14 @@
</ol>
</fieldset>
<a
v-if="agreements.length"
v-if="initialized && agreements.length"
class="btn btn-default"
@click="addAgreement"
><font-awesome-icon icon="plus" /> {{ $__("Add new agreement") }}</a
>
<span v-else>{{ $__("There are no agreements created yet") }}</span>
<span v-else-if="initialized">{{
$__("There are no agreements created yet")
}}</span>
</fieldset>
</template>
@ -56,11 +61,13 @@ export default {
data() {
return {
agreements: [],
initialized: false,
}
},
beforeCreate() {
fetchAgreements().then(agreements => {
this.agreements = agreements
this.initialized = true
})
},
methods: {