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

Commit1a587df

Browse files
committed
fix workspaces updated myorg endpoint
1 parentf9128ea commit1a587df

File tree

7 files changed

+24
-15
lines changed

7 files changed

+24
-15
lines changed

‎client/packages/lowcoder/src/api/userApi.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ export type GetCurrentUserResponse = GenericApiResponse<CurrentUser>;
6363
exportinterfaceGetMyOrgsResponseextendsApiResponse{
6464
data:{
6565
data:Array<{
66-
orgId:string;
67-
orgName:string;
68-
createdAt?:number;
69-
updatedAt?:number;
66+
isCurrentOrg:boolean;
67+
orgView:{
68+
orgId:string;
69+
orgName:string;
70+
createdAt?:number;
71+
updatedAt?:number;
72+
};
7073
}>;
7174
pageNum:number;
7275
pageSize:number;

‎client/packages/lowcoder/src/constants/orgConstants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export type Org = {
5656
createTime?:string;
5757
createdAt?:number;
5858
updatedAt?:number;
59+
isCurrentOrg?:boolean;
5960
};
6061

6162
exporttypeOrgAndRole={

‎client/packages/lowcoder/src/pages/common/WorkspaceSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ export default function WorkspaceSectionComponent({
242242
displayWorkspaces.map((org:Org)=>(
243243
<WorkspaceItem
244244
key={org.id}
245-
$isActive={user.currentOrgId===org.id}
245+
$isActive={org.isCurrentOrg}
246246
onClick={()=>handleOrgSwitch(org.id)}
247247
>
248248
<WorkspaceNametitle={org.name}>{org.name}</WorkspaceName>
249-
{user.currentOrgId===org.id&&<ActiveIcon/>}
249+
{org.isCurrentOrg&&<ActiveIcon/>}
250250
</WorkspaceItem>
251251
))
252252
) :(

‎client/packages/lowcoder/src/pages/setting/organization/orgList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function OrganizationSetting() {
262262
dataIndex:"orgName",
263263
ellipsis:true,
264264
render:(_,record:any)=>{
265-
constisActiveOrg=record.id===user.currentOrgId;
265+
constisActiveOrg=record.isCurrentOrg;
266266
return(
267267
<OrgName>
268268
<StyledOrgLogosource={record.logoUrl}orgName={record.orgName}/>

‎client/packages/lowcoder/src/redux/reducers/uiReducers/usersReducer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const initialState: UsersReduxState = {
2525
workspaces:{
2626
items:[],
2727
totalCount:0,
28+
currentOrg:null
29+
2830
}
2931
};
3032

@@ -231,6 +233,7 @@ export interface UsersReduxState {
231233
workspaces:{
232234
items:Org[];// Current page of workspaces
233235
totalCount:number;// Total workspaces available
236+
currentOrg:Org|null;
234237
};
235238
}
236239

‎client/packages/lowcoder/src/redux/sagas/orgSagas.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,11 @@ export function* fetchWorkspacesSaga(action: ReduxAction<{page: number, pageSize
368368

369369
// Transform orgId/orgName to match Org interface
370370
consttransformedItems=apiData.data.map(item=>({
371-
id:item.orgId,
372-
name:item.orgName,
373-
createdAt:item.createdAt,
374-
updatedAt:item.updatedAt,
371+
id:item.orgView.orgId,
372+
name:item.orgView.orgName,
373+
createdAt:item.orgView.createdAt,
374+
updatedAt:item.orgView.updatedAt,
375+
isCurrentOrg:item.isCurrentOrg,
375376
}));
376377

377378
yieldput({

‎client/packages/lowcoder/src/util/useWorkspaceManager.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ export function useWorkspaceManager({
9191
if(response.data.success){
9292
constapiData=response.data.data;
9393
consttransformedItems=apiData.data.map(item=>({
94-
id:item.orgId,
95-
name:item.orgName,
96-
createdAt:item.createdAt,
97-
updatedAt:item.updatedAt,
94+
id:item.orgView.orgId,
95+
name:item.orgView.orgName,
96+
createdAt:item.orgView.createdAt,
97+
updatedAt:item.orgView.updatedAt,
98+
isCurrentOrg:item.isCurrentOrg,
9899
}));
99100

100101
dispatch({

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp