How to access the data for Custom created table in merchant portal gui module.

aashutosh.namdeo
aashutosh.namdeo Posts: 36 🧑🏻‍🚀 - Cadet

I have created a custom database table in TestArticle Module → PyzTestArticle now i want to fetch data for that table in Merchant portal Gui module i have setup all the things using facade dependency but always i get 0 data row from that table not able to acess the data for that table .

what ACL entity or ACL metrchant portal configuration i have to do for using that.

Tagged:

Answers

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 86 🏛 - Council (mod)

    We have a dedicated course to the Merchant portal: https://sprykee-safari.spryker.com/learn/course/667/play/4119/spryker-marketplace-frontend-development

    The backend part is the same as for any backoffice module. You need to have a controller to provide the data to the view.

    The course goes step by step on the frontend part but also shows you how to create a new module, customer´s orders, and show that data in an angular table

  • aashutosh.namdeo
    aashutosh.namdeo Posts: 36 🧑🏻‍🚀 - Cadet

    Thanks for replying , i am facing issue while creting a new component in existing module name SalesMerchantPortalGui want to create a new component so what process i have to follow for that i have extended entry.ts and created mp.public-api . The content of entry.ts us import { registerNgModule } from '@mp/zed-ui';
    import { ComponentsModule } from './app/components.module';
    registerNgModule(ComponentsModule);

    and mp.public-api is
    export * from './app/test-article-table/test-article-table.module';export * from './app/components.module';

    and This is my component.module.ts : -

    import { NgModule } from '@angular/core';import { WebComponentsModule } from '@spryker/web-components';import { ButtonAjaxComponent, ButtonAjaxModule } from '@spryker/button';import { ChipsComponent, ChipsModule } from '@spryker/chips';import { CardModule, CardComponent } from '@spryker/card';import { TabsModule, TabsComponent, TabComponent } from '@spryker/tabs';
    import { TestArticleTableComponent } from './test-article-table/test-article-table.component'; import { TestArtileTableModule } from './test-article-table/test-article-table.module'; import { ComponentsModule as CoreComponentsModule } from '@mp/sales-merchant-portal-gui';
    @NgModule({    imports: [        CoreComponentsModule,        WebComponentsModule.withComponents([            TestArticleTableComponent        ]),        ButtonAjaxModule,        ChipsModule,        CardModule,        TabsModule,        TestArtileTableModule    ],})export class ComponentsModule {}

    i created one component also render this in view but the component is not apearing in my view when i load on browser only conponent tag is there not the conent inside that coponent , what procedure i have to follow if want to create new component in existing module.

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 86 🏛 - Council (mod)

    it's pretty hard to see if there is any issue in the code. In the course, we do exactly what you're trying to accomplish. Follow that example where we create the component and render it:

  • mk00559179
    mk00559179 Posts: 18 🧑🏻‍🚀 - Cadet

    @hCan we've example code for this course, it is hard to follow along with course, so it is fine if we've that example module

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 86 🏛 - Council (mod)
    edited November 18

    I'll be adding the commits to every lesson.
    In the meantime, you can access the source code at:
    https://github.com/spryker-academy/marketplace-b2c-course

  • mk00559179
    mk00559179 Posts: 18 🧑🏻‍🚀 - Cadet

    @Hidran Arias , Thanks will look into this.

  • mk00559179
    mk00559179 Posts: 18 🧑🏻‍🚀 - Cadet

    @Hidran Arias , I've copy customer module in my project but when I run npm run mp:build:watch

    I am getting below error, I've copy as it is to test in local and have not change anything in module.

    globalThis.GLOBAL_NX_VERSION ?= GLOBAL_NX_VERSION;
    ^

    SyntaxError: Unexpected token '='
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 86 🏛 - Council (mod)

    Please, try copying again the module. I just pushed the latest modifications . I tried it locally and it works.
    https://github.com/spryker-academy/marketplace-b2c-course/tree/main/src/Pyz/Zed/CustomerMerchantPortalGui

    Copy also the DTO
    https://github.com/spryker-academy/marketplace-b2c-course/tree/main/src/Pyz/Shared/CustomerMerchantPortalGui

    Run docker/sdk console router:cache:warm-up:merchant-portal. so the link is available.
    Enable the module by going to the backoffice as admin and adding the bundle customer/merchant-portal-gui to the Merchant role (harald) and * for controller and actions