Skip to content

Commit

Permalink
Migrate the SubProject Dependencies page to Vue (#1882)
Browse files Browse the repository at this point in the history
This PR continues our ongoing effort to migrate from AngularJS to Vue.
  • Loading branch information
sbelsk authored Jan 2, 2024
1 parent e57ca31 commit d044148
Show file tree
Hide file tree
Showing 15 changed files with 673 additions and 438 deletions.
19 changes: 12 additions & 7 deletions app/Http/Controllers/SubProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Utils\PageTimer;
use CDash\Model\SubProject;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
Expand Down Expand Up @@ -108,12 +108,13 @@ public function apiManageSubProject(): JsonResponse
return response()->json(cast_data_for_JSON($response));
}

public function dependenciesGraph(): View|RedirectResponse
public function dependenciesGraph(Request $request, string $project): View
{
$this->setProjectByName($_GET['project'] ?? '');
$this->setProjectByName($project);

return view('project.subproject-dependencies')
->with('project', $this->project);
return $this->view('project.subproject-dependencies')->with([
'date' => $request->string('date'),
]);
}

public function apiViewSubProjects(): JsonResponse
Expand Down Expand Up @@ -169,6 +170,7 @@ public function apiViewSubProjects(): JsonResponse
$linkparams .= "&date=$date";
}
$response['linkparams'] = $linkparams;
$response['linkdate'] = $date;

// Menu definition
$menu_response = [];
Expand Down Expand Up @@ -284,7 +286,7 @@ public function apiViewSubProjects(): JsonResponse
return response()->json(cast_data_for_JSON($response));
}

public function ajaxDependenciesGraph(): JsonResponse
public function apiDependenciesGraph(): JsonResponse
{
$this->setProjectByName(htmlspecialchars($_GET['project'] ?? ''));

Expand All @@ -304,6 +306,7 @@ public function ajaxDependenciesGraph(): JsonResponse
$subarray = [
'name' => $subproject->name,
'id' => $subproject->id,
'depends' => [],
];

if ($subproject->groupid > 0) {
Expand All @@ -317,6 +320,8 @@ public function ajaxDependenciesGraph(): JsonResponse
}
$result[] = $subarray;
}
return response()->json(cast_data_for_JSON($result));
return response()->json([
'dependencies' => $result,
]);
}
}
113 changes: 0 additions & 113 deletions app/cdash/public/css/d3.dependencyedgebundling.css

This file was deleted.

196 changes: 0 additions & 196 deletions app/cdash/public/js/d3.dependencyedgebundling.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/cdash/public/views/viewSubProjects.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ <h3>Project</h3>

<br/>

<a ng-href="viewSubProjectDependenciesGraph.php?{{cdash.linkparams}}">
<a ng-href="projects/{{cdash.projectname_encoded}}/subprojects/dependencies{{cdash.linkdate ? '?'+cdash.linkdate : ''}}">
[SubProject Dependencies]
</a>
1 change: 1 addition & 0 deletions app/cdash/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ add_php_test(redundanttests)
add_php_test(configureappend)
add_php_test(notesparsererrormessages)
add_php_test(viewsubprojectslinkoption)
add_laravel_test(/Feature/SubProjectDependencies)

add_subdirectory(ctest)

Expand Down
1 change: 1 addition & 0 deletions app/cdash/tests/js/e2e_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function(add_protractor_test test_name)
endfunction()

add_cypress_test(manage-overview)
add_cypress_test(sub-project-dependencies)
add_protractor_test(manageBuildGroup)
add_protractor_test(manageSubProject)
add_protractor_test(viewBuildError)
Expand Down
Loading

0 comments on commit d044148

Please sign in to comment.