Skip to content

Commit

Permalink
Add reusable build information card (#2543)
Browse files Browse the repository at this point in the history
Most build-specific pages currently display a basic table of information
about that build. For example:

![image](https://github.com/user-attachments/assets/11743b47-d581-41a4-8a48-42d26afb32e6)

This primitive approach uses a significant amount of vertical space,
while wasting most of the horizontal space available at the top of the
page. Additionally, this table does not display site information or
build history information, which means that it is often augmented by UI
elements which take up additional vertical space.

This PR introduces a new reusable "build information card" Vue component
which accepts a build ID and displays a large amount of summary
information about a build and associated site in a collapsible format.

Example of the card in its closed form:

![image](https://github.com/user-attachments/assets/ce207920-b0e8-4329-b503-93db28ff6e3a)

Example of the same card in its open form:

![image](https://github.com/user-attachments/assets/953907e3-1c8a-43f3-b0cf-38524a04f0db)

This PR implements the basic functionality, but there are a few future
improvements to be made, including:
- The horizontal space to the right of the build summary card is
reserved for charts showing the history of the build.
- The horizontal space to the right of the site information card is
reserved for charts showing the time allocation of the site, including
the amount of time spent on the associated project. A map showing the
location of the site (if site locations are enabled) is another future
improvement to be made.

I have added this component to the list of components to be tested via
Cypress component testing once type-safe GraphQL mocking is ready for
use.
  • Loading branch information
williamjallen authored Jan 27, 2025
1 parent 64e37a8 commit 5cb23a0
Show file tree
Hide file tree
Showing 5 changed files with 716 additions and 0 deletions.
3 changes: 3 additions & 0 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,15 @@ type SiteInformation {

numberPhysicalCpus: Int @rename(attribute: "numberphysicalcpus")

"Virtual memory in MiB."
totalVirtualMemory: Int @rename(attribute: "totalvirtualmemory")

"Physical memory in MiB."
totalPhysicalMemory: Int @rename(attribute: "totalphysicalmemory")

logicalProcessorsPerPhysical: Int @rename(attribute: "logicalprocessorsperphysical")

"Clock frequency in MHz."
processorClockFrequency: Int @rename(attribute: "processorclockfrequency")

description: String
Expand Down
1 change: 1 addition & 0 deletions resources/js/vue/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const apolloClient = new ApolloClient({
Build: {
fields: {
tests: relayStylePagination(),
labels: relayStylePagination(),
},
},
Site: {
Expand Down
4 changes: 4 additions & 0 deletions resources/js/vue/components/BuildTestsPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<div class="tw-flex tw-flex-col tw-w-full tw-gap-4">
<BuildSummaryCard :build-id="buildId" />

<filter-builder
filter-type="BuildTestsFiltersMultiFilterInput"
primary-record-name="tests"
Expand Down Expand Up @@ -42,11 +44,13 @@ import DataTable from './shared/DataTable.vue';
import gql from 'graphql-tag';
import FilterBuilder from './shared/FilterBuilder.vue';
import LoadingIndicator from './shared/LoadingIndicator.vue';
import BuildSummaryCard from './shared/BuildSummaryCard.vue';
export default {
name: 'BuildTestsPage',
components: {
BuildSummaryCard,
LoadingIndicator,
FilterBuilder,
DataTable,
Expand Down
Loading

0 comments on commit 5cb23a0

Please sign in to comment.