Skip to content

Commit

Permalink
Migrate user.php frontend from AngularJS to Vue
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjallen committed Sep 13, 2023
1 parent 0a23b52 commit 4ed7ac6
Show file tree
Hide file tree
Showing 22 changed files with 825 additions and 500 deletions.
1 change: 0 additions & 1 deletion app/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ public function upgrade()
@set_time_limit(0);

$xml = begin_XML_for_XSLT();
$xml .= '<backurl>user.php</backurl>';
$xml .= '<menutitle>CDash</menutitle>';
$xml .= '<menusubtitle>Maintenance</menusubtitle>';

Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/CoverageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function manageCoverage(): View|RedirectResponse
}

$xml = begin_XML_for_XSLT();
$xml .= '<backurl>user.php</backurl>';
$xml .= '<menutitle>CDash</menutitle>';
$xml .= '<menusubtitle>Coverage</menusubtitle>';

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ManageMeasurementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function apiGet(): JsonResponse

// Menu
$menu_response = [];
$menu_response['back'] = 'user.php';
$menu_response['back'] = '/user';
$response['menu'] = $menu_response;
$response['hidenav'] = true;

Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/ManageProjectRolesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function viewPage(): View|RedirectResponse
}

$xml = begin_XML_for_XSLT();
$xml .= '<backurl>user.php</backurl>';
$xml .= '<menutitle>CDash</menutitle>';
$xml .= '<menusubtitle>Project Roles</menusubtitle>';

Expand Down Expand Up @@ -493,7 +492,7 @@ private function register_user($projectid, $email, $firstName, $lastName, $repos
// Send the email
$text = 'Hello' . $prefix . $firstName . ",\n\n";
$text .= 'You have been registered to CDash because you have access to the source repository for ' . $projectname . "\n";
$text .= 'To access your CDash account: ' . $currentURI . "/user.php\n";
$text .= 'To access your CDash account: ' . $currentURI . "/user\n";
$text .= 'Your login is: ' . $email . "\n";
$text .= 'Your password is: ' . $pass . "\n\n";
$text .= 'Generated by CDash.';
Expand Down
3 changes: 0 additions & 3 deletions app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public function apiCreateProject(): JsonResponse
get_dashboard_JSON($this->project->GetName(), null, $response);
}
$response['hidenav'] = 1;
$menu =[];
$menu['back'] = 'user.php';
$response['menu'] = $menu;

$nRepositories = 0;
$repositories_response = [];
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public function editSite(): View|RedirectResponse
$userid = Auth::id();

$xml = begin_XML_for_XSLT();
$xml .= '<backurl>user.php</backurl>';
$xml .= '<menutitle>CDash</menutitle>';
$xml .= '<menusubtitle>Claim sites</menusubtitle>';

Expand Down Expand Up @@ -138,7 +137,7 @@ public function editSite(): View|RedirectResponse
DELETE FROM site2user
WHERE siteid=? AND userid=?
', [intval($_GET['siteid']), $userid]);
return redirect('/user.php');
return redirect('/user');
}

if ($updatesite || $geolocation) {
Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/SubProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function apiManageSubProject(): JsonResponse
$pageTimer = new PageTimer();

$response = begin_JSON_response();
$response['backurl'] = 'user.php';
$response['menutitle'] = 'CDash';
$response['menusubtitle'] = 'SubProjects';
$response['title'] = 'Manage SubProjects';
Expand Down
7 changes: 3 additions & 4 deletions app/Http/Controllers/SubscribeProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function subscribeProject(): View|RedirectResponse
$user = Auth::user();

$xml = begin_XML_for_XSLT();
$xml .= '<backurl>user.php</backurl>';
$xml .= '<menutitle>CDash</menutitle>';
$xml .= '<menusubtitle>Subscription</menusubtitle>';

Expand Down Expand Up @@ -111,7 +110,7 @@ public function subscribeProject(): View|RedirectResponse
GROUP BY build.siteid
)
', [$user->id, $user->id]);
return redirect('user.php?note=unsubscribedtoproject');
return redirect('/user?note=unsubscribedtoproject');
} elseif ($UpdateSubscription) {
$emailcategory_update = intval($_POST['emailcategory_update'] ?? 0);
$emailcategory_configure = intval($_POST['emailcategory_configure'] ?? 0);
Expand Down Expand Up @@ -174,7 +173,7 @@ public function subscribeProject(): View|RedirectResponse
$LabelEmail->UpdateLabels(null);
}
// Redirect
return redirect('user.php');
return redirect('/user');
} elseif ($Subscribe) {
$emailcategory_update = intval($_POST['emailcategory_update'] ?? 0);
$emailcategory_configure = intval($_POST['emailcategory_configure'] ?? 0);
Expand Down Expand Up @@ -258,7 +257,7 @@ public function subscribeProject(): View|RedirectResponse
$UserProject->AddCredential($credential);
}
}
return redirect('user.php?note=subscribedtoproject');
return redirect('/user?note=subscribedtoproject');
}

// XML
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ public function edit(): View
{
$xml = begin_XML_for_XSLT();
$xml .= '<title>CDash - My Profile</title>';
$xml .= '<backurl>user.php</backurl>';
$xml .= '<menutitle>CDash</menutitle>';
$xml .= '<menusubtitle>My Profile</menusubtitle>';

Expand Down Expand Up @@ -522,7 +521,7 @@ public function recoverPassword(): View
$password = generate_password(10);

$currentURI = $config->getBaseUrl();
$url = $currentURI . '/user.php';
$url = $currentURI . '/user';

$text = "Hello,\n\n You have asked to recover your password for CDash.\n\n";
$text .= 'Your new password is: ' . $password . "\n";
Expand Down
1 change: 0 additions & 1 deletion app/cdash/public/api/v1/manageBuildGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
$userid = $user->id;

$response = begin_JSON_response();
$response['backurl'] = 'user.php';
$response['menutitle'] = 'CDash';
$response['menusubtitle'] = 'Build Groups';
$response['title'] = 'Build Groups';
Expand Down
1 change: 0 additions & 1 deletion app/cdash/public/api/v1/manageOverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

$pageTimer = new PageTimer();
$response = begin_JSON_response();
$response['backurl'] = 'user.php';
$response['menutitle'] = 'CDash';
$response['menusubtitle'] = 'Overview';
$response['hidenav'] = 1;
Expand Down
4 changes: 0 additions & 4 deletions app/cdash/public/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,6 @@ textarea {
padding: 4px;
}

.bordertop {
border-top: 1px solid black;
}

.missing {background-color: #dfdfdf; }
.tabb tbody tr.odd td.missing,
.striped.tabb tbody tr:nth-child(odd) td.missing {
Expand Down
75 changes: 0 additions & 75 deletions app/cdash/public/js/controllers/user.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/cdash/public/js/oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function oauth2(type) {
var requestedURI = document.URL;
// Don't send the user back to the login page if that's where they came from.
if (requestedURI.indexOf('login') !== -1) {
requestedURI = 'user.php';
requestedURI = 'user';
}
requestedURI = encodeURIComponent(requestedURI);

Expand Down
2 changes: 2 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import BuildNotes from "./components/BuildNotes";
import BuildSummary from "./components/BuildSummary";
import BuildUpdate from "./components/BuildUpdate";
import EditProject from "./components/EditProject";
import UserHomepage from "./components/UserHomepage";
import ManageAuthTokens from "./components/ManageAuthTokens.vue";
import ManageMeasurements from "./components/ManageMeasurements";
import Monitor from "./components/Monitor";
Expand All @@ -25,6 +26,7 @@ const cdash_components = {
BuildSummary,
BuildUpdate,
EditProject,
UserHomepage,
ManageAuthTokens,
ManageMeasurements,
Monitor,
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/EditProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2381,8 +2381,8 @@ export default {
this.$axios
.delete('/api/v1/project.php', { data: parameters})
.then(response => {
// Redirect to user.php
window.location = this.$baseURL + '/user.php';
// Redirect to /user
window.location = this.$baseURL + '/user';
});
}
},
Expand Down
Loading

0 comments on commit 4ed7ac6

Please sign in to comment.