Skip to content

Commit

Permalink
Merge pull request #1822 from thfries/ui_fix_401_on_startup
Browse files Browse the repository at this point in the history
UI - fix for #1821 (401 on startup)
  • Loading branch information
thjaeckle committed Nov 29, 2023
2 parents 2f88899 + 61eeb35 commit e1a1fee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion ui/modules/operations/piggyback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as Utils from '../utils.js';
import piggybackHTML from './piggyback.html';
import piggybackPlaceholders from './piggybackPlaceholders.json';
import * as Templates from './templates.js';
import {TabHandler} from '../utils/tabHandler.js';

const EDITOR_INVALID_JSON_MNSSAGE = 'Invalid json!'
const HEADER_IS_REQUIRED_MESSAGE = 'Headers field is required!';
Expand Down Expand Up @@ -57,6 +58,8 @@ let dom = {
responseStatus: null,
commandValidationElement: null,
headerValidationElement: null,
tabOperations: null,
collapseOperations: null,
}

document.getElementById('piggybackHTML').innerHTML = piggybackHTML;
Expand All @@ -72,7 +75,7 @@ export async function ready() {
Templates.setSelectedService(service);
}

await loadServicesAndInstances();
TabHandler(dom.tabOperations, dom.collapseOperations, loadServicesAndInstances, 'disableOperations');

initAceEditors();

Expand Down
10 changes: 6 additions & 4 deletions ui/modules/utils/tabHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ import * as Authorization from '../environments/authorization.js';

/**
* Common behaviour of all main tabs. Handles refresh of a tab after the environmant was changed
* @param {Element} domTabItem
* @param {Element} domTabContent
* @param {function} onRefreshTab
* @param {string} envDisabledKey
* It tracks a flag if the environment was changed and does a lazy call to refresh the tab
* if needed.
* @param {Element} domTabItem Reference to tab item in dom
* @param {Element} domTabContent Reference to the tab content in dom
* @param {function} onRefreshTab Callback that is called if the tab is activated and environment has changed
* @param {string} envDisabledKey Key that is used in environment json to toggle the tab
* @returns
*/

Expand Down

0 comments on commit e1a1fee

Please sign in to comment.