mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 01:48:24 +00:00
for TypeScript breaking change with keyof operator now supporting number and symbol type, use extract to specify string type
upgrades various dependencies. renames mirage .js files to .ts. fixes linting issues. rebuilds lock file removes redux deps upgrades to latest Revert "upgrades to latest" This reverts commit 45d2d45b0a28db3217863b2ac9492c5bfe67bf0a. Committer: Seyi Adebajo <sadebajo@linkedin.com> reoders tsconfig keys
This commit is contained in:
parent
b631b61458
commit
1c02e757ab
@ -4,7 +4,7 @@ module.exports = {
|
||||
server: true,
|
||||
define: true
|
||||
},
|
||||
extends: ['prettier', 'plugin:ember/recommended'],
|
||||
extends: ['plugin:ember/recommended', 'prettier'],
|
||||
parser: 'typescript-eslint-parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
const createLazyRequest = (
|
||||
requesterActionCreator,
|
||||
receiverActionCreator,
|
||||
asyncExecutor /**
|
||||
asyncExecutor
|
||||
/**
|
||||
*
|
||||
* @param {Object} props = {}
|
||||
*/
|
||||
@ -33,7 +34,8 @@ const createLazyRequest = (
|
||||
*/
|
||||
const createAsyncThunk = (
|
||||
receiverActionCreator,
|
||||
asyncExecutor /**
|
||||
asyncExecutor
|
||||
/**
|
||||
*
|
||||
* @param {Function} dispatch callback for action dispatch from redux thunk
|
||||
* @param {Function} getState callback to get the current store state
|
||||
|
||||
@ -47,7 +47,7 @@ export default class DatasetSchema extends Component {
|
||||
* @param {Element} jsonViewer
|
||||
* @return {JQuery}
|
||||
*/
|
||||
buildJsonView(this: DatasetSchema, jsonViewer: Element): JQuery | void {
|
||||
buildJsonView(this: DatasetSchema, jsonViewer: Element): JQuery<Element> | void {
|
||||
try {
|
||||
return $(jsonViewer).JSONView(JSON.parse(get(this, 'json')));
|
||||
} catch (e) {
|
||||
|
||||
@ -41,7 +41,8 @@ export default class JsonUpload extends Component {
|
||||
const reader = new FileReader();
|
||||
|
||||
if (typeof closureAction === 'function' && fileBlob) {
|
||||
reader.onload = ({ target }: FileReaderProgressEvent) => target && closureAction(target.result);
|
||||
reader.onload = ({ target }: ProgressEvent & { target: FileReader }) =>
|
||||
target && closureAction(String(target.result));
|
||||
reader.readAsText(fileBlob);
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,8 @@ const initializeState = () => JSON.parse(JSON.stringify(_initialState));
|
||||
* @param {String} entityName
|
||||
*/
|
||||
const appendEntityIdMap = (
|
||||
entityName /**
|
||||
entityName
|
||||
/**
|
||||
*
|
||||
* @param {Object} prevEntities current list of ids mapped to entities
|
||||
* @param {Object} props
|
||||
@ -117,7 +118,8 @@ const namesToNodeName = (state, { nodes = [], parentName = null } = {}) => {
|
||||
* @param {String} entityName
|
||||
*/
|
||||
const receiveEntities = (
|
||||
entityName /**
|
||||
entityName
|
||||
/**
|
||||
* entities (flows|metrics|datasets) for the ActionTypes.RECEIVE_PAGED_[ENTITY_NAME] action
|
||||
* @param {Object} state previous state for datasets
|
||||
* @param {Object} payload data received through ActionTypes.RECEIVE_PAGED_[ENTITY_NAME]
|
||||
|
||||
@ -31,5 +31,5 @@ export interface IUserEntityMap {
|
||||
export interface IPartyProps {
|
||||
userEntities: Array<IPartyEntity>;
|
||||
userEntitiesMaps: IUserEntityMap;
|
||||
userEntitiesSource: Array<keyof IUserEntityMap>;
|
||||
userEntitiesSource: Array<Extract<keyof IUserEntityMap, string>>;
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ const getUserEntities: () => Promise<IPartyProps> = (() => {
|
||||
* Memoized reference to the resolved value of a previous invocation to curried function in getUserEntities
|
||||
* @type {{result: IPartyProps | null}}
|
||||
*/
|
||||
const cache: { result: IPartyProps | null; userEntitiesSource: Array<keyof IUserEntityMap> } = {
|
||||
const cache: { result: IPartyProps | null; userEntitiesSource: Array<Extract<keyof IUserEntityMap, string>> } = {
|
||||
result: null,
|
||||
userEntitiesSource: []
|
||||
};
|
||||
|
||||
@ -60,7 +60,7 @@ const readDatasetProperties = async <T extends IDatasetPropertiesGetResponse | I
|
||||
* @param {*} value
|
||||
* @returns {*}
|
||||
*/
|
||||
const formatPropertyDateValue = (property: keyof IDatasetProperties, value: any): any => {
|
||||
const formatPropertyDateValue = (property: Extract<keyof IDatasetProperties, string>, value: any): any => {
|
||||
const isoStringDateProperties = ['modification_time', 'begin_date', 'lumos_process_time', 'end_date', 'oracle_time'];
|
||||
|
||||
if (isoStringDateProperties.includes(property)) {
|
||||
@ -96,7 +96,7 @@ const formatPropertyDateValue = (property: keyof IDatasetProperties, value: any)
|
||||
* @link IPropertyItem
|
||||
*/
|
||||
const buildPropertiesList = (properties: IDatasetProperties): Array<IPropertyItem> => {
|
||||
return Object.keys(properties).reduce((propertiesList, property: keyof IDatasetProperties) => {
|
||||
return Object.keys(properties).reduce((propertiesList, property: Extract<keyof IDatasetProperties, string>) => {
|
||||
if (['elements', 'view_depends_on'].includes(property)) {
|
||||
return propertiesList;
|
||||
}
|
||||
|
||||
@ -7,6 +7,5 @@ module.exports = {
|
||||
'ember-concurrency': '^0.8.18', //https://github.com/cibernox/ember-power-calendar/pull/135
|
||||
'ember-compatibility-helpers': '0.1.3 || 1.0.0-beta.1 || ^1.0.0',
|
||||
'ember-getowner-polyfill': '1.2.5 || ^2.2.0', //https://github.com/asross/dynamic-link/pull/10
|
||||
'@ember-decorators/babel-transforms': '0.1.1 || 2.0.1' //https://github.com/martndemus/ember-font-awesome/pull/211
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Factory, faker, trait } from 'ember-cli-mirage';
|
||||
import { testSchemaA } from 'wherehows-web/mirage/data/schema';
|
||||
import { testSchemaA } from 'wherehows-web/mirage/fixtures/schema';
|
||||
|
||||
export default Factory.extend({
|
||||
id: faker.random.number({ min: 10000, max: 20000 }),
|
||||
@ -34,10 +34,10 @@ export default Factory.extend({
|
||||
owners: () => [],
|
||||
|
||||
forUnitTests: trait({
|
||||
id(id) {
|
||||
id(id: number) {
|
||||
return id;
|
||||
},
|
||||
schema(id) {
|
||||
schema(id: number) {
|
||||
return id === 0 ? testSchemaA : 'abcd';
|
||||
}
|
||||
})
|
||||
@ -1,4 +1,4 @@
|
||||
import { Factory, faker, association } from 'ember-cli-mirage';
|
||||
import { Factory, faker } from 'ember-cli-mirage';
|
||||
|
||||
export default Factory.extend({
|
||||
userName() {
|
||||
@ -1,3 +1,5 @@
|
||||
import { IMirageServer } from 'wherehows-web/typings/ember-cli-mirage';
|
||||
|
||||
const fixtures = [
|
||||
'dataset-nodes',
|
||||
'metric-metrics',
|
||||
@ -7,7 +9,7 @@ const fixtures = [
|
||||
'dataset-acl-users'
|
||||
];
|
||||
|
||||
export default function(server) {
|
||||
export default function(server: IMirageServer) {
|
||||
server.loadFixtures(...fixtures);
|
||||
server.create('config');
|
||||
server.createList('owner', 6);
|
||||
@ -20,13 +20,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ember-decorators/babel-transforms": "^2.0.1",
|
||||
"@types/ember": "^2.8.22",
|
||||
"@types/ember-qunit": "^3.0.2",
|
||||
"@types/ember": "^2.8.32",
|
||||
"@types/ember-qunit": "^3.0.3",
|
||||
"@types/ember-test-helpers": "^0.7.1",
|
||||
"@types/ember-testing-helpers": "^0.0.3",
|
||||
"@types/lodash": "^4.14.83",
|
||||
"@types/qunit": "^2.5.0",
|
||||
"@types/rsvp": "^4.0.1",
|
||||
"@types/qunit": "^2.5.2",
|
||||
"@types/rsvp": "^4.0.2",
|
||||
"@zestia/ember-simple-infinite-scroller": "^2.0.2",
|
||||
"babel-plugin-transform-async-to-generator": "^6.24.1",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
@ -58,13 +58,13 @@
|
||||
"ember-cli-qunit": "^4.1.1",
|
||||
"ember-cli-shims": "^1.1.0",
|
||||
"ember-cli-sri": "^2.1.0",
|
||||
"ember-cli-typescript": "1.1.5",
|
||||
"ember-cli-typescript": "^1.3.3",
|
||||
"ember-cli-uglify": "^2.0.0",
|
||||
"ember-composable-helpers": "^2.1.0",
|
||||
"ember-concurrency": "^0.8.15",
|
||||
"ember-decorators": "^2.0.0",
|
||||
"ember-export-application-global": "^2.0.0",
|
||||
"ember-fetch": "^3.4.4",
|
||||
"ember-fetch": "^5.1.1",
|
||||
"ember-font-awesome": "^4.0.0-rc.2",
|
||||
"ember-highcharts": "^1.0.0",
|
||||
"ember-inflector": "^2.2.0",
|
||||
@ -74,8 +74,6 @@
|
||||
"ember-native-dom-helpers": "^0.5.10",
|
||||
"ember-power-calendar": "^0.7.1",
|
||||
"ember-power-select-typeahead": "^0.7.0",
|
||||
"ember-redux-shim": "^1.1.1",
|
||||
"ember-redux-thunk-shim": "^1.1.2",
|
||||
"ember-resolver": "^4.0.0",
|
||||
"ember-sinon": "^1.0.1",
|
||||
"ember-sinon-qunit": "^2.1.0",
|
||||
@ -85,7 +83,7 @@
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-ember": "^5.0.0",
|
||||
"eslint-plugin-import": "^2.8.0",
|
||||
"eslint-plugin-prettier": "^2.5.0",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
"eyeglass": "^1.3.0",
|
||||
"eyeglass-restyle": "^1.1.0",
|
||||
"highcharts": "^6.1.1",
|
||||
@ -94,10 +92,8 @@
|
||||
"lint-staged": "^7.1.0",
|
||||
"loader.js": "^4.2.3",
|
||||
"node-sass": "^4.7.2",
|
||||
"prettier": "^1.10.2",
|
||||
"redux": "^3.6.0",
|
||||
"redux-thunk": "^2.2.0",
|
||||
"typescript": "^2.8.3"
|
||||
"prettier": "^1.14.0",
|
||||
"typescript": "^2.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"dynamic-link": "^0.2.3",
|
||||
@ -107,20 +103,18 @@
|
||||
"ember-lodash": "^4.18.0",
|
||||
"ember-modal-dialog": "^2.4.1",
|
||||
"ember-moment": "^7.5.0",
|
||||
"ember-power-select": "2.0.0",
|
||||
"ember-power-select": "^2.0.4",
|
||||
"ember-radio-button": "^1.2.1",
|
||||
"ember-redux": "^2.10.1",
|
||||
"ember-redux-actions": "^0.3.0",
|
||||
"ember-simple-auth": "^1.4.0",
|
||||
"ember-tether": "0.4.1",
|
||||
"ember-tooltips": "^2.9.2",
|
||||
"ember-truth-helpers": "^2.0.0",
|
||||
"eslint-plugin-typescript": "^0.12.0",
|
||||
"jquery": "^3.3.0",
|
||||
"typescript-eslint-parser": "^15.0.0"
|
||||
"typescript-eslint-parser": "^17.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^4.5 || 6.* || >= 7.*"
|
||||
"node": ">= 8.*"
|
||||
},
|
||||
"lint-staged": {
|
||||
"linters": {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { startMirage } from 'wherehows-web/initializers/ember-cli-mirage';
|
||||
import datasetsCreateSearchEntries from 'wherehows-web/utils/datasets/create-search-entries';
|
||||
import { testSchemaA } from 'wherehows-web/mirage/data/schema';
|
||||
import { testSchemaA } from 'wherehows-web/mirage/fixtures/schema';
|
||||
|
||||
module('Unit | Utility | datasets/create search entries', {
|
||||
beforeEach() {
|
||||
|
||||
@ -1,30 +1,35 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"lib": ["es2017.object", "es2016", "dom", "dom.iterable", "scripthost"],
|
||||
"listEmittedFiles": true,
|
||||
"moduleResolution": "node",
|
||||
"allowJs": true,
|
||||
"baseUrl": ".",
|
||||
"inlineSourceMap": true,
|
||||
"inlineSources": true,
|
||||
"module": "es6",
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noEmit": true,
|
||||
"noEmitOnError": true,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"pretty": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noEmitOnError": true,
|
||||
"noEmit": true,
|
||||
"inlineSourceMap": true,
|
||||
"inlineSources": true,
|
||||
"baseUrl": ".",
|
||||
"module": "es6",
|
||||
"lib": ["es2017.object", "es2016", "dom", "dom.iterable", "scripthost"],
|
||||
"listEmittedFiles": true,
|
||||
"experimentalDecorators": true,
|
||||
"downlevelIteration": true,
|
||||
"paths": {
|
||||
"wherehows-web/*": ["app/*"],
|
||||
"wherehows-web/tests/*": ["tests/*"],
|
||||
"wherehows-web/mirage/*": ["mirage/*"]
|
||||
"wherehows-web/tests/*": [
|
||||
"tests/*"
|
||||
],
|
||||
"wherehows-web/*": [
|
||||
"app/*"
|
||||
],
|
||||
"wherehows-web/mirage/*": [
|
||||
"mirage/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": ["app/**/*", "tests/**/*", "mirage/**/*"],
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user