Skip to content
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

integrate api workspaces #81

Merged
merged 30 commits into from
Aug 1, 2023
Merged

integrate api workspaces #81

merged 30 commits into from
Aug 1, 2023

Conversation

sanglevinh
Copy link
Collaborator

No description provided.

@sanglevinh sanglevinh linked an issue Jul 26, 2023 that may be closed by this pull request
Copy link
Collaborator

@itutu-tienday itutu-tienday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noted the points raised. Please confirm.

frontend/src/pages/Workspace/index.tsx Outdated Show resolved Hide resolved
frontend/src/pages/Workspace/index.tsx Outdated Show resolved Hide resolved
frontend/src/store/slice/Workspace/WorkspaceType.ts Outdated Show resolved Hide resolved
frontend/src/api/Workspace/index.ts Outdated Show resolved Hide resolved
frontend/src/store/slice/Workspace/WorkspaceSlice.ts Outdated Show resolved Hide resolved
studio/app/common/schemas/workspace.py Show resolved Hide resolved
@sanglevinh sanglevinh force-pushed the feature/workspaces branch from ed400d7 to 4dcc382 Compare July 28, 2023 05:12
@itutu-tienday
Copy link
Collaborator

@sanglevinh
The following error seems to be occurring on the API side when displaying the Workspaces screen on the latest branch as of now.

File "/workspace/optinist-for-server/studio/app/common/routers/workspace.py", line 58, in search_workspaces
    ws.__dict__["user"] = db.query(common_model.User).get(ws.user_id)
AttributeError: 'Workspace' object has no attribute 'user_id'

It seems that the above user_id is being removed on the API side in commit 0bec77a, but is the above error occurring in your environment?

@sanglevinh
Copy link
Collaborator Author

sanglevinh commented Jul 28, 2023

@sanglevinh The following error seems to be occurring on the API side when displaying the Workspaces screen on the latest branch as of now.

File "/workspace/optinist-for-server/studio/app/common/routers/workspace.py", line 58, in search_workspaces
    ws.__dict__["user"] = db.query(common_model.User).get(ws.user_id)
AttributeError: 'Workspace' object has no attribute 'user_id'

It seems that the above user_id is being removed on the API side in commit 0bec77a, but is the above error occurring in your environment?

@itutu-tienday

I reverted it
I think it should be fixed in the backend later.

Is this attribute required as API schema?

)
data = paginate(db, query)
for ws in data.items:
Copy link

@ReiHashimoto ReiHashimoto Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quanpython
Could you refactor the models?
(In other PR can be OK)

It seems relationship and FK is not defined in current models.

FYI
https://docs.sqlalchemy.org/en/20/orm/basic_relationships.html#one-to-many

I don't think we have to insert User object into Workspace object like this process.

With relation, we can get User Object from user attribute.

@sanglevinh sanglevinh marked this pull request as ready for review July 31, 2023 07:41
@sanglevinh sanglevinh force-pushed the feature/workspaces branch from 6f77eb4 to 84d7fa9 Compare July 31, 2023 08:49
Copy link

@ReiHashimoto ReiHashimoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend requires refactor( as this comment), but frontend looks fine.

@itutu-tienday itutu-tienday merged commit 3a922d2 into develop-main Aug 1, 2023
@ReiHashimoto ReiHashimoto deleted the feature/workspaces branch August 4, 2023 06:39
sanglevinh pushed a commit that referenced this pull request Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4. Workspaces(基本機能)
4 participants