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 base URL usage in frontend #85

Closed
wants to merge 1 commit into from
Closed

Conversation

MattG57
Copy link
Collaborator

@MattG57 MattG57 commented Dec 9, 2024

Workspace helped to find where we don't have the BASE_URL: http://localhost:port
referenced when constructing URLs.


For more details, open the Copilot Workspace session.

Workspace helped to find where we don't have the BASE_URL: http://localhost:port
referenced when constructing URLs.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/austenstone/github-value?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

github-actions bot commented Dec 9, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@@ -6,7 +6,7 @@
import { CommonModule } from '@angular/common';
import { ClipboardModule } from '@angular/cdk/clipboard';
import { ThemeService } from '../services/theme.service';

import { BASE_URL } from '../services/server.service';

Check failure

Code scanning / ESLint

Disallow unused variables Error

'BASE_URL' is defined but never used.

Copilot Autofix AI 29 days ago

To fix the problem, we need to remove the unused BASE_URL import from the file frontend/src/app/install/install.component.ts. This will resolve the ESLint error and clean up the code by removing unnecessary imports.

  • Locate the import statement for BASE_URL on line 9.
  • Remove the BASE_URL import from the import statement.
Suggested changeset 1
frontend/src/app/install/install.component.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/frontend/src/app/install/install.component.ts b/frontend/src/app/install/install.component.ts
--- a/frontend/src/app/install/install.component.ts
+++ b/frontend/src/app/install/install.component.ts
@@ -8,3 +8,3 @@
 import { ThemeService } from '../services/theme.service';
-import { BASE_URL } from '../services/server.service';
+
 
EOF
@@ -8,3 +8,3 @@
import { ThemeService } from '../services/theme.service';
import { BASE_URL } from '../services/server.service';


Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -16,6 +16,7 @@
import { ActiveUsersChartComponent } from './dashboard-card/active-users-chart/active-users-chart.component';
import { InstallationsService } from '../../../services/api/installations.service';
import { StatusComponent } from './status/status.component';
import { BASE_URL } from '../../../services/server.service';

Check failure

Code scanning / ESLint

Disallow unused variables Error

'BASE_URL' is defined but never used.

Copilot Autofix AI 29 days ago

The best way to fix the problem is to remove the unused BASE_URL import from the file. This will resolve the ESLint error and clean up the code by removing unnecessary imports.

To implement this fix, we need to:

  1. Remove the import statement for BASE_URL on line 19.
Suggested changeset 1
frontend/src/app/main/copilot/copilot-dashboard/dashboard.component.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/frontend/src/app/main/copilot/copilot-dashboard/dashboard.component.ts b/frontend/src/app/main/copilot/copilot-dashboard/dashboard.component.ts
--- a/frontend/src/app/main/copilot/copilot-dashboard/dashboard.component.ts
+++ b/frontend/src/app/main/copilot/copilot-dashboard/dashboard.component.ts
@@ -18,3 +18,3 @@
 import { StatusComponent } from './status/status.component';
-import { BASE_URL } from '../../../services/server.service';
+
 
EOF
@@ -18,3 +18,3 @@
import { StatusComponent } from './status/status.component';
import { BASE_URL } from '../../../services/server.service';


Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -18,6 +18,7 @@
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { InstallationsService } from '../services/api/installations.service';
import { BASE_URL } from '../services/server.service';

Check failure

Code scanning / ESLint

Disallow unused variables Error

'BASE_URL' is defined but never used.

Copilot Autofix AI 29 days ago

The best way to fix the problem is to remove the unused import of BASE_URL from the file. This will resolve the ESLint error and clean up the code by removing unnecessary imports.

  • Locate the import statement for BASE_URL on line 21.
  • Remove the import statement entirely since BASE_URL is not used anywhere in the MainComponent class.
Suggested changeset 1
frontend/src/app/main/main.component.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/frontend/src/app/main/main.component.ts b/frontend/src/app/main/main.component.ts
--- a/frontend/src/app/main/main.component.ts
+++ b/frontend/src/app/main/main.component.ts
@@ -20,3 +20,3 @@
 import { InstallationsService } from '../services/api/installations.service';
-import { BASE_URL } from '../services/server.service';
+
 
EOF
@@ -20,3 +20,3 @@
import { InstallationsService } from '../services/api/installations.service';
import { BASE_URL } from '../services/server.service';


Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@austenstone
Copy link
Owner

The BASE_URL is only required for the PR comments. When PR comments go out we don't know the URL to send the user to.

@austenstone austenstone closed this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants