Skip to content
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

UI - fix for #1821 (401 on startup) #1822

Merged
merged 1 commit into from
Nov 29, 2023
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
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
Loading