diff --git a/src/DARE-FrontEnd/Controllers/ProjectController.cs b/src/DARE-FrontEnd/Controllers/ProjectController.cs index 66058ba41..c1f498ae5 100644 --- a/src/DARE-FrontEnd/Controllers/ProjectController.cs +++ b/src/DARE-FrontEnd/Controllers/ProjectController.cs @@ -104,6 +104,67 @@ public IActionResult GetProject(int id) return View(projectView); } + public IActionResult SubmissionProjectSQL(int id) + { + + var paramlist = new Dictionary(); + paramlist.Add("projectId", id.ToString()); + var project = _clientHelper.CallAPIWithoutModel( + "/api/Project/GetProject/", paramlist).Result; + + ViewBag.UserCanDoSubmissions = IsUserOnProject(project); + + var projectView = new ProjectUserTre() + { + Id = project.Id, + Name = project.Name + }; + + return View(projectView); + } + + + public IActionResult SubmissionProjectGraphQL(int id) + { + + var paramlist = new Dictionary(); + paramlist.Add("projectId", id.ToString()); + var project = _clientHelper.CallAPIWithoutModel( + "/api/Project/GetProject/", paramlist).Result; + + ViewBag.UserCanDoSubmissions = IsUserOnProject(project); + + var projectView = new ProjectUserTre() + { + Id = project.Id, + Name = project.Name + }; + + return View(projectView); + } + + public IActionResult SubmissionProjectCrate(int id) + { + + var paramlist = new Dictionary(); + paramlist.Add("projectId", id.ToString()); + var project = _clientHelper.CallAPIWithoutModel( + "/api/Project/GetProject/", paramlist).Result; + + ViewBag.UserCanDoSubmissions = IsUserOnProject(project); + + var projectView = new ProjectUserTre() + { + Id = project.Id, + Name = project.Name + }; + + return View(projectView); + } + + + + [HttpGet] [AllowAnonymous] public IActionResult GetAllProjects() diff --git a/src/DARE-FrontEnd/Controllers/SubmissionController.cs b/src/DARE-FrontEnd/Controllers/SubmissionController.cs index 37e252c50..897557668 100644 --- a/src/DARE-FrontEnd/Controllers/SubmissionController.cs +++ b/src/DARE-FrontEnd/Controllers/SubmissionController.cs @@ -113,7 +113,7 @@ public async Task SubmissionWizard(SubmissionWizard model) var result = await _clientHelper.CallAPI("/v1/tasks", TesTask); - return RedirectToAction("GetProject", "Project", new { id = model.ProjectId }); + return Ok(); } catch (Exception ex) { @@ -191,7 +191,7 @@ public async Task AddiSubmissionWizard(AddiSubmissionWizard model, try { - + var listOfTre = ""; var paramlist = new Dictionary(); @@ -350,7 +350,7 @@ public async Task AddiSubmissionWizard(AddiSubmissionWizard model, var result = await _clientHelper.CallAPI("/v1/tasks", test); - return RedirectToAction("GetProject", "Project", new { id = model.ProjectId }); + return Ok(); } catch (Exception e) { diff --git a/src/DARE-FrontEnd/Views/Project/GetProject.cshtml b/src/DARE-FrontEnd/Views/Project/GetProject.cshtml index cb38bacf7..32db89b12 100644 --- a/src/DARE-FrontEnd/Views/Project/GetProject.cshtml +++ b/src/DARE-FrontEnd/Views/Project/GetProject.cshtml @@ -114,17 +114,17 @@ {
- + - Submit with Crate Submission Wizard + Submit with Crate Submission Wizard - + - Submit with SQL TES Wizard + Submit with SQL TES Wizard - + Submit with GraphQL TES Wizard diff --git a/src/DARE-FrontEnd/Views/Project/SubmissionProjectCrate.cshtml b/src/DARE-FrontEnd/Views/Project/SubmissionProjectCrate.cshtml new file mode 100644 index 000000000..5cbe7f19a --- /dev/null +++ b/src/DARE-FrontEnd/Views/Project/SubmissionProjectCrate.cshtml @@ -0,0 +1,13 @@ +@using BL.Models.ViewModels +@model BL.Models.ViewModels.ProjectUserTre +@{ + string pageName = Model.Name; + + ViewData["Title"] = @pageName; + int pId = Model.Id; +} + +@if (ViewBag.UserCanDoSubmissions) +{ + @await Component.InvokeAsync("SubmissionWizerd", new {projectId=pId}) +} \ No newline at end of file diff --git a/src/DARE-FrontEnd/Views/Project/SubmissionProjectGraphQL.cshtml b/src/DARE-FrontEnd/Views/Project/SubmissionProjectGraphQL.cshtml new file mode 100644 index 000000000..fb4831234 --- /dev/null +++ b/src/DARE-FrontEnd/Views/Project/SubmissionProjectGraphQL.cshtml @@ -0,0 +1,13 @@ +@using BL.Models.ViewModels +@model BL.Models.ViewModels.ProjectUserTre +@{ + string pageName = Model.Name; + + ViewData["Title"] = @pageName; + int pId = Model.Id; +} + +@if (ViewBag.UserCanDoSubmissions) +{ + @await Component.InvokeAsync("SubmissionWizardRawGraphQL", new {projectId=pId}) +} \ No newline at end of file diff --git a/src/DARE-FrontEnd/Views/Project/SubmissionProjectSQL.cshtml b/src/DARE-FrontEnd/Views/Project/SubmissionProjectSQL.cshtml new file mode 100644 index 000000000..5b2298a19 --- /dev/null +++ b/src/DARE-FrontEnd/Views/Project/SubmissionProjectSQL.cshtml @@ -0,0 +1,13 @@ +@using BL.Models.ViewModels +@model BL.Models.ViewModels.ProjectUserTre +@{ + string pageName = Model.Name; + + ViewData["Title"] = @pageName; + int pId = Model.Id; +} + +@if (ViewBag.UserCanDoSubmissions) +{ + @await Component.InvokeAsync("SubmissionWizardRaw", new {projectId=pId}) +} \ No newline at end of file diff --git a/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRaw/Default.cshtml b/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRaw/Default.cshtml index e0e6187ed..f1fbd264a 100644 --- a/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRaw/Default.cshtml +++ b/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRaw/Default.cshtml @@ -63,6 +63,7 @@ Image + Command Environment Variables @@ -117,7 +118,7 @@
- +
} diff --git a/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRawGraphQL/Default.cshtml b/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRawGraphQL/Default.cshtml index d863cf289..af75aab75 100644 --- a/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRawGraphQL/Default.cshtml +++ b/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizardRawGraphQL/Default.cshtml @@ -64,6 +64,7 @@ Image Command + Environment Variabl @@ -117,7 +118,7 @@
- +
} diff --git a/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizerd/Default.cshtml b/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizerd/Default.cshtml index fd18c23c2..545162b55 100644 --- a/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizerd/Default.cshtml +++ b/src/DARE-FrontEnd/Views/Shared/Components/SubmissionWizerd/Default.cshtml @@ -6,7 +6,7 @@ } -@using (Html.BeginForm("SubmissionWizard", "Submission", FormMethod.Post, new { enctype = "multipart/form-data", id = "frmMain" })) +@using (Html.BeginForm("GetAllProjects", "Project", FormMethod.Post, new { enctype = "multipart/form-data", id = "frmMain" })) { @Html.HiddenFor(x => x.ProjectId) { @@ -100,7 +100,7 @@
- +
} diff --git a/src/DARE-FrontEnd/Views/Shared/_Layout.cshtml b/src/DARE-FrontEnd/Views/Shared/_Layout.cshtml index 43255a67b..3e6d33f14 100644 --- a/src/DARE-FrontEnd/Views/Shared/_Layout.cshtml +++ b/src/DARE-FrontEnd/Views/Shared/_Layout.cshtml @@ -541,7 +541,7 @@ contentType: false, processData: false, success: function (result) { - location.reload(); + window.location.href = "/Project/GetProject/" + this.data.get("ProjectId"); console.log(result); }, error: function (error) { @@ -621,7 +621,7 @@ contentType: false, processData: false, success: function (result) { - location.reload(); + window.location.href = "/Project/GetProject/" + this.data.get("ProjectId"); console.log(result); }, error: function (error) {