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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ unified-ui version it builds into its image.

### Changed

- A project's card (both apps) always has its Credentials row, saying None for a public repository cloned without one, so every card has the same rows; the row and the project page's fact say Credentials, as the item's `credentials:` key now does.
- unified-api project page: its Endpoints are a table (Endpoint, Output, Sources ready, State), like its Sources and Connectors, in place of a list of links.
- unified-api credential page: its Projects are a table (Project, Last pull, State), as its Sources above them and a credential's projects in unified-gitops, in place of a list of links.
- Cron schedules read in words, as intervals do: "daily at 04:15 UTC", "every 4h", "every 2h, at :15", "Mon–Fri at 06:00 UTC", "yearly on 1 Jan at 00:00 UTC", the expression on hover (`formatSchedule` and `Schedule` in `@opusprojects/unified-ui`); on a source's card and page and a project's, where a project on a schedule showed nothing on its card. One too irregular to say plainly is shown as written.
Expand Down
18 changes: 11 additions & 7 deletions packages/ui/src/components/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,20 @@ export function ProjectsPage<T extends ProjectLike>({
<Fact label="Commit">
<Commit gitUrl={project.git_url} revision={project.revision} />
</Fact>
{v.credential && (
<Fact label="Credential">
{/* Always the row, so every card has the same rows: a public
repository is cloned with no credential, said as None. */}
<Fact label="Credentials">
{v.credential ? (
<Link
className={styles.link}
to={`/credentials/${encodeURIComponent(v.credential)}`}
>
{v.credential}
</Link>
</Fact>
)}
) : (
"None"
)}
</Fact>
<Fact label="Last pull">
<LiveAge
seconds={project.sync_health?.last_success_age_seconds}
Expand Down Expand Up @@ -225,8 +229,8 @@ const HINTS = {
Branch: "branch. The branch the checkout follows.",
Commit:
"The commit the checkout is at: what this instance reads now. Each pull moves it to the branch's latest commit; a link opens it when the repository has a web page.",
Credential:
"credential. What the clone and pulls authenticate with, when the repository needs it.",
Credentials:
"credentials. What the clone and pulls authenticate with, when the repository needs it: None for a public one.",
"Last attempt":
"When this project was last pulled, whether it worked or not.",
Schedule:
Expand Down Expand Up @@ -305,7 +309,7 @@ export function ProjectOverview({
<Fact label="Commit" hint={HINTS.Commit}>
<Commit gitUrl={project.git_url} revision={project.revision} />
</Fact>
<Fact label="Credential" hint={HINTS.Credential}>
<Fact label="Credentials" hint={HINTS.Credentials}>
{credential ? (
<Link
className={detail.link}
Expand Down
16 changes: 16 additions & 0 deletions tests/e2e/unified-api/pages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,19 @@ test("each Vault is a row of the Secrets card, with its readers on its page", as
await expect(readerRow).toContainText("infra/d42");
await expect(readerRow.getByRole("link", { name: "cred-d42" })).toBeVisible();
});

// A public repository is cloned with no credentials: its card still has the
// row, saying None, so every project card has the same rows.
test("a project with no credentials says None on its card", async ({
page,
}) => {
await mockApi(page);
await page.goto("/projects");
const card = page.locator("article", {
has: page.getByRole("heading", { name: "prj-inventory" }),
});
const row = card.locator("dl > div", {
has: page.locator("dt", { hasText: "Credentials" }),
});
await expect(row.locator("dd")).toHaveText("None");
});
Loading