Browse Source

fix: DEC-10883 修改其他JDBC的类型为otherJDBC以区别旧版

research/10.0
alan 5 years ago
parent
commit
dac2515602
  1. 2
      src/modules/app.service.ts
  2. 15
      src/modules/constants/constant.ts
  3. 8
      src/modules/pages/database/database.ts

2
src/modules/app.service.ts

@ -28,7 +28,7 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT
let databaseType = null; let databaseType = null;
// KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driber来判断数据类型 // KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driber来判断数据类型
// DEC-10872 不能过滤other,因为新版数据连接创建的其他jdbc也是other类型,会混淆,需要和后端讨论一个最佳的解决方案。 // DEC-10872 不能过滤other,因为新版数据连接创建的其他jdbc也是other类型,会混淆,需要和后端讨论一个最佳的解决方案。
if (database && DATA_BASE_TYPES.some(item => item.databaseType === database)) { if (database && database !== 'other' && DATA_BASE_TYPES.some(item => item.databaseType === database)) {
databaseType = DATA_BASE_TYPES.find(item => item.databaseType === database); databaseType = DATA_BASE_TYPES.find(item => item.databaseType === database);
} else { } else {
const designDatabase = DESIGN_DRIVER_TYPE.find(item => item.driver === driver); const designDatabase = DESIGN_DRIVER_TYPE.find(item => item.driver === driver);

15
src/modules/constants/constant.ts

@ -7,19 +7,22 @@ export const PAGE_INDEX = {
POOL: 'pool', POOL: 'pool',
}; };
export const OTHER_JDBC = 'otherJDBC';
export const DATEBASE_FILTER_TYPE = { export const DATEBASE_FILTER_TYPE = {
COMMONLY: 'commonly', COMMONLY: 'commonly',
ALL: 'all', ALL: 'all',
OTHER: 'other', OTHER: OTHER_JDBC,
}; };
BI.constant(CONSTANT_PLUGIN_TYPES, [ BI.constant(CONSTANT_PLUGIN_TYPES, [
]); ]);
export const DATA_BASE_TYPES_OTHER = export const DATA_BASE_TYPES_OTHER =
{ {
text: 'other', text: OTHER_JDBC,
databaseType: 'other', databaseType: OTHER_JDBC,
driver: '', driver: '',
url: '', url: '',
commonly: false, commonly: false,
@ -162,7 +165,7 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [
link: DecCst.Hyperlink.Database.INCEPTOR, link: DecCst.Hyperlink.Database.INCEPTOR,
}, },
{ {
databaseType: 'other', databaseType: OTHER_JDBC,
link: DecCst.Hyperlink.Database.OTHER, link: DecCst.Hyperlink.Database.OTHER,
}, },
] : []; ] : [];
@ -570,13 +573,13 @@ export const DATA_BASE_TYPES = [
}, },
{ {
text: BI.i18nText('Dec-Dcm_Connection_JDBC_Other'), text: BI.i18nText('Dec-Dcm_Connection_JDBC_Other'),
databaseType: 'other', databaseType: OTHER_JDBC,
driver: 'org.h2.Driver', driver: 'org.h2.Driver',
drivers: ['org.h2.Driver', 'com.fr.third.org.hsqldb.jdbcDriver', 'org.sqlite.JDBC'], drivers: ['org.h2.Driver', 'com.fr.third.org.hsqldb.jdbcDriver', 'org.sqlite.JDBC'],
url: 'jdbc:h2://${ENV_HOME}/../database', url: 'jdbc:h2://${ENV_HOME}/../database',
commonly: false, commonly: false,
internal: true, internal: true,
type: 'other', type: OTHER_JDBC,
hasSchema: true, hasSchema: true,
kerberos: false, kerberos: false,
urls: { urls: {

8
src/modules/pages/database/database.ts

@ -2,7 +2,7 @@ import { SearchEditor, Vtape, Right, Htape, Vertical, ButtonGroup, Left, Vertica
import { shortcut, store } from '@core/core'; import { shortcut, store } from '@core/core';
import { FilterXtype } from './filter/filter'; import { FilterXtype } from './filter/filter';
import { DatebaseModel, DatebaseModelXtype } from './database.model'; import { DatebaseModel, DatebaseModelXtype } from './database.model';
import { DATEBASE_FILTER_TYPE } from '@constants/constant'; import { DATEBASE_FILTER_TYPE, OTHER_JDBC } from '@constants/constant';
import { connectionType } from '@constants/env'; import { connectionType } from '@constants/env';
import { DatebaseTypeXtype } from './database_type/database_type'; import { DatebaseTypeXtype } from './database_type/database_type';
import { getAllDatabaseTypes } from '../../app.service'; import { getAllDatabaseTypes } from '../../app.service';
@ -56,7 +56,7 @@ export class Datebase extends BI.Widget {
if (this.model.isPlugin) { if (this.model.isPlugin) {
datebaseTypes = [...datebaseTypes, ...this.allDatabaseTypes.filter(item => !item.internal)]; datebaseTypes = [...datebaseTypes, ...this.allDatabaseTypes.filter(item => !item.internal)];
} }
this.store.setDatebaseTypes(datebaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== 'other')); this.store.setDatebaseTypes(datebaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== OTHER_JDBC));
} }
}, },
} }
@ -241,10 +241,10 @@ export class Datebase extends BI.Widget {
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.commonly)); this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.commonly));
break; break;
case DATEBASE_FILTER_TYPE.OTHER: case DATEBASE_FILTER_TYPE.OTHER:
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type === connectionType.JNDI || item.type === 'other')); this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type === connectionType.JNDI || item.type === OTHER_JDBC));
break; break;
default: default:
this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== 'other')); this.store.setDatebaseTypes(this.allDatabaseTypes.filter(item => item.type !== connectionType.JNDI && item.type !== OTHER_JDBC));
break; break;
} }
} }

Loading…
Cancel
Save