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

Commit08d1c34

Browse files
committed
address CR comments
1 parent158dd56 commit08d1c34

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

‎site/src/components/Resources/Resources.tsx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -131,27 +131,24 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
131131
{agent.name}
132132
<spanclassName={styles.operatingSystem}>{agent.operating_system}</span>
133133
</TableCell>
134-
{canUpdateWorkspace&&(
134+
{canUpdateWorkspace&&agent.status==="connected"&&(
135135
<TableCell>
136136
<Stack>
137-
{agent.status==="connected"&&(
138-
<TerminalLink
139-
className={styles.accessLink}
140-
workspaceName={workspace.name}
141-
agentName={agent.name}
137+
<TerminalLink
138+
className={styles.accessLink}
139+
workspaceName={workspace.name}
140+
agentName={agent.name}
141+
userName={workspace.owner_name}
142+
/>
143+
{agent.apps.map((app)=>(
144+
<AppLink
145+
key={app.name}
146+
appIcon={app.icon}
147+
appName={app.name}
142148
userName={workspace.owner_name}
149+
workspaceName={workspace.name}
143150
/>
144-
)}
145-
{agent.status==="connected"&&
146-
agent.apps.map((app)=>(
147-
<AppLink
148-
key={app.name}
149-
appIcon={app.icon}
150-
appName={app.name}
151-
userName={workspace.owner_name}
152-
workspaceName={workspace.name}
153-
/>
154-
))}
151+
))}
155152
</Stack>
156153
</TableCell>
157154
)}

‎site/src/pages/WorkspacePage/WorkspacePage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ export const WorkspacePage: React.FC = () => {
2121
constxServices=useContext(XServiceContext)
2222
constme=useSelector(xServices.authXService,selectUser)
2323

24-
const[workspaceState,workspaceSend]=useMachine(workspaceMachine.withContext({userId:me?.id}))
24+
const[workspaceState,workspaceSend]=useMachine(
25+
workspaceMachine.withContext({
26+
...workspaceMachine.initialState.context,
27+
userId:me?.id,
28+
}),
29+
)
2530
const{ workspace, resources, getWorkspaceError, getResourcesError, builds, permissions}=workspaceState.context
2631

2732
constcanUpdateWorkspace=!!permissions?.updateWorkspace

‎site/src/xServices/workspace/workspaceXService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ export interface WorkspaceContext {
2828
// error creating a new WorkspaceBuild
2929
buildError?:Error|unknown
3030
// these are separate from getX errors because they don't make the page unusable
31-
refreshWorkspaceError?:Error|unknown
32-
refreshTemplateError?:Error|unknown
33-
getResourcesError?:Error|unknown
31+
refreshWorkspaceError:Error|unknown
32+
refreshTemplateError:Error|unknown
33+
getResourcesError:Error|unknown
3434
// Builds
3535
builds?:TypesGen.WorkspaceBuild[]
3636
getBuildsError?:Error|unknown
3737
loadMoreBuildsError?:Error|unknown
38-
cancellationMessage?:string
38+
cancellationMessage:string
3939
// permissions
4040
permissions?:Permissions
4141
checkPermissionsError?:Error|unknown
@@ -411,7 +411,7 @@ export const workspaceMachine = createMachine(
411411
cancellationMessage:undefined,
412412
}),
413413
displayCancellationError:(context)=>{
414-
displayError(context.cancellationMessage||"Cancellation failed")
414+
displayError(context.cancellationMessage)
415415
},
416416
assignRefreshWorkspaceError:(_,event)=>
417417
assign({

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp