mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-4067 reverts isOutdated
This commit is contained in:
-4
@@ -29,10 +29,6 @@ export class ConnectionFormDriverPropertiesPart extends FormPart<IConnectionProp
|
||||
return getConnectionFormOptionsPart(this.formState);
|
||||
}
|
||||
|
||||
override isOutdated(): boolean {
|
||||
return this.optionsPart.isOutdated();
|
||||
}
|
||||
|
||||
protected override async loader(): Promise<void> {
|
||||
if (!this.optionsPart.connectionKey) {
|
||||
this.setInitialState(getDefaultState());
|
||||
|
||||
+1
-20
@@ -23,7 +23,7 @@ import {
|
||||
isJDBCConnection,
|
||||
type DatabaseConnection,
|
||||
} from '@cloudbeaver/core-connections';
|
||||
import type { ProjectInfoResource, ProjectsService } from '@cloudbeaver/core-projects';
|
||||
import type { ProjectInfoResource } from '@cloudbeaver/core-projects';
|
||||
import { AUTH_PROVIDER_LOCAL_ID, AuthProvidersResource, UserInfoResource } from '@cloudbeaver/core-authentication';
|
||||
import { action, makeObservable, observable, toJS } from 'mobx';
|
||||
import { getUniqueName, isNotNullDefined } from '@cloudbeaver/core-utils';
|
||||
@@ -66,7 +66,6 @@ export class ConnectionFormOptionsPart extends FormPart<IConnectionFormOptionsSt
|
||||
private readonly localizationService: LocalizationService,
|
||||
private readonly commonDialogService: CommonDialogService,
|
||||
private readonly notificationService: NotificationService,
|
||||
private readonly projectsService: ProjectsService,
|
||||
) {
|
||||
super(formState, defaultStateGetter());
|
||||
|
||||
@@ -141,24 +140,6 @@ export class ConnectionFormOptionsPart extends FormPart<IConnectionFormOptionsSt
|
||||
return createConnectionParam(this.formState.state.projectId, this.state.connectionId);
|
||||
}
|
||||
|
||||
override isOutdated(): boolean {
|
||||
if (!this.formState.state.projectId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const project = this.projectInfoResource.get(this.formState.state.projectId);
|
||||
const isProjectOutdated =
|
||||
this.projectInfoResource.isOutdated(this.formState.state.projectId) ||
|
||||
!project?.canEditDataSources ||
|
||||
!this.projectsService.activeProjects.includes(project);
|
||||
|
||||
if (!this.connectionKey) {
|
||||
return isProjectOutdated;
|
||||
}
|
||||
|
||||
return this.connectionInfoResource.isOutdated(this.connectionKey) || isProjectOutdated;
|
||||
}
|
||||
|
||||
protected override async loader(): Promise<void> {
|
||||
if (this.formState.mode === 'create') {
|
||||
const defaults = await this.getDefaults();
|
||||
|
||||
+1
-3
@@ -9,7 +9,7 @@ import { createDataContext, DATA_CONTEXT_DI_PROVIDER } from '@cloudbeaver/core-d
|
||||
import type { IFormState } from '@cloudbeaver/core-ui';
|
||||
import { ConnectionFormOptionsPart } from './ConnectionFormOptionsPart.js';
|
||||
import { ConnectionInfoResource, DatabaseAuthModelsResource, DBDriverResource } from '@cloudbeaver/core-connections';
|
||||
import { ProjectInfoResource, ProjectsService } from '@cloudbeaver/core-projects';
|
||||
import { ProjectInfoResource } from '@cloudbeaver/core-projects';
|
||||
import { AuthProvidersResource, UserInfoResource } from '@cloudbeaver/core-authentication';
|
||||
import { LocalizationService } from '@cloudbeaver/core-localization';
|
||||
import type { IConnectionFormState } from '../IConnectionFormState.js';
|
||||
@@ -30,7 +30,6 @@ export function getConnectionFormOptionsPart(formState: IFormState<IConnectionFo
|
||||
const localizationService = di.getService(LocalizationService);
|
||||
const commonDialogService = di.getService(CommonDialogService);
|
||||
const notificationService = di.getService(NotificationService);
|
||||
const projectsService = di.getService(ProjectsService);
|
||||
|
||||
return new ConnectionFormOptionsPart(
|
||||
formState,
|
||||
@@ -43,7 +42,6 @@ export function getConnectionFormOptionsPart(formState: IFormState<IConnectionFo
|
||||
localizationService,
|
||||
commonDialogService,
|
||||
notificationService,
|
||||
projectsService,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
-4
@@ -45,10 +45,6 @@ export class ConnectionFormOriginInfoFormPart extends FormPart<IConnectionFormOr
|
||||
return getConnectionFormOptionsPart(this.formState);
|
||||
}
|
||||
|
||||
override isOutdated(): boolean {
|
||||
return this.optionsPart.isOutdated();
|
||||
}
|
||||
|
||||
get providerId(): string | null {
|
||||
if (!this.formState.state.projectId || !this.optionsPart.state.driverId) {
|
||||
return null;
|
||||
|
||||
@@ -46,10 +46,6 @@ export class ConnectionFormSSHPart extends FormPart<INetworkHandlerConfig, IConn
|
||||
return getConnectionFormOptionsPart(this.formState);
|
||||
}
|
||||
|
||||
override isOutdated(): boolean {
|
||||
return this.optionsPart.isOutdated();
|
||||
}
|
||||
|
||||
protected override async loader(): Promise<void> {
|
||||
if (!this.optionsPart.connectionKey) {
|
||||
this.setInitialState(getDefaultState());
|
||||
|
||||
@@ -43,12 +43,6 @@ export class ConnectionFormSSLPart extends FormPart<INetworkHandlerConfig, IConn
|
||||
return getConnectionFormOptionsPart(this.formState);
|
||||
}
|
||||
|
||||
override isOutdated(): boolean {
|
||||
return (
|
||||
this.optionsPart.isOutdated() || this.dbDriverResource.isOutdated(this.optionsPart.state.driverId) || this.networkHandlerResource.isOutdated()
|
||||
);
|
||||
}
|
||||
|
||||
protected override async loader(): Promise<void> {
|
||||
if (!this.optionsPart.state.driverId) {
|
||||
this.setInitialState(getDefaultState());
|
||||
|
||||
Reference in New Issue
Block a user