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

CB-4069 adds new form API for Identity Provider #2714

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { ServerConfigResource } from '@cloudbeaver/core-root';
import { AuthProviderConfigurationInfoFragment, AuthProviderInfoFragment, GraphQLService } from '@cloudbeaver/core-sdk';

import { AuthConfigurationsResource } from './AuthConfigurationsResource';
import { AuthSettingsService } from './AuthSettingsService';

export type AuthProvider = NonNullable<AuthProviderInfoFragment>;
export type AuthProviderConfiguration = NonNullable<AuthProviderConfigurationInfoFragment>;
Expand All @@ -32,7 +31,6 @@ export class AuthProvidersResource extends CachedMapResource<string, AuthProvide
}

constructor(
private readonly authSettingsService: AuthSettingsService,
private readonly graphQLService: GraphQLService,
private readonly serverConfigResource: ServerConfigResource,
private readonly authConfigurationsResource: AuthConfigurationsResource,
Expand Down
8 changes: 6 additions & 2 deletions webapp/packages/core-ui/src/Form/FormBaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ export class FormBaseService<TState, TProps extends IFormProps<TState> = IFormPr

readonly onConfigure: IExecutorHandlersCollection<IFormState<TState>>;
readonly onFillDefaultConfig: IExecutorHandlersCollection<IFormState<TState>>;
readonly onPrepareConfig: IExecutorHandlersCollection<TState>;
readonly onPrepareConfig: IExecutorHandlersCollection<IFormState<TState>>;
readonly onFormat: IExecutorHandlersCollection<IFormState<TState>>;
readonly onValidate: IExecutorHandlersCollection<IFormState<TState>>;
readonly onSubmit: IExecutorHandlersCollection<IFormState<TState>>;
readonly onState: IExecutorHandlersCollection<TState>;

constructor(private readonly localizationService: LocalizationService, private readonly notificationService: NotificationService, name: string) {
constructor(
private readonly localizationService: LocalizationService,
private readonly notificationService: NotificationService,
name: string,
) {
this.parts = new TabsContainer(name);
this.actionsContainer = new PlaceholderContainer();
this.onConfigure = new ExecutorHandlersCollection();
Expand Down
2 changes: 2 additions & 0 deletions webapp/packages/core-ui/src/Form/FormPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
this.loading = false;

this.formState.submitTask.addHandler(executorHandlerFilter(() => this.isLoaded(), this.save.bind(this)));
this.formState.fillDefaultConfigTask.addHandler(executorHandlerFilter(() => this.isLoaded(), this.fillConfig.bind(this)));
this.formState.configureTask.addHandler(executorHandlerFilter(() => this.isLoaded(), this.configure.bind(this)));
this.formState.formatTask.addHandler(executorHandlerFilter(() => this.isLoaded(), this.format.bind(this)));
this.formState.validationTask.addHandler(executorHandlerFilter(() => this.isLoaded(), this.validate.bind(this)));
Expand Down Expand Up @@ -150,6 +151,7 @@
protected configure(data: IFormState<TFormState>, contexts: IExecutionContextProvider<IFormState<TFormState>>): void | Promise<void> {}
protected format(data: IFormState<TFormState>, contexts: IExecutionContextProvider<IFormState<TFormState>>): void | Promise<void> {}
protected validate(data: IFormState<TFormState>, contexts: IExecutionContextProvider<IFormState<TFormState>>): void | Promise<void> {}
protected fillConfig(data: IFormState<TFormState>, contexts: IExecutionContextProvider<IFormState<TFormState>>): void | Promise<void> {}

Check warning on line 154 in webapp/packages/core-ui/src/Form/FormPart.ts

View check run for this annotation

Jenkins-CI-integration / CheckStyle TypeScript Report

webapp/packages/core-ui/src/Form/FormPart.ts#L154

data is defined but never used. (@typescript-eslint/no-unused-vars)

Check warning on line 154 in webapp/packages/core-ui/src/Form/FormPart.ts

View check run for this annotation

Jenkins-CI-integration / CheckStyle TypeScript Report

webapp/packages/core-ui/src/Form/FormPart.ts#L154

contexts is defined but never used. (@typescript-eslint/no-unused-vars)
Copy link
Member

Choose a reason for hiding this comment

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

please revert


protected abstract loader(): Promise<void>;
protected abstract saveChanges(data: IFormState<TFormState>, contexts: IExecutionContextProvider<IFormState<TFormState>>): Promise<void>;
Expand Down
Loading