Polyterative / Patcher

The everything modular manager and database
https://patcher.xyz
GNU Affero General Public License v3.0
23 stars 2 forks source link

Sweep: allowe to copy name and company of module with a simple click #113

Closed Polyterative closed 10 months ago

Polyterative commented 10 months ago

Description

on the /modules/details/ page,in the HTML add a simple button,beside "search with google" that allows you to copy name and manufacturer on the currently opened module.simple as a text. example of desired output: "Kraken by WMD" or " Waver Bastl by Instruments"

also add a suitableicon as the other buttons

Checklist - [X] Modify `src/app/components/module-parts/module-details/module-details.component.html` ! No changes made [Edit](https://github.com/Polyterative/Patcher/edit/sweep/allowe_to_copy_name_and_company_of_modul/src/app/components/module-parts/module-details/module-details.component.html) - [X] Running GitHub Actions for `src/app/components/module-parts/module-details/module-details.component.html` ✗ [Edit](https://github.com/Polyterative/Patcher/edit/sweep/allowe_to_copy_name_and_company_of_modul/src/app/components/module-parts/module-details/module-details.component.html) - [X] Modify `src/app/components/module-parts/module-details/module-details.component.ts` ✓ https://github.com/Polyterative/Patcher/commit/9bcbdf5a9903039f18d1c391fd06010aa423d801 [Edit](https://github.com/Polyterative/Patcher/edit/sweep/allowe_to_copy_name_and_company_of_modul/src/app/components/module-parts/module-details/module-details.component.ts) - [X] Running GitHub Actions for `src/app/components/module-parts/module-details/module-details.component.ts` ✓ [Edit](https://github.com/Polyterative/Patcher/edit/sweep/allowe_to_copy_name_and_company_of_modul/src/app/components/module-parts/module-details/module-details.component.ts)
sweep-ai[bot] commented 10 months ago

🚀 Here's the PR! #114

See Sweep's progress at the progress dashboard!
Sweep Basic Tier: I'm using GPT-4. You have 3 GPT-4 tickets left for the month and 2 for the day. (tracking ID: bcf77c211a)

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).
Install Sweep Configs: Pull Request

[!TIP] I'll email you at vlady.y@live.it when I complete this pull request!


Actions (click)

GitHub Actions✓

Here are the GitHub Actions logs prior to making any changes:

Sandbox logs for d655a1d
Checking src/app/components/module-parts/module-details/module-details.component.html for syntax errors... ✅ src/app/components/module-parts/module-details/module-details.component.html has no syntax errors! 1/1 ✓
Checking src/app/components/module-parts/module-details/module-details.component.html for syntax errors...
✅ src/app/components/module-parts/module-details/module-details.component.html has no syntax errors!

Sandbox passed on the latest develop, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/Polyterative/Patcher/blob/d655a1dc3cb6198d2afc8f8db65f14600a68bbc2/src/polyfills.ts#L39-L73 https://github.com/Polyterative/Patcher/blob/d655a1dc3cb6198d2afc8f8db65f14600a68bbc2/src/polyfills.ts#L1-L39 https://github.com/Polyterative/Patcher/blob/d655a1dc3cb6198d2afc8f8db65f14600a68bbc2/src/app/components/rack-parts/rack-detail-data.service.ts#L313-L343 https://github.com/Polyterative/Patcher/blob/d655a1dc3cb6198d2afc8f8db65f14600a68bbc2/README.md#L15-L30 https://github.com/Polyterative/Patcher/blob/d655a1dc3cb6198d2afc8f8db65f14600a68bbc2/src/app/features/module-browser/module-browser-adder/module-browser-adder.component.html#L15-L38 https://github.com/Polyterative/Patcher/blob/d655a1dc3cb6198d2afc8f8db65f14600a68bbc2/src/app/components/rack-parts/rack-detail-data.service.ts#L412-L448 https://github.com/Polyterative/Patcher/blob/d655a1dc3cb6198d2afc8f8db65f14600a68bbc2/src/index.html#L1-L33

Step 2: ⌨️ Coding

--- 
+++ 
@@ -3,6 +3,7 @@
 import { SupabaseService } from 'src/app/features/backend/supabase.service';
 import { DbModule } from 'src/app/models/module';
 import { defaultModuleMinimalViewConfig, ModuleMinimalViewConfig } from '../module-minimal/module-minimal.component';
+import { Clipboard } from '@angular/cdk/clipboard';

 @Component({
   selector:        'app-module-details',
@@ -24,7 +25,8 @@
   switches = [];

   constructor(
-    public backend: SupabaseService
+    public backend: SupabaseService,
+    private clipboard: Clipboard
     // userManagerService: UserManagementService
   ) {
     // console.error(patchService);
@@ -32,5 +34,10 @@

   ngOnInit(): void {
   }
+
+  copyModuleNameAndManufacturer(): void {
+    const textToCopy = `${this.data.name} by ${this.data.manufacturer.name}`;
+    this.clipboard.copy(textToCopy);
+  }

 }

Ran GitHub Actions for 9bcbdf5a9903039f18d1c391fd06010aa423d801:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/allowe_to_copy_name_and_company_of_modul.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.Something wrong? Let us know.

This is an automated message generated by Sweep AI.