Skip to content

Commit 100f08f

Browse files
chore: remove donation dialog and links
1 parent 93d27ea commit 100f08f

File tree

8 files changed

+7
-250
lines changed

8 files changed

+7
-250
lines changed

arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@ import { DebugConfigurationWidget } from './theia/debug/debug-configuration-widg
368368
import { DebugConfigurationWidget as TheiaDebugConfigurationWidget } from '@theia/debug/lib/browser/view/debug-configuration-widget';
369369
import { DebugToolBar } from '@theia/debug/lib/browser/view/debug-toolbar-widget';
370370

371-
import {
372-
VersionWelcomeDialog,
373-
VersionWelcomeDialogProps,
374-
} from './dialogs/version-welcome-dialog';
375371
import { TestViewContribution as TheiaTestViewContribution } from '@theia/test/lib/browser/view/test-view-contribution';
376372
import { TestViewContribution } from './theia/test/test-view-contribution';
377373

@@ -987,11 +983,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
987983
title: 'IDEUpdater',
988984
});
989985

990-
bind(VersionWelcomeDialog).toSelf().inSingletonScope();
991-
bind(VersionWelcomeDialogProps).toConstantValue({
992-
title: 'VersionWelcomeDialog',
993-
});
994-
995986
bind(UserFieldsDialog).toSelf().inSingletonScope();
996987
bind(UserFieldsDialogProps).toConstantValue({
997988
title: 'UserFields',

arduino-ide-extension/src/browser/contributions/check-for-ide-updates.ts

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
} from '../../common/protocol/ide-updater';
99
import { IDEUpdaterDialog } from '../dialogs/ide-updater/ide-updater-dialog';
1010
import { Contribution } from './contribution';
11-
import { VersionWelcomeDialog } from '../dialogs/version-welcome-dialog';
1211
import { AppService } from '../app-service';
1312
import { SemVer } from 'semver';
1413

@@ -20,9 +19,6 @@ export class CheckForIDEUpdates extends Contribution {
2019
@inject(IDEUpdaterDialog)
2120
private readonly updaterDialog: IDEUpdaterDialog;
2221

23-
@inject(VersionWelcomeDialog)
24-
private readonly versionWelcomeDialog: VersionWelcomeDialog;
25-
2622
@inject(LocalStorageService)
2723
private readonly localStorage: LocalStorageService;
2824

@@ -59,13 +55,8 @@ export class CheckForIDEUpdates extends Contribution {
5955
return this.updater.checkForUpdates(true);
6056
})
6157
.then(async (updateInfo) => {
62-
if (!updateInfo) {
63-
const isNewVersion = await this.isNewStableVersion();
64-
if (isNewVersion) {
65-
this.versionWelcomeDialog.open();
66-
}
67-
return;
68-
}
58+
if (!updateInfo) return;
59+
6960
const versionToSkip = await this.localStorage.getData<string>(
7061
SKIP_IDE_VERSION
7162
);
@@ -86,6 +77,11 @@ export class CheckForIDEUpdates extends Contribution {
8677
});
8778
}
8879

80+
/**
81+
* This value is set in localStorage but currently not used.
82+
* We keep this logic running anyway for eventual future needs
83+
* (eg. show a new version welcome dialog)
84+
*/
8985
private async setCurrentIDEVersion(): Promise<void> {
9086
try {
9187
const { appVersion } = await this.appService.info();
@@ -95,29 +91,4 @@ export class CheckForIDEUpdates extends Contribution {
9591
// ignore invalid versions
9692
}
9793
}
98-
99-
/**
100-
* Check if user is running a new IDE version for the first time.
101-
* @returns true if the current IDE version is greater than the last used version
102-
* and both are non-prerelease versions.
103-
*/
104-
private async isNewStableVersion(): Promise<boolean> {
105-
try {
106-
const { appVersion } = await this.appService.info();
107-
const prevVersion = await this.localStorage.getData<string>(
108-
LAST_USED_IDE_VERSION
109-
);
110-
111-
const prevSemVer = new SemVer(prevVersion ?? '');
112-
const currSemVer = new SemVer(appVersion ?? '');
113-
114-
if (prevSemVer.prerelease.length || currSemVer.prerelease.length) {
115-
return false;
116-
}
117-
118-
return currSemVer.compare(prevSemVer) === 1;
119-
} catch (e) {
120-
return false;
121-
}
122-
}
12394
}

arduino-ide-extension/src/browser/dialogs/ide-updater/ide-updater-dialog.tsx

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from '../../../common/protocol/ide-updater';
1818
import { LocalStorageService } from '@theia/core/lib/browser';
1919
import { WindowService } from '@theia/core/lib/browser/window/window-service';
20-
import { sanitize } from 'dompurify';
2120

2221
@injectable()
2322
export class IDEUpdaterDialogProps extends DialogProps {}
@@ -166,51 +165,6 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
166165
goToDownloadPageButton.focus();
167166
}
168167

169-
private appendDonateFooter() {
170-
const footer = document.createElement('div');
171-
footer.classList.add('ide-updater-dialog--footer');
172-
const footerContent = document.createElement('div');
173-
footerContent.classList.add('ide-updater-dialog--footer-content');
174-
footer.appendChild(footerContent);
175-
176-
const footerLink = document.createElement('a');
177-
footerLink.innerText = sanitize(
178-
nls.localize('arduino/ide-updater/donateLinkText', 'donate to support us')
179-
);
180-
footerLink.classList.add('ide-updater-dialog--footer-link');
181-
footerLink.onclick = () =>
182-
this.openExternal('https://www.arduino.cc/en/donate');
183-
184-
const footerLinkIcon = document.createElement('span');
185-
footerLinkIcon.title = nls.localize(
186-
'arduino/ide-updater/donateLinkIconTitle',
187-
'open donation page'
188-
);
189-
footerLinkIcon.classList.add('ide-updater-dialog--footer-link-icon');
190-
footerLink.appendChild(footerLinkIcon);
191-
192-
const placeholderKey = '%%link%%';
193-
const footerText = sanitize(
194-
nls.localize(
195-
'arduino/ide-updater/donateText',
196-
'Open source is love, {0}',
197-
placeholderKey
198-
)
199-
);
200-
const placeholder = footerText.indexOf(placeholderKey);
201-
if (placeholder !== -1) {
202-
const parts = footerText.split(placeholderKey);
203-
footerContent.appendChild(document.createTextNode(parts[0]));
204-
footerContent.appendChild(footerLink);
205-
footerContent.appendChild(document.createTextNode(parts[1]));
206-
} else {
207-
footerContent.appendChild(document.createTextNode(footerText));
208-
footerContent.appendChild(footerLink);
209-
}
210-
211-
this.controlPanel.insertAdjacentElement('afterend', footer);
212-
}
213-
214168
private openDownloadPage(): void {
215169
this.openExternal('https://www.arduino.cc/en/software');
216170
this.close();
@@ -233,7 +187,6 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
233187
downloadStarted: true,
234188
});
235189
this.clearButtons();
236-
this.appendDonateFooter();
237190
this.updater.downloadUpdate();
238191
}
239192

arduino-ide-extension/src/browser/dialogs/version-welcome-dialog.tsx

Lines changed: 0 additions & 107 deletions
This file was deleted.

arduino-ide-extension/src/browser/style/ide-updater-dialog.css

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,6 @@
3434
min-width: 0;
3535
}
3636

37-
.ide-updater-dialog--footer {
38-
display: inline-block;
39-
margin-top: -16px;
40-
padding: 12px 0 24px 0;
41-
border-top: 1px solid var(--theia-editorWidget-border);
42-
}
43-
.ide-updater-dialog--footer-content {
44-
float: right;
45-
}
46-
47-
.ide-updater-dialog--footer-link {
48-
display: inline-block;
49-
color: var(--theia-textLink-foreground);
50-
font-weight: 500;
51-
line-height: 13px;
52-
}
53-
.ide-updater-dialog--footer-link:hover {
54-
color: var(--theia-textLink-foreground);
55-
cursor: pointer;
56-
}
57-
.ide-updater-dialog--footer-link-icon {
58-
display: inline-block;
59-
-webkit-mask: url(../icons/link-open-icon.svg) center no-repeat;
60-
background-color: var(--theia-textLink-foreground);
61-
height: 12px;
62-
width: 12px;
63-
cursor: pointer;
64-
transform: translateY(2px);
65-
margin-left: 4px;
66-
}
67-
6837
.ide-updater-dialog .changelog {
6938
color: var(--theia-editor-foreground);
7039
background-color: var(--theia-editor-background);
@@ -140,7 +109,6 @@
140109
max-height: 100%;
141110
overflow: hidden;
142111
display: flex;
143-
padding-bottom: 20px !important;
144112
}
145113

146114
#ide-updater-dialog-container .skip-version-button {

arduino-ide-extension/src/browser/style/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
@import "./settings-dialog.css";
1111
@import "./firmware-uploader-dialog.css";
1212
@import "./ide-updater-dialog.css";
13-
@import "./version-welcome-dialog.css";
1413
@import "./certificate-uploader-dialog.css";
1514
@import "./user-fields-dialog.css";
1615
@import "./debug.css";

arduino-ide-extension/src/browser/style/version-welcome-dialog.css

Lines changed: 0 additions & 7 deletions
This file was deleted.

i18n/en.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,6 @@
275275
"checkForUpdates": "Check for Arduino IDE Updates",
276276
"closeAndInstallButton": "Close and Install",
277277
"closeToInstallNotice": "Close the software and install the update on your machine.",
278-
"donateLinkIconTitle": "open donation page",
279-
"donateLinkText": "donate to support us",
280-
"donateText": "Open source is love, {0}",
281278
"downloadButton": "Download",
282279
"downloadingNotice": "Downloading the latest version of the Arduino IDE.",
283280
"errorCheckingForUpdates": "Error while checking for Arduino IDE updates.\n{0}",
@@ -523,14 +520,6 @@
523520
"renameSketchFolderMessage": "The sketch '{0}' cannot be used. {1} To get rid of this message, rename the sketch. Do you want to rename the sketch now?",
524521
"renameSketchFolderTitle": "Invalid sketch name"
525522
},
526-
"versionWelcome": {
527-
"cancelButton": "Maybe later",
528-
"donateButton": "Donate now",
529-
"donateMessage": "Arduino is committed to keeping software free and open-source for everyone. Your donation helps us develop new features, improve libraries, and support millions of users worldwide.",
530-
"donateMessage2": "Please consider supporting our work on the free open source Arduino IDE.",
531-
"title": "Welcome to a new version of the Arduino IDE!",
532-
"titleWithVersion": "Welcome to the new Arduino IDE {0}!"
533-
},
534523
"workspace": {
535524
"alreadyExists": "'{0}' already exists."
536525
}

0 commit comments

Comments
 (0)