This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const hapiServer = new Server({ | |
host: env.APP_HOST, | |
port: env.APP_PORT, | |
routes: { cors: true }, | |
}); | |
(async () => { | |
await hapiServer.route(new ApiModule().getRoutes()); | |
await hapiServer.route(new ApiModuleForAdmin().getRoutes()); | |
await hapiServer.route(new AdminModule().getRoutes()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Now I want user api to be available for admin | |
// may be I want to show in dashboard | |
export class ApiModuleForAdmin extends ApiModule { | |
public auth = "simple"; | |
public baseUrl = `${baseUrl}/admin/user-apis${baseUrl}`; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ApiModule extends Hapiest.HapiestModule { | |
public routeSets = [UserApiRoutes]; | |
public baseUrl = baseUrl; | |
} | |
export class AdminModule extends Hapiest.HapiestModule { | |
public routeSets = [AdminRoutes]; | |
public auth = "simple"; // Overrides auth for all routes under this. | |
public baseUrl = `${baseUrl}/admin`; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create batches out of big array | |
// Map those batches to a lambda | |
export async function asyncBatchMap<T, F>( | |
items: ReadonlyArray<T>, | |
predicate: (input: T[]) => Promise<F>, | |
batchSize: number = 10, | |
): Promise<F[]> { | |
const newContainer = items.map((e) => e); | |
const result: F[] = []; | |
while (newContainer.length > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.blue_grace_preview_button { | |
box-shadow: 0 3px 2px #e0e0e0; | |
margin-left: 11px !important; | |
} | |
.blue_grace_toolbar_buttons { | |
color: #3F51B5 !important; | |
margin-right: 5px !important; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div(class="overflow-fix") | |
app-inputs( | |
#myCustomInput | |
appTheme | |
) | |
app-inputs( | |
#myCustomInput | |
appTheme="myCustomThemeKey" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, Input, OnInit, ElementRef, Renderer2 } from '@angular/core'; | |
import { ThemeService } from './theme.service'; | |
@Directive({ | |
selector: '[appTheme]' | |
}) | |
export class ThemeDirective implements OnInit { | |
@Input('appTheme') appTheme: string; // appTheme="customClassKey" | |
constructor( | |
private themeService: ThemeService, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const blueGrace = { | |
appSidebarClass: 'blue_grace_sidebar', | |
sidebarSectionClass: 'blue_grace_sidebar_section', | |
'app-inputs': 'blue_grace_app_inputs', | |
'app-tags': 'blue_grace_app_inputs', | |
'app-sources': 'blue_grace_app_inputs', | |
'myCustomThemeKey': 'myCustomClass', | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { blueGrace } from './themes'; | |
const themeKey = 'app:theme'; | |
export const themeStore = { | |
'Blue Grace': blueGrace, | |
'Default': null | |
}; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<style> | |
.begin { | |
background: #f1f1f1; | |
width : 100%; | |
} | |
.anim { | |
background: red; | |
width: 0%; |
NewerOlder