Skip to content

chore: edit CLI/UI copy #2247

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 24 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Merge branch 'main' into cli-ui-copyedits
  • Loading branch information
Katie Horne committed Jun 14, 2022
commit d602078b49a7ba4ecd2d27f233c631dd0b79782c
2 changes: 1 addition & 1 deletion coderd/audit/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestDiff(t *testing.T) {
ActiveVersionID: uuid.UUID{3},
MaxTtl: int64(time.Hour),
MinAutostartInterval: int64(time.Minute),
CreatedBy: uuid.NullUUID{UUID: uuid.UUID{4}, Valid: true},
CreatedBy: uuid.UUID{4},
},
exp: audit.Map{
"id": uuid.UUID{1}.String(),
Expand Down
16 changes: 0 additions & 16 deletions coderd/database/databasefake/databasefake.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,22 +647,6 @@ func (q *fakeQuerier) GetWorkspaceBuildByWorkspaceIDAndBuildNumber(_ context.Con
return database.WorkspaceBuild{}, sql.ErrNoRows
}

func (q *fakeQuerier) GetWorkspacesByOrganizationIDs(_ context.Context, req database.GetWorkspacesByOrganizationIDsParams) ([]database.Workspace, error) {
q.mutex.RLock()
defer q.mutex.RUnlock()

for _, workspaceBuild := range q.workspaceBuilds {
if workspaceBuild.WorkspaceID.String() != arg.WorkspaceID.String() {
continue
}
if workspaceBuild.BuildNumber != arg.BuildNumber {
continue
}
return workspaceBuild, nil
}
return database.WorkspaceBuild{}, sql.ErrNoRows
}

func (q *fakeQuerier) GetOrganizations(_ context.Context) ([]database.Organization, error) {
q.mutex.RLock()
defer q.mutex.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/dump.sql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coderd/database/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 13 additions & 52 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 5 additions & 12 deletions coderd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,7 @@ func (api *API) postTemplateByOrganization(rw http.ResponseWriter, r *http.Reque
Description: createTemplate.Description,
MaxTtl: int64(maxTTL),
MinAutostartInterval: int64(minAutostartInterval),
CreatedBy: uuid.NullUUID{
UUID: apiKey.UserID,
Valid: true,
},
CreatedBy: apiKey.UserID,
})
if err != nil {
return xerrors.Errorf("insert template: %s", err)
Expand Down Expand Up @@ -453,15 +450,11 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
func getCreatedByNamesByTemplateIDs(ctx context.Context, db database.Store, templates []database.Template) (map[string]string, error) {
creators := make(map[string]string, len(templates))
for _, template := range templates {
if template.CreatedBy.Valid {
creator, err := db.GetUserByID(ctx, template.CreatedBy.UUID)
if err != nil {
return map[string]string{}, err
}
creators[template.ID.String()] = creator.Username
} else {
creators[template.ID.String()] = ""
creator, err := db.GetUserByID(ctx, template.CreatedBy)
if err != nil {
return map[string]string{}, err
}
creators[template.ID.String()] = creator.Username
}
return creators, nil
}
Expand Down
2 changes: 1 addition & 1 deletion codersdk/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Template struct {
Description string `json:"description"`
MaxTTLMillis int64 `json:"max_ttl_ms"`
MinAutostartIntervalMillis int64 `json:"min_autostart_interval_ms"`
CreatedByID uuid.NullUUID `json:"created_by_id"`
CreatedByID uuid.UUID `json:"created_by_id"`
CreatedByName string `json:"created_by_name"`
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ require (
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.15.0 // indirect
github.com/klauspost/compress v1.15.6
github.com/kr/fs v0.1.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1052,8 +1052,8 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8
github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U=
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY=
github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down
4 changes: 4 additions & 0 deletions site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ export interface Template {
readonly description: string
readonly max_ttl_ms: number
readonly min_autostart_interval_ms: number
<<<<<<< HEAD
readonly created_by_id?: string
=======
readonly created_by_id: string
>>>>>>> main
readonly created_by_name: string
}

Expand Down
7 changes: 7 additions & 0 deletions site/src/components/TemplateStats/TemplateStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const Language = {
userPlural: "users",
userSingular: "user",
createdByLabel: "Created by",
<<<<<<< HEAD
defaultTemplateCreator: "<unknown>",
=======
>>>>>>> main
}

export interface TemplateStatsProps {
Expand Down Expand Up @@ -50,7 +53,11 @@ export const TemplateStats: FC<TemplateStatsProps> = ({ template, activeVersion
<div className={styles.statsDivider} />
<div className={styles.statItem}>
<span className={styles.statsLabel}>{Language.createdByLabel}</span>
<<<<<<< HEAD
<span className={styles.statsValue}>{template.created_by_name || Language.defaultTemplateCreator}</span>
=======
<span className={styles.statsValue}>{template.created_by_name}</span>
>>>>>>> main
</div>
</div>
)
Expand Down
15 changes: 15 additions & 0 deletions site/src/pages/TemplatesPage/TemplatesPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ import {
HelpTooltipLinksGroup,
HelpTooltipText,
HelpTooltipTitle,
<<<<<<< HEAD
} from "../../components/Tooltips/HelpTooltip/HelpTooltip"
=======
} from "../../components/HelpTooltip/HelpTooltip"
import { Margins } from "../../components/Margins/Margins"
import { PageHeader, PageHeaderSubtitle, PageHeaderTitle } from "../../components/PageHeader/PageHeader"
import { Stack } from "../../components/Stack/Stack"
import { TableLoader } from "../../components/TableLoader/TableLoader"
>>>>>>> main

dayjs.extend(relativeTime)

Expand All @@ -50,7 +58,10 @@ export const Language = {
templateTooltipText: "With templates you can create a common configuration for your workspaces using Terraform.",
templateTooltipLink: "Manage templates",
createdByLabel: "Created by",
<<<<<<< HEAD
defaultTemplateCreator: "<unknown>",
=======
>>>>>>> main
}

const TemplateHelpTooltip: React.FC = () => {
Expand Down Expand Up @@ -140,7 +151,11 @@ export const TemplatesPageView: FC<TemplatesPageViewProps> = (props) => {
<TableCell>{Language.developerCount(template.workspace_owner_count)}</TableCell>

<TableCell data-chromatic="ignore">{dayjs().to(dayjs(template.updated_at))}</TableCell>
<<<<<<< HEAD
<TableCell>{template.created_by_name || Language.defaultTemplateCreator}</TableCell>
=======
<TableCell>{template.created_by_name}</TableCell>
>>>>>>> main
<TableCell>
<div className={styles.arrowCell}>
<KeyboardArrowRight className={styles.arrowRight} />
Expand Down
12 changes: 12 additions & 0 deletions site/src/pages/WorkspacesPage/WorkspacesPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ import {
HelpTooltipLinksGroup,
HelpTooltipText,
HelpTooltipTitle,
<<<<<<< HEAD
} from "../../components/Tooltips/HelpTooltip/HelpTooltip"
=======
} from "../../components/HelpTooltip/HelpTooltip"
import { Margins } from "../../components/Margins/Margins"
import { PageHeader, PageHeaderSubtitle, PageHeaderTitle } from "../../components/PageHeader/PageHeader"
import { Stack } from "../../components/Stack/Stack"
import { TableLoader } from "../../components/TableLoader/TableLoader"
>>>>>>> main
import { getFormHelpers, onChangeTrimmed } from "../../util/formUtils"
import { getDisplayStatus, workspaceFilterQuery } from "../../util/workspace"

Expand Down Expand Up @@ -130,6 +138,7 @@ export const WorkspacesPageView: FC<WorkspacesPageViewProps> = ({ loading, works

return (
<Margins>
<<<<<<< HEAD
<PageHeader
actions={
<PageHeaderText>
Expand All @@ -141,6 +150,9 @@ export const WorkspacesPageView: FC<WorkspacesPageViewProps> = ({ loading, works
</PageHeaderText>
}
>
=======
<PageHeader>
>>>>>>> main
<PageHeaderTitle>
<Stack direction="row" spacing={1} alignItems="center">
<span>Workspaces</span>
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.