Skip to content

[Reporting] refactor routes files and helpers - #30111

Merged
tsullivan merged 19 commits into
elastic:masterfrom
tsullivan:refactor/reporting-routes
Feb 12, 2019
Merged

tsullivan merged 19 commits into
elastic:masterfrom
tsullivan:refactor/reporting-routes

Conversation

@tsullivan

@tsullivan tsullivan commented Feb 5, 2019 •

Copy link
Copy Markdown
Member
  • Reorganize files in server/routes
    • Consolidate helper code
    • Split out legacy routes to a new file
  • Remove unused get_absolute_time
  • Files that were significantly changed after the refactoring were converted into Typescript

WIP: Hold off until #29977 is merged

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@joelgriffith

Copy link
Copy Markdown
Contributor

This is a nice cleanup... what do you think about doing TS for some of this (at least the newer modules)?

@tsullivan tsullivan added WIP Work in progress and removed review labels Feb 5, 2019
@tsullivan

Copy link
Copy Markdown
Member Author

@joelgriffith sure, I can put some of the changes in as TS. I'm hunting down a failing unit test, and then I'll pick that up

import _ from 'lodash';

export function createFlattenHit(fields, metaFields, conflictedTypesFields) {
export function createFlattenHit(fields, metaFields, conflictedTypesFields = []) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Whoops, looks like there was a unit test expecting this to cause a failure

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@tsullivan

Copy link
Copy Markdown
Member Author

retest

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@tsullivan tsullivan added review v8.0.0 zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead refactoring and removed WIP Work in progress chore labels Feb 7, 2019
@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@@ -7,8 +7,7 @@
import { resolve } from 'path';
import { UI_SETTINGS_CUSTOM_PDF_LOGO } from './common/constants';
import { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice consolidation here

@joelgriffith joelgriffith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lovin' that TS flavor! LGTM

@tsullivan
tsullivan merged commit 925998e into elastic:master Feb 12, 2019
@tsullivan
tsullivan deleted the refactor/reporting-routes branch February 12, 2019 18:33
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 12, 2019
* remove unused file

* refactor routes files and helpers

* default empty array for conflictedTypesFields

* minor prettier

* remove some unrelated diff

* some typescript conversions

* more typescripts

* more typscript

* jobtype is a string

* revert some logic change

* set payload.headers to undefined + not mutate

* fix jest import
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 12, 2019
* remove unused file

* refactor routes files and helpers

* default empty array for conflictedTypesFields

* minor prettier

* remove some unrelated diff

* some typescript conversions

* more typescripts

* more typscript

* jobtype is a string

* revert some logic change

* set payload.headers to undefined + not mutate

* fix jest import
tsullivan added a commit that referenced this pull request Feb 13, 2019
* remove unused file

* refactor routes files and helpers

* default empty array for conflictedTypesFields

* minor prettier

* remove some unrelated diff

* some typescript conversions

* more typescripts

* more typscript

* jobtype is a string

* revert some logic change

* set payload.headers to undefined + not mutate

* fix jest import
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
* remove unused file

* refactor routes files and helpers

* default empty array for conflictedTypesFields

* minor prettier

* remove some unrelated diff

* some typescript conversions

* more typescripts

* more typscript

* jobtype is a string

* revert some logic change

* set payload.headers to undefined + not mutate

* fix jest import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring review v7.0.0 v8.0.0 zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants