Badsender-com / LePatron.email

LePatron is an opensource email builder allowing to industrialize your email template production. Build tailor made email templates and make them available to your non-technical users.
https://www.lepatron.email
GNU General Public License v3.0
73 stars 12 forks source link

Display Custom Blocks Listing in the Second Tab of the Left Sidebar #722

Closed omar-bear closed 1 year ago

omar-bear commented 1 year ago

Feature: Display Personalized Blocks Listing in the Second Tab of the Left Sidebar

Description:

Integrate the listing of Personalized Blocks in the existing second tab in the left sidebar when the "Blocks" button in the page header is selected.

Implementation Details:

Frontend:

  1. Initialize Main Vue.js Component PersonalizedBlocksPlugin

    • File: personalizedBlocksPlugin.js
    • Task:
      • Create a Vue.js component to configure the ViewModel and extensions. Use this.vm. to refer to the ViewModel.
    • Example Template:
      Vue.component('PersonalizedBlocksPlugin', {
      components: {
       PersonalizedBlocksListComponent,
      },
      data: () => ({
       viewModel: vm,
      }),
      //... other logic
      });
  2. Initialize List Component PersonalizedBlocksListComponent

    • File: personalizedBlocksListComponent.js
    • Task:
      • Create a Vue.js component to manage the listing of Personalized Blocks, including API calls, loading state, and error handling.
    • Example Template:
      Vue.component('PersonalizedBlocksListComponent', {
      //... other logic
      });
  3. API Calls to Fetch Personalized Blocks

    • File: personalizedBlocksListComponent.js
    • Task:
      • Add a method named fetchPersonalizedBlocks that will make an API call to the getPersonalizedBlocks endpoint. Utilize this.vm.metadata.groupId for the groupId.
  4. Manage Loading State

    • File: personalizedBlocksListComponent.js
    • Task:
      • Add a Vue.js data property isLoading to manage the loading state. Display a loading spinner while fetching data.
  5. Vue Data Property for Personalized Blocks

    • File: personalizedBlocksListComponent.js
    • Task:
      • Add a Vue.js data property named personalizedBlocks to store the fetched blocks.
  6. Displaying Personalized Blocks Using Existing HTML Structure

    • File: toolbox.tmpl.html
    • Task:
      • Utilize the HTML structure already in place for displaying template blocks. Bind this part to the personalizedBlocks data property from the Vue component.
  7. Handle Errors

    • File: personalizedBlocksListComponent.js
    • Task:
      • In case of an API failure, display an error toast notification using this.vm.notifier.error(message).
  8. Integrate the Vue.js Component into HTML

    • File: toolbox.tmpl.html
    • Task:
      • Add a tag <personalized-blocks-list-component /> to integrate the Vue.js component within the HTML file.

Acceptance Criteria:

Time Estimate:

2-3 days

RESULT

https://github.com/Badsender-com/LePatron.email/assets/80390318/a22a8e47-ca23-4155-98ab-771b36dd6b8a

sonarcloud[bot] commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
30.0% 30.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint