Skip to content

refactor: Improve the load state for the list pages #1428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 13, 2022
Prev Previous commit
Next Next commit
Add total label
  • Loading branch information
BrunoQuaresma committed May 12, 2022
commit e1e6d9d76886b345e13f6db4b3524c03a244418c
3 changes: 2 additions & 1 deletion site/src/pages/TemplatesPages/TemplatesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const Language = {
nameLabel: "Name",
emptyMessage: "No templates have been created yet",
emptyDescription: "Run the following command to get started:",
totalLabel: "total",
}

export const TemplatesPage: React.FC = () => {
Expand All @@ -34,7 +35,7 @@ export const TemplatesPage: React.FC = () => {
orgs ? `/api/v2/organizations/${orgs[0].id}/templates` : null,
)
const isLoading = !templates || !orgs
const subTitle = templates ? `${templates.length} total` : undefined
const subTitle = templates ? `${templates.length} ${Language.totalLabel}` : undefined
const hasError = orgsError || error
// Create a dictionary of organization ID -> organization Name
// Needed to properly construct links to dive into a template
Expand Down