// Copyright Epic Games, Inc. All Rights Reserved. function goHome() { location.href = '/' + location.hash } function shelfVerify() { let queryParams = processQueryParameters(['bot', 'branch', 'cl', 'target'], ['targetStream']) if (!queryParams) return; let requestedBotName = queryParams["bot"] let requestedBranchName = queryParams["branch"] let targetBranchName = queryParams["target"] let optTargetStreamName = queryParams["targetStream"] let requestedBranchCl = parseInt(queryParams["cl"], 10) if (isNaN(requestedBranchCl)) { shelfFailure(`CL ${queryParams["cl"]} not a number.`) return } // Retrieve branch information to verify requested information getBranch(requestedBotName, requestedBranchName, function(data) { if (!data) { shelfFailure(`Couldn't find branch for ${requestedBranchName}`) return } let requestedBranch = verifyShelfRequest(requestedBotName, requestedBranchName, requestedBranchCl, targetBranchName, data.branch) // If the branch failed verification, please quit immediately if (!requestedBranch) { return } let requestedEdgeData = requestedBranch.edges[targetBranchName.toUpperCase()] // Print preview $('#preview').append(renderSingleBranchTable(requestedBranch, requestedEdgeData)) let formDiv = $('#workspaceFormDiv') let workspaceForm = $('
').prependTo(formDiv) // Check if conflict is already acknowledged or not const conflictAcknowledged = requestedEdgeData.blockage.acknowledger !== undefined // Determine if we have any relevant workspaces let foundWorkspaces = false getUserWorkspaces(requestedEdgeData.serverID, function(wsdata) { // Ensure we have data if (!wsdata || !wsdata.data) { shelfFailure('Workspaces could not be found for user.') return } // Ensure we have a proper return code, or display the error message if (wsdata.statusCode !== 200) { shelfFailure("Could not retrieve workspaces: " + wsdata.message) return } let userWorkspaces = wsdata.data if (!userWorkspaces || userWorkspaces.length == 0) { shelfFailure("Found no user workspaces.") return } // Collect and sort the user workspaces userWorkspaces.sort(function(a,b) { return a.client.localeCompare(b.client); }); // Create form for relevant workspaces const addClientToForm = function(client, exactMatch) { const clientOptionLabel = $('