Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit57bc338

Browse files
authored
Merge branch 'main' into mafredri/feat-shutdown-script
2 parentsf51eab5 +136f23f commit57bc338

File tree

32 files changed

+1403
-491
lines changed

32 files changed

+1403
-491
lines changed

‎cli/testdata/coder_--help.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Workspace Commands:
4545
ssh Start a shell into a workspace
4646
start Start a workspace
4747
stop Stop a workspace
48-
updateUpdate aworkspace
48+
updateWill update and start a givenworkspace if it is out of date.
4949

5050
Flags:
5151
--global-config coder Path to the global coder config directory.

‎cli/testdata/coder_update_--help.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Update aworkspace
1+
Will update and start a givenworkspace if it is out of date. Use --always-prompt to change the parameter values of the workspace.
22

33
Usage:
44
coder update <workspace> [flags]

‎cli/update.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ func update() *cobra.Command {
2020
Annotations:workspaceCommand,
2121
Use:"update <workspace>",
2222
Args:cobra.ExactArgs(1),
23-
Short:"Update a workspace",
23+
Short:"Will update and start a given workspace if it is out of date.",
24+
Long:"Will update and start a given workspace if it is out of date. Use --always-prompt to change "+
25+
"the parameter values of the workspace.",
2426
RunE:func(cmd*cobra.Command,args []string)error {
2527
client,err:=CreateClient(cmd)
2628
iferr!=nil {
@@ -68,7 +70,7 @@ func update() *cobra.Command {
6870

6971
build,err:=client.CreateWorkspaceBuild(cmd.Context(),workspace.ID, codersdk.CreateWorkspaceBuildRequest{
7072
TemplateVersionID:template.ActiveVersionID,
71-
Transition:workspace.LatestBuild.Transition,
73+
Transition:codersdk.WorkspaceTransitionStart,
7274
ParameterValues:buildParams.parameters,
7375
RichParameterValues:buildParams.richParameters,
7476
})

‎docs/cli.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ coder [flags]
5050
|[<code>stop</code>](./cli/coder_stop)| Stop a workspace|
5151
|[<code>templates</code>](./cli/coder_templates)| Manage templates|
5252
|[<code>tokens</code>](./cli/coder_tokens)| Manage personal access tokens|
53-
|[<code>update</code>](./cli/coder_update)|Update a workspace|
53+
|[<code>update</code>](./cli/coder_update)|Will update and start a given workspace if it is out of date.|
5454
|[<code>users</code>](./cli/coder_users)| Manage users|
5555
|[<code>version</code>](./cli/coder_version)| Show coder version|

‎docs/cli/coder_update.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#coder update
44

5-
Update aworkspace
5+
Will update and start a givenworkspace if it is out of date. Use --always-prompt to change the parameter values of the workspace.
66

77
##Usage
88

‎site/jest.setup.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,30 @@ import { server } from "./src/testHelpers/server"
55
import"jest-location-mock"
66
import{TextEncoder,TextDecoder}from"util"
77
import{Blob}from"buffer"
8+
import{fetch,Request,Response,Headers}from"@remix-run/web-fetch"
89

910
global.TextEncoder=TextEncoder
1011
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Polyfill for jsdom
1112
global.TextDecoder=TextDecoderasany
1213
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Polyfill for jsdom
1314
global.Blob=Blobasany
1415

16+
// From REMIX https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/__tests__/setup.ts
17+
if(!global.fetch){
18+
// Built-in lib.dom.d.ts expects `fetch(Request | string, ...)` but the web
19+
// fetch API allows a URL so@remix-run/web-fetch defines
20+
// `fetch(string | URL | Request, ...)`
21+
//@ts-expect-error -- Polyfill for jsdom
22+
global.fetch=fetch
23+
// Same as above, lib.dom.d.ts doesn't allow a URL to the Request constructor
24+
//@ts-expect-error -- Polyfill for jsdom
25+
global.Request=Request
26+
// web-std/fetch Response does not currently implement Response.error()
27+
//@ts-expect-error -- Polyfill for jsdom
28+
global.Response=Response
29+
global.Headers=Headers
30+
}
31+
1532
// Polyfill the getRandomValues that is used on utils/random.ts
1633
Object.defineProperty(global.self,"crypto",{
1734
value:{

‎site/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@material-ui/icons":"4.5.1",
3737
"@material-ui/lab":"4.0.0-alpha.42",
3838
"@monaco-editor/react":"4.4.6",
39+
"@remix-run/web-fetch":"4.3.2",
3940
"@tanstack/react-query":"4.22.4",
4041
"@testing-library/react-hooks":"8.0.1",
4142
"@types/color-convert":"2.0.0",

‎site/src/components/Dialogs/ConfirmDialog/ConfirmDialog.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ const useStyles = makeStyles((theme) => ({
8787
color:theme.palette.text.primary,
8888
},
8989

90-
"& p":{
90+
"& p:not(.MuiFormHelperText-root)":{
91+
margin:0,
92+
},
93+
94+
"& > p":{
9195
margin:theme.spacing(1,0),
9296
},
9397
},

‎site/src/components/RequireAuth/RequireAuth.test.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import{screen}from"@testing-library/react"
22
import{rest}from"msw"
3-
import{Route}from"react-router-dom"
43
import{renderWithAuth}from"testHelpers/renderHelpers"
54
import{server}from"testHelpers/server"
65

@@ -20,7 +19,12 @@ describe("RequireAuth", () => {
2019
)
2120

2221
renderWithAuth(<h1>Test</h1>,{
23-
routes:<Routepath="setup"element={<h1>Setup</h1>}/>,
22+
nonAuthenticatedRoutes:[
23+
{
24+
path:"setup",
25+
element:<h1>Setup</h1>,
26+
},
27+
],
2428
})
2529

2630
awaitscreen.findByText("Setup")

‎site/src/components/TemplateLayout/TemplateLayout.tsx‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Permissions } from "xServices/auth/authXService"
1414
import{Loader}from"components/Loader/Loader"
1515
import{usePermissions}from"hooks/usePermissions"
1616
import{TemplatePageHeader}from"./TemplatePageHeader"
17+
import{AlertBanner}from"components/AlertBanner/AlertBanner"
1718

1819
constuseTemplateName=()=>{
1920
const{ template}=useParams()
@@ -57,9 +58,21 @@ export const TemplateLayout: FC<{ children?: JSX.Element }> = ({
5758
organizationId,
5859
},
5960
})
60-
const{ template,permissions:templatePermissions}=templateState.context
61+
const{
62+
template,
63+
permissions:templatePermissions,
64+
getTemplateError,
65+
}=templateState.context
6166
constpermissions=usePermissions()
6267

68+
if(getTemplateError){
69+
return(
70+
<divclassName={styles.error}>
71+
<AlertBannerseverity="error"error={getTemplateError}/>
72+
</div>
73+
)
74+
}
75+
6376
if(!template||!templatePermissions){
6477
return<Loader/>
6578
}
@@ -117,6 +130,9 @@ export const TemplateLayout: FC<{ children?: JSX.Element }> = ({
117130

118131
exportconstuseStyles=makeStyles((theme)=>{
119132
return{
133+
error:{
134+
margin:theme.spacing(2),
135+
},
120136
tabs:{
121137
borderBottom:`1px solid${theme.palette.divider}`,
122138
marginBottom:theme.spacing(5),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp