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

Ability to configure user agreements for the register user form #1464

Merged
merged 13 commits into from
May 19, 2020
1 change: 1 addition & 0 deletions cvat-core/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function build() {
* @param {string} email A email address for the new account
* @param {string} password1 A password for the new account
* @param {string} password2 The confirmation password for the new account
* @param {Object} userConfirmations An user confirmations of terms of use if needed
* @throws {module:API.cvat.exceptions.PluginError}
* @throws {module:API.cvat.exceptions.ServerError}
*/
Expand Down
19 changes: 19 additions & 0 deletions cvat-ui/src/reducers/notifications-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { AboutActionTypes } from 'actions/about-actions';
import { AnnotationActionTypes } from 'actions/annotation-actions';
import { NotificationsActionType } from 'actions/notification-actions';
import { BoundariesActionTypes } from 'actions/boundaries-actions';
import { UserAgreementsActions, UserAgreementsActionTypes } from 'actions/useragreements-actions';

import { NotificationsState } from './interfaces';

Expand Down Expand Up @@ -80,6 +81,9 @@ const defaultState: NotificationsState = {
boundaries: {
resetError: null,
},
userAgreements: {
fetching: null,
},
},
messages: {
tasks: {
Expand Down Expand Up @@ -801,6 +805,21 @@ export default function (state = defaultState, action: AnyAction): Notifications
},
};
}
case UserAgreementsActionTypes.GET_USER_AGREEMENTS_FAILED: {
return {
...state,
errors: {
...state.errors,
formats: {
...state.errors.formats,
fetching: {
azhavoro marked this conversation as resolved.
Show resolved Hide resolved
message: 'Could not get user agreements from the server',
reason: action.payload.error.toString(),
},
},
},
};
}
case NotificationsActionType.RESET_ERRORS: {
return {
...state,
Expand Down