Skip to content

Commit f7f7b3e

Browse files
committed
chore: update setup for windows-rdp type-checking
1 parent bad778e commit f7f7b3e

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

registry/coder/modules/windows-rdp/devolutions-patch.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ async function autoSubmitForm(myForm) {
152152
// they're part of the form. Avoids CSS stacking context issues, maybe?
153153
/** @type {HTMLLIElement | null} */
154154
const protocolOption = document.querySelector(
155+
// biome-ignore lint/style/useTemplate: Have to skip interpolation for the main.tf interpolation
155156
'p-dropdownitem[ng-reflect-label="' + PROTOCOL + '"] li',
156157
);
157158

@@ -191,6 +192,7 @@ async function autoSubmitForm(myForm) {
191192

192193
if (input === null) {
193194
throw new Error(
195+
// biome-ignore lint/style/useTemplate: Have to skip interpolation for the main.tf interpolation
194196
'Unable to element that matches query "' + querySelector + '"',
195197
);
196198
}
@@ -293,6 +295,7 @@ function setupFormDetection() {
293295
*/
294296
function setupAlwaysOnStyles() {
295297
const styleId = "coder-patch--styles-always-on";
298+
// biome-ignore lint/style/useTemplate: Have to skip interpolation for the main.tf interpolation
296299
const existingContainer = document.querySelector("#" + styleId);
297300
if (existingContainer) {
298301
return;
@@ -310,11 +313,24 @@ function setupAlwaysOnStyles() {
310313
document.head.appendChild(styleContainer);
311314
}
312315

316+
/**
317+
* This ensures that the Devolutions login form (which by default, always shows
318+
* up on screen when the app first launches) stays visually hidden from the user
319+
* when they open Devolutions via the Coder module.
320+
*
321+
* The form will still be filled out automatically and submitted in the
322+
* background via the rest of the logic in this file, so this function is mainly
323+
* to help avoid screen flickering and make the overall experience feel a little
324+
* more polished (even though it's just one giant hack).
325+
*
326+
* @returns {void}
327+
*/
313328
function hideFormForInitialSubmission() {
314329
const styleId = "coder-patch--styles-initial-submission";
315330
const cssOpacityVariableName = "--coder-opacity-multiplier";
316331

317332
/** @type {HTMLStyleElement | null} */
333+
// biome-ignore lint/style/useTemplate: Have to skip interpolation for the main.tf interpolation
318334
let styleContainer = document.querySelector("#" + styleId);
319335
if (!styleContainer) {
320336
styleContainer = document.createElement("style");
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
// Even though this module doesn't contain any TypeScript, it's still
3+
// incredibly helpful to include a custom tsconfig file here to ensure that
4+
// the raw, unprocessed JavaScript we send doesn't use features that are too
5+
// modern, to maximize browser compatibility
6+
"extends": ["../../../../tsconfig.json"],
7+
"compilerOptions": {
8+
"target": "ES6",
9+
"module": "ES6"
10+
}
11+
}

tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
22
"compilerOptions": {
3-
// If we were just compiling for the tests, we could safely target ESNext at
4-
// all times, but just because we've been starting to add more runtime logic
5-
// files to some of the modules, erring on the side of caution by having a
6-
// older compilation target
73
"target": "ES2024",
84
"module": "esnext",
95
"strict": true,

0 commit comments

Comments
 (0)