Bug 42141: Fix Save and show/list/edit button on Vue SIP2 config
This patch fixes the behavior of the Save (Save and list, Save and continue editing, Save and show) button which is controlled via useBaseResource.navigationOnFormSave on
Accounts, Institutions and System preference overrides in Administration -> Self-service circulation (SIP2)
To test:
a) go to Administration -> Self-service circulation (SIP2)
b) create one of the given resources (institution, account, system preference override) and fill out mandatory fields
c) click either Save or Save and continue editing or Save and show
d) check that you always end up on the list.
e) apply patch and run 'yarn js:build' , reload your browser
f) repeat b) and c)
g) check that the desired view is now shown
- show the edited/created resource
- list all created resources
- continue editing the resource
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a866e3d380)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
parent
b08204a1ef
commit
166a0ba124
|
|
@ -1054,14 +1054,17 @@ export default {
|
|||
|
||||
try {
|
||||
if (sip_account_id) {
|
||||
await client.update(account, sip_account_id);
|
||||
let updatedAccount = await client.update(
|
||||
account,
|
||||
sip_account_id
|
||||
);
|
||||
baseResource.setMessage(__("Account updated"));
|
||||
return updatedAccount;
|
||||
} else {
|
||||
await client.create(account);
|
||||
let createdAccount = await client.create(account);
|
||||
baseResource.setMessage(__("Account created"));
|
||||
return createdAccount;
|
||||
}
|
||||
|
||||
baseResource.router.push({ name: "SIP2AccountsList" });
|
||||
} catch (error) {
|
||||
// Handle errors if needed
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ export default {
|
|||
resourceTableUrl:
|
||||
APIClient.sip2.httpClient._baseURL + "institutions",
|
||||
},
|
||||
navigationOnFormSave: "SIP2InstitutionsList",
|
||||
resourceAttrs: [
|
||||
{
|
||||
name: "name",
|
||||
|
|
@ -172,16 +173,19 @@ export default {
|
|||
|
||||
try {
|
||||
if (sip_institution_id) {
|
||||
await baseResource.apiClient.update(
|
||||
institution,
|
||||
sip_institution_id
|
||||
);
|
||||
let updatedInstitution =
|
||||
await baseResource.apiClient.update(
|
||||
institution,
|
||||
sip_institution_id
|
||||
);
|
||||
baseResource.setMessage(__("Institution updated"));
|
||||
return updatedInstitution;
|
||||
} else {
|
||||
await baseResource.apiClient.create(institution);
|
||||
let createdInstitution =
|
||||
await baseResource.apiClient.create(institution);
|
||||
baseResource.setMessage(__("Institution created"));
|
||||
return createdInstitution;
|
||||
}
|
||||
baseResource.router.push({ name: "SIP2InstitutionsList" });
|
||||
} catch (error) {
|
||||
// Handle error here if needed
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ export default {
|
|||
),
|
||||
newLabel: $__("New system preference override"),
|
||||
},
|
||||
navigationOnFormSave: "SIP2SystemPreferenceOverridesList",
|
||||
resourceAttrs: [
|
||||
{
|
||||
name: "variable",
|
||||
|
|
@ -77,24 +78,23 @@ export default {
|
|||
|
||||
try {
|
||||
if (sip_system_preference_override_id) {
|
||||
await baseResource.apiClient.update(
|
||||
let updatedResource = await baseResource.apiClient.update(
|
||||
system_preference_override,
|
||||
sip_system_preference_override_id
|
||||
);
|
||||
baseResource.setMessage(
|
||||
$__("System preference override updated")
|
||||
);
|
||||
return updatedResource;
|
||||
} else {
|
||||
await baseResource.apiClient.create(
|
||||
let createdResource = await baseResource.apiClient.create(
|
||||
system_preference_override
|
||||
);
|
||||
baseResource.setMessage(
|
||||
$__("System preference override created")
|
||||
);
|
||||
return createdResource;
|
||||
}
|
||||
baseResource.router.push({
|
||||
name: "SIP2SystemPreferenceOverridesList",
|
||||
});
|
||||
} catch (error) {
|
||||
// Handle error here if needed
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue