diff --git a/.eslintrc.js b/.eslintrc.js index 41e0974f88a..c843d8f7d0d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -56,6 +56,71 @@ const globals = normalGlobals.concat(hueGlobals).reduce((acc, key) => { return acc; }, {}); +const jsTsVueRules = { + 'no-useless-constructor': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-this-alias': 'error', + '@typescript-eslint/no-unused-vars': 'error', + 'vue/max-attributes-per-line': [ + 'error', + { + singleline: 10, + multiline: { + max: 1, + allowFirstLine: false + } + } + ], + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'any' + } + } + ], + 'vue/singleline-html-element-content-newline': 'off' // Conflicts with prettier +}; + +const jestRules = { + 'jest/no-focused-tests': 'error', + 'jest/valid-expect': 'error', + 'new-cap': 'off', + 'no-console': 'off', + 'no-restricted-syntax': [ + 'error', + { + selector: + 'CallExpression[callee.object.name="console"][callee.property.name!=/^(warn|error|info|trace)$/]', + message: 'Unexpected property on console object was called' + } + ], + 'no-extra-boolean-cast': 'off', + 'no-invalid-this': 'off', + 'no-lonely-if': 'error', + 'no-throw-literal': 'off', + 'no-unused-vars': [ + 'error', + { + vars: 'all', + args: 'none', + ignoreRestSiblings: true, + varsIgnorePattern: '_[a-zA-Z0-9_]+' + } + ], + 'no-useless-constructor': 'error', + 'no-var': 'error', + 'no-undef': 'error', + 'one-var': 'off', + 'prefer-arrow-callback': 'error', + 'prefer-const': ['warn', { destructuring: 'all' }], + 'require-jsdoc': 'off', + strict: 'off', + 'valid-jsdoc': 'off', + curly: ['error', 'all'] +}; + module.exports = { env: { browser: true, @@ -76,47 +141,21 @@ module.exports = { parser: '@typescript-eslint/parser' }, plugins: ['vue', '@typescript-eslint'], - rules: { - 'vue/max-attributes-per-line': [ - 'error', - { - singleline: 10, - multiline: { - max: 1, - allowFirstLine: false - } - } - ], - 'vue/html-self-closing': [ - 'error', - { - html: { - void: 'any' - } - } - ], - 'vue/singleline-html-element-content-newline': 0, // Conflicts with prettier - '@typescript-eslint/no-non-null-assertion': 0 - } + rules: jsTsVueRules }, { files: ['*.d.ts'], extends: ['plugin:@typescript-eslint/recommended'], parser: '@typescript-eslint/parser', plugins: ['jest', '@typescript-eslint'], - rules: { - 'no-useless-constructor': 0, - '@typescript-eslint/no-non-null-assertion': 0 - } + rules: jsTsVueRules }, { files: ['*.ts', '*.tsx'], extends: ['plugin:@typescript-eslint/recommended'], parser: '@typescript-eslint/parser', plugins: ['jest', '@typescript-eslint'], - rules: { - '@typescript-eslint/no-non-null-assertion': 0 - } + rules: jsTsVueRules } ], extends: ['plugin:prettier/recommended'], @@ -131,42 +170,6 @@ module.exports = { } }, plugins: ['jest'], - rules: { - 'jest/no-focused-tests': 'error', - 'jest/valid-expect': 'error', - 'new-cap': 0, - 'no-console': 0, - 'no-restricted-syntax': [ - 'error', - { - selector: - 'CallExpression[callee.object.name="console"][callee.property.name!=/^(warn|error|info|trace)$/]', - message: 'Unexpected property on console object was called' - } - ], - 'no-extra-boolean-cast': 0, - 'no-invalid-this': 0, - 'no-lonely-if': 2, - 'no-throw-literal': 0, - 'no-unused-vars': [ - 'error', - { - vars: 'all', - args: 'none', - ignoreRestSiblings: true, - varsIgnorePattern: '_[a-zA-Z0-9_]+' - } - ], - 'no-useless-constructor': 2, - 'no-var': 1, - 'no-undef': 2, - 'one-var': 0, - 'prefer-arrow-callback': 2, - 'prefer-const': ['warn', { destructuring: 'all' }], - 'require-jsdoc': 0, - strict: 0, - 'valid-jsdoc': 0, - curly: [2, 'all'] - }, + rules: jestRules, settings: {} }; diff --git a/apps/jobbrowser/src/jobbrowser/templates/job_browser.mako b/apps/jobbrowser/src/jobbrowser/templates/job_browser.mako index 103102a41a3..df46b4938da 100644 --- a/apps/jobbrowser/src/jobbrowser/templates/job_browser.mako +++ b/apps/jobbrowser/src/jobbrowser/templates/job_browser.mako @@ -17,14 +17,9 @@ import sys from desktop.conf import CUSTOM, IS_K8S_ONLY -from desktop.views import commonheader, commonfooter, _ko +from desktop.views import commonheader, commonfooter from desktop.webpack_utils import get_hue_bundles -from impala.conf import COORDINATOR_URL as IMPALA_COORDINATOR_URL -from metadata.conf import PROMETHEUS -from notebook.conf import ENABLE_QUERY_SCHEDULING - -from jobbrowser.conf import DISABLE_KILLING_JOBS, MAX_JOB_FETCH, ENABLE_QUERY_BROWSER, ENABLE_HIVE_QUERY_BROWSER, QUERY_STORE, ENABLE_HISTORY_V2 - +from jobbrowser.conf import MAX_JOB_FETCH, ENABLE_QUERY_BROWSER from webpack_loader.templatetags.webpack_loader import render_bundle if sys.version_info[0] > 2: @@ -33,4408 +28,383 @@ else: from django.utils.translation import ugettext as _ %> -<% -SUFFIX = is_mini and "-mini" or "" -%> - % if not is_embeddable: ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode } % endif -% if not is_embeddable: - - - -% endif - - - - - - - - -% for bundle in get_hue_bundles('jobBrowser'): - ${ render_bundle(bundle) | n,unicode } -% endfor - - - - - - - - - -% if ENABLE_QUERY_BROWSER.get(): - - -% endif - -% if not is_mini: -
-% else: -
-% endif - -% if not is_embeddable: - - - -% endif - - -% if is_mini: -
- - - % if not IS_K8S_ONLY.get(): - - % endif -
- -% else: - -
-% endif - - - - +
+
+ +
+ - + -
-
-
-
- % if not is_embeddable: -
- - - -
-
-
 
- % endif + + ${_('in the last')} + -
-
- -
- + + + + - - -
- - ${ _('Impala queries from') } - - - - - - - + + + ${ _('Add Warehouse') } + + + ${ _('Create / Register') } + + + - - - +
+
- - ${_('in the last')} - +
+ ${ _("Showing oldest %s jobs. Use days filter to get the recent ones.") % MAX_JOB_FETCH.get() } +
- - - +
+ + +

${ _('Running') }

+
+

${ _('Completed') }

+
- - - - ${ _('Add Warehouse') } - - - ${ _('Create / Register') } - - - +
-
- - + + + +
+ -
- ${ _("Showing oldest %s jobs. Use days filter to get the recent ones.") % MAX_JOB_FETCH.get() } -
+ +
+ -
- - - -
    -
  • -  -  - -
    - -
    -
    -
    -
    -
    -
  • -
    -
+ +
- -

${ _('Running') }

-
-

${ _('Completed') }

-
+ + +
- -
- - - - -
- + +
+ - -
- + + +
+ - -
- + +
+ + - -
- + +
+ - -
- + +
+ - - -
+ +
- -
+ +
- - -
- + +
+ - -
+ +
+ - - -
- -
+ +
- - -
+
- -
+ + - - - - -
- -
- - - % if not is_mini: - - - -
+
-
+
-
+
- - - -
- %endif + + + +
+
-
- - - - - - - + + + - -