Skip to content

Commit 8144ba9

Browse files
authored
Merge pull request #168 from Accedia/develop
Development Environment Update with Grouped logic added
2 parents 82dee35 + 5291a67 commit 8144ba9

File tree

3 files changed

+64
-3
lines changed

3 files changed

+64
-3
lines changed

electron-app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "fit-mitchell-rpa",
33
"appname": "REV Import Technology",
44
"productName": "REV Import Technology",
5-
"version": "1.5.95",
5+
"version": "1.5.96",
66
"homepage": "./",
77
"main": "./dist/main.js",
88
"description": "Automation for CCC by FIT",

electron-app/src/utils/mitchell_importer.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,16 @@ export class Mitchell_Importer extends Importer {
305305
) => {
306306
const hasSelectedItemized = selectedTypeForCommit === 'Itemized';
307307
const hasSelectedBundled = selectedTypeForCommit === 'Bundled';
308+
const hasSeletedGrouped = selectedTypeForCommit === 'Grouped';
308309
const numberOfInputs = forgettables.length * 8;
309310
const percentagePerCell = VERIFICATION_PROGRESS_BREAKPOINT / numberOfInputs;
310311
this.progressUpdater.setStep(percentagePerCell);
311312
if (hasSelectedItemized) {
312313
await this.populateItemized(forgettables);
313314
} else if (hasSelectedBundled) {
314315
await this.populateBundled(forgettables);
316+
} else if (hasSeletedGrouped) {
317+
await this.populateGrouped(forgettables);
315318
}
316319
};
317320

@@ -446,6 +449,64 @@ export class Mitchell_Importer extends Importer {
446449
await snooze(4000); // wait until modal is closed
447450
};
448451

452+
private populateGrouped = async (forgettables: MitchellForgettable[]) => {
453+
for (let i = 0; i < forgettables.length; i++) {
454+
const { description, extPrice, consumableLineNote } = forgettables[i];
455+
await this.typeMitchellValue(description);
456+
this.progressUpdater.update();
457+
458+
await times(4).pressKey(Key.Tab);
459+
await times(2).pressKey(Key.Down); // Selecting Part Type to be Aftermarket New
460+
461+
462+
await keyboard.pressKey(Key.Enter); // Select it
463+
await keyboard.releaseKey(Key.Enter);
464+
this.progressUpdater.update();
465+
await snooze(250);
466+
467+
await keyboard.pressKey(Key.LeftShift); // Hold Left Shift
468+
469+
for (let i = 0; i < 5; i++) {
470+
await keyboard.pressKey(Key.Tab);
471+
await keyboard.releaseKey(Key.Tab);
472+
}
473+
474+
await keyboard.releaseKey(Key.LeftShift); // Release Left Shift
475+
this.progressUpdater.update();
476+
477+
478+
await this.typeMitchellValue(extPrice); // type totalPrice;
479+
this.progressUpdater.update();
480+
await snooze(250)
481+
482+
await this.pressTabButton(2); // go to (+More) button
483+
this.progressUpdater.update();
484+
485+
await keyboard.pressKey(Key.Enter); // press Add Line with Enter to open Dropdown
486+
await keyboard.releaseKey(Key.Enter);
487+
await snooze(250)
488+
489+
490+
await times(4).pressKey(Key.Down); // Select Add New explanation
491+
await keyboard.pressKey(Key.Enter); // Press Add new explanation to open the textarea
492+
await keyboard.releaseKey(Key.Enter);
493+
494+
await this.typeMitchellValue(consumableLineNote); // Write the consumableLineNote
495+
this.progressUpdater.update();
496+
497+
await this.pressTabButton(4); // go to Add Line
498+
await keyboard.pressKey(Key.Enter); // press Add Line with Enter
499+
await keyboard.releaseKey(Key.Enter);
500+
this.progressUpdater.update();
501+
await snooze(6000); // wait until modal is closed
502+
503+
if (i < forgettables.length - 1) {
504+
await mouse.leftClick(); // open the modal again for the next line
505+
}
506+
}
507+
};
508+
509+
449510
private commitMitchellData = async (commitButtonCoordinates: Point, electronWindow: BrowserWindow) => {
450511
await mouse.setPosition(commitButtonCoordinates);
451512
await mouse.leftClick();

0 commit comments

Comments
 (0)