Noticing some inconsistencies with the CRDs of other Operators, which makes it difficult to integrate cleanly with the OLM UI.
status.membersshould look like:
status:
members:| /** | |
| * Service worker utilities. | |
| * Inspired by https://github.com/deebloo/worker. | |
| */ | |
| export type $worker = (fn: (event: MessageEvent) => void) => Worker; | |
| export const $worker: $worker = fn => { | |
| const blob: Blob = new Blob(['self.onmessage=', fn.toString(), ';'], {type: 'text/javascript'}); | |
| const url: string = URL.createObjectURL(blob); | |
| const worker: Worker = new Worker(url); |
| import * as React from 'react'; | |
| import { mount, ReactWrapper } from 'enzyme'; | |
| import { AsyncComponent } from '../../../public/components/utils/async'; | |
| describe('AsyncComponent', () => { | |
| let wrapper: ReactWrapper; | |
| const Foo = (props: {className: string}) => <div id={fooId} className={props.className} />; | |
| const fooId = 'fooId'; | |
| const loadingBoxSelector = '.cos-status-box'; |
| import * as React from 'react'; | |
| import h = React.createElement; | |
| export const TestComponentTSX: React.SFC<TestComponentProps> = (props) => { | |
| return <div className="col-md-3"> | |
| { props.items.map((item, key) => <span key={key}> | |
| Item {key + 1}: {item.name} | |
| </span>) } | |
| <input /> | |
| <button onClick={() => console.log('Clicked!')}>Create</button> |
| const { execSync } = require('child_process'); | |
| /** | |
| * Create a bunch of configmaps for load testing. | |
| */ | |
| new Array(10000).fill(0).forEach((_, i) => { | |
| const configMap = { | |
| apiVersion: 'v1', | |
| kind: 'ConfigMap', | |
| metadata: { |
| apiVersion: apiextensions.k8s.io/v1beta1 | |
| kind: CustomResourceDefinition | |
| metadata: | |
| name: clusters.rook.io | |
| spec: | |
| group: rook.io | |
| version: v1alpha1 | |
| scope: Namespaced | |
| names: | |
| kind: Cluster |
| apiVersion: operators.coreos.com/v1alpha1 | |
| kind: ClusterServiceVersion | |
| metadata: | |
| name: clusterlogging.v0.0.1 | |
| namespace: placeholder | |
| spec: | |
| displayName: Cluster Logging Operator | |
| description: | | |
| The Cluster Logging Operator for OKD provides easy means for configuring and managing your aggregated logging stack. |
| /** | |
| * Opaque type that can have a meaning. | |
| */ | |
| enum Subject { | |
| life = 'life', | |
| dreams = 'dreams', | |
| } | |
| export const meaningFor = (subject: Subject) => { | |
| switch (subject) { |
Defines the app's Redux store using TypeScript to add type safety and improve developer documentation.
The general strategy to get TypeScript to work nicely with ImmutableJS is to:
ReducerNameStateData type (the raw, JSON-serializable state)export type MyReducerStateData = {
currentUser: string;
data: {