-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "save and continue" button to admin menu node and content type editors #17515
base: main
Are you sure you want to change the base?
Conversation
Thank you for submitting your first pull request, awesome! 🚀 If you haven't already, please take a moment to review our contribution guide. This guide provides helpful information to ensure your contribution aligns with our standards. A core team member will review your pull request. If you like Orchard Core, please star our repo and join our community channels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current Save button already does the "save and close" behavior. What you asked for is the "save and continue" one.
src/OrchardCore.Modules/OrchardCore.AdminMenu/Controllers/NodeController.cs
Outdated
Show resolved
Hide resolved
I'm not sure what you mean by that, please be specific. There are no related commits in this, the official, repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still implementing a "save and close" behavior. As I told previously, and as you also asked under the issue, this should rather be "save and continue", meaning that the default is "save and close" (as it is today), and you can opt to do a "save and continue". As we discussed here: #17483 (comment) please do this in the exact same way as other piece of the UI do; you can take the "Save Draft ...and continue" button as an example. This should be the same, just without "Draft", since the Admin Menu is not versioned.
24151bb
to
ed5759c
Compare
I have made changes as you said. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
} | ||
else if (String.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) | ||
{ | ||
await _notifier.SuccessAsync(H["Admin node updated successfully."]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await _notifier.SuccessAsync(H["Admin node updated successfully."]); | |
await _notifier.SuccessAsync(H["Content type updated successfully."]); |
@@ -225,7 +225,15 @@ public async Task<IActionResult> Edit(AdminNodeEditViewModel model) | |||
await _adminMenuService.SaveAsync(adminMenu); | |||
|
|||
await _notifier.SuccessAsync(H["Admin node updated successfully."]); | |||
return RedirectToAction(nameof(List), new { id = model.AdminMenuId }); | |||
if (String.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the same in the other places.
if (String.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) | |
if (string.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) |
if (String.Equals(submit, "save", StringComparison.Ordinal)) | ||
{ | ||
return RedirectToAction(nameof(List)); | ||
} | ||
else if (String.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) | ||
{ | ||
await _notifier.SuccessAsync(H["Admin node updated successfully."]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (String.Equals(submit, "save", StringComparison.Ordinal)) | |
{ | |
return RedirectToAction(nameof(List)); | |
} | |
else if (String.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) | |
{ | |
await _notifier.SuccessAsync(H["Admin node updated successfully."]); | |
} | |
if (string.Equals(submit, "saveAndContinue", StringComparison.Ordinal)) | |
{ | |
await _notifier.SuccessAsync(H["Admin node updated successfully."]); | |
return View(typeViewModel); | |
} | |
else | |
{ | |
return RedirectToAction(nameof(List)); | |
} |
<span class="visually-hidden">@T["Toggle Dropdown"]</span> | ||
</button> | ||
<div class="dropdown-menu"> | ||
<button class="dropdown-item save-continue" type="submit" name="submit" value="saveAndContinue">@T["and continue"]</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's in line with the other such features. Also do the same for the content type editor.
<button class="dropdown-item save-continue" type="submit" name="submit" value="saveAndContinue">@T["and continue"]</button> | |
<button class="dropdown-item save-continue" type="submit" name="submit" value="SaveAndContinue">@T["and continue"]</button> |
Fixes #17483