Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@quantumart/qa-engine-page-structure-angular
Advanced tools
**@quantumart/qa-engine-page-structure-angular**
@quantumart/qa-engine-page-structure-angular
Данная библиотека предоставляет набор инструментов для построения фронтенда для сайта на базе QP (Angular версия).
Demo site
Описание
Необходимый бэкенд для построения сайта:
Установка
Установить npm пакет:
npm install @quantumart/qa-engine-page-structure-angular
Пример подключения
Импортировать модуль QaEnginePageStructureModule в основном модуле angular-приложения:
...
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],
...
]),
}),
...
],
...
Определить angular-роуты:
...
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',
},
},
...
];
Пример реализации компонента стартовой страницы:
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) {
}
}
Пример реализации компонента виджета:
...
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;
}
FAQs
**@quantumart/qa-engine-page-structure-angular**
We found that @quantumart/qa-engine-page-structure-angular demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.