Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@quantumart/qa-engine-page-structure-angular

Package Overview
Dependencies
Maintainers
6
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quantumart/qa-engine-page-structure-angular - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

2

package.json
{
"name": "@quantumart/qa-engine-page-structure-angular",
"author": "Quantum Art",
"version": "0.3.1",
"version": "0.3.2",
"license": "MIT",

@@ -6,0 +6,0 @@ "peerDependencies": {

@@ -14,2 +14,116 @@ **@quantumart/qa-engine-page-structure-angular**

* База данных на основе qp
* API на .net core с методом получения структуры сайта (дерево UniversalAbstractItem)
* API на .NET Core с методом получения структуры сайта (дерево UniversalAbstractItem)
**Установка**
Установить npm пакет:
```npm install @quantumart/qa-engine-page-structure-angular```
**Пример подключения**
Импортировать модуль QaEnginePageStructureModule в основном модуле angular-приложения:
```typescript
...
import { QaEnginePageStructureModule, WidgetComponent } from '@quantumart/qa-engine-page-structure-angular';
@NgModule({
...
imports: [
...
QaEnginePageStructureModule.forRoot({
widgetPlatformApiUrl: environment.WIDGET_PLATFORM_API_URL,
layoutWidgetZones: ['SiteHeaderZone', 'SiteFooterZone'],
widgetMapping: new Map<string, Type<WidgetComponent>>([
['html_widget', HtmlWidgetComponent],
['banner_widget', BannerWidgetComponent],
['feedback_widget', FeedbackWidgetComponent],
...
]),
}),
...
],
...
```
* widgetPlatformApiUrl - базовый URL API виджетной платформы
* layoutWidgetZones - список виджетных зон, размещенных в шаблоне
* widgetMapping - маппинг виджетов на angular-компоненты
Определить angular-роуты:
```typescript
...
import {
DynamicRoutesInitializer,
InitialRequestComponent,
LayoutWidgetsResolver,
PageDetailsResolver
} from '@quantumart/qa-engine-page-structure-angular';
const routes: Routes = [
{
path: '**',
component: InitialRequestComponent,
canActivate: [DynamicRoutesInitializer],
},
{
path: 'start-page',
loadChildren: () => import('./start-page/start-page.module').then(m => m.StartPageModule),
resolve: {
details: PageDetailsResolver,
staticWidgets: LayoutWidgetsResolver,
},
data: {
nodeType: 'start_page',
},
},
...
];
```
Пример реализации компонента стартовой страницы:
```typescript
import { NodeDetails } from '@quantumart/qa-engine-page-structure-angular';
import { SiteNodeComponent, SiteNodeService } from '../services';
export interface StartPageDetails extends NodeDetails {
title: string;
}
@Component({
selector: 'qa-start-page',
templateUrl: './start-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class StartPageComponent implements SiteNodeComponent {
public get id(): number {
return this.siteNodeService.getNodeId();
}
public readonly pageDetails$ = this.siteNodeService.getDetails<StartPageDetails>();
constructor(private readonly siteNodeService: SiteNodeService) {
}
}
```
Пример реализации компонента виджета:
```typescript
...
import { WidgetComponent, WidgetDetails } from '@quantumart/qa-engine-page-structure-angular';
export interface HtmlWidgetDetails extends WidgetDetails {
html: string;
}
@Component({
selector: 'qa-html-widget',
templateUrl: './html-widget.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HtmlWidgetComponent implements WidgetComponent {
@Input() public widget!: HtmlWidgetDetails;
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc