-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to disable sign-in/sign-up in the UI (#7348)
Co-authored-by: Boris Sekachev <boris.sekachev@yandex.ru>
- Loading branch information
1 parent
4e2b2df
commit ad60b82
Showing
20 changed files
with
310 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (C) 2024 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { ActionUnion, createAction, ThunkAction } from 'utils/redux'; | ||
import { getCore, SerializedAPISchema } from 'cvat-core-wrapper'; | ||
|
||
const core = getCore(); | ||
|
||
export enum ServerAPIActionTypes { | ||
GET_SERVER_API_SCHEMA = 'GET_SERVER_API_SCHEMA', | ||
GET_SERVER_API_SCHEMA_SUCCESS = 'GET_SERVER_API_SCHEMA_SUCCESS', | ||
GET_SERVER_API_SCHEMA_FAILED = 'GET_SERVER_API_SCHEMA_FAILED', | ||
} | ||
|
||
const serverAPIActions = { | ||
getServerAPISchema: () => createAction(ServerAPIActionTypes.GET_SERVER_API_SCHEMA), | ||
getServerAPISchemaSuccess: (schema: SerializedAPISchema) => ( | ||
createAction(ServerAPIActionTypes.GET_SERVER_API_SCHEMA_SUCCESS, { schema }) | ||
), | ||
getServerAPISchemaFailed: (error: any) => ( | ||
createAction(ServerAPIActionTypes.GET_SERVER_API_SCHEMA_FAILED, { error }) | ||
), | ||
}; | ||
|
||
export type ServerAPIActions = ActionUnion<typeof serverAPIActions>; | ||
|
||
export const getServerAPISchemaAsync = (): ThunkAction => async (dispatch): Promise<void> => { | ||
dispatch(serverAPIActions.getServerAPISchema()); | ||
|
||
try { | ||
const schema = await core.server.apiSchema(); | ||
dispatch(serverAPIActions.getServerAPISchemaSuccess(schema)); | ||
} catch (error) { | ||
dispatch(serverAPIActions.getServerAPISchemaFailed(error)); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.