Hi Akshay, Please find the attached patch which fixes the linter issues.
Thanks, Khushboo On Wed, May 2, 2018 at 11:10 AM, Akshay Joshi <akshay.jo...@enterprisedb.com > wrote: > Hi Joao > > Linter fails for 'parse_shortcut_value_spec.js' file: > > $ node pga_eslint.js > > > /Users/akshay/Development/pgadmin4/web/regression/ > javascript/parse_shortcut_value_spec.js > > 13:4 error Expected indentation of 2 spaces but found 3 indent > > 14:7 error Expected indentation of 5 spaces but found 6 indent > > 21:26 error Missing trailing comma > comma-dangle > > 22:12 error Missing trailing comma > comma-dangle > > 26:4 error Expected indentation of 2 spaces but found 3 indent > > 27:7 error Expected indentation of 5 spaces but found 6 indent > > 34:26 error Missing trailing comma > comma-dangle > > 35:12 error Missing trailing comma > comma-dangle > > 39:4 error Expected indentation of 2 spaces but found 3 indent > > 40:7 error Expected indentation of 5 spaces but found 6 indent > > 47:25 error Missing trailing comma > comma-dangle > > 48:12 error Missing trailing comma > comma-dangle > > 52:4 error Expected indentation of 2 spaces but found 3 indent > > 53:7 error Expected indentation of 5 spaces but found 6 indent > > 60:25 error Missing trailing comma > comma-dangle > > 61:12 error Missing trailing comma > comma-dangle > > 65:4 error Expected indentation of 2 spaces but found 3 indent > > 66:7 error Expected indentation of 5 spaces but found 6 indent > > 73:25 error Missing trailing comma > comma-dangle > > 74:12 error Missing trailing comma > comma-dangle > > 78:4 error Expected indentation of 2 spaces but found 3 indent > > 79:7 error Expected indentation of 5 spaces but found 6 indent > > 86:25 error Missing trailing comma > comma-dangle > > 87:12 error Missing trailing comma > comma-dangle > > 91:4 error Expected indentation of 2 spaces but found 3 indent > > 92:7 error Expected indentation of 5 spaces but found 6 indent > > 99:25 error Missing trailing comma > comma-dangle > > 100:12 error Missing trailing comma > comma-dangle > > 104:4 error Expected indentation of 2 spaces but found 3 indent > > 105:7 error Expected indentation of 5 spaces but found 6 indent > > 112:25 error Missing trailing comma > comma-dangle > > 113:12 error Missing trailing comma > comma-dangle > > > *✖ 32 problems (32 errors, 0 warnings)* > > > > > On Mon, Apr 30, 2018 at 8:10 PM, Joao De Almeida Pereira < > jdealmeidapere...@pivotal.io> wrote: > >> Hi there, >> >> We weren't able to see these functions get called. Perhaps we're missing >> something. >> >> Thanks, >> Joao && Anthony >> >> On Mon, Apr 30, 2018 at 2:48 AM Khushboo Vashi < >> khushboo.va...@enterprisedb.com> wrote: >> >>> Hi Joao, >>> >>> The patches look good however I have noticed that you >>> deleted attachShortcut and attachDialogTabNavigatorShortcut functions >>> from keyboard.js, any specific reason for that? >>> >>> Thanks, >>> Khushboo >>> >>> On Fri, Apr 27, 2018 at 3:11 AM, Joao De Almeida Pereira < >>> jdealmeidapere...@pivotal.io> wrote: >>> >>>> Hi Khushboo, >>>> >>>> I did some changes on your patch: >>>> 0001 - Your original patch >>>> 0002 - Convert keyboard.js to ES6 >>>> 0003 - Refactoring of the keyboard.js file(some one letter variables >>>> and other code) >>>> >>>> >>>> >>>> Thanks >>>> Joao >>>> >>>> On Thu, Apr 26, 2018 at 5:34 AM Khushboo Vashi < >>>> khushboo.va...@enterprisedb.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> Please find the attached patch to fix the RM #3284 : F5 key not >>>>> working consistently. >>>>> >>>>> - Added the configurable keyboard shortcut (default F5) to refresh the >>>>> browser tree nodes. >>>>> >>>>> >>>>> Thanks, >>>>> Khushboo >>>>> >>>> >>> > > > -- > *Akshay Joshi* > > *Sr. Software Architect * > > > > *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* >
diff --git a/web/regression/javascript/parse_shortcut_value_spec.js b/web/regression/javascript/parse_shortcut_value_spec.js new file mode 100644 index 0000000..4a801aa --- /dev/null +++ b/web/regression/javascript/parse_shortcut_value_spec.js @@ -0,0 +1,117 @@ +///////////////////////////////////////////////////////////// +// +// pgAdmin 4 - PostgreSQL Tools +// +// Copyright (C) 2013 - 2018, The pgAdmin Development Team +// This software is released under the PostgreSQL Licence +// +////////////////////////////////////////////////////////////// + +import { parseShortcutValue } from 'sources/utils'; + +describe('parseShortcutValue', function () { + describe('when short cut is F5', function () { + it('returns f5', function () { + expect(parseShortcutValue({ + alt: false, + control: false, + shift: false, + key: { + char: 'F5', + key_code: 116, + }, + })).toEqual('f5'); + }); + }); + describe('when short cut is Alt+Shift+F5', function () { + it('returns alt+shift+f5', function () { + expect(parseShortcutValue({ + alt: true, + control: false, + shift: true, + key: { + char: 'F5', + key_code: 116, + }, + })).toEqual('alt+shift+f5'); + }); + }); + describe('when short cut is Alt+Shift+t', function () { + it('returns alt+shift+t', function () { + expect(parseShortcutValue({ + alt: true, + control: false, + shift: true, + key: { + char: 't', + key_code: 84, + }, + })).toEqual('alt+shift+t'); + }); + }); + describe('when short cut is Alt+Shift+Ctrl+t', function () { + it('returns alt+shift+ctrl+t', function () { + expect(parseShortcutValue({ + alt: true, + control: true, + shift: true, + key: { + char: 't', + key_code: 84, + }, + })).toEqual('alt+shift+ctrl+t'); + }); + }); + describe('when short cut is Alt+Ctrl+t', function () { + it('returns alt+ctrl+t', function () { + expect(parseShortcutValue({ + alt: true, + control: true, + shift: false, + key: { + char: 't', + key_code: 84, + }, + })).toEqual('alt+ctrl+t'); + }); + }); + describe('when short cut is Shift+Ctrl+L', function () { + it('returns shift+ctrl+l', function () { + expect(parseShortcutValue({ + alt: false, + control: true, + shift: true, + key: { + char: 'L', + key_code: 76, + }, + })).toEqual('shift+ctrl+l'); + }); + }); + describe('when short cut is $', function () { + it('returns $', function () { + expect(parseShortcutValue({ + alt: false, + control: false, + shift: false, + key: { + char: '$', + key_code: 52, + }, + })).toEqual('$'); + }); + }); + describe('when short cut is 4', function () { + it('returns 4', function () { + expect(parseShortcutValue({ + alt: false, + control: false, + shift: false, + key: { + char: '4', + key_code: 52, + }, + })).toEqual('4'); + }); + }); +});