Browse Source

Merge pull request #126 in DEC/decision-webui-dcm from ~ALAN/decision-webui-dcm:release/10.0 to release/10.0

* commit 'dac2515602fd9533896a3fc336b0ab0a0014b2ef':
  fix: DEC-10883 修改其他JDBC的类型为otherJDBC以区别旧版
research/10.0
alan 5 years ago
parent
commit
3051617994
  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;
// KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driber来判断数据类型
// 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);
} else {
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',
};
export const OTHER_JDBC = 'otherJDBC';
export const DATEBASE_FILTER_TYPE = {
COMMONLY: 'commonly',
ALL: 'all',
OTHER: 'other',
OTHER: OTHER_JDBC,
};
BI.constant(CONSTANT_PLUGIN_TYPES, [
]);
export const DATA_BASE_TYPES_OTHER =
{
text: 'other',
databaseType: 'other',
text: OTHER_JDBC,
databaseType: OTHER_JDBC,
driver: '',
url: '',
commonly: false,
@ -162,7 +165,7 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [
link: DecCst.Hyperlink.Database.INCEPTOR,
},
{
databaseType: 'other',
databaseType: OTHER_JDBC,
link: DecCst.Hyperlink.Database.OTHER,
},
] : [];
@ -570,13 +573,13 @@ export const DATA_BASE_TYPES = [
},
{
text: BI.i18nText('Dec-Dcm_Connection_JDBC_Other'),
databaseType: 'other',
databaseType: OTHER_JDBC,
driver: 'org.h2.Driver',
drivers: ['org.h2.Driver', 'com.fr.third.org.hsqldb.jdbcDriver', 'org.sqlite.JDBC'],
url: 'jdbc:h2://${ENV_HOME}/../database',
commonly: false,
internal: true,
type: 'other',
type: OTHER_JDBC,
hasSchema: true,
kerberos: false,
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 { FilterXtype } from './filter/filter';
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 { DatebaseTypeXtype } from './database_type/database_type';
import { getAllDatabaseTypes } from '../../app.service';
@ -56,7 +56,7 @@ export class Datebase extends BI.Widget {
if (this.model.isPlugin) {
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));
break;
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;
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;
}
}

Loading…
Cancel
Save