Merge pull request 'fix: refs #6897 update onClick logic to correctly handle save and continue functionality in FormModelPopup' (!1434) from 6897-warmfix-fixOnDataSaved into test
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1434 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
a4dc3ae8c8
|
@ -27,12 +27,12 @@ const formModelRef = ref(null);
|
|||
const closeButton = ref(null);
|
||||
const isSaveAndContinue = ref(false);
|
||||
const onDataSaved = (formData, requestResponse) => {
|
||||
if (closeButton.value && isSaveAndContinue.value) closeButton.value.click();
|
||||
if (closeButton.value && !isSaveAndContinue.value) closeButton.value.click();
|
||||
emit('onDataSaved', formData, requestResponse);
|
||||
};
|
||||
|
||||
const onClick = async () => {
|
||||
isSaveAndContinue.value = true;
|
||||
const onClick = async (saveAndContinue) => {
|
||||
isSaveAndContinue.value = saveAndContinue;
|
||||
await formModelRef.value.save();
|
||||
};
|
||||
|
||||
|
@ -83,7 +83,7 @@ defineExpose({
|
|||
:flat="showSaveAndContinueBtn"
|
||||
:label="t('globals.save')"
|
||||
:title="t('globals.save')"
|
||||
@click="onClick"
|
||||
@click="onClick(false)"
|
||||
color="primary"
|
||||
class="q-ml-sm"
|
||||
:disabled="isLoading"
|
||||
|
@ -101,7 +101,7 @@ defineExpose({
|
|||
:loading="isLoading"
|
||||
data-cy="FormModelPopup_isSaveAndContinue"
|
||||
z-max
|
||||
@click="onClick"
|
||||
@click="onClick(true)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue