change to have repositoryId and not branchName

This commit is contained in:
Nitzan Miranda 2023-07-26 11:13:53 +03:00 committed by shamoon
parent 017a8152df
commit efb8388dec
2 changed files with 5 additions and 5 deletions

View File

@ -294,7 +294,7 @@ export function cleanServiceGroups(groups) {
snapshotHost, // kopia snapshotHost, // kopia
snapshotPath, snapshotPath,
userEmail, // azuredevops userEmail, // azuredevops
branchName repositoryId
} = cleanedService.widget; } = cleanedService.widget;
let fieldsList = fields; let fieldsList = fields;
@ -316,7 +316,7 @@ export function cleanServiceGroups(groups) {
if (type === "azuredevops") { if (type === "azuredevops") {
if (userEmail) cleanedService.widget.userEmail = userEmail; if (userEmail) cleanedService.widget.userEmail = userEmail;
if (branchName) cleanedService.widget.branchName = branchName; if (repositoryId) cleanedService.widget.repositoryId = repositoryId;
} }
if (type === "coinmarketcap") { if (type === "coinmarketcap") {

View File

@ -7,14 +7,14 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
export default function Component({ service }) { export default function Component({ service }) {
const { t } = useTranslation(); const { t } = useTranslation();
const { widget } = service; const { widget } = service;
const { userEmail, branchName } = widget; const { userEmail, repositoryId } = widget;
const includePR = userEmail !== undefined && branchName !== undefined; const includePR = userEmail !== undefined && repositoryId !== undefined;
const { data: prData, error: prError } = useWidgetAPI(widget, "pr"); const { data: prData, error: prError } = useWidgetAPI(widget, "pr");
const { data: pipelineData, error: pipelineError } = useWidgetAPI(widget, "pipeline"); const { data: pipelineData, error: pipelineError } = useWidgetAPI(widget, "pipeline");
if ( if (
pipelineError || pipelineError ||
(includePR && (prError || prData?.errorCode !== null)) (includePR && (prError || prData?.errorCode !== undefined))
) { ) {
let finalError = pipelineError ?? prError; let finalError = pipelineError ?? prError;
if (includePR && prData?.errorCode !== null) { if (includePR && prData?.errorCode !== null) {