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

feat: Added account setting screens #4119

Merged
merged 18 commits into from
Aug 10, 2023
Merged

feat: Added account setting screens #4119

merged 18 commits into from
Aug 10, 2023

Conversation

hrishavjha
Copy link
Member

@hrishavjha hrishavjha commented Aug 8, 2023

Proposed changes

  • Added automatic API generation from swagger.json file.
  • Replaced Axios with React-Query for Rest APIs.
  • Added new account setting screens.
  • Fixed few UI issues.

Screenshots for reference

  • Admin User

image

  • Non-Admin Users

image

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

  • Please add the links to the dependent PR need to be merged before this (if any).

Special notes for your reviewer:

chaoscenter/web/config/oats.config.ts Show resolved Hide resolved
chaoscenter/web/config/oats.config.ts Outdated Show resolved Hide resolved
chaoscenter/web/scripts/swagger-custom-generator.js Outdated Show resolved Hide resolved
chaoscenter/web/scripts/swagger-transform.js Outdated Show resolved Hide resolved
chaoscenter/web/src/api/LitmusAPIProvider.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@Saranya-jena Saranya-jena left a comment

Choose a reason for hiding this comment

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

Backend changes look good

return apolloClient ? <ApolloProvider client={apolloClient}>{children}</ApolloProvider> : <></>;
return apolloClient ? (
<QueryClientProvider client={reactQueryClient}>
<ApolloProvider client={apolloClient}>{children}</ApolloProvider>
Copy link
Contributor

Choose a reason for hiding this comment

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

apollo client check should wrap this

services: {
auth: {
url: 'https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/auth/v3.0.0/auth-api.json',
output: 'src/api/auth/index.ts',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
output: 'src/api/auth/index.ts',
output: 'src/api/auth',

Comment on lines 3 to 11
export interface Member {
userID: string;
role: Role;
invitation: string;
joinedAt: string;
}

export interface Project {
id: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

delete this file...these types should be auto generated

@@ -51,7 +32,7 @@ export function AppWithoutAuthentication(): React.ReactElement {
const userDetails = getUserDetails();
return (
<StringsContext.Provider value={{ data: strings as StringsMap }}>
<LitmusAPIProvider config={APIEndpoints} token={userDetails.token}>
<LitmusAPIProvider config={APIEndpoints} token={userDetails.accessToken}>
Copy link
Contributor

Choose a reason for hiding this comment

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

move userDetails.token from getUserDetails to inside LitmusAPIProvider

);
};

export default function MainNav(): React.ReactElement {
const accountScopedPaths = useRouteWithBaseUrl('account');
const { getString } = useStrings();
const userData = useContext(AppStoreContext);
Copy link
Contributor

Choose a reason for hiding this comment

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

use useAppStoreContext instead

@arkajyotiMukherjee arkajyotiMukherjee merged commit aa8e9a3 into litmuschaos:master Aug 10, 2023
11 of 13 checks passed
punithnayak pushed a commit to punithnayak/litmus that referenced this pull request Aug 17, 2023
* feat: Done with new routing setup for account screens and started with account screen implementations

Signed-off-by: Hrishav <[email protected]>

* feat: Added support for React-Query and automatic API generation using swagger file

Signed-off-by: Hrishav <[email protected]>

* chore: Updated createAt swagger issue

Signed-off-by: Hrishav <[email protected]>

* chore: Updated invitation_state

Signed-off-by: Hrishav <[email protected]>

* chore: Updated invitation_state again

Signed-off-by: Hrishav <[email protected]>

* feat: Added swagger API generation and several account setting screens

Signed-off-by: Hrishav <[email protected]>

* feat: Added user interaction modals in settings overview

Signed-off-by: Hrishav <[email protected]>

* feat: Added new automatic API generations and account setting screens

Signed-off-by: Hrishav <[email protected]>

* chore: updated testUtils

Signed-off-by: Hrishav <[email protected]>

* chore: updated testUtils and fixed errors

Signed-off-by: Hrishav <[email protected]>

* chore: Fixed review comments

Signed-off-by: Hrishav <[email protected]>

* chore: updated user search function

Signed-off-by: Hrishav <[email protected]>

* chore: fixed request comments

Signed-off-by: Hrishav <[email protected]>

---------

Signed-off-by: Hrishav <[email protected]>
Signed-off-by: punithnayak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants