Skip to content

Commit

Permalink
Rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiaSliusar committed Aug 29, 2024
1 parent a9e9a0e commit f991f2b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/apputils/src/sessioncontext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1914,8 +1914,8 @@ namespace Private {
translator
);

const allowCustomEnvVariables =
PageConfig.getOption('allow_setup_custom_env_variables') === 'true'
const acceptKernelEnvVar =
PageConfig.getOption('accept_kernel_env_var') === 'true'
? true
: false;
const envVarsDiv = document.createElement('div');
Expand All @@ -1933,7 +1933,7 @@ namespace Private {
option.selected = true;
let val = JSON.parse(value);
let id = val && val.id ? val.id : '';
if (allowCustomEnvVariables && !id) {
if (acceptKernelEnvVar && !id) {
let defaultEnvValue = {};
envVarsDiv.innerHTML = '';
addEnvBlock(envVarsDiv, defaultEnvValue, translator);
Expand All @@ -1952,7 +1952,7 @@ namespace Private {
let kernelData = JSON.parse(select.value) as Kernel.IModel;
envVarsDiv.innerHTML = '';
body.setAttribute('data-custom-env-vars', '');
if (allowCustomEnvVariables && !kernelData.id) {
if (acceptKernelEnvVar && !kernelData.id) {
let defaultEnvValue = {};
addEnvBlock(envVarsDiv, defaultEnvValue, translator);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/apputils/test/sessioncontext.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('@jupyterlab/apputils', () => {
// eslint-disable-next-line camelcase
allow_external_kernels: true,
// eslint-disable-next-line camelcase
allow_setup_custom_env_variables: true,
accept_kernel_env_var: true,
// eslint-disable-next-line camelcase
external_connection_dir: external
}
Expand Down
6 changes: 3 additions & 3 deletions packages/console-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,11 @@ async function activateConsole(
});
}

const allowCustomEnvVariables =
PageConfig.getOption('allow_setup_custom_env_variables') === 'true'
const acceptKernelEnvVar =
PageConfig.getOption('accept_kernel_env_var') === 'true'
? true
: false;
if (allowCustomEnvVariables) {
if (acceptKernelEnvVar) {
app.contextMenu.addItem({
command: CommandIDs.setupCustomEnv,
selector: '.jp-LauncherCard[data-category="Console"]',
Expand Down
4 changes: 2 additions & 2 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2131,8 +2131,8 @@ function activateNotebookHandler(
services.kernelspecs.specsChanged.connect(onSpecsChanged);
});

const allowCustomEnvVariables =
PageConfig.getOption('allow_setup_custom_env_variables') === 'true'
const acceptKernelEnvVar =

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable acceptKernelEnvVar.
PageConfig.getOption('accept_kernel_env_var') === 'true'
? true
: false;
if (allowCustomEnvVariables) {
Expand Down

0 comments on commit f991f2b

Please sign in to comment.