Skip to content

Commit 28228f1

Browse files
authored
feat: allow editing org icon (#13547)
1 parent 58bf0ec commit 28228f1

File tree

19 files changed

+116
-22
lines changed

19 files changed

+116
-22
lines changed

clock/mock.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package clock
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76
"slices"
87
"sync"
98
"testing"
109
"time"
10+
11+
"golang.org/x/xerrors"
1112
)
1213

1314
// Mock is the testing implementation of Clock. It tracks a time that monotonically increases
@@ -571,7 +572,7 @@ func (t *Trap) Close() {
571572
close(t.done)
572573
}
573574

574-
var ErrTrapClosed = errors.New("trap closed")
575+
var ErrTrapClosed = xerrors.New("trap closed")
575576

576577
func (t *Trap) Wait(ctx context.Context) (*Call, error) {
577578
select {

coderd/apidoc/docs.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbgen/dbgen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ func Organization(t testing.TB, db database.Store, orig database.Organization) d
338338
Name: takeFirst(orig.Name, namesgenerator.GetRandomName(1)),
339339
DisplayName: takeFirst(orig.Name, namesgenerator.GetRandomName(1)),
340340
Description: takeFirst(orig.Description, namesgenerator.GetRandomName(1)),
341+
Icon: takeFirst(orig.Icon, ""),
341342
CreatedAt: takeFirst(orig.CreatedAt, dbtime.Now()),
342343
UpdatedAt: takeFirst(orig.UpdatedAt, dbtime.Now()),
343344
})

coderd/database/dbmem/dbmem.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func New() database.Store {
8888
Name: "first-organization",
8989
DisplayName: "first-organization",
9090
Description: "Builtin default organization.",
91+
Icon: "",
9192
CreatedAt: dbtime.Now(),
9293
UpdatedAt: dbtime.Now(),
9394
})
@@ -6189,6 +6190,7 @@ func (q *FakeQuerier) InsertOrganization(_ context.Context, arg database.InsertO
61896190
Name: arg.Name,
61906191
DisplayName: arg.DisplayName,
61916192
Description: arg.Description,
6193+
Icon: arg.Icon,
61926194
CreatedAt: arg.CreatedAt,
61936195
UpdatedAt: arg.UpdatedAt,
61946196
IsDefault: len(q.organizations) == 0,
@@ -7334,6 +7336,7 @@ func (q *FakeQuerier) UpdateOrganization(_ context.Context, arg database.UpdateO
73347336
org.Name = arg.Name
73357337
org.DisplayName = arg.DisplayName
73367338
org.Description = arg.Description
7339+
org.Icon = arg.Icon
73377340
q.organizations[i] = org
73387341
return org, nil
73397342
}

coderd/database/dump.sql

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
alter table organizations
2+
drop column icon;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
alter table organizations
2+
add column icon text not null default '';

coderd/database/models.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 22 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)