Skip to content

FOUR-21667 | "Edit Template” Link for Screen Templates Does Not Redirect to Edit Page in Screen Builder #7959

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

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ProcessMaker/Http/Controllers/TemplateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ class TemplateController extends Controller
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function edit(string $type, Request $request)
public function editScreenTemplate(Request $request)
{
new $this->types[$type][1]->edit($request);
$screenTemplate = new $this->types['screen'][1];

$response = $screenTemplate->show($request);

return view('processes.screen-builder.showTemplate')->with('id', $response['id']);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/shared/ellipsisMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ export default {
{
value: "edit-template",
content: "Edit Template",
link: true,
href: "/screen-template/{{id}}/edit",
permission: ["edit-screens"],
icon: "fas fa-pen-square",
},
Expand Down Expand Up @@ -322,6 +324,8 @@ export default {
{
value: "edit-template",
content: "Edit Template",
link: true,
href: "/screen-template/{{id}}/edit",
permission: ["edit-screens"],
icon: "fas fa-pen-square",
conditional: "if(is_owner and user_id, true, false)",
Expand Down
11 changes: 0 additions & 11 deletions resources/js/processes/screen-templates/mixins/navigationMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ export default {
methods: {
onTemplateNavigate(actionType, data) {
switch (actionType?.value) {
case "edit-template":
this.goToScreenBuilder(data.id);
break;
case "make-public":
ProcessMaker.apiClient
.put(`template/screen/${data.id}/update`, {
Expand Down Expand Up @@ -46,13 +43,5 @@ export default {
break;
}
},
goToScreenBuilder(data) {
ProcessMaker.apiClient.get(`/screen-builder/screen/${data}`)
.then((response) => {
window.location = `/designer/screen-builder/${response.data.id}/edit`;
}).catch((error) => {
ProcessMaker.alert(error.response?.data?.message, "danger");
});
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script>
window.location.href = "/designer/screen-builder/{{ $id }}/edit";
</script>
4 changes: 3 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
Route::get('modeler/templates/{id}', [TemplateController::class, 'show'])->name('modeler.template.show')->middleware('template-authorization', 'can:edit-process-templates');
Route::get('screen-template/{screen}/export', [TemplateController::class, 'export'])->name('screens-template.export')->middleware('can:export-screens');
Route::get('screen-template/import', [TemplateController::class, 'importScreen'])->name('screens-template.importScreen')->middleware('can:import-screens');
Route::get('screen-template/{id}/edit', [TemplateController::class, 'editScreenTemplate'])->name('screen-template.edit')->middleware('can:edit-screens');

// Allows for a logged in user to see navigation on a 404 page
Route::fallback(function () {
return response()->view('errors.404', [], 404);
Expand Down Expand Up @@ -237,4 +239,4 @@
return response(Metrics::renderMetrics(), 200, [
'Content-Type' => 'text/plain; version=0.0.4',
]);
});
});
Loading