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
package io.mseemann.poc.k8sleaderelection; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.context.event.EventListener; | |
import org.springframework.integration.leader.event.OnGrantedEvent; | |
import org.springframework.integration.leader.event.OnRevokedEvent; | |
import org.springframework.stereotype.Component; | |
@Slf4j | |
@Component |
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
spring: | |
application: | |
name: leader-app | |
cloud: | |
kubernetes: | |
leader: | |
config-map-name: leader | |
management: |
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 {SelectControlComponent} from './select-control.component'; | |
import {ComponentFixture, TestBed} from "@angular/core/testing"; | |
import {Component, DebugElement} from "@angular/core"; | |
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms"; | |
import {OptionWithLabel} from "./option-with-label.interface"; | |
import {By} from "@angular/platform-browser"; | |
@Component({ | |
template: ` | |
<form [formGroup]="form"> |
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 {SelectControlComponent} from './select-control.component'; | |
describe('SelectControlComponent', () => { | |
let component: SelectControlComponent<unknown>; | |
beforeEach(async () => { | |
component = new SelectControlComponent<unknown>({} as any) | |
}); | |
it('should create the component and have default inits', () => { |
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 [ngModel]="viewModel" (click)="inputClicked()" (focus)="inputFocused()" (blur)="inputBlurred()"> | |
<div *ngIf="optionsVisible" class="options"> | |
<div *ngFor="let option of options" (click)="optionClicked(option)" class="option-item" | |
[ngClass]="{active:option===selectedOption}"> | |
{{option.label}} | |
</div> | |
</div> |
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, Output, Self} from '@angular/core'; | |
import {ControlValueAccessor, NgControl} from "@angular/forms"; | |
import {OptionWithLabel} from "./option-with-label.interface"; | |
@Component({ | |
selector: 'app-select-control', | |
templateUrl: './select-control.component.html', | |
styleUrls: ['./select-control.component.scss'] | |
}) | |
export class SelectControlComponent<T> implements ControlValueAccessor { |
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, | |
OnDestroy, | |
OnInit, | |
TemplateRef, | |
ViewContainerRef, | |
} from '@angular/core'; | |
import { Store } from '@ngrx/store'; | |
import { User } from './user'; |
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 React, {useEffect, useState} from "react"; | |
import "./App.css"; | |
import Web3 from "web3"; | |
import SampleContractCompiled from "backend/build/contracts/SampleContract.json"; | |
import {SampleContract} from "backend/types/web3-v1-contracts/SampleContract"; | |
import {AbiItem} from "web3-utils"; | |
function App() { | |
const [storageValue, setStorageValue] = useState(null as string | 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
Show hidden characters
{ | |
"compilerOptions": { | |
"lib": ["ES2018", "DOM"], | |
"module": "CommonJS", | |
"moduleResolution": "node", | |
"strict": true, | |
"target": "ES2018", | |
"sourceMap": true, | |
"esModuleInterop": true | |
} |
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
const SampleContract = artifacts.require("SampleContract"); | |
contract("SampleContract", function (accounts) { | |
it("...should store the value 89.", async function () { | |
const simpleStorageInstance = await SampleContract.deployed(); | |
// Set value of 89 | |
await simpleStorageInstance.set(89, {from: accounts[1]}); | |
// Get stored value |
NewerOlder