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'; | |
@Injectable() | |
export class LocalStorageWrapperStubService { | |
constructor() { } | |
private localStorage = new Map(); | |
remove(key) { |
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 { HttpClientTestingModule } from '@angular/common/http/testing'; | |
import {NgModule} from "@angular/core"; | |
import {LoginServiceStub} from "../stubs/services/login-service-stub"; | |
import {LoginService} from "./login/login.service"; | |
import {RouterTestingModule} from "@angular/router/testing"; | |
import {LocalStorageWrapperStubService} from "../stubs/services/local-storage-wrapper.stub.service"; | |
import {LocalStorageWrapperService} from "./services/local-storage-wrapper.service"; | |
import {SystemSettingsServiceStub} from "../stubs/services/system-settings-service-stub"; | |
import {SystemSettingsService} from "./services/store/system-settings.service"; | |
import {FormBuilder, ReactiveFormsModule} from "@angular/forms"; |
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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
import { LoginComponent } from './login.component'; | |
import {AppTestingModule} from "../app-testing.module"; | |
import {NO_ERRORS_SCHEMA} from "@angular/core"; | |
import {LocalStorageWrapperService} from "../services/local-storage-wrapper.service"; | |
describe('LoginComponent', () => { | |
let component: LoginComponent; | |
let fixture: ComponentFixture<LoginComponent>; |
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 { BoardsService } from "../../../services/boards-service"; | |
const boardService = new BoardsService(); | |
let initailState = [{ | |
id: 1, | |
stages: [ { | |
id: 2, | |
name: 'stage name', | |
parentId: 1, | |
tasks: [ |
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 initDefinitions = (svg) => | |
svg.append('defs') | |
.append('marker') | |
.attrs({'id':'arrowhead', | |
'viewBox':'-0 -5 10 10', | |
'refX':34, | |
'refY':0, | |
'orient':'auto', | |
'markerWidth':8, | |
'markerHeight':8, |
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 forceSimulation = (d3, {width, height}) => d3.forceSimulation() | |
.force("charge", d3.forceManyBody()) | |
.force("center", d3.forceCenter(width / 2, height / 2)); | |
// use: | |
const simulation = forceSimulation(d3, {width,height}); | |
simulation.force("link", |
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 ticked = (link, node, edgepaths, edgelabels) => { | |
link | |
.attr("x1", function (d) {return d.source.x;}) | |
.attr("y1", function (d) {return d.source.y;}) | |
.attr("x2", function (d) {return d.target.x;}) | |
.attr("y2", function (d) {return d.target.y;}); | |
node.attr("transform", | |
function (d) {return "translate(" + d.x + ", " + d.y + ")";}); |
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 {Component, Input, OnInit, ViewEncapsulation} from '@angular/core'; | |
import {SillyButtonService} from './silly-button.service'; | |
@Component({ | |
// tslint:disable-next-line:component-selector | |
selector: 'ng-silly-button', | |
template: | |
`<div class="silly-btn" (click)="onClick($event)"> | |
<div class="content"> | |
<ng-content></ng-content> |
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 { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | |
@Component({ | |
selector: 'toggle-btn', | |
template: ` | |
<label class='so-slide-toggle'> | |
<input (change)="onChange($event)" type="checkbox"/> | |
<span class="back"> | |
<span class="toggle"></span> | |
<span class="label on" [title]="enabledText">{{ enabledText }}</span> |
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
input[type=checkbox] { | |
display: none; | |
} | |
.toggle-legend { | |
cursor: pointer; | |
} | |
input[type=checkbox]:checked ~ .groups-legend { | |
display: flex; | |
} | |
input:not(:checked) ~ .groups-legend { |