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

Fix dv samples git path for codesandbox #467

Merged
merged 1 commit into from
Jun 24, 2024
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
8 changes: 4 additions & 4 deletions src/app/services/code-view/angular-code-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ export class AngularCodeService extends CodeService {
return `https://codesandbox.io/s/github/IgniteUI/${repositoryPath}${branch}/${sampleUrl}`;
}

private getGitHubSampleUrl(demosBaseUrl: string, sampleUrl: string) {
private getGitHubSampleUrl(demosBaseUrl: string, sampleUrl: string, gitSrc?: string) {
// Get sample application base path
const projectPath = demosBaseUrl.substring(demosBaseUrl.lastIndexOf("/") + 1)
let demoPath = sampleUrl.replace(demosBaseUrl + "/", projectPath + "/");

if (util.isLocalhost) {
demoPath = this.isDvSample(demosBaseUrl, sampleUrl) ? demoPath.replace(projectPath, 'samples') : demoPath.replace(projectPath, 'angular-demos');
if (this.isDvSample(demosBaseUrl, sampleUrl) && gitSrc) {
demoPath = 'samples/' + gitSrc;
}
return demoPath;
}
Expand All @@ -150,7 +150,7 @@ export class AngularCodeService extends CodeService {
const codeService = this;
codeService.isButtonClickInProgress = true;
let demosBaseUrl = $codeView.attr(codeService.demosBaseUrlAttrName)!;
let sampleFileUrl = codeService.getGitHubSampleUrl(demosBaseUrl, $codeView.attr(codeService.sampleUrlAttrName)!);
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";
window.open(codeService.getAngularGitHubSampleUrl(editor, sampleFileUrl, branch, demosBaseUrl), '_blank');
Expand Down
1 change: 1 addition & 0 deletions src/app/services/code-view/base-code-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export abstract class CodeService {
protected buttonSampleSourceAttrName = "data-sample-src";
protected demosBaseUrlAttrName = "data-demos-base-url";
protected sampleUrlAttrName = "iframe-src";
protected githubSrc = "github-src";
protected isButtonClickInProgress = false;
protected demosUrls: Map<string, ISampleData[]> = new Map();

Expand Down
2 changes: 1 addition & 1 deletion src/app/services/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LocalizationService {
"ctaGenericActionText": "60+ reusable components",
"ctaGridText": "A {{actionText}}, covering everything from paging, sorting, filtering, editing, grouping to virtualization on rows and columns, and beyond. No limits for .NET developers.",
"ctaGridActionText": "full set of ready-to-use features",
"ctaChartText": "Transform raw data into stunning visualizations and ensure the best UX, using {{actionText}} and graphs optimized for Blazor WebAssembly and Blazor Server.",
"ctaChartText": "Transform raw data into stunning visualizations and ensure the best UX, {{actionText}} and graphs optimized for Blazor WebAssembly and Blazor Server.",
"ctaChartActionText": "using 60+ high-performance charts",
},
"hljs": {
Expand Down
Loading