@bigbinary/neeto-commons-frontend 2.0.48 → 2.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  declare namespace Cypress {
2
2
  interface Chainable {
3
- clearAndType(selector: any, text: any): Void;
4
- clearAndTypeFast(selector: any, text: any): Void;
5
- clearByClickAndTypeFast(selector: any, text: any): Void;
6
- typeFast(selector: any, text: any): Void;
7
- typeAndEnter(selector: any, text: any): Void;
8
- verifyToastMessage(message: any): Void;
3
+ clearAndType(selector: string, text: string): Void;
4
+ clearAndTypeFast(selector: string, text: string): Void;
5
+ clearByClickAndTypeFast(selector: string, text: string): Void;
6
+ typeFast(selector: string, text: string): Void;
7
+ typeAndEnter(selector: string, text: string): Void;
8
+ verifyToastMessage(message: string): Void;
9
9
  continueOnAlert(
10
10
  alias:
11
11
  | string
@@ -53,5 +53,18 @@ declare namespace Cypress {
53
53
  globalState(key: string): Void;
54
54
  ifExist(selector: string, callback: Function): Void;
55
55
  ifNotExist(selector: string, callback: Function): Void;
56
+ dragAndDrop(props: {
57
+ subject: string;
58
+ target: string;
59
+ dragIndex: number;
60
+ dropIndex: number
61
+ });
62
+ verifyPlaceholder(textInputSelector: string, value: string): Void;
63
+ enableOrDisableSwitch(switchButton: string, value: string): Void;
64
+ interceptNonVersionedApi(props: {
65
+ url: string;
66
+ alias: string;
67
+ times?: number; // maximum number of times to match
68
+ }): Cypress.Chainable<Cypress.InterceptionOptions>;
56
69
  }
57
70
  }
@@ -172,7 +172,29 @@ var commonSelectors = {
172
172
  toastCloseButton: ".neeto-ui-toastr__close-button",
173
173
  windowAlert: "#alert-box",
174
174
  body: "body",
175
- toastIcon: ".Toastify__toast-icon"
175
+ toastIcon: ".Toastify__toast-icon",
176
+ paneModalCrossIcon: ".neeto-ui-pane__close",
177
+ inputField: dataCy("input-field"),
178
+ alertConfirmationText: dataCy("alert-confirmation-text"),
179
+ alertCancelButton: dataCy("alert-cancel-button"),
180
+ alertModalCrossIcon: ".neeto-ui-modal__close",
181
+ saveChangesButton: dataCy("save-changes-button"),
182
+ cancelButton: dataCy("cancel-button"),
183
+ inputFieldError: dataCy("nui-input-error"),
184
+ selectDropDownError: dataCy("nui-select-error"),
185
+ subTitleHeading: function subTitleHeading(index) {
186
+ return dataCy("menubar-subtitle-heading", ":eq(".concat(index, ")"));
187
+ },
188
+ noDataTitle: dataCy("no-data-title"),
189
+ noDataDescription: dataCy("no-data-description"),
190
+ backDrop: "[data-testid='backdrop']",
191
+ menuBarHeading: dataCy("menubar-heading"),
192
+ tabItem: function tabItem(index) {
193
+ return dataCy("tab-item", ":eq(".concat(index, ")"));
194
+ },
195
+ dropdownWrapper: function dropdownWrapper(index) {
196
+ return dataCy("nui-select-container-wrapper", ":eq(".concat(index, ")"));
197
+ }
176
198
  };
177
199
  var tableSelectors = {
178
200
  nthColumn: function nthColumn(n) {
@@ -181,7 +203,10 @@ var tableSelectors = {
181
203
  tableBody: ".ant-table-body",
182
204
  tableHeader: ".ant-table-thead th",
183
205
  tableRow: ".ant-table-tbody tr",
184
- spinner: ".ant-spin"
206
+ spinner: ".ant-spin",
207
+ nthHeading: function nthHeading(n) {
208
+ return "tr > th:nth-child(".concat(n, ")");
209
+ }
185
210
  };
186
211
  var profileSelectors = {
187
212
  tab: dataCy("profile-section"),
@@ -203,7 +228,15 @@ var commonTexts = {
203
228
  "new": "New",
204
229
  takeAction: "Take action",
205
230
  unblock: "Unblock",
206
- toastIcon: "👍"
231
+ toastIcon: "👍",
232
+ emailRequiredError: "Email is required.",
233
+ emailTakenMessage: "Email is already taken",
234
+ nameTakenMessage: "Name has already been taken",
235
+ all: "All",
236
+ proceed: "Proceed",
237
+ settings: "Settings",
238
+ unsavedChangesAlertTitle: "You have unsaved changes!",
239
+ unsavedChangesAlertMessage: "Are you sure you want to continue? All of your unsaved changes will be lost."
207
240
  };
208
241
 
209
242
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -277,7 +310,9 @@ var initCustomCommands = function initCustomCommands() {
277
310
  Cypress.Commands.add("apiRequest", function (options) {
278
311
  return cy.get("@requestHeaders").then(function (requestHeaders) {
279
312
  return requestHeaders ? cy.request(_objectSpread(_objectSpread({}, options), {}, {
280
- headers: requestHeaders
313
+ headers: _objectSpread(_objectSpread({}, requestHeaders), {}, {
314
+ "accept-encoding": "gzip"
315
+ })
281
316
  })) : cy.log("No request headers found");
282
317
  });
283
318
  });
@@ -333,6 +368,72 @@ var initCustomCommands = function initCustomCommands() {
333
368
  if (!$body.find(selector).length) callback();
334
369
  });
335
370
  });
371
+ Cypress.Commands.add("dragAndDrop", function (_ref2) {
372
+ var subject = _ref2.subject,
373
+ target = _ref2.target,
374
+ _ref2$dragIndex = _ref2.dragIndex,
375
+ dragIndex = _ref2$dragIndex === void 0 ? 0 : _ref2$dragIndex,
376
+ _ref2$dropIndex = _ref2.dropIndex,
377
+ dropIndex = _ref2$dropIndex === void 0 ? 0 : _ref2$dropIndex;
378
+ cy.get(subject).should("be.visible", {
379
+ timeout: 20000
380
+ });
381
+ Cypress.log({
382
+ name: "DRAGNDROP",
383
+ message: "Dragging element ".concat(subject, " to ").concat(target),
384
+ consoleProps: function consoleProps() {
385
+ return {
386
+ subject: subject,
387
+ target: target
388
+ };
389
+ }
390
+ });
391
+ cy.get(target).eq(dropIndex).then(function ($target) {
392
+ var coordsDrop = $target[0].getBoundingClientRect();
393
+ cy.get(subject).eq(dragIndex).then(function (subject) {
394
+ var coordsDrag = subject[0].getBoundingClientRect();
395
+ cy.wrap(subject).trigger("mousedown", {
396
+ button: 0,
397
+ // BUTTON_INDEX
398
+ clientX: coordsDrag.x,
399
+ clientY: coordsDrag.y,
400
+ force: true
401
+ }).trigger("mousemove", {
402
+ button: 0,
403
+ // BUTTON_INDEX
404
+ clientX: coordsDrag.x + 10,
405
+ // SLOPPY_CLICK_THRESHOLD
406
+ clientY: coordsDrag.y,
407
+ force: true
408
+ });
409
+ cy.get("body").trigger("mousemove", {
410
+ button: 0,
411
+ // BUTTON_INDEX
412
+ clientX: coordsDrop.x,
413
+ clientY: coordsDrop.y,
414
+ force: true
415
+ }).trigger("mouseup");
416
+ });
417
+ });
418
+ });
419
+ Cypress.Commands.add("verifyPlaceholder", function (textInputSelector, value) {
420
+ cy.get(textInputSelector).should("have.attr", "placeholder").and("eq", value);
421
+ });
422
+ Cypress.Commands.add("enableOrDisableSwitch", function (switchButton, value) {
423
+ cy.get(switchButton).invoke("click");
424
+ cy.get(switchButton).should("have.prop", "value").and("eq", value);
425
+ });
426
+ Cypress.Commands.add("interceptNonVersionedApi", function (_ref3) {
427
+ var _ref3$url = _ref3.url,
428
+ url = _ref3$url === void 0 ? "*" : _ref3$url,
429
+ alias = _ref3.alias,
430
+ _ref3$times = _ref3.times,
431
+ times = _ref3$times === void 0 ? 1 : _ref3$times;
432
+ cy.intercept({
433
+ url: url,
434
+ times: times
435
+ }).as(alias);
436
+ });
336
437
  };
337
438
 
338
439
  var loginSelectors = {
@@ -15,6 +15,22 @@ type CommonSelectors = {
15
15
  toastCloseButton: string;
16
16
  windowAlert: string;
17
17
  body: string;
18
+ paneModalCrossIcon: string;
19
+ inputField: string;
20
+ alertConfirmationText: string;
21
+ alertCancelButton: string;
22
+ alertModalCrossIcon: string;
23
+ saveChangesButton: string;
24
+ cancelButton: string;
25
+ inputFieldError: string;
26
+ selectDropDownError: string;
27
+ subTitleHeading: (index: string) => string;
28
+ noDataTitle: string;
29
+ noDataDescription: string;
30
+ backDrop: string;
31
+ menuBarHeading: string;
32
+ tabItem: (index: string) => string;
33
+ dropdownWrapper: (index: string) => string;
18
34
  };
19
35
 
20
36
  type MemberSelectors = {
@@ -82,6 +98,15 @@ type CommonTexts = {
82
98
  new: string;
83
99
  takeAction: string;
84
100
  unblock: string;
101
+ emailRequiredError: string;
102
+ emailTakenMessage: string;
103
+ nameTakenMessage: string;
104
+ all: string;
105
+ proceed: string;
106
+ settings: string;
107
+ unsavedChangesAlertTitle: string;
108
+ unsavedChangesAlertMessage: string;
109
+ unsavedChangesAlertTitle: string;
85
110
  };
86
111
 
87
112
  type MemberText = {
package/cypress-utils.js CHANGED
@@ -164,7 +164,29 @@ var commonSelectors = {
164
164
  toastCloseButton: ".neeto-ui-toastr__close-button",
165
165
  windowAlert: "#alert-box",
166
166
  body: "body",
167
- toastIcon: ".Toastify__toast-icon"
167
+ toastIcon: ".Toastify__toast-icon",
168
+ paneModalCrossIcon: ".neeto-ui-pane__close",
169
+ inputField: dataCy("input-field"),
170
+ alertConfirmationText: dataCy("alert-confirmation-text"),
171
+ alertCancelButton: dataCy("alert-cancel-button"),
172
+ alertModalCrossIcon: ".neeto-ui-modal__close",
173
+ saveChangesButton: dataCy("save-changes-button"),
174
+ cancelButton: dataCy("cancel-button"),
175
+ inputFieldError: dataCy("nui-input-error"),
176
+ selectDropDownError: dataCy("nui-select-error"),
177
+ subTitleHeading: function subTitleHeading(index) {
178
+ return dataCy("menubar-subtitle-heading", ":eq(".concat(index, ")"));
179
+ },
180
+ noDataTitle: dataCy("no-data-title"),
181
+ noDataDescription: dataCy("no-data-description"),
182
+ backDrop: "[data-testid='backdrop']",
183
+ menuBarHeading: dataCy("menubar-heading"),
184
+ tabItem: function tabItem(index) {
185
+ return dataCy("tab-item", ":eq(".concat(index, ")"));
186
+ },
187
+ dropdownWrapper: function dropdownWrapper(index) {
188
+ return dataCy("nui-select-container-wrapper", ":eq(".concat(index, ")"));
189
+ }
168
190
  };
169
191
  var tableSelectors = {
170
192
  nthColumn: function nthColumn(n) {
@@ -173,7 +195,10 @@ var tableSelectors = {
173
195
  tableBody: ".ant-table-body",
174
196
  tableHeader: ".ant-table-thead th",
175
197
  tableRow: ".ant-table-tbody tr",
176
- spinner: ".ant-spin"
198
+ spinner: ".ant-spin",
199
+ nthHeading: function nthHeading(n) {
200
+ return "tr > th:nth-child(".concat(n, ")");
201
+ }
177
202
  };
178
203
  var profileSelectors = {
179
204
  tab: dataCy("profile-section"),
@@ -195,7 +220,15 @@ var commonTexts = {
195
220
  "new": "New",
196
221
  takeAction: "Take action",
197
222
  unblock: "Unblock",
198
- toastIcon: "👍"
223
+ toastIcon: "👍",
224
+ emailRequiredError: "Email is required.",
225
+ emailTakenMessage: "Email is already taken",
226
+ nameTakenMessage: "Name has already been taken",
227
+ all: "All",
228
+ proceed: "Proceed",
229
+ settings: "Settings",
230
+ unsavedChangesAlertTitle: "You have unsaved changes!",
231
+ unsavedChangesAlertMessage: "Are you sure you want to continue? All of your unsaved changes will be lost."
199
232
  };
200
233
 
201
234
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -269,7 +302,9 @@ var initCustomCommands = function initCustomCommands() {
269
302
  Cypress.Commands.add("apiRequest", function (options) {
270
303
  return cy.get("@requestHeaders").then(function (requestHeaders) {
271
304
  return requestHeaders ? cy.request(_objectSpread(_objectSpread({}, options), {}, {
272
- headers: requestHeaders
305
+ headers: _objectSpread(_objectSpread({}, requestHeaders), {}, {
306
+ "accept-encoding": "gzip"
307
+ })
273
308
  })) : cy.log("No request headers found");
274
309
  });
275
310
  });
@@ -325,6 +360,72 @@ var initCustomCommands = function initCustomCommands() {
325
360
  if (!$body.find(selector).length) callback();
326
361
  });
327
362
  });
363
+ Cypress.Commands.add("dragAndDrop", function (_ref2) {
364
+ var subject = _ref2.subject,
365
+ target = _ref2.target,
366
+ _ref2$dragIndex = _ref2.dragIndex,
367
+ dragIndex = _ref2$dragIndex === void 0 ? 0 : _ref2$dragIndex,
368
+ _ref2$dropIndex = _ref2.dropIndex,
369
+ dropIndex = _ref2$dropIndex === void 0 ? 0 : _ref2$dropIndex;
370
+ cy.get(subject).should("be.visible", {
371
+ timeout: 20000
372
+ });
373
+ Cypress.log({
374
+ name: "DRAGNDROP",
375
+ message: "Dragging element ".concat(subject, " to ").concat(target),
376
+ consoleProps: function consoleProps() {
377
+ return {
378
+ subject: subject,
379
+ target: target
380
+ };
381
+ }
382
+ });
383
+ cy.get(target).eq(dropIndex).then(function ($target) {
384
+ var coordsDrop = $target[0].getBoundingClientRect();
385
+ cy.get(subject).eq(dragIndex).then(function (subject) {
386
+ var coordsDrag = subject[0].getBoundingClientRect();
387
+ cy.wrap(subject).trigger("mousedown", {
388
+ button: 0,
389
+ // BUTTON_INDEX
390
+ clientX: coordsDrag.x,
391
+ clientY: coordsDrag.y,
392
+ force: true
393
+ }).trigger("mousemove", {
394
+ button: 0,
395
+ // BUTTON_INDEX
396
+ clientX: coordsDrag.x + 10,
397
+ // SLOPPY_CLICK_THRESHOLD
398
+ clientY: coordsDrag.y,
399
+ force: true
400
+ });
401
+ cy.get("body").trigger("mousemove", {
402
+ button: 0,
403
+ // BUTTON_INDEX
404
+ clientX: coordsDrop.x,
405
+ clientY: coordsDrop.y,
406
+ force: true
407
+ }).trigger("mouseup");
408
+ });
409
+ });
410
+ });
411
+ Cypress.Commands.add("verifyPlaceholder", function (textInputSelector, value) {
412
+ cy.get(textInputSelector).should("have.attr", "placeholder").and("eq", value);
413
+ });
414
+ Cypress.Commands.add("enableOrDisableSwitch", function (switchButton, value) {
415
+ cy.get(switchButton).invoke("click");
416
+ cy.get(switchButton).should("have.prop", "value").and("eq", value);
417
+ });
418
+ Cypress.Commands.add("interceptNonVersionedApi", function (_ref3) {
419
+ var _ref3$url = _ref3.url,
420
+ url = _ref3$url === void 0 ? "*" : _ref3$url,
421
+ alias = _ref3.alias,
422
+ _ref3$times = _ref3.times,
423
+ times = _ref3$times === void 0 ? 1 : _ref3$times;
424
+ cy.intercept({
425
+ url: url,
426
+ times: times
427
+ }).as(alias);
428
+ });
328
429
  };
329
430
 
330
431
  var loginSelectors = {
@@ -581,6 +581,7 @@ var neetoCommons = {
581
581
  },
582
582
  keyboardShortcuts: {
583
583
  title: "Keyboard shortcuts",
584
+ viewFullListOfShortcuts: "View full list of shortcuts",
584
585
  global: {
585
586
  categoryName: "GLOBAL",
586
587
  openKeyboardShortcutsPane: "Open the keyboard shortcuts pane",
package/initializers.js CHANGED
@@ -571,6 +571,7 @@ var neetoCommons = {
571
571
  },
572
572
  keyboardShortcuts: {
573
573
  title: "Keyboard shortcuts",
574
+ viewFullListOfShortcuts: "View full list of shortcuts",
574
575
  global: {
575
576
  categoryName: "GLOBAL",
576
577
  openKeyboardShortcutsPane: "Open the keyboard shortcuts pane",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "2.0.48",
3
+ "version": "2.0.50",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -30,23 +30,28 @@
30
30
  "exports": {
31
31
  "./react-utils": {
32
32
  "import": "./react-utils.js",
33
- "require": "./react-utils.cjs.js"
33
+ "require": "./react-utils.cjs.js",
34
+ "types": "./react-utils.d.ts"
34
35
  },
35
36
  "./cypress-utils": {
36
37
  "import": "./cypress-utils.js",
37
- "require": "./cypress-utils.cjs.js"
38
+ "require": "./cypress-utils.cjs.js",
39
+ "types": "./cypress-utils.d.ts"
38
40
  },
39
41
  "./utils": {
40
42
  "import": "./utils.js",
41
- "require": "./utils.cjs.js"
43
+ "require": "./utils.cjs.js",
44
+ "types": "./utils.d.ts"
42
45
  },
43
46
  "./pure": {
44
47
  "import": "./pure.js",
45
- "require": "./pure.cjs.js"
48
+ "require": "./pure.cjs.js",
49
+ "types": "./pure.d.ts"
46
50
  },
47
51
  "./initializers": {
48
52
  "import": "./initializers.js",
49
- "require": "./initializers.cjs.js"
53
+ "require": "./initializers.cjs.js",
54
+ "types": "./initializers.d.ts"
50
55
  },
51
56
  "./configs/*": "./configs/*"
52
57
  },
@@ -136,6 +141,7 @@
136
141
  "dependencies": {},
137
142
  "peerDependencies": {
138
143
  "@bigbinary/neeto-commons-frontend": "latest",
144
+ "@bigbinary/neeto-editor": "latest",
139
145
  "@bigbinary/neeto-icons": "^1.9.15",
140
146
  "@bigbinary/neetoui": "^4.4.3",
141
147
  "@honeybadger-io/react": "2.0.1",