Skip to content
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
26 changes: 0 additions & 26 deletions app/Http/Controllers/EditProjectController.php

This file was deleted.

2 changes: 2 additions & 0 deletions app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ public function apiCreateProject(): JsonResponse

$response['ldap_enabled'] = config('cdash.ldap_enabled');

$response['deprecated'] = 'This endpoint will be removed in the next major version of CDash.';

$pageTimer->end($response);
return response()->json(cast_data_for_JSON($response));
}
Expand Down
24 changes: 24 additions & 0 deletions app/Http/Controllers/ProjectSettingsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Http\Controllers;

use App\Models\Project;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use Illuminate\View\View;

final class ProjectSettingsController extends AbstractProjectController
{
public function __invoke(Request $request, int $project_id): View
{
$this->setProjectById($project_id);

$project = Project::find($project_id);
Gate::authorize('update', $project);

return $this->vue('project-settings-page', 'Project Settings', [
'project-id' => $project_id,
'ldap-enabled' => (bool) config('cdash.ldap_enabled'),
]);
}
}
15 changes: 15 additions & 0 deletions app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @property int $autoremovetimeframe
* @property int $autoremovemaxbuilds
* @property int $uploadquota Maximum sum of uploaded file sizes (in bytes)
* @property int $uploadquotagb Maximum sum of uploaded file sizes (in GiB)
* @property bool $showcoveragecode
* @property bool $sharelabelfilters
* @property bool $authenticatesubmissions
Expand Down Expand Up @@ -89,6 +90,7 @@ class Project extends Model
'autoremovetimeframe',
'autoremovemaxbuilds',
'uploadquota',
'uploadquotagb',
'showcoveragecode',
'sharelabelfilters',
'authenticatesubmissions',
Expand Down Expand Up @@ -137,6 +139,19 @@ protected function logoUrl(): Attribute
);
}

/**
* @return Attribute<int,int>
*/
protected function uploadquotagb(): Attribute
{
return Attribute::make(
get: fn (mixed $value, array $attributes): int => (int) ((int) $attributes['uploadquota'] / (2 ** 30)),
set: fn (int $value): array => [
'uploadquota' => $value * (2 ** 30),
]
);
}

/**
* Get the users who have been added to this project. Note that this selects users with all roles.
*
Expand Down
4 changes: 2 additions & 2 deletions app/cdash/public/subscribeProject.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<td><font color="#900000">*This project has not been configured to send emails.
<xsl:choose>
<xsl:when test="/cdash/role>1"><a>
<xsl:attribute name="href">project/<xsl:value-of select="/cdash/project/id"/>/edit#Email</xsl:attribute>Change the project settings.
<xsl:attribute name="href">project/<xsl:value-of select="/cdash/project/id"/>/settings#Email</xsl:attribute>Change the project settings.
</a></xsl:when>
<xsl:otherwise> Contact the project administrator.</xsl:otherwise>
</xsl:choose>
Expand Down Expand Up @@ -135,7 +135,7 @@
<td><font color="#900000">*This project has not been configured to send emails.
<xsl:choose>
<xsl:when test="/cdash/role>1"><a>
<xsl:attribute name="href">project/<xsl:value-of select="/cdash/project/id"/>/edit#Email</xsl:attribute>Change the project settings.
<xsl:attribute name="href">project/<xsl:value-of select="/cdash/project/id"/>/settings#Email</xsl:attribute>Change the project settings.
</a></xsl:when>
<xsl:otherwise> Contact the project administrator.</xsl:otherwise>
</xsl:choose>
Expand Down
2 changes: 2 additions & 0 deletions app/cdash/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ add_browser_test(/Browser/Pages/BuildSummaryPageTest)

add_browser_test(/Browser/Pages/BuildSidebarComponentTest)

add_browser_test(/Browser/Pages/ProjectSettingsPageTest)

add_php_test(image)
set_tests_properties(image PROPERTIES DEPENDS /CDash/XmlHandler/UpdateHandler)

Expand Down
4 changes: 2 additions & 2 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ type Project {
"""
Uploaded files exceeding this limit (in GB) will be deleted from oldest to newest.
"""
fileUploadLimit: Int! @rename(attribute: "uploadquota")
fileUploadLimit: Int! @rename(attribute: "uploadquotagb")

"""
Enable/Disable the display of source code for the project. Only administrators can see the source
Expand Down Expand Up @@ -478,7 +478,7 @@ input UpdateProjectInput @validator {

autoRemoveMaxBuilds: Int @rename(attribute: "autoremovemaxbuilds")

fileUploadLimit: Int @rename(attribute: "uploadquota")
fileUploadLimit: Int @rename(attribute: "uploadquotagb")

showCoverageCode: Boolean @rename(attribute: "showcoveragecode")

Expand Down
38 changes: 37 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6138,7 +6138,7 @@ parameters:
-
rawMessage: Cannot cast mixed to int.
identifier: cast.int
count: 1
count: 2
path: app/Models/Project.php

-
Expand Down Expand Up @@ -26478,6 +26478,42 @@ parameters:
count: 1
path: tests/Browser/Pages/ProjectMembersPageTest.php

-
rawMessage: 'Only booleans are allowed in a ternary operator condition, mixed given.'
identifier: ternary.condNotBoolean
count: 2
path: tests/Browser/Pages/ProjectSettingsPageTest.php

-
rawMessage: 'Parameter #2 $value of method Laravel\Dusk\Browser::assertRadioSelected() expects string, mixed given.'
identifier: argument.type
count: 1
path: tests/Browser/Pages/ProjectSettingsPageTest.php

-
rawMessage: 'Parameter #2 $value of method Laravel\Dusk\Browser::assertValue() expects string, mixed given.'
identifier: argument.type
count: 1
path: tests/Browser/Pages/ProjectSettingsPageTest.php

-
rawMessage: 'Parameter #2 $value of method Laravel\Dusk\Browser::radio() expects string, mixed given.'
identifier: argument.type
count: 1
path: tests/Browser/Pages/ProjectSettingsPageTest.php

-
rawMessage: 'Parameter #2 $value of method Laravel\Dusk\Browser::select() expects array|string|null, mixed given.'
identifier: argument.type
count: 1
path: tests/Browser/Pages/ProjectSettingsPageTest.php

-
rawMessage: 'Parameter #2 $value of method Laravel\Dusk\Browser::type() expects string, mixed given.'
identifier: argument.type
count: 1
path: tests/Browser/Pages/ProjectSettingsPageTest.php

-
rawMessage: 'You should use assertSame() instead of assertEquals(), because both values are scalars of the same type'
identifier: phpunit.assertEquals
Expand Down
2 changes: 1 addition & 1 deletion resources/js/vue/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const app = Vue.createApp({
BuildNotesPage: Vue.defineAsyncComponent(() => import('./components/BuildNotesPage.vue')),
BuildSummary: Vue.defineAsyncComponent(() => import('./components/BuildSummary')),
BuildUpdate: Vue.defineAsyncComponent(() => import('./components/BuildUpdate')),
EditProject: Vue.defineAsyncComponent(() => import('./components/EditProject')),
UserHomepage: Vue.defineAsyncComponent(() => import('./components/UserHomepage')),
ManageAuthTokens: Vue.defineAsyncComponent(() => import('./components/ManageAuthTokens.vue')),
ManageMeasurements: Vue.defineAsyncComponent(() => import('./components/ManageMeasurements')),
Expand All @@ -37,6 +36,7 @@ const app = Vue.createApp({
BuildCoveragePage: Vue.defineAsyncComponent(() => import('./components/BuildCoveragePage.vue')),
CreateProjectPage: Vue.defineAsyncComponent(() => import('./components/CreateProjectPage.vue')),
AdministrationPage: Vue.defineAsyncComponent(() => import('./components/AdministrationPage.vue')),
ProjectSettingsPage: Vue.defineAsyncComponent(() => import('./components/ProjectSettingsPage.vue')),
},
});

Expand Down
2 changes: 1 addition & 1 deletion resources/js/vue/components/CreateProjectPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default {
});

if (response.data.createProject) {
window.location.href = `${this.$baseURL}/projects/${response.data.createProject.id}/edit`;
window.location.href = `${this.$baseURL}/projects/${response.data.createProject.id}/settings`;
}
}
catch (error) {
Expand Down
Loading
Loading