Skip to content

chore: disable uninstall feedback form #5333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/common/commands/preuninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { doesCurrentNpmCommandMatch, isInteractive } from "../helpers";
import { TrackActionNames, AnalyticsEventLabelDelimiter } from "../../constants";

export class PreUninstallCommand implements ICommand {
private static FEEDBACK_FORM_URL = "https://www.nativescript.org/uninstall-feedback";
// disabled for now (6/24/2020)
// private static FEEDBACK_FORM_URL = "https://www.nativescript.org/uninstall-feedback";

public allowedParameters: ICommandParameter[] = [];

constructor(private $analyticsService: IAnalyticsService,
private $extensibilityService: IExtensibilityService,
private $fs: IFileSystem,
private $opener: IOpener,
// private $opener: IOpener,
private $packageInstallationManager: IPackageInstallationManager,
private $settingsService: ISettingsService) { }

Expand All @@ -37,9 +38,11 @@ export class PreUninstallCommand implements ICommand {
}

private async handleFeedbackForm(): Promise<void> {
if (isInteractive()) {
this.$opener.open(PreUninstallCommand.FEEDBACK_FORM_URL);
}
// disabled for now (6/24/2020)
// if (isInteractive()) {
// this.$opener.open(PreUninstallCommand.FEEDBACK_FORM_URL);
// }
return Promise.resolve();
}
}

Expand Down
31 changes: 16 additions & 15 deletions lib/common/test/unit-tests/preuninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,20 @@ describe("preuninstall", () => {
assert.isTrue(isClearInspectorCacheCalled, "When uninstall is called, `clearInspectorCache` method must be called");
});

it("opens the uninstall feedback form when terminal is interactive and uninstall is called", async () => {
helpers.doesCurrentNpmCommandMatch = () => true;
helpers.isInteractive = () => true;

const testInjector = createTestInjector();
const opener = testInjector.resolve<IOpener>("opener");
const openParams: any[] = [];
opener.open = (filename: string, appname?: string) => {
openParams.push({ filename, appname });
};

const preUninstallCommand: ICommand = testInjector.resolveCommand("dev-preuninstall");
await preUninstallCommand.execute([]);
assert.deepEqual(openParams, [{ filename: "https://www.nativescript.org/uninstall-feedback", appname: undefined }]);
});
// disabled (6/24/2020)
// it("opens the uninstall feedback form when terminal is interactive and uninstall is called", async () => {
// helpers.doesCurrentNpmCommandMatch = () => true;
// helpers.isInteractive = () => true;

// const testInjector = createTestInjector();
// const opener = testInjector.resolve<IOpener>("opener");
// const openParams: any[] = [];
// opener.open = (filename: string, appname?: string) => {
// openParams.push({ filename, appname });
// };

// const preUninstallCommand: ICommand = testInjector.resolveCommand("dev-preuninstall");
// await preUninstallCommand.execute([]);
// assert.deepEqual(openParams, [{ filename: "https://www.nativescript.org/uninstall-feedback", appname: undefined }]);
// });
});