feat: demo version additions

This commit is contained in:
Sergey Andrievskiy 2021-08-06 18:48:35 +03:00
parent 0eec54695f
commit eee950248e
322 changed files with 23456 additions and 188 deletions

View file

@ -0,0 +1,40 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { CommonModule } from '@angular/common';
import { throwIfAlreadyLoaded } from './module-import-guard';
import { DataModule } from './data/data.module';
const PIPES = [
];
const NB_CORE_PROVIDERS = [
...DataModule.forRoot().providers,
];
@NgModule({
imports: [
CommonModule,
],
exports: [...PIPES],
declarations: [...PIPES],
})
export class CoreModule {
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
throwIfAlreadyLoaded(parentModule, 'CoreModule');
}
static forRoot(): ModuleWithProviders<CoreModule> {
return {
ngModule: CoreModule,
providers: [
...NB_CORE_PROVIDERS,
],
};
}
}

View file

@ -0,0 +1,39 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HeaderMenuService } from './service/header-menu.service';
import { ReviewsService } from './service/reviews.service';
import { DescriptionsService } from './service/descriptions.service';
import { BundlesService } from './service/bundles.service';
const SERVICES = [
HeaderMenuService,
ReviewsService,
DescriptionsService,
BundlesService,
];
@NgModule({
imports: [
CommonModule,
],
providers: [
...SERVICES,
],
})
export class DataModule {
static forRoot(): ModuleWithProviders<DataModule> {
return {
ngModule: DataModule,
providers: [
...SERVICES,
],
};
}
}

View file

@ -0,0 +1,125 @@
import { Injectable } from '@angular/core';
import { of as observableOf, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { HttpClient } from '@angular/common/http';
export interface Product {
id: string;
imageUrl: string;
storeUrl: string;
tags: string[];
title: string;
description: string;
variants: ProductVariant[];
}
export interface ProductVariant {
available: boolean;
compare_at_price: string;
price: string;
title: string;
}
export const BUNDLE_LICENSE = {
personal: 'personal',
developer: 'developer',
};
export const STORE_PRODUCTS_URL = {
base: 'https://store.akveo.com/collections/collection-for-ngx-admin-landing/products.json',
material: 'https://store.akveo.com/collections/collection-for-ngx-admin-landing/products.json',
};
export class Feature {
text: string;
availableInPersonalLicence: boolean;
availableInCommercialLicence: boolean;
}
@Injectable()
export class BundlesService {
private readonly STORE_COLLECTION: string = 'https://store.akveo.com/collections';
private features: Feature[] = [
{
text: 'ngx-admin template with 100+ UI components integrated with Backend Services',
availableInPersonalLicence: true,
availableInCommercialLicence: true,
},
{
text: 'Backend Services and Repository layers with data access',
availableInPersonalLicence: true,
availableInCommercialLicence: true,
},
{
text: 'JWT Authentication setup for UI and Backend',
availableInPersonalLicence: true,
availableInCommercialLicence: true,
},
{
text: 'Running instructions and code documentation',
availableInPersonalLicence: true,
availableInCommercialLicence: true,
},
{
text: 'Commercial Usage',
availableInPersonalLicence: true,
availableInCommercialLicence: true,
},
{
text: 'Create multiple end products using bundle',
availableInPersonalLicence: false,
availableInCommercialLicence: true,
},
{
text: 'Bug fixes and questions according to license terms',
availableInPersonalLicence: false,
availableInCommercialLicence: true,
},
];
constructor(private http: HttpClient) {}
getFeatures(): Observable<Feature[]> {
return observableOf(this.features);
}
getProducts(url: string): Observable<Product[]> {
return this.http.get(url)
.pipe(map((result: any) => {
return result.products.map((item: any) => {
return {
id: item.id,
imageUrl: this.getDefaultImage(item.images),
storeUrl: `${this.STORE_COLLECTION}/${item.handle}`,
tags: item.tags,
title: item.title,
description: (item.body_html as string).trim().replace(/<(?:.|\n)*?>/gm, ' ').replace(/ +/gm, ' '),
variants: item.variants.map(variant => {
return {
available: variant.available,
compare_at_price: variant.compare_at_price,
price: variant.price,
title: variant.title,
};
}),
};
});
}));
}
getDefaultImage(images: any[]): any {
const defaultImage = images.reduce((value, current) => {
if (!value) {
value = current;
}
return value;
});
return defaultImage ? this.trimImageUrl(defaultImage.src) : undefined;
}
trimImageUrl(url: string): string {
return url.substring(0, url.indexOf('?'));
}
}

View file

@ -0,0 +1,68 @@
import { Injectable } from '@angular/core';
import { of as observableOf, Observable } from 'rxjs';
export class Descriptions {
icon: string;
title: string;
description: string;
}
@Injectable()
export class DescriptionsService {
/* tslint:disable:max-line-length */
private descriptions: Descriptions[] = [
{
icon: 'layout-outline',
title: 'Efficient',
description: 'Packed with a huge number of handcrafted UI components, charts, maps, editors, tables, and much more, so that developers can focus on business needs',
},
{
icon: 'smartphone-outline',
title: 'Mobile first',
description: 'Looks stunning on every screen size and is optimized to bring the large-screen experience from desktop to mobile',
},
{
icon: 'color-palette-outline',
title: 'Сustomizable',
description: 'With 4 themes, 2 dashboards, and outstanding UI architecture, its easy to change the themes and find the right fit for your company',
},
{
icon: 'heart-outline',
title: 'Updated and supported',
description: 'Continuous updates and fixes from the development team to keep your tech up to date. The friendly and active community support team are ready to guide you through your challenges',
},
];
private bundleDescriptions: Descriptions[] = [
{
icon: 'umbrella-outline',
title: 'Convenient',
description: 'Complete pack of well known Angular based ngx-admin template, integrated with Backend Solution of your choice. Finally, you can get fully integrated solution out of the box.',
},
{
icon: 'settings-2-outline',
title: 'Functional',
description: 'Deploy it as ready to use solution for a particular case, or give it to your development team to incrementally add functionality. It provides a significant boost and solid development structure.',
},
{
icon: 'clock-outline',
title: 'Efficient',
description: 'Save more than $21,000 using Backend Bundle. According to our research ready Backend Bundle optimizes around 300 hours of development time.',
},
{
icon: 'checkmark-circle-2-outline',
title: 'Ready to use',
description: 'We prepared this Backend pack as development basement which lets your team concentrate on business logic and data models.',
},
];
/* tslint:disable:max-line-length */
getDescriptions(): Observable<Descriptions[]> {
return observableOf(this.descriptions);
}
getBundleDescriptions(): Observable<Descriptions[]> {
return observableOf(this.bundleDescriptions);
}
}

View file

@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
import { of as observableOf, Observable } from 'rxjs';
import { NbMenuItem } from '@nebular/theme';
@Injectable()
export class HeaderMenuService {
private headerMenu: NbMenuItem[] = [
{
title: 'Home',
link: '/',
},
{
title: 'Docs',
link: '/docs',
},
{
title: 'Demo',
url: 'https://www.akveo.com/ngx-admin?utm_campaign=ngx_admin%20-%20demo%20-%20ngx_admin%20docs&utm_source=ngx_admin&utm_medium=referral&utm_content=landing_main_section',
},
];
getHeaderMenu(): Observable<NbMenuItem[]> {
return observableOf(this.headerMenu);
}
}

View file

@ -0,0 +1,72 @@
import { Injectable } from '@angular/core';
import { of as observableOf, Observable } from 'rxjs';
export class Review {
avatar: string;
firstName: string;
lastName: string;
socialIcon: string;
review: string;
link: string;
}
@Injectable()
export class ReviewsService {
/* tslint:disable:max-line-length */
private reviews: Review[] = [
{
avatar: 'assets/img/avatars/1.png',
firstName: 'Marcin',
lastName: 'Masiorski',
socialIcon: 'facebook',
review: 'Awesome template! You are doing great job! Regards.',
link: 'https://www.facebook.com/pg/akveo/reviews/?ref=page_internal',
},
{
avatar: 'assets/img/avatars/2.png',
firstName: 'Rashid',
lastName: 'Thompson',
socialIcon: 'facebook',
review: 'I just want to say you have the best admin template I have seen so far as a new developer (Trust me I have searched).',
link: 'https://www.facebook.com/pg/akveo/reviews/?ref=page_internal',
},
{
avatar: 'assets/img/avatars/3.png',
firstName: 'Yuriy',
lastName: 'Marshall',
socialIcon: 'facebook',
review: 'Thanks for free angular theme! Design and file/system structure is on high level! Love you, Akveo!)',
link: 'https://www.facebook.com/pg/akveo/reviews/?ref=page_internal',
},
{
avatar: 'assets/img/avatars/4.png',
firstName: 'Kenneth',
lastName: 'Reis',
socialIcon: 'facebook',
review: 'Nice people working hard for high quality projects. Love you guys!',
link: 'https://www.facebook.com/pg/akveo/reviews/?ref=page_internal',
},
{
avatar: 'assets/img/avatars/5.png',
firstName: 'Renato',
lastName: 'Oliveira Silva',
socialIcon: 'facebook',
review: 'Great company and great projects',
link: 'https://www.facebook.com/pg/akveo/reviews/?ref=page_internal',
},
{
avatar: 'assets/img/avatars/6.png',
firstName: 'Mohammed',
lastName: 'Benyakoub',
socialIcon: 'facebook',
review: 'That one of the best open source software - Product I have ever seen',
link: 'https://www.facebook.com/pg/akveo/reviews/?ref=page_internal',
},
];
/* tslint:enable:max-line-length */
getReviews(): Observable<Review[]> {
return observableOf(this.reviews);
}
}

View file

@ -0,0 +1,11 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
if (parentModule) {
throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`);
}
}