From 5675e83e4ba6deef31c7a80393cd17c4691be211 Mon Sep 17 00:00:00 2001 From: dobromirts Date: Mon, 24 Jun 2024 15:14:51 +0300 Subject: [PATCH] Handle different repos vnext namings --- src/app/services/code-view/angular-code-service.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/services/code-view/angular-code-service.ts b/src/app/services/code-view/angular-code-service.ts index 52b3296..aabc375 100644 --- a/src/app/services/code-view/angular-code-service.ts +++ b/src/app/services/code-view/angular-code-service.ts @@ -127,9 +127,6 @@ export class AngularCodeService extends CodeService { private getAngularGitHubSampleUrl(editor: string, sampleUrl: string, branch: string, demosBaseUrl: string) { const dvSample = this.isDvSample(demosBaseUrl, sampleUrl); - if (util.isLocalhost) { - branch = dvSample ? 'vnext' : 'vNext'; - } const repositoryPath = dvSample ? 'igniteui-angular-examples/tree/' : 'igniteui-live-editing-samples/tree/'; if (editor === "stackblitz") return `https://stackblitz.com/github/IgniteUI/${repositoryPath}${branch}/${sampleUrl}`; return `https://codesandbox.io/s/github/IgniteUI/${repositoryPath}${branch}/${sampleUrl}`; @@ -152,7 +149,9 @@ export class AngularCodeService extends CodeService { let demosBaseUrl = $codeView.attr(codeService.demosBaseUrlAttrName)!; let sampleFileUrl = codeService.getGitHubSampleUrl(demosBaseUrl, $codeView.attr(codeService.sampleUrlAttrName)!, $codeView.attr(codeService.githubSrc)!); let editor = $button.hasClass(codeService.stkbButtonClass) ? "stackblitz" : "codesandbox"; - let branch = demosBaseUrl.indexOf("staging.infragistics.com") !== -1 ? "vNext" : "master"; + const dvSample = this.isDvSample(demosBaseUrl, sampleFileUrl); + const stagingBranch = dvSample ? 'vnext' : 'vNext'; + let branch = demosBaseUrl.indexOf("staging.infragistics.com") !== -1 ? stagingBranch : "master"; window.open(codeService.getAngularGitHubSampleUrl(editor, sampleFileUrl, branch, demosBaseUrl), '_blank'); codeService.isButtonClickInProgress = false; }