Skip to Content
0
May 06, 2023 at 10:33 AM

Smart Edit Shows Loading when Early Login is Enabled in Spartacus

594 Views Last edit May 06, 2023 at 05:46 PM 2 rev

Hi

I have enabled early login for my B2B site. I have not done any customization and using Hybris 2211 Version and Spartacus 5.2 V

Smart Edit will always be in a loading state as below. If I remove Early Login import it works fine. Is there anything else I need to do here?

smartedit-loading.jpeg

Only Changes are done in the spartacus-configuration.module.ts file . I have added below smartedit configuration

 storefrontPreviewRoute: 'cx-preview',
        allowOrigin: 'localhost:9002',

and Early Login configuration

imports: [

    ConfigModule.withConfig({
      routing: {
        /* ... */
        protected : true,
        routes: {
          contact: {
            paths: ['contact'],
            protected: false, // make the contact route public
          },
          register: {
            protected: false, // make the register route protected by overriding the `protected: false` configuration in `default-routing-config.ts`
          },
        },
      },
    }),
  ],

Below is the Complete File

import { NgModule } from '@angular/core';
import { translationChunksConfig, translations } from '@spartacus/assets';
import {
  ConfigModule,
  FeaturesConfig,
  I18nConfig,
  OccConfig,
  provideConfig,
  SiteContextConfig,
} from '@spartacus/core';
import { defaultB2bOccConfig } from '@spartacus/setup';
import { SmartEditConfig } from '@spartacus/smartedit/root';
import {
  defaultCmsContentProviders,
  layoutConfig,
  mediaConfig,
} from '@spartacus/storefront';

@NgModule({
  declarations: [],
  imports: [
    ConfigModule.withConfig({
      routing: {
        /* ... */
        protected : true,
        routes: {
          contact: {
            paths: ['contact'],
            protected: false, // make the contact route public
          },
          register: {
            protected: false, // make the register route protected by overriding the `protected: false` configuration in `default-routing-config.ts`
          },
        },
      },
    }),
  ],
  providers: [
    provideConfig(layoutConfig),
    provideConfig(mediaConfig),
    ...defaultCmsContentProviders,
    provideConfig(<OccConfig>{
      backend: {
        occ: {
          baseUrl: 'https://localhost:9002',
        },
      },
    }),
    provideConfig(<SiteContextConfig>{
      context: {
        urlParameters: ['baseSite', 'language', 'currency'],
        baseSite: ['powertools-spa'],
        currency: ['USD', 'GBP'],
      },
    }),
    provideConfig(<I18nConfig>{
      i18n: {
        resources: translations,
        chunks: translationChunksConfig,
        fallbackLang: 'en',
      },
    }),
    provideConfig(<FeaturesConfig>{
      features: {
        level: '5.2',
      },
    }),
    provideConfig(defaultB2bOccConfig),
    provideConfig(<SmartEditConfig>{
      smartEdit: {
        storefrontPreviewRoute: 'cx-preview',
        allowOrigin: 'localhost:9002',
      },
    }),
  ],
})
export class SpartacusConfigurationModule {}

sap commerce cloud - Missing Perspective Toolbar in SmartEdit in SPARTACUS 5.2 Version - Stack Overflow


Regards
Yashwanth

Attachments