commit
stringlengths 40
40
| old_file
stringlengths 4
150
| new_file
stringlengths 4
150
| old_contents
stringlengths 0
3.26k
| new_contents
stringlengths 1
4.43k
| subject
stringlengths 15
501
| message
stringlengths 15
4.06k
| lang
stringclasses 4
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
| diff
stringlengths 0
4.35k
|
---|---|---|---|---|---|---|---|---|---|---|
daf538099b8ea521adfb7be7b154ae9832fa8686 | src/app/root-component.tsx | src/app/root-component.tsx | import React from "react"
import "../styles/app-layout-grid.css"
import "../styles/uikit.css"
import "../styles/editor.css"
import { PlayerContainer } from "./components/videoContainer"
import { MarkdownPreviewEditor as Editor } from "./components/editor"
interface AppLayoutState {
pathToMedia: string
}
interface AppLayoutProps {}
class AppLayout extends React.Component<AppLayoutProps, AppLayoutState> {
constructor(props: AppLayoutProps) {
super(props)
}
public render() {
return (
<div className="grid-container">
<PlayerContainer />
<div className="editor-container uk-card uk-card-default uk-overflow-auto">
<div className="uk-card-body uk-overflow-auto">
<Editor />
</div>
</div>
</div>
)
}
}
export { AppLayout }
| import React from "react"
import "../styles/app-layout-grid.css"
import "../styles/uikit.css"
import { PlayerContainer } from "./components/videoContainer"
import { MarkdownPreviewEditor as Editor } from "./components/editor"
interface AppLayoutState {
pathToMedia: string
}
interface AppLayoutProps {}
class AppLayout extends React.Component<AppLayoutProps, AppLayoutState> {
constructor(props: AppLayoutProps) {
super(props)
}
public render() {
return (
<div className="grid-container">
<PlayerContainer />
<div className="editor-container uk-card uk-card-default uk-overflow-auto">
<div className="uk-card-body uk-overflow-auto">
<Editor />
</div>
</div>
</div>
)
}
}
export { AppLayout }
| Stop importing a stylesheet that doesn't exist | Stop importing a stylesheet that doesn't exist
| TypeScript | agpl-3.0 | briandk/transcriptase,briandk/transcriptase | ---
+++
@@ -1,7 +1,6 @@
import React from "react"
import "../styles/app-layout-grid.css"
import "../styles/uikit.css"
-import "../styles/editor.css"
import { PlayerContainer } from "./components/videoContainer"
import { MarkdownPreviewEditor as Editor } from "./components/editor"
|
3b06c2c72b409957aedfe145257caf030ec55417 | packages/common/src/mvc/registries/ControllerRegistry.ts | packages/common/src/mvc/registries/ControllerRegistry.ts | import {GlobalProviders, ProviderType, TypedProvidersRegistry} from "@tsed/di";
import {ControllerProvider} from "../class/ControllerProvider";
import {ExpressRouter} from "../services/ExpressRouter";
// tslint:disable-next-line: variable-name
export const ControllerRegistry: TypedProvidersRegistry = GlobalProviders.createRegistry(ProviderType.CONTROLLER, ControllerProvider, {
injectable: false,
onInvoke(provider: ControllerProvider, locals: any) {
if (!locals.has(ExpressRouter)) {
locals.set(ExpressRouter, provider.router);
}
}
});
| import {GlobalProviders, ProviderType, TypedProvidersRegistry} from "@tsed/di";
import {ControllerProvider} from "../class/ControllerProvider";
import {ExpressRouter} from "../services/ExpressRouter";
// tslint:disable-next-line: variable-name
export const ControllerRegistry: TypedProvidersRegistry = GlobalProviders.createRegistry(ProviderType.CONTROLLER, ControllerProvider, {
injectable: false,
onInvoke(provider: ControllerProvider, locals: any) {
locals.set(ExpressRouter, provider.router);
}
});
| Remove precondition when building a controller | fix: Remove precondition when building a controller
| TypeScript | mit | Romakita/ts-express-decorators,Romakita/ts-express-decorators,Romakita/ts-express-decorators,Romakita/ts-express-decorators | ---
+++
@@ -7,8 +7,6 @@
injectable: false,
onInvoke(provider: ControllerProvider, locals: any) {
- if (!locals.has(ExpressRouter)) {
- locals.set(ExpressRouter, provider.router);
- }
+ locals.set(ExpressRouter, provider.router);
}
}); |
b67436490e5231fcae8521b475f6bea4f2b80bbd | test/compileToStringSync.ts | test/compileToStringSync.ts | var chai = require("chai");
var path = require("path");
var compiler = require(path.join(__dirname, "../src"));
var expect = chai.expect;
var fixturesDir = path.join(__dirname, "fixtures");
function prependFixturesDir(filename) {
return path.join(fixturesDir, filename);
}
describe("#compileToStringSync", function () {
it('returns string JS output of the given elm file', function () {
var opts = { verbose: true, cwd: fixturesDir };
var result = compiler.compileToStringSync(prependFixturesDir("Parent.elm"), opts);
expect(result).to.include("_Platform_export");
});
it('returns html output given "html" output option', function () {
var opts = { verbose: true, cwd: fixturesDir, output: '.html' };
var result = compiler.compileToStringSync(prependFixturesDir("Parent.elm"), opts);
expect(result).to.include('<!DOCTYPE HTML>');
expect(result).to.include('<title>Parent</title>');
expect(result).to.include("_Platform_export");
});
});
| var chai = require("chai");
var path = require("path");
var compiler = require(path.join(__dirname, "../src"));
var expect = chai.expect;
var fixturesDir = path.join(__dirname, "fixtures");
function prependFixturesDir(filename) {
return path.join(fixturesDir, filename);
}
describe("#compileToStringSync", function () {
it('returns string JS output of the given elm file', function () {
var opts = { verbose: true, cwd: fixturesDir };
var result = compiler.compileToStringSync(prependFixturesDir("Parent.elm"), opts);
expect(result).to.include("_Platform_export");
});
it('returns html output given "html" output option', function () {
var opts = {
verbose: true,
cwd: fixturesDir,
output: prependFixturesDir('compiled.html'),
};
var result = compiler.compileToStringSync(prependFixturesDir("Parent.elm"), opts);
expect(result).to.include('<!DOCTYPE HTML>');
expect(result).to.include('<title>Parent</title>');
expect(result).to.include("_Platform_export");
});
});
| Modify test for sync suffix handling | Modify test for sync suffix handling
| TypeScript | bsd-3-clause | rtfeldman/node-elm-compiler | ---
+++
@@ -19,7 +19,11 @@
});
it('returns html output given "html" output option', function () {
- var opts = { verbose: true, cwd: fixturesDir, output: '.html' };
+ var opts = {
+ verbose: true,
+ cwd: fixturesDir,
+ output: prependFixturesDir('compiled.html'),
+ };
var result = compiler.compileToStringSync(prependFixturesDir("Parent.elm"), opts);
expect(result).to.include('<!DOCTYPE HTML>'); |
874a920fc5059bfe0a3ad23986e0e745d38d301f | blueprints/app/files/tests/helpers/index.ts | blueprints/app/files/tests/helpers/index.ts | import {
setupApplicationTest as upstreamSetupApplicationTest,
setupRenderingTest as upstreamSetupRenderingTest,
setupTest as upstreamSetupTest,
} from 'ember-qunit';
// This file exists to provide wrappers around ember-qunit's / ember-mocha's
// test setup functions. This way, you can easily extend the setup that is
// needed per test type.
function setupApplicationTest(
hooks: Parameters<typeof upstreamSetupApplicationTest>[0],
options?: Parameters<typeof upstreamSetupApplicationTest>[1]
) {
upstreamSetupApplicationTest(hooks, options);
// Additional setup for application tests can be done here.
//
// For example, if you need an authenticated session for each
// application test, you could do:
//
// hooks.beforeEach(async function () {
// await authenticateSession(); // ember-simple-auth
// });
//
// This is also a good place to call test setup functions coming
// from other addons:
//
// setupIntl(hooks); // ember-intl
// setupMirage(hooks); // ember-cli-mirage
}
function setupRenderingTest(
hooks: Parameters<typeof upstreamSetupApplicationTest>[0],
options?: Parameters<typeof upstreamSetupApplicationTest>[1]
) {
upstreamSetupRenderingTest(hooks, options);
// Additional setup for rendering tests can be done here.
}
function setupTest(
hooks: Parameters<typeof upstreamSetupApplicationTest>[0],
options?: Parameters<typeof upstreamSetupApplicationTest>[1]
) {
upstreamSetupTest(hooks, options);
// Additional setup for unit tests can be done here.
}
export { setupApplicationTest, setupRenderingTest, setupTest };
| import {
setupApplicationTest as upstreamSetupApplicationTest,
setupRenderingTest as upstreamSetupRenderingTest,
setupTest as upstreamSetupTest,
SetupTestOptions,
} from 'ember-qunit';
// This file exists to provide wrappers around ember-qunit's / ember-mocha's
// test setup functions. This way, you can easily extend the setup that is
// needed per test type.
function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions) {
upstreamSetupApplicationTest(hooks, options);
// Additional setup for application tests can be done here.
//
// For example, if you need an authenticated session for each
// application test, you could do:
//
// hooks.beforeEach(async function () {
// await authenticateSession(); // ember-simple-auth
// });
//
// This is also a good place to call test setup functions coming
// from other addons:
//
// setupIntl(hooks); // ember-intl
// setupMirage(hooks); // ember-cli-mirage
}
function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) {
upstreamSetupRenderingTest(hooks, options);
// Additional setup for rendering tests can be done here.
}
function setupTest(hooks: NestedHooks, options?: SetupTestOptions) {
upstreamSetupTest(hooks, options);
// Additional setup for unit tests can be done here.
}
export { setupApplicationTest, setupRenderingTest, setupTest };
| Use new types from ember-qunit | Use new types from ember-qunit
| TypeScript | mit | ember-cli/ember-cli,ember-cli/ember-cli,ember-cli/ember-cli | ---
+++
@@ -2,16 +2,14 @@
setupApplicationTest as upstreamSetupApplicationTest,
setupRenderingTest as upstreamSetupRenderingTest,
setupTest as upstreamSetupTest,
+ SetupTestOptions,
} from 'ember-qunit';
// This file exists to provide wrappers around ember-qunit's / ember-mocha's
// test setup functions. This way, you can easily extend the setup that is
// needed per test type.
-function setupApplicationTest(
- hooks: Parameters<typeof upstreamSetupApplicationTest>[0],
- options?: Parameters<typeof upstreamSetupApplicationTest>[1]
-) {
+function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions) {
upstreamSetupApplicationTest(hooks, options);
// Additional setup for application tests can be done here.
@@ -30,19 +28,13 @@
// setupMirage(hooks); // ember-cli-mirage
}
-function setupRenderingTest(
- hooks: Parameters<typeof upstreamSetupApplicationTest>[0],
- options?: Parameters<typeof upstreamSetupApplicationTest>[1]
-) {
+function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions) {
upstreamSetupRenderingTest(hooks, options);
// Additional setup for rendering tests can be done here.
}
-function setupTest(
- hooks: Parameters<typeof upstreamSetupApplicationTest>[0],
- options?: Parameters<typeof upstreamSetupApplicationTest>[1]
-) {
+function setupTest(hooks: NestedHooks, options?: SetupTestOptions) {
upstreamSetupTest(hooks, options);
// Additional setup for unit tests can be done here. |
35c2c0db32fff45f3d7ab1160fad257acee1d289 | test/helpers/make_class.ts | test/helpers/make_class.ts | /**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {UrlNode} from '../../src/triples/types';
import {Class, ClassMap} from '../../src/ts/class';
export function makeClass(url: string, allowString = false): Class {
return new Class(UrlNode.Parse(url), allowString);
}
export function makeClassMap(...classes: Class[]): ClassMap {
return new Map(classes.map(cls => [cls.subject.href, cls]));
}
| /**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {UrlNode} from '../../src/triples/types';
import {Class, ClassMap} from '../../src/ts/class';
export function makeClass(url: string): Class {
return new Class(UrlNode.Parse(url));
}
export function makeClassMap(...classes: Class[]): ClassMap {
return new Map(classes.map(cls => [cls.subject.href, cls]));
}
| Fix test still referencing allowString. | Fix test still referencing allowString.
| TypeScript | apache-2.0 | google/schema-dts,google/schema-dts | ---
+++
@@ -16,8 +16,8 @@
import {UrlNode} from '../../src/triples/types';
import {Class, ClassMap} from '../../src/ts/class';
-export function makeClass(url: string, allowString = false): Class {
- return new Class(UrlNode.Parse(url), allowString);
+export function makeClass(url: string): Class {
+ return new Class(UrlNode.Parse(url));
}
export function makeClassMap(...classes: Class[]): ClassMap { |
4afaabee62e13b6cb1947106e93deb928451f65d | peril/compareReactionSchema.ts | peril/compareReactionSchema.ts | import { buildSchema } from "graphql"
import { readFileSync } from "fs"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
import { warn } from "danger"
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
export default async () => {
const forcePackageJSON = await (await fetch(
"https://raw.githubusercontent.com/artsy/force/release/package.json"
)).json()
const reactionVersion = forcePackageJSON["dependencies"]["@artsy/reaction"]
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
const localSchema = readFileSync("_schemaV2.graphql", "utf8")
const allChanges = schemaDiff(
buildSchema(reactionSchema),
buildSchema(localSchema)
)
const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
const messages = breakings.map(c => c.message)
if (messages.length) {
warn(
`The V2 schema in this PR has breaking changes with production Force. Remember to update Reaction if necessary:\n\n${messages}`
)
}
}
| import { buildSchema } from "graphql"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
import { warn, danger } from "danger"
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
export default async () => {
const forcePackageJSON = await (await fetch(
"https://raw.githubusercontent.com/artsy/force/release/package.json"
)).json()
const reactionVersion = forcePackageJSON["dependencies"]["@artsy/reaction"]
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
const repo = danger.github.pr.head.repo.full_name
const sha = danger.github.pr.head.sha
const localSchema = await (await fetch(
`https://raw.githubusercontent.com/${repo}/${sha}/_schemaV2.graphql`
)).text()
const allChanges = schemaDiff(
buildSchema(reactionSchema),
buildSchema(localSchema)
)
const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
const messages = breakings.map(c => c.message)
if (messages.length) {
warn(
`The V2 schema in this PR has breaking changes with production Force. Remember to update Reaction if necessary:\n\n${messages}`
)
}
}
| Tweak schema check to infer URL to PR schema | [Peril] Tweak schema check to infer URL to PR schema
| TypeScript | mit | artsy/metaphysics,artsy/metaphysics,artsy/metaphysics | ---
+++
@@ -1,8 +1,7 @@
import { buildSchema } from "graphql"
-import { readFileSync } from "fs"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
-import { warn } from "danger"
+import { warn, danger } from "danger"
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
@@ -14,7 +13,11 @@
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
- const localSchema = readFileSync("_schemaV2.graphql", "utf8")
+ const repo = danger.github.pr.head.repo.full_name
+ const sha = danger.github.pr.head.sha
+ const localSchema = await (await fetch(
+ `https://raw.githubusercontent.com/${repo}/${sha}/_schemaV2.graphql`
+ )).text()
const allChanges = schemaDiff(
buildSchema(reactionSchema), |
60c6e295607e6091c679eeef3b8353ce40c99447 | src/components/layout/layout.tsx | src/components/layout/layout.tsx | import * as React from "react";
import {Navbar} from "./navbar"
import { Link } from 'react-router'
export interface LayoutProps {
}
export class Layout extends React.Component<LayoutProps, {}> {
render() {
return <div>
<Navbar title={<img src="/logo.svg"
style={{padding: 2.5, height: "35px"}}/>}
height="40"
items={[<Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{color: "red"}} to="/about">About</Link>,
<Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{color: "red"}} to="/login">Login</Link>]}
/>
<div style={{minHeight: "100%", "margin": "0 auto"}} className="content">
{this.props.children}
</div>
</div>
}
} | import * as React from "react";
import {Navbar} from "./navbar"
import { Link } from 'react-router'
export interface LayoutProps {
}
export class Layout extends React.Component<LayoutProps, {}> {
render() {
return <div>
<Navbar title={<img src="/logo.svg"
style={{padding: 2.5, height: "35px"}}/>}
height="40"
items={[<Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{fontWeight: "bold"}} to="/about">About</Link>,
<Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{fontWeight: "bold"}} to="/course/add/">Add Course</Link>]}
/>
<div style={{minHeight: "100%", "margin": "0 auto"}} className="content">
{this.props.children}
</div>
</div>
}
} | Add Link to Add Course | Add Link to Add Course
| TypeScript | mit | goodbye-island/S-Store-Front-End,goodbye-island/S-Store-Front-End,goodbye-island/S-Store-Front-End | ---
+++
@@ -11,8 +11,8 @@
<Navbar title={<img src="/logo.svg"
style={{padding: 2.5, height: "35px"}}/>}
height="40"
- items={[<Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{color: "red"}} to="/about">About</Link>,
- <Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{color: "red"}} to="/login">Login</Link>]}
+ items={[<Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{fontWeight: "bold"}} to="/about">About</Link>,
+ <Link style={{padding: 7, fontSize: 30, color: "white"}} activeStyle={{fontWeight: "bold"}} to="/course/add/">Add Course</Link>]}
/>
<div style={{minHeight: "100%", "margin": "0 auto"}} className="content">
{this.props.children} |
0cc8d340388dfd8e2f13026f7cb104ce5d33285a | src/reducers.ts | src/reducers.ts | import { RootState } from './types';
import { combineReducers } from 'redux';
import { reducer as toastr } from 'react-redux-toastr';
import { default as tab } from './reducers/tab';
import { default as searchingActive } from './reducers/searchingActive';
import { default as search } from './reducers/search';
import { default as queue } from './reducers/queue';
import { default as requesters } from './reducers/requesters';
import { default as searchOptions } from './reducers/searchOptions';
import { default as searchFormActive } from './reducers/searchFormActive';
import { default as sortingOption } from './reducers/sortingOption';
import { default as hitBlocklist } from './reducers/hitBlocklist';
import { default as timeNextSearch } from './reducers/timeNextSearch';
import { default as waitingForMturk } from './reducers/waitingForMturk';
export const rootReducer = combineReducers<RootState>({
tab,
queue,
search,
toastr,
requesters,
hitBlocklist,
searchOptions,
sortingOption,
timeNextSearch,
waitingForMturk,
searchingActive,
searchFormActive
});
| import { RootState } from './types';
import { combineReducers } from 'redux';
import { reducer as toastr } from 'react-redux-toastr';
import { default as tab } from './reducers/tab';
import { default as searchingActive } from './reducers/searchingActive';
import { default as search } from './reducers/search';
import { default as queue } from './reducers/queue';
import { default as requesters } from './reducers/requesters';
import { default as searchOptions } from './reducers/searchOptions';
import { default as searchFormActive } from './reducers/searchFormActive';
import { default as sortingOption } from './reducers/sortingOption';
import { default as hitBlocklist } from './reducers/hitBlocklist';
import { default as timeNextSearch } from './reducers/timeNextSearch';
import { default as waitingForMturk } from './reducers/waitingForMturk';
import { default as requesterBlockList } from './reducers/requesterBlockList';
export const rootReducer = combineReducers<RootState>({
tab,
queue,
search,
toastr,
requesters,
hitBlocklist,
searchOptions,
sortingOption,
timeNextSearch,
waitingForMturk,
searchingActive,
searchFormActive,
requesterBlockList
});
| Add requesterBlockList to root reducer. | Add requesterBlockList to root reducer.
| TypeScript | mit | Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine | ---
+++
@@ -12,6 +12,7 @@
import { default as hitBlocklist } from './reducers/hitBlocklist';
import { default as timeNextSearch } from './reducers/timeNextSearch';
import { default as waitingForMturk } from './reducers/waitingForMturk';
+import { default as requesterBlockList } from './reducers/requesterBlockList';
export const rootReducer = combineReducers<RootState>({
tab,
@@ -25,5 +26,6 @@
timeNextSearch,
waitingForMturk,
searchingActive,
- searchFormActive
+ searchFormActive,
+ requesterBlockList
}); |
675b98ba7ee2fd30e2e807b27ec1ed2a7945a8b0 | src/utilities/testing/itAsync.ts | src/utilities/testing/itAsync.ts | const itIsDefined = typeof it === "object";
function wrap<TResult>(
original: ((...args: any[]) => TResult) | false,
) {
return (
message: string,
callback: (
resolve: (result?: any) => void,
reject: (reason?: any) => void,
) => any,
timeout?: number,
) => original && original(message, function () {
return new Promise(
(resolve, reject) => callback.call(this, resolve, reject),
);
}, timeout);
}
const wrappedIt = wrap(itIsDefined && it);
export function itAsync(...args: Parameters<typeof wrappedIt>) {
return wrappedIt.apply(this, args);
}
export namespace itAsync {
export const only = wrap(itIsDefined && it.only);
export const skip = wrap(itIsDefined && it.skip);
export const todo = wrap(itIsDefined && it.todo);
}
| function wrap<TResult>(
original: (...args: any[]) => TResult,
) {
return (
message: string,
callback: (
resolve: (result?: any) => void,
reject: (reason?: any) => void,
) => any,
timeout?: number,
) => original(message, function () {
return new Promise(
(resolve, reject) => callback.call(this, resolve, reject),
);
}, timeout);
}
const wrappedIt = wrap(it);
export function itAsync(...args: Parameters<typeof wrappedIt>) {
return wrappedIt.apply(this, args);
}
export namespace itAsync {
export const only = wrap(it.only);
export const skip = wrap(it.skip);
export const todo = wrap(it.todo);
}
| Revert "Allow importing @apollo/client/testing when global.it undefined." | Revert "Allow importing @apollo/client/testing when global.it undefined."
This reverts commit 458960673148b70051315a4c0e73f9f22d749e2d, because it
was pushed without a PR, and broke a number of tests.
| TypeScript | mit | apollostack/apollo-client,apollographql/apollo-client,apollostack/apollo-client,apollostack/apollo-client,apollographql/apollo-client | ---
+++
@@ -1,7 +1,5 @@
-const itIsDefined = typeof it === "object";
-
function wrap<TResult>(
- original: ((...args: any[]) => TResult) | false,
+ original: (...args: any[]) => TResult,
) {
return (
message: string,
@@ -10,20 +8,20 @@
reject: (reason?: any) => void,
) => any,
timeout?: number,
- ) => original && original(message, function () {
+ ) => original(message, function () {
return new Promise(
(resolve, reject) => callback.call(this, resolve, reject),
);
}, timeout);
}
-const wrappedIt = wrap(itIsDefined && it);
+const wrappedIt = wrap(it);
export function itAsync(...args: Parameters<typeof wrappedIt>) {
return wrappedIt.apply(this, args);
}
export namespace itAsync {
- export const only = wrap(itIsDefined && it.only);
- export const skip = wrap(itIsDefined && it.skip);
- export const todo = wrap(itIsDefined && it.todo);
+ export const only = wrap(it.only);
+ export const skip = wrap(it.skip);
+ export const todo = wrap(it.todo);
} |
e93159c539f39b8f5958dcde63788fcec539676c | src/app/config/constants/apiURL.ts | src/app/config/constants/apiURL.ts | let API_URL: string;
API_URL = "http://localhost:3000/api";
export default API_URL;
| let API_URL: string;
API_URL = `${window.location.protocol}//${window.location.hostname}:3000/api`;
export default API_URL;
| Correct development URL to use port 3000 for api | CONFIG: Correct development URL to use port 3000 for api
| TypeScript | agpl-3.0 | doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web | ---
+++
@@ -1,4 +1,4 @@
let API_URL: string;
-API_URL = "http://localhost:3000/api";
+API_URL = `${window.location.protocol}//${window.location.hostname}:3000/api`;
export default API_URL; |
3aa9330eb0a2b418bf996f8309efaf82950e839d | src/app/services/budget.service.ts | src/app/services/budget.service.ts | import {BudgetItem} from '../budget/budget-item';
export class BudgetService {
private _budgetItems: BudgetItem[];
getItems() {
this._budgetItems = budgetItems;
return this._budgetItems;
}
addItem(new_sum: number, new_description: string) {
var item: BudgetItem = {
sum: new_sum,
description: new_description
}
this._budgetItems.push(item);
}
}
var budgetItems: BudgetItem[] = [
{
sum: 900,
description: "Salary"
},
{
sum: -150,
description: "BB-8 toy"
},
{
sum: -20,
description: "Groceries"
},
{
sum: -200,
description: "Emergency"
},
{
sum: -50,
description: "Superman toy"
},
{
sum: 80,
description: "Loan returned"
}
]
| import {BudgetItem} from '../budget/budget-item';
export class BudgetService {
getItems() {
var budgetItems: BudgetItem[];
if (localStorage.budgetItems) {
budgetItems = JSON.parse(localStorage.budgetItems) || [];
} else {
budgetItems = [];
}
return budgetItems;
}
addItem(item: BudgetItem) {
var allItems: BudgetItem[];
try {
allItems = localStorage.budgetItems ? JSON.parse(localStorage.budgetItems) : [];
} catch(e) {
allItems = [];
} finally {
allItems.push(item);
localStorage.budgetItems = JSON.stringify(<Array<BudgetItem>>allItems);
}
}
fillWithTestData() {
localStorage.budgetItems = JSON.stringify(<Array<BudgetItem>>budgetItems);
}
}
var budgetItems: BudgetItem[] = [
{
sum: 900,
description: "Salary"
},
{
sum: -150,
description: "BB-8 toy"
},
{
sum: -20,
description: "Groceries"
},
{
sum: -200,
description: "Emergency"
},
{
sum: -50,
description: "Superman toy"
},
{
sum: 80,
description: "Loan returned"
}
]
| Add localStorage to store data | Add localStorage to store data
| TypeScript | mit | bluebirrrrd/ng2-budget,bluebirrrrd/ng2-budget,bluebirrrrd/ng2-budget | ---
+++
@@ -2,20 +2,39 @@
export class BudgetService {
- private _budgetItems: BudgetItem[];
-
getItems() {
- this._budgetItems = budgetItems;
- return this._budgetItems;
+
+ var budgetItems: BudgetItem[];
+
+ if (localStorage.budgetItems) {
+ budgetItems = JSON.parse(localStorage.budgetItems) || [];
+ } else {
+ budgetItems = [];
+ }
+
+ return budgetItems;
}
- addItem(new_sum: number, new_description: string) {
- var item: BudgetItem = {
- sum: new_sum,
- description: new_description
- }
- this._budgetItems.push(item);
+
+ addItem(item: BudgetItem) {
+
+ var allItems: BudgetItem[];
+
+ try {
+ allItems = localStorage.budgetItems ? JSON.parse(localStorage.budgetItems) : [];
+ } catch(e) {
+ allItems = [];
+ } finally {
+ allItems.push(item);
+ localStorage.budgetItems = JSON.stringify(<Array<BudgetItem>>allItems);
+ }
+
}
+
+ fillWithTestData() {
+ localStorage.budgetItems = JSON.stringify(<Array<BudgetItem>>budgetItems);
+ }
+
}
var budgetItems: BudgetItem[] = [ |
d2369f887a1e269cbf51fd935b2c5a9dbabb3f6f | packages/react-scripts/template/src/App.tsx | packages/react-scripts/template/src/App.tsx | import * as React from 'react';
import './App.css';
const logo = require('./logo.svg');
class App extends React.Component<{}, null> {
render() {
return (
<div className="App">
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
</div>
<p className="App-intro">
To get started, edit <code>src/App.tsx</code> and save to reload.
</p>
</div>
);
}
}
export default App;
| import * as React from 'react';
import './App.css';
const logo = require('./logo.svg');
class App extends React.Component<{}, {}> {
render() {
return (
<div className="App">
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
</div>
<p className="App-intro">
To get started, edit <code>src/App.tsx</code> and save to reload.
</p>
</div>
);
}
}
export default App;
| Fix bug with new @types/react | Fix bug with new @types/react
| TypeScript | bsd-3-clause | devex-web-frontend/create-react-app-dx,devex-web-frontend/create-react-app-dx,devex-web-frontend/create-react-app-dx,devex-web-frontend/create-react-app-dx | ---
+++
@@ -3,7 +3,7 @@
const logo = require('./logo.svg');
-class App extends React.Component<{}, null> {
+class App extends React.Component<{}, {}> {
render() {
return (
<div className="App"> |
38eb55580326459c53ea4e818ac34099362935fa | src/I18NextTitle.ts | src/I18NextTitle.ts | import { Injectable, Inject } from '@angular/core';
import { Title, DOCUMENT } from '@angular/platform-browser';
import { I18NextPipe } from './I18NextPipe';
@Injectable()
export class I18NextTitle extends Title {
constructor(private i18nextPipe: I18NextPipe, @Inject(DOCUMENT) doc) {
super(doc);
}
setTitle(value: string) {
return super.setTitle(this.translate(value));
}
private translate(text: string) {
return this.i18nextPipe.transform(text, { format: 'cap'});
}
}
| import { DOCUMENT } from '@angular/common';
import { Inject, Injectable } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { I18NextPipe } from './I18NextPipe';
@Injectable()
export class I18NextTitle extends Title {
constructor(private i18nextPipe: I18NextPipe, @Inject(DOCUMENT) doc) {
super(doc);
}
setTitle(value: string) {
return super.setTitle(this.translate(value));
}
private translate(text: string) {
return this.i18nextPipe.transform(text, { format: 'cap'});
}
}
| Fix deprecated import of DOCUMENT | Fix deprecated import of DOCUMENT
| TypeScript | mit | Romanchuk/angular-i18next,Romanchuk/angular-i18next,Romanchuk/angular-i18next,Romanchuk/angular-i18next | ---
+++
@@ -1,5 +1,6 @@
-import { Injectable, Inject } from '@angular/core';
-import { Title, DOCUMENT } from '@angular/platform-browser';
+import { DOCUMENT } from '@angular/common';
+import { Inject, Injectable } from '@angular/core';
+import { Title } from '@angular/platform-browser';
import { I18NextPipe } from './I18NextPipe';
@Injectable() |
24b3c7210997216da21aeb2acfcf51b323455976 | src/util/MsgUtils.ts | src/util/MsgUtils.ts | import {
Session,
EntityRecognizer,
} from 'botbuilder';
export class MsgUtils {
public static sendAsSay(session:Session, msg:string) {
session.say(msg, msg);
}
public static onlyAlpha(msg:string) {
}
public static getDateFromUtterance(msg:string) : Date | null {
return EntityRecognizer.parseTime(msg);
}
} | import {
Session,
EntityRecognizer,
} from 'botbuilder';
export class MsgUtils {
public static sayAsSend(session:Session, msg:string) {
return session.say(msg, msg);
}
public static getDateFromUtterance(msg:string) : Date | null {
return EntityRecognizer.parseTime(msg);
}
public static meanYes(msg:string) : boolean {
return EntityRecognizer.parseBoolean(msg);
}
public static extract(type:string, msg:string) {
// TODO: ues regular expression to extract specify str
}
} | Prepare for RegExp helper class | Prepare for RegExp helper class
| TypeScript | mit | yujiahaol68/alfred | ---
+++
@@ -4,16 +4,20 @@
} from 'botbuilder';
export class MsgUtils {
- public static sendAsSay(session:Session, msg:string) {
- session.say(msg, msg);
- }
-
- public static onlyAlpha(msg:string) {
-
+ public static sayAsSend(session:Session, msg:string) {
+ return session.say(msg, msg);
}
public static getDateFromUtterance(msg:string) : Date | null {
return EntityRecognizer.parseTime(msg);
}
+ public static meanYes(msg:string) : boolean {
+ return EntityRecognizer.parseBoolean(msg);
+ }
+
+ public static extract(type:string, msg:string) {
+ // TODO: ues regular expression to extract specify str
+ }
+
} |
a935a1fe83cabd28a048f914abff3dbf1c356ff5 | packages/lesswrong/components/comments/CommentsItem/CommentUserName.tsx | packages/lesswrong/components/comments/CommentsItem/CommentUserName.tsx | import { registerComponent, Components } from '../../../lib/vulcan-lib';
import React from 'react';
import classNames from 'classnames';
const styles = (theme: ThemeType): JssStyles => ({
author: {
...theme.typography.body2,
fontWeight: 600,
},
authorAnswer: {
...theme.typography.body2,
fontFamily: theme.typography.postStyle.fontFamily,
fontWeight: 600,
'& a, & a:hover': {
textShadow:"none",
backgroundImage: "none"
}
},
});
const CommentUserName = ({comment, classes, simple = false, className}: {
comment: CommentsList,
classes: ClassesType,
simple?: boolean,
className?: string
}) => {
if (comment.deleted) {
return <span className={className}>[comment deleted]</span>
} else if (comment.hideAuthor || !comment.user) {
return <span className={className}>
<Components.UserNameDeleted/>
</span>
} else if (comment.answer) {
return (
<span className={classNames(className, classes.authorAnswer)}>
Answer by <Components.UsersName user={comment.user} simple={simple}/>
</span>
);
} else {
return <Components.UsersName user={comment.user} simple={simple} className={classNames(className, classes.author)}/>
}
}
const CommentUserNameComponent = registerComponent('CommentUserName', CommentUserName, {styles});
declare global {
interface ComponentTypes {
CommentUserName: typeof CommentUserNameComponent
}
}
| import { registerComponent, Components } from '../../../lib/vulcan-lib';
import React from 'react';
import classNames from 'classnames';
const styles = (theme: ThemeType): JssStyles => ({
author: {
...theme.typography.body2,
fontWeight: 600,
},
authorAnswer: {
...theme.typography.body2,
fontFamily: theme.typography.postStyle.fontFamily,
fontWeight: 600,
'& a, & a:hover': {
textShadow:"none",
backgroundImage: "none"
}
},
});
const CommentUserName = ({comment, classes, simple = false, className}: {
comment: CommentsList,
classes: ClassesType,
simple?: boolean,
className?: string
}) => {
if (comment.deleted) {
return <span className={className}>[comment deleted]</span>
} else if (comment.hideAuthor || !comment.user) {
return <span className={className}>
<Components.UserNameDeleted/>
</span>
} else if (comment.answer) {
return (
<span className={classNames(className, classes.authorAnswer)}>
Answer by <Components.UsersName user={comment.user} simple={simple}/>
</span>
);
} else {
return <Components.UsersName user={comment.user} simple={simple} className={classNames(className, classes.author)}/>
}
}
const CommentUserNameComponent = registerComponent('CommentUserName', CommentUserName, {
styles,
stylePriority: 100, //Higher than Components.UsersName, which gets a className from us
});
declare global {
interface ComponentTypes {
CommentUserName: typeof CommentUserNameComponent
}
}
| Fix coloring of comment usernames in single-line comments | Fix coloring of comment usernames in single-line comments
| TypeScript | mit | Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2 | ---
+++
@@ -41,7 +41,10 @@
}
}
-const CommentUserNameComponent = registerComponent('CommentUserName', CommentUserName, {styles});
+const CommentUserNameComponent = registerComponent('CommentUserName', CommentUserName, {
+ styles,
+ stylePriority: 100, //Higher than Components.UsersName, which gets a className from us
+});
declare global {
interface ComponentTypes { |
d87c01acc609abb807ba922c458519d420eaa2eb | bemuse/src/previewer/PreviewInfo.tsx | bemuse/src/previewer/PreviewInfo.tsx | import './PreviewInfo.scss'
import React from 'react'
export const PreviewInfo = () => {
return (
<div className='PreviewInfo'>
<h2>No BMS/bmson loaded</h2>
<p>Drop a folder with BMS/bmson files into this window to preview it.</p>
<p className='PreviewInfoのkeyHints'>
<kbd>Space</kbd> Play/Pause · <kbd>Left/Right</kbd> Seek ·{' '}
<kbd>Up/Down</kbd> Hi-Speed ·{' '}
</p>
</div>
)
}
| import './PreviewInfo.scss'
import React from 'react'
export const PreviewInfo = () => {
return (
<div className='PreviewInfo'>
<h2>No BMS/bmson loaded</h2>
<p>Drop a folder with BMS/bmson files into this window to preview it.</p>
<p className='PreviewInfoのkeyHints'>
<kbd>Space</kbd> Play/Pause · <kbd>Left/Right</kbd> Seek ·{' '}
<kbd>Up/Down</kbd> Hi-Speed · <kbd>R</kbd> Reload
</p>
</div>
)
}
| Document R key for reloading | Document R key for reloading
| TypeScript | agpl-3.0 | bemusic/bemuse,bemusic/bemuse,bemusic/bemuse,bemusic/bemuse,bemusic/bemuse | ---
+++
@@ -8,7 +8,7 @@
<p>Drop a folder with BMS/bmson files into this window to preview it.</p>
<p className='PreviewInfoのkeyHints'>
<kbd>Space</kbd> Play/Pause · <kbd>Left/Right</kbd> Seek ·{' '}
- <kbd>Up/Down</kbd> Hi-Speed ·{' '}
+ <kbd>Up/Down</kbd> Hi-Speed · <kbd>R</kbd> Reload
</p>
</div>
) |
015f1c7909f5f554300e933e9b2e948a86b539f0 | extensions/typescript-language-features/src/utils/arrays.ts | extensions/typescript-language-features/src/utils/arrays.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export function equals<T>(
a: ReadonlyArray<T>,
b: ReadonlyArray<T>,
itemEquals: (a: T, b: T) => boolean = (a, b) => a === b
): boolean {
if (a === b) {
return true;
}
if (a.length !== b.length) {
return false;
}
return a.every((x, i) => itemEquals(x, b[i]));
}
export function flatten<T>(arr: ReadonlyArray<T>[]): T[] {
return ([] as T[]).concat.apply([], arr);
} | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export function equals<T>(
a: ReadonlyArray<T>,
b: ReadonlyArray<T>,
itemEquals: (a: T, b: T) => boolean = (a, b) => a === b
): boolean {
if (a === b) {
return true;
}
if (a.length !== b.length) {
return false;
}
return a.every((x, i) => itemEquals(x, b[i]));
}
export function flatten<T>(arr: ReadonlyArray<T>[]): T[] {
return Array.prototype.concat.apply([], arr);
} | Use array prototype instead of creating instance | Use array prototype instead of creating instance
| TypeScript | mit | eamodio/vscode,joaomoreno/vscode,the-ress/vscode,eamodio/vscode,Microsoft/vscode,microsoft/vscode,eamodio/vscode,mjbvz/vscode,joaomoreno/vscode,joaomoreno/vscode,the-ress/vscode,joaomoreno/vscode,mjbvz/vscode,the-ress/vscode,mjbvz/vscode,joaomoreno/vscode,hoovercj/vscode,mjbvz/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,eamodio/vscode,microsoft/vscode,mjbvz/vscode,mjbvz/vscode,mjbvz/vscode,Krzysztof-Cieslak/vscode,the-ress/vscode,Microsoft/vscode,Microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,mjbvz/vscode,Microsoft/vscode,eamodio/vscode,mjbvz/vscode,Microsoft/vscode,eamodio/vscode,mjbvz/vscode,microsoft/vscode,the-ress/vscode,mjbvz/vscode,the-ress/vscode,joaomoreno/vscode,Microsoft/vscode,joaomoreno/vscode,eamodio/vscode,mjbvz/vscode,Microsoft/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,joaomoreno/vscode,eamodio/vscode,hoovercj/vscode,Microsoft/vscode,the-ress/vscode,hoovercj/vscode,hoovercj/vscode,Microsoft/vscode,joaomoreno/vscode,eamodio/vscode,the-ress/vscode,hoovercj/vscode,hoovercj/vscode,microsoft/vscode,Microsoft/vscode,mjbvz/vscode,microsoft/vscode,eamodio/vscode,hoovercj/vscode,mjbvz/vscode,joaomoreno/vscode,microsoft/vscode,hoovercj/vscode,the-ress/vscode,Microsoft/vscode,joaomoreno/vscode,joaomoreno/vscode,Krzysztof-Cieslak/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,hoovercj/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,the-ress/vscode,eamodio/vscode,hoovercj/vscode,microsoft/vscode,eamodio/vscode,microsoft/vscode,hoovercj/vscode,mjbvz/vscode,joaomoreno/vscode,microsoft/vscode,hoovercj/vscode,the-ress/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Microsoft/vscode,Microsoft/vscode,the-ress/vscode,mjbvz/vscode,Krzysztof-Cieslak/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,Microsoft/vscode,hoovercj/vscode,microsoft/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,joaomoreno/vscode,Microsoft/vscode,microsoft/vscode,the-ress/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,the-ress/vscode,the-ress/vscode,mjbvz/vscode,the-ress/vscode | ---
+++
@@ -18,5 +18,5 @@
}
export function flatten<T>(arr: ReadonlyArray<T>[]): T[] {
- return ([] as T[]).concat.apply([], arr);
+ return Array.prototype.concat.apply([], arr);
} |
cd6f814fe4f9e223ed1703e825fa56cf15249143 | src/app/views/sessions/session/tools/tools.module.ts | src/app/views/sessions/session/tools/tools.module.ts | import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {ToolService} from "./tool.service";
import {ToolTitleComponent} from "./tooltitle.component";
import {ToolListItemComponent} from "./toolsmodal/tool-list-item/tool-list-item.component";
import {ToolBoxComponent} from "./toolbox.component";
import {ToolsModalComponent} from "./toolsmodal/toolsmodal.component";
import {SharedModule} from "../../../../shared/shared.module";
import {FormsModule} from "@angular/forms";
import { ToolsParameterFormComponent } from './toolsmodal/tools-parameter-form/tools-parameter-form.component';
import SourceModalComponent from "./sourcemodal/sourcemodal.component";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import { ToolSourceComponent } from './toolsmodal/tool-source/tool-source.component';
@NgModule({
imports: [
CommonModule,
SharedModule,
FormsModule,
NgbModule
],
declarations: [ToolTitleComponent, ToolListItemComponent, ToolBoxComponent, ToolsModalComponent, ToolsParameterFormComponent, SourceModalComponent, ToolSourceComponent],
providers: [ToolService],
exports: [ToolBoxComponent]
})
export class ToolsModule { }
| import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {ToolService} from "./tool.service";
import {ToolTitleComponent} from "./tooltitle.component";
import {ToolListItemComponent} from "./toolsmodal/tool-list-item/tool-list-item.component";
import {ToolBoxComponent} from "./toolbox.component";
import {ToolsModalComponent} from "./toolsmodal/toolsmodal.component";
import {SharedModule} from "../../../../shared/shared.module";
import {FormsModule} from "@angular/forms";
import { ToolsParameterFormComponent } from './toolsmodal/tools-parameter-form/tools-parameter-form.component';
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import { ToolSourceComponent } from './toolsmodal/tool-source/tool-source.component';
@NgModule({
imports: [
CommonModule,
SharedModule,
FormsModule,
NgbModule
],
declarations: [ToolTitleComponent, ToolListItemComponent, ToolBoxComponent, ToolsModalComponent, ToolsParameterFormComponent, ToolSourceComponent],
providers: [ToolService],
exports: [ToolBoxComponent]
})
export class ToolsModule { }
| Remove SourceModalComponent dependency from ToolsModule | Remove SourceModalComponent dependency from ToolsModule
| TypeScript | mit | chipster/chipster-web,chipster/chipster-web,chipster/chipster-web | ---
+++
@@ -8,7 +8,6 @@
import {SharedModule} from "../../../../shared/shared.module";
import {FormsModule} from "@angular/forms";
import { ToolsParameterFormComponent } from './toolsmodal/tools-parameter-form/tools-parameter-form.component';
-import SourceModalComponent from "./sourcemodal/sourcemodal.component";
import {NgbModule} from "@ng-bootstrap/ng-bootstrap";
import { ToolSourceComponent } from './toolsmodal/tool-source/tool-source.component';
@@ -19,7 +18,7 @@
FormsModule,
NgbModule
],
- declarations: [ToolTitleComponent, ToolListItemComponent, ToolBoxComponent, ToolsModalComponent, ToolsParameterFormComponent, SourceModalComponent, ToolSourceComponent],
+ declarations: [ToolTitleComponent, ToolListItemComponent, ToolBoxComponent, ToolsModalComponent, ToolsParameterFormComponent, ToolSourceComponent],
providers: [ToolService],
exports: [ToolBoxComponent]
}) |
240dd12ac0c5b10816b92535d01107127d385afd | brandings/src/services/exchanges.service.ts | brandings/src/services/exchanges.service.ts | import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { ExchangeInfo } from '../interfaces/exchange.interfaces';
@Injectable()
export class ExchangesService {
constructor(private http: HttpClient) {
}
getExchanges() {
return this.http.get<ExchangeInfo[]>('assets/data/exchanges.json');
}
getExchangeDescription(exchangeInfo: ExchangeInfo) {
return this.http.get(exchangeInfo.url, { responseType: 'text' });
}
}
| import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
import { ExchangeInfo } from '../interfaces/exchange.interfaces';
@Injectable()
export class ExchangesService {
constructor(private http: HttpClient) {
}
getExchanges() {
return this.http.get<ExchangeInfo[]>('assets/data/exchanges.json');
}
getExchangeDescription(exchangeInfo: ExchangeInfo) {
const split = exchangeInfo.url.split('/');
split.pop(); // remove filename
const baseUrl = split.join('/');
// Prepend the base url to paths starting with ../
return this.http.get(exchangeInfo.url, { responseType: 'text' }).pipe(
map(response => response.replace(/\.\.\//g, `${baseUrl}/../`)),
);
}
}
| Fix images inside exchange details | Fix images inside exchange details
| TypeScript | bsd-3-clause | threefoldfoundation/app_backend,threefoldfoundation/app_backend,threefoldfoundation/app_backend,threefoldfoundation/app_backend | ---
+++
@@ -1,5 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
+import { map } from 'rxjs/operators';
import { ExchangeInfo } from '../interfaces/exchange.interfaces';
@Injectable()
@@ -13,6 +14,12 @@
}
getExchangeDescription(exchangeInfo: ExchangeInfo) {
- return this.http.get(exchangeInfo.url, { responseType: 'text' });
+ const split = exchangeInfo.url.split('/');
+ split.pop(); // remove filename
+ const baseUrl = split.join('/');
+ // Prepend the base url to paths starting with ../
+ return this.http.get(exchangeInfo.url, { responseType: 'text' }).pipe(
+ map(response => response.replace(/\.\.\//g, `${baseUrl}/../`)),
+ );
}
} |
1f310c5f323b180b11031ce42a1a9db344a4950f | simple-subscriptions/client/src/modules/patients/sagas/subscribePatients.ts | simple-subscriptions/client/src/modules/patients/sagas/subscribePatients.ts | import { takeLatest } from 'redux-saga/effects';
import { eventChannel } from 'redux-saga';
import { actionsIDs } from '../constants'
import { fetchPatients } from './fetchPatients';
import { createStartHandler } from 'redux-saga-subscriptions';
import socket from '../../../socketIo/socket';
const msgChannel = 'patients-modified';
const getFetchEmit = (emit) => () => Promise.resolve(fetchPatients()).then(emit);
const createChannel = (payload?) => eventChannel((emit) => {
const fetch = getFetchEmit(emit);
fetch();
socket.on(msgChannel, fetch);
return () => {
socket.off(msgChannel);
};
});
export const watchPatientsSubscription = function *() {
const startHandler = createStartHandler([actionsIDs.STOP_SUBSCRIBE]);
yield takeLatest(actionsIDs.START_SUBSCRIBE, startHandler(createChannel));
};
| import { takeLatest, put } from 'redux-saga/effects';
import { eventChannel } from 'redux-saga';
import { actionsIDs } from '../constants'
import { fetchPatients } from './fetchPatients';
import { createStartHandler } from 'redux-saga-subscriptions';
import socket from '../../../socketIo/socket';
const msgChannel = 'patients-modified';
const getFetchEmit = (emit) => () => Promise.resolve(fetchPatients()).then(emit);
const createChannel = (payload?) => eventChannel((emit) => {
const fetch = getFetchEmit(emit);
fetch();
socket.on(msgChannel, fetch);
socket.on('disconnect', () => emit(put({type: 'failing-socket'})));
socket.on('connect', () => emit(put({type: 'socket-alive'})));
return () => {
socket.off(msgChannel);
};
});
export const watchPatientsSubscription = function *() {
const startHandler = createStartHandler([actionsIDs.STOP_SUBSCRIBE]);
yield takeLatest(actionsIDs.START_SUBSCRIBE, startHandler(createChannel));
};
| Support for socket life-time events. | Support for socket life-time events.
| TypeScript | mit | jaszczw/stomp-redux-subscriptions | ---
+++
@@ -1,4 +1,4 @@
-import { takeLatest } from 'redux-saga/effects';
+import { takeLatest, put } from 'redux-saga/effects';
import { eventChannel } from 'redux-saga';
import { actionsIDs } from '../constants'
import { fetchPatients } from './fetchPatients';
@@ -14,6 +14,8 @@
fetch();
socket.on(msgChannel, fetch);
+ socket.on('disconnect', () => emit(put({type: 'failing-socket'})));
+ socket.on('connect', () => emit(put({type: 'socket-alive'})));
return () => {
socket.off(msgChannel); |
8b8342c1cbaa03e87f2287f42bf660844f3df8ee | src/components/Footer.tsx | src/components/Footer.tsx | import * as React from 'react';
import Track from '../model/Track';
import { clear } from '../service';
import './Footer.css';
interface Props extends React.HTMLProps<HTMLDivElement> {
tracks: Track[];
}
function Footer({ tracks }: Props) {
return (
<div className="Footer">
<button
disabled={!tracks.length}
onClick={() => allowExportToM3U(tracks)}
>Export</button>
<button
disabled={!tracks.length}
onClick={() => clear()}
>Clear</button>
</div>
);
}
function allowExportToM3U(tracks: Track[]) {
chrome.permissions.request({
permissions: ['downloads']
}, function (granted) {
if (granted) exportToM3U(tracks);
});
}
function exportToM3U(tracks: Track[]) {
const html = document.implementation.createHTMLDocument('Extereo Playlist');
const ul = html.createElement('ol');
tracks.forEach(track => {
const li = html.createElement('li');
const a = html.createElement('a');
a.href = track.href;
a.innerText = track.title;
li.appendChild(a);
ul.appendChild(li);
});
html.body.appendChild(ul);
const blob = new Blob([html.documentElement.outerHTML], {
type: 'text/html'
});
chrome.downloads.download({
url: URL.createObjectURL(blob),
filename: 'playlist.html'
});
}
export default Footer; | import * as React from 'react';
import Track from '../model/Track';
import { clear } from '../service';
import './Footer.css';
interface Props extends React.HTMLProps<HTMLDivElement> {
tracks: Track[];
}
function Footer({ tracks }: Props) {
return (
<div className="Footer">
<button
disabled={!tracks.length}
onClick={() => allowDownload(tracks)}
>Export</button>
<button
disabled={!tracks.length}
onClick={() => clear()}
>Clear</button>
</div>
);
}
function allowDownload(tracks: Track[]) {
chrome.permissions.request({
permissions: ['downloads']
}, function (granted) {
if (granted) exportToHTML(tracks);
});
}
function exportToHTML(tracks: Track[]) {
const html = document.implementation.createHTMLDocument('Extereo Playlist');
const ul = html.createElement('ol');
tracks.forEach(track => {
const li = html.createElement('li');
const a = html.createElement('a');
a.href = track.href;
a.innerText = track.title;
li.appendChild(a);
ul.appendChild(li);
});
html.body.appendChild(ul);
const blob = new Blob([html.documentElement.outerHTML], {
type: 'text/html'
});
chrome.downloads.download({
url: URL.createObjectURL(blob),
filename: 'playlist.html',
saveAs: true
});
}
export default Footer; | Save as flag and rename methods. | Save as flag and rename methods.
| TypeScript | mit | soflete/extereo,soflete/extereo | ---
+++
@@ -12,7 +12,7 @@
<div className="Footer">
<button
disabled={!tracks.length}
- onClick={() => allowExportToM3U(tracks)}
+ onClick={() => allowDownload(tracks)}
>Export</button>
<button
disabled={!tracks.length}
@@ -22,15 +22,15 @@
);
}
-function allowExportToM3U(tracks: Track[]) {
+function allowDownload(tracks: Track[]) {
chrome.permissions.request({
permissions: ['downloads']
}, function (granted) {
- if (granted) exportToM3U(tracks);
+ if (granted) exportToHTML(tracks);
});
}
-function exportToM3U(tracks: Track[]) {
+function exportToHTML(tracks: Track[]) {
const html = document.implementation.createHTMLDocument('Extereo Playlist');
const ul = html.createElement('ol');
tracks.forEach(track => {
@@ -49,7 +49,8 @@
chrome.downloads.download({
url: URL.createObjectURL(blob),
- filename: 'playlist.html'
+ filename: 'playlist.html',
+ saveAs: true
});
}
|
e6e2784595c41299e9ac4d6937efb9ed6d881ca6 | src/schema-form.module.ts | src/schema-form.module.ts | import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
FormsModule,
ReactiveFormsModule
} from '@angular/forms';
import { FormElementComponent } from './formelement.component';
import { FormComponent } from './form.component';
import { WidgetChooserComponent } from './widgetchooser.component';
import {
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget
} from './defaultwidgets';
import {
DefaultWidget
} from './default.widget';
@NgModule({
imports : [CommonModule, FormsModule, ReactiveFormsModule],
declarations: [
FormElementComponent,
FormComponent,
WidgetChooserComponent,
DefaultWidget,
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget,
],
entryComponents: [
FormElementComponent,
FormComponent,
WidgetChooserComponent,
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget,
],
exports: [
FormComponent,
FormElementComponent,
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget
]
})
export class SchemaFormModule {}
| import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
FormsModule,
ReactiveFormsModule
} from '@angular/forms';
import { FormElementComponent } from './formelement.component';
import { FormComponent } from './form.component';
import { WidgetChooserComponent } from './widgetchooser.component';
import {
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget
} from './defaultwidgets';
import {
DefaultWidget
} from './default.widget';
@NgModule({
imports : [CommonModule, FormsModule, ReactiveFormsModule],
declarations: [
FormElementComponent,
FormComponent,
WidgetChooserComponent,
DefaultWidget,
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget,
],
entryComponents: [
FormElementComponent,
FormComponent,
WidgetChooserComponent,
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget,
],
exports: [
FormComponent,
FormElementComponent,
WidgetChooserComponent,
ArrayWidget,
ObjectWidget,
CheckboxWidget,
FileWidget,
IntegerWidget,
TextAreaWidget,
RadioWidget,
RangeWidget,
SelectWidget,
StringWidget
]
})
export class SchemaFormModule {}
| Add widget ChooserComponent to exports | Add widget ChooserComponent to exports
| TypeScript | mit | SBats/angular2-schema-form,SBats/angular2-schema-form,SBats/angular2-schema-form | ---
+++
@@ -60,6 +60,7 @@
exports: [
FormComponent,
FormElementComponent,
+ WidgetChooserComponent,
ArrayWidget,
ObjectWidget,
CheckboxWidget, |
a3d4ae1b4ea16721902ab6d53b2d5fc06cab114b | src/utils/hots-commons.ts | src/utils/hots-commons.ts | export enum HeroRoles {
Assassin,
Warrior,
Specialist,
Support
}
export interface Skill {
name: string;
level: number;
description: string;
}
export interface Build {
name: string;
skills: Array<Skill>;
}
export interface Hero {
name: string;
role: HeroRoles|Array<HeroRoles>;
builds: Array<Build>;
}
| export enum HeroRoles {
Assassin,
Warrior,
Specialist,
Support
}
export interface Skill {
name: string;
level: number;
description: string;
}
export interface Build {
name: string;
skills: Array<Skill>;
}
export interface Hero {
name: string;
role: Array<HeroRoles>;
builds: Array<Build>;
}
| Change Hero.role type to Array to avoid later test. | Change Hero.role type to Array to avoid later test. | TypeScript | mit | jchakra/hots-parser | ---
+++
@@ -18,6 +18,6 @@
export interface Hero {
name: string;
- role: HeroRoles|Array<HeroRoles>;
+ role: Array<HeroRoles>;
builds: Array<Build>;
} |
6602b84fc100e52d98f4eab8ee8604518d436896 | packages/most-buffer/src/most-buffer.d.ts | packages/most-buffer/src/most-buffer.d.ts | import { Stream } from 'most';
export function buffer<T>(count: number): (stream: Stream<T>) => Stream<T[]>;
export default buffer;
| import { Stream } from 'most';
export default function buffer<T>(count: number): (stream: Stream<T>) => Stream<T[]>;
| Fix the export for the buffer | Fix the export for the buffer | TypeScript | bsd-3-clause | craft-ai/most-utils,craft-ai/most-utils | ---
+++
@@ -1,4 +1,3 @@
import { Stream } from 'most';
-export function buffer<T>(count: number): (stream: Stream<T>) => Stream<T[]>;
-export default buffer;
+export default function buffer<T>(count: number): (stream: Stream<T>) => Stream<T[]>; |
7df23e7b9249259ca67a131f69eca61f22296557 | js/components/portal-dashboard/questions/iframe-question.tsx | js/components/portal-dashboard/questions/iframe-question.tsx | import React from "react";
import { Map } from "immutable";
import { renderHTML } from "../../../util/render-html";
import css from "../../../../css/portal-dashboard/questions/multiple-choice-question.less";
import ReportItemIframe from "../report-item-iframe";
interface IProps {
question?: Map<string, any>;
useMinHeight?: boolean;
}
export const IframeQuestion: React.FC<IProps> = (props) => {
const { question, useMinHeight } = props;
const prompt = question?.get("prompt");
const blankRegEx = /\[([^)]+)\]/g;
const promptText = prompt?.replace(blankRegEx,'__________');
return (
<div className={css.questionText}>
{prompt && renderHTML(promptText)}
{question && question.get("reportItemUrl") && <ReportItemIframe question={question} view={useMinHeight ? "singleAnswer" : "multipleAnswer"} />}
</div>
);
};
| import React from "react";
import { Map } from "immutable";
import { renderHTML } from "../../../util/render-html";
import css from "../../../../css/portal-dashboard/questions/multiple-choice-question.less";
import ReportItemIframe from "../report-item-iframe";
interface IProps {
question?: Map<string, any>;
useMinHeight?: boolean;
}
export const IframeQuestion: React.FC<IProps> = (props) => {
const { question, useMinHeight } = props;
const prompt = question?.get("prompt");
const blankRegEx = /\[([^)]+)\]/g;
const promptText = prompt?.replace(blankRegEx,'__________');
return (
<div className={css.questionText}>
{prompt && renderHTML(promptText)}
{question && question.get("reportItemUrl") && <ReportItemIframe key={question.get("id")} question={question} view={useMinHeight ? "singleAnswer" : "multipleAnswer"} />}
</div>
);
};
| Add a key property to `ReportItemIframe` for each question. | Add a key property to `ReportItemIframe` for each question.
Without the key property the Iframe content is not reliably updating when question selection changes.
[#180647562]
https://www.pivotaltracker.com/n/projects/2441249
| TypeScript | mit | concord-consortium/portal-report,concord-consortium/portal-report,concord-consortium/portal-report,concord-consortium/portal-report | ---
+++
@@ -19,7 +19,7 @@
return (
<div className={css.questionText}>
{prompt && renderHTML(promptText)}
- {question && question.get("reportItemUrl") && <ReportItemIframe question={question} view={useMinHeight ? "singleAnswer" : "multipleAnswer"} />}
+ {question && question.get("reportItemUrl") && <ReportItemIframe key={question.get("id")} question={question} view={useMinHeight ? "singleAnswer" : "multipleAnswer"} />}
</div>
);
}; |
830c8fa8c1529d2350814eb954928e913636278e | modules/effects/src/actions.ts | modules/effects/src/actions.ts | import { Inject, Injectable } from '@angular/core';
import { Action, ScannedActionsSubject } from '@ngrx/store';
import { Observable, Operator, OperatorFunction } from 'rxjs';
import { filter } from 'rxjs/operators';
@Injectable()
export class Actions<V = Action> extends Observable<V> {
constructor(@Inject(ScannedActionsSubject) source?: Observable<V>) {
super();
if (source) {
this.source = source;
}
}
lift<R>(operator: Operator<V, R>): Observable<R> {
const observable = new Actions<R>();
observable.source = this;
observable.operator = operator;
return observable;
}
ofType<V2 extends V = V>(...allowedTypes: string[]): Actions<V2> {
return ofType<any>(...allowedTypes)(this as Actions<any>) as Actions<V2>;
}
}
export function ofType<T extends Action>(
...allowedTypes: string[]
): OperatorFunction<Action, T> {
return filter(
(action: Action): action is T =>
allowedTypes.some(type => type === action.type)
);
}
| import { Inject, Injectable } from '@angular/core';
import { Action, ScannedActionsSubject } from '@ngrx/store';
import { Observable, Operator, OperatorFunction } from 'rxjs';
import { filter } from 'rxjs/operators';
@Injectable()
export class Actions<V = Action> extends Observable<V> {
constructor(@Inject(ScannedActionsSubject) source?: Observable<V>) {
super();
if (source) {
this.source = source;
}
}
lift<R>(operator: Operator<V, R>): Observable<R> {
const observable = new Actions<R>();
observable.source = this;
observable.operator = operator;
return observable;
}
/**
* @deprecated from 6.1.0. Use the pipeable `ofType` operator instead.
*/
ofType<V2 extends V = V>(...allowedTypes: string[]): Actions<V2> {
return ofType<any>(...allowedTypes)(this as Actions<any>) as Actions<V2>;
}
}
export function ofType<T extends Action>(
...allowedTypes: string[]
): OperatorFunction<Action, T> {
return filter(
(action: Action): action is T =>
allowedTypes.some(type => type === action.type)
);
}
| Add deprecation notice for ofType instance operator | fix(effects): Add deprecation notice for ofType instance operator
| TypeScript | mit | brandonroberts/platform,brandonroberts/platform,brandonroberts/platform,brandonroberts/platform | ---
+++
@@ -20,6 +20,9 @@
return observable;
}
+ /**
+ * @deprecated from 6.1.0. Use the pipeable `ofType` operator instead.
+ */
ofType<V2 extends V = V>(...allowedTypes: string[]): Actions<V2> {
return ofType<any>(...allowedTypes)(this as Actions<any>) as Actions<V2>;
} |
188cdfc35b198859869f06e6d09a01c57d69d919 | src/dnd.service.ts | src/dnd.service.ts | // Copyright (C) 2016 Sergey Akopkokhyants
// This project is licensed under the terms of the MIT license.
// https://github.com/akserg/ng2-dnd
import {Injectable, ElementRef, EventEmitter} from '@angular/core';
import {DragDropConfig} from './dnd.config';
import {isPresent} from './dnd.utils';
import {SortableContainer} from './dnd.sortable';
export interface DragDropData {
dragData: any;
mouseEvent: MouseEvent;
}
@Injectable()
export class DragDropService {
allowedDropZones: Array<string> = [];
onDragSuccessCallback: EventEmitter<DragDropData>;
dragData: any;
isDragged: boolean;
}
@Injectable()
export class DragDropSortableService {
index: number;
sortableContainer: SortableContainer;
isDragged: boolean;
private _elem: HTMLElement;
public get elem(): HTMLElement {
return this._elem;
}
constructor(private _config:DragDropConfig) {}
markSortable(elem: HTMLElement) {
if (isPresent(this._elem)) {
this._elem.classList.remove(this._config.onSortableDragClass);
}
if (isPresent(elem)) {
this._elem = elem;
this._elem.classList.add(this._config.onSortableDragClass);
}
}
} | // Copyright (C) 2016 Sergey Akopkokhyants
// This project is licensed under the terms of the MIT license.
// https://github.com/akserg/ng2-dnd
import {Injectable, ElementRef, EventEmitter} from '@angular/core';
import {DragDropConfig} from './dnd.config';
import {isPresent} from './dnd.utils';
import {SortableContainer} from './sortable.component';
export interface DragDropData {
dragData: any;
mouseEvent: MouseEvent;
}
@Injectable()
export class DragDropService {
allowedDropZones: Array<string> = [];
onDragSuccessCallback: EventEmitter<DragDropData>;
dragData: any;
isDragged: boolean;
}
@Injectable()
export class DragDropSortableService {
index: number;
sortableContainer: SortableContainer;
isDragged: boolean;
private _elem: HTMLElement;
public get elem(): HTMLElement {
return this._elem;
}
constructor(private _config:DragDropConfig) {}
markSortable(elem: HTMLElement) {
if (isPresent(this._elem)) {
this._elem.classList.remove(this._config.onSortableDragClass);
}
if (isPresent(elem)) {
this._elem = elem;
this._elem.classList.add(this._config.onSortableDragClass);
}
}
}
| Fix wrong import (still using old name) | Fix wrong import (still using old name)
| TypeScript | mit | obosha/ng2-dnd,akserg/ng2-dnd,akserg/ng2-dnd,obosha/ng2-dnd | ---
+++
@@ -6,7 +6,7 @@
import {DragDropConfig} from './dnd.config';
import {isPresent} from './dnd.utils';
-import {SortableContainer} from './dnd.sortable';
+import {SortableContainer} from './sortable.component';
export interface DragDropData {
dragData: any; |
c5dc308793ae312f28746f762f3bb62196b71875 | src/v2/Apps/Partner/Components/Overview/SubscriberBanner.tsx | src/v2/Apps/Partner/Components/Overview/SubscriberBanner.tsx | import React from "react"
import { Text, Message } from "@artsy/palette"
import { RouterLink } from "v2/Artsy/Router/RouterLink"
import { createFragmentContainer, graphql } from "react-relay"
import { SubscriberBanner_partner } from "v2/__generated__/SubscriberBanner_partner.graphql"
export interface SubscriberBannerProps {
partner: SubscriberBanner_partner
}
export const SubscriberBanner: React.FC<SubscriberBannerProps> = ({
partner: { hasFairPartnership, name },
}) => {
const fairPartner = `${name} participates in Artsy’s art fair coverage but does not have a full profile.`
const churnedPartner = `${name} is not currently an Artsy partner and does not have a full profile.`
return (
<Message title={hasFairPartnership ? fairPartner : churnedPartner}>
<Text display="inline">{`Do you represent ${name}?`}</Text>
<RouterLink to="https://partners.artsy.net/gallery-partnerships/">
<Text display="inline">
Learn about Artsy gallery partnerships.
</Text>
</RouterLink>
</Message>
)
}
export const SubscriberBannerFragmentContainer = createFragmentContainer(
SubscriberBanner,
{
partner: graphql`
fragment SubscriberBanner_partner on Partner {
hasFairPartnership
name
}
`,
}
)
| import React from "react"
import { Text, Message } from "@artsy/palette"
import { RouterLink } from "v2/Artsy/Router/RouterLink"
import { createFragmentContainer, graphql } from "react-relay"
import { SubscriberBanner_partner } from "v2/__generated__/SubscriberBanner_partner.graphql"
export interface SubscriberBannerProps {
partner: SubscriberBanner_partner
}
export const SubscriberBanner: React.FC<SubscriberBannerProps> = ({
partner: { hasFairPartnership, name },
}) => {
const fairPartner = `${name} participates in Artsy’s art fair coverage but does not have a full profile.`
const churnedPartner = `${name} is not currently an Artsy partner and does not have a full profile.`
return (
<Message mb={4} title={hasFairPartnership ? fairPartner : churnedPartner}>
<Text display="inline">{`Do you represent ${name}?`}</Text>
<RouterLink to="https://partners.artsy.net/gallery-partnerships/">
<Text display="inline">
Learn about Artsy gallery partnerships.
</Text>
</RouterLink>
</Message>
)
}
export const SubscriberBannerFragmentContainer = createFragmentContainer(
SubscriberBanner,
{
partner: graphql`
fragment SubscriberBanner_partner on Partner {
hasFairPartnership
name
}
`,
}
)
| Make a space between banner and about section | Make a space between banner and about section
| TypeScript | mit | artsy/force,artsy/force,artsy/force,joeyAghion/force,joeyAghion/force,artsy/force-public,artsy/force-public,joeyAghion/force,artsy/force,joeyAghion/force | ---
+++
@@ -14,7 +14,7 @@
const fairPartner = `${name} participates in Artsy’s art fair coverage but does not have a full profile.`
const churnedPartner = `${name} is not currently an Artsy partner and does not have a full profile.`
return (
- <Message title={hasFairPartnership ? fairPartner : churnedPartner}>
+ <Message mb={4} title={hasFairPartnership ? fairPartner : churnedPartner}>
<Text display="inline">{`Do you represent ${name}?`}</Text>
<RouterLink to="https://partners.artsy.net/gallery-partnerships/">
<Text display="inline"> |
4d09a2497b61e3c1f3a9e63b1180ac680e6a9194 | packages/core/src/core/config-mock.ts | packages/core/src/core/config-mock.ts | import { Config } from './config';
/**
* Mock the Config class when it is used as a service.
*
* @export
* @class ConfigMock
* @implements {Config}
*/
export class ConfigMock implements Config {
private map: Map<string, any> = new Map();
/**
* Set an configuration variable.
*
* @param {string} key - Name of the config key using dots and camel case.
* @param {*} value - The config value (ex: 36000).
* @memberof ConfigMock
*/
set(key: string, value: any) {
this.map.set(key, value);
}
/**
* Return the config value previously given with ConfigMock.set.
*
* @template T - TypeScript type of the returned value. Default is `any`.
* @param {string} key - Name of the config key using dots and camel case.
* @param {T} [defaultValue] - Default value to return if no configuration is found with that key.
* @returns {T} The configuration value.
* @memberof ConfigMock
*/
get<T = any>(key: string, defaultValue?: T | undefined): T {
return this.map.get(key) || defaultValue;
}
/**
* Clear every config value previously given with Config.set.
*
* @memberof ConfigMock
*/
reset(): void {
this.map.clear();
}
}
| import { Config } from './config';
/**
* Mock the Config class when it is used as a service.
*
* @export
* @class ConfigMock
* @implements {Config}
*/
export class ConfigMock implements Config {
private map: Map<string, any> = new Map();
/**
* Set an configuration variable.
*
* @param {string} key - Name of the config key using dots and camel case.
* @param {*} value - The config value (ex: 36000).
* @memberof ConfigMock
*/
set(key: string, value: any): void {
this.map.set(key, value);
}
/**
* Return the config value previously given with ConfigMock.set.
*
* @template T - TypeScript type of the returned value. Default is `any`.
* @param {string} key - Name of the config key using dots and camel case.
* @param {T} [defaultValue] - Default value to return if no configuration is found with that key.
* @returns {T} The configuration value.
* @memberof ConfigMock
*/
get<T = any>(key: string, defaultValue?: T | undefined): T {
return this.map.get(key) || defaultValue;
}
/**
* Clear every config value previously given with Config.set.
*
* @memberof ConfigMock
*/
reset(): void {
this.map.clear();
}
}
| Add return type to ConfigMock.set | Add return type to ConfigMock.set
| TypeScript | mit | FoalTS/foal,FoalTS/foal,FoalTS/foal,FoalTS/foal | ---
+++
@@ -18,7 +18,7 @@
* @param {*} value - The config value (ex: 36000).
* @memberof ConfigMock
*/
- set(key: string, value: any) {
+ set(key: string, value: any): void {
this.map.set(key, value);
}
|
0de5afb6f3615168e8d1fb61c35cdc8a2378991b | src/entities/workflow/WorkflowRegistry.ts | src/entities/workflow/WorkflowRegistry.ts | import * as path from 'path';
import * as Joi from 'joi';
import { Registry } from '../Registry';
import { WorkflowType } from './WorkflowType';
import { BaseWorkflow, FTLWorkflowDef } from './BaseWorkflow';
const workflowSchema = Joi.object({
decider: Joi.func().arity(1).required(),
output: Joi.func().arity(1).required(),
schema: Joi.object().required(),
version: Joi.string().min(3).required(),
name: Joi.string()
}).unknown(false).required();
export class WorkflowRegistry extends Registry<WorkflowType> {
wrapModule(filename: string, workflowDefObj: FTLWorkflowDef | any): WorkflowType {
if (workflowDefObj.default) { workflowDefObj = workflowDefObj.default; }
let name: string = path.basename(filename, path.extname(filename));
if (!name) {
throw new Error('missing workflow name');
}
workflowDefObj.name = name;
// Ensure the provided object has the correct shape
const {error} = Joi.validate(workflowDefObj, workflowSchema);
if (error) {
throw new Error(`Error validating ${name} workflow: ` + error);
}
let handler: BaseWorkflow;
// Create BaseWorkflow object with validateTask method that uses schema
handler = new BaseWorkflow(this.config, workflowDefObj);
if (!handler.validateTask) {
throw new Error(`workflow object for ${name} does not have a validateTask function`);
}
return new WorkflowType(handler as BaseWorkflow, this.config);
}
}
| import * as path from 'path';
import * as Joi from 'joi';
import { Registry } from '../Registry';
import { WorkflowType } from './WorkflowType';
import { BaseWorkflow, FTLWorkflowDef } from './BaseWorkflow';
const workflowSchema = Joi.object({
decider: Joi.func().arity(1).required(),
output: Joi.func().arity(1).required(),
schema: Joi.object().required(),
version: Joi.string().min(3).required(),
name: Joi.string()
}).unknown(true).required();
export class WorkflowRegistry extends Registry<WorkflowType> {
wrapModule(filename: string, workflowDefObj: FTLWorkflowDef | any): WorkflowType {
if (workflowDefObj.default) { workflowDefObj = workflowDefObj.default; }
let name: string = path.basename(filename, path.extname(filename));
if (!name) {
throw new Error('missing workflow name');
}
workflowDefObj.name = name;
// Ensure the provided object has the correct shape
const {error} = Joi.validate(workflowDefObj, workflowSchema);
if (error) {
throw new Error(`Error validating ${name} workflow: ` + error);
}
let handler: BaseWorkflow;
// Create BaseWorkflow object with validateTask method that uses schema
handler = new BaseWorkflow(this.config, workflowDefObj);
if (!handler.validateTask) {
throw new Error(`workflow object for ${name} does not have a validateTask function`);
}
return new WorkflowType(handler as BaseWorkflow, this.config);
}
}
| Allow unknown props to be provided in workflow module definitions | Allow unknown props to be provided in workflow module definitions
| TypeScript | mit | f5itc/swf-graph,f5itc/swf-graph,f5itc/swf-graph | ---
+++
@@ -12,7 +12,7 @@
schema: Joi.object().required(),
version: Joi.string().min(3).required(),
name: Joi.string()
-}).unknown(false).required();
+}).unknown(true).required();
export class WorkflowRegistry extends Registry<WorkflowType> {
wrapModule(filename: string, workflowDefObj: FTLWorkflowDef | any): WorkflowType { |
69c9d433d015149c1b4fb7ffc5643f4f2c3de80e | src/Parsing/Inline/Token.ts | src/Parsing/Inline/Token.ts | export enum TokenMeaning {
Text,
EmphasisStart,
EmphasisEnd,
StressStart,
StressEnd,
InlineCode,
InlineCodeStart,
InlineCodeEnd,
RevisionDeletionStart,
RevisionDeletionEnd,
SpoilerStart,
SpoilerEnd,
InlineAsideStart,
InlineAsideEnd
}
export class Token {
constructor(
public meaning: TokenMeaning,
public index: number,
public value?: string) { }
} | export enum TokenMeaning {
Text,
EmphasisStart,
EmphasisEnd,
StressStart,
StressEnd,
InlineCode,
RevisionDeletionStart,
RevisionDeletionEnd,
SpoilerStart,
SpoilerEnd,
InlineAsideStart,
InlineAsideEnd
}
export class Token {
constructor(
public meaning: TokenMeaning,
public index: number,
public value?: string) { }
} | Remove old inline code token meanings | Remove old inline code token meanings
| TypeScript | mit | start/up,start/up | ---
+++
@@ -5,8 +5,6 @@
StressStart,
StressEnd,
InlineCode,
- InlineCodeStart,
- InlineCodeEnd,
RevisionDeletionStart,
RevisionDeletionEnd,
SpoilerStart, |
0f7af6a4e98004db82d393f3a8ba9f25f75735e3 | src/common/types/objects/settings.ts | src/common/types/objects/settings.ts | import {Memo} from './memos'
export type WeightedSigner = {
address: string,
weight: number
}
export type Signers = {
threshold?: number,
weights: WeightedSigner[]
}
export type FormattedSettings = {
passwordSpent?: boolean,
requireDestinationTag?: boolean,
requireAuthorization?: boolean,
disallowIncomingXRP?: boolean,
disableMasterKey?: boolean,
enableTransactionIDTracking?: boolean,
noFreeze?: boolean,
globalFreeze?: boolean,
defaultRipple?: boolean,
emailHash?: string|null,
messageKey?: string,
domain?: string,
transferRate?: number|null,
regularKey?: string,
signers?: Signers,
memos?: Memo[]
}
| import {Memo} from './memos'
export type WeightedSigner = {
address: string,
weight: number
}
export type Signers = {
threshold?: number,
weights: WeightedSigner[]
}
export type FormattedSettings = {
defaultRipple?: boolean,
depositAuth?: boolean,
disableMasterKey?: boolean,
disallowIncomingXRP?: boolean,
domain?: string,
emailHash?: string|null,
enableTransactionIDTracking?: boolean,
globalFreeze?: boolean,
memos?: Memo[],
messageKey?: string,
noFreeze?: boolean,
passwordSpent?: boolean,
regularKey?: string,
requireAuthorization?: boolean,
requireDestinationTag?: boolean,
signers?: Signers,
transferRate?: number|null
}
| Add depositAuth to FormattedSettings type | Add depositAuth to FormattedSettings type
| TypeScript | isc | ripple/ripple-lib,ripple/ripple-lib,ripple/ripple-lib,ripple/ripple-lib | ---
+++
@@ -11,20 +11,21 @@
}
export type FormattedSettings = {
+ defaultRipple?: boolean,
+ depositAuth?: boolean,
+ disableMasterKey?: boolean,
+ disallowIncomingXRP?: boolean,
+ domain?: string,
+ emailHash?: string|null,
+ enableTransactionIDTracking?: boolean,
+ globalFreeze?: boolean,
+ memos?: Memo[],
+ messageKey?: string,
+ noFreeze?: boolean,
passwordSpent?: boolean,
+ regularKey?: string,
+ requireAuthorization?: boolean,
requireDestinationTag?: boolean,
- requireAuthorization?: boolean,
- disallowIncomingXRP?: boolean,
- disableMasterKey?: boolean,
- enableTransactionIDTracking?: boolean,
- noFreeze?: boolean,
- globalFreeze?: boolean,
- defaultRipple?: boolean,
- emailHash?: string|null,
- messageKey?: string,
- domain?: string,
- transferRate?: number|null,
- regularKey?: string,
signers?: Signers,
- memos?: Memo[]
+ transferRate?: number|null
} |
9a445d54857a33de5d8a21803f2795cc8aa7791d | apps/docs/src/common/page-wrap.tsx | apps/docs/src/common/page-wrap.tsx | import { FC, createElement as h } from 'react';
import { PageProps } from '@not-govuk/app-composer';
import { Page } from '@hods/components';
import './app.scss';
export const PageWrap: FC<PageProps> = ({ children }) => {
const navigation = [
{ href: '/get-started', text: 'Get started' },
{ href: '/styles', text: 'Styles' },
{ href: '/components', text: 'Components' },
{ href: '/patterns', text: 'Patterns' },
{ href: '/accessibility', text: 'Accessibility' },
{ href: '/get-involved', text: 'Get involved' }
];
const footerNavigation = [
{ href: 'https://github.com/UKHomeOffice/hods-poc/', text: 'GitHub' },
{ href: '/cookies', text: 'Cookies' },
{ href: 'https://github.com/UKHomeOffice/hods-poc/issues/new', text: 'Feedback' },
{ href: 'https://design-system.service.gov.uk/', text: 'Gov.UK Design System' }
];
return (
<Page
footerNavigation={footerNavigation}
navigation={navigation}
serviceName="Design System"
title="Home Office Design System"
>
{children}
</Page>
);
};
export default PageWrap;
| import { FC, createElement as h } from 'react';
import { PageProps } from '@not-govuk/app-composer';
import { Page } from '@hods/components';
import './app.scss';
export const PageWrap: FC<PageProps> = ({ children }) => {
const navigation = [
{ href: '/get-started', text: 'Get started' },
{ href: '/styles', text: 'Styles' },
{ href: '/components', text: 'Components' },
{ href: '/patterns', text: 'Patterns' },
{ href: '/accessibility', text: 'Accessibility' },
{ href: '/get-involved', text: 'Get involved' }
];
const footerNavigation = [
{ href: 'https://github.com/UKHomeOffice/hods-poc/', text: 'GitHub' },
{ href: 'https://github.com/UKHomeOffice/hods-poc/issues/new', text: 'Feedback' },
{ href: 'https://design-system.service.gov.uk/', text: 'Gov.UK Design System' }
];
return (
<Page
footerNavigation={footerNavigation}
navigation={navigation}
serviceName="Design System"
title="Home Office Design System"
>
{children}
</Page>
);
};
export default PageWrap;
| Remove link to cookies page | docs: Remove link to cookies page
We don't have cookies at the moment and so have no need of a cookies
page.
When we have cookies we can add this back.
| TypeScript | mit | eliothill/home-office-digital-patterns,eliothill/home-office-digital-patterns,eliothill/home-office-digital-patterns | ---
+++
@@ -15,7 +15,6 @@
];
const footerNavigation = [
{ href: 'https://github.com/UKHomeOffice/hods-poc/', text: 'GitHub' },
- { href: '/cookies', text: 'Cookies' },
{ href: 'https://github.com/UKHomeOffice/hods-poc/issues/new', text: 'Feedback' },
{ href: 'https://design-system.service.gov.uk/', text: 'Gov.UK Design System' }
]; |
09f82a7a598b8573f41d5cd2f1803b123133582f | translations/lxqt-openssh-askpass.ts | translations/lxqt-openssh-askpass.ts | <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>MainWindow</name>
<message>
<location filename="../src/mainwindow.ui" line="14"/>
<source>OpenSSH Authentication Passphrase request</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.ui" line="20"/>
<source>Enter your SSH passphrase for request:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="39"/>
<source>unknown request</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
| <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>MainWindow</name>
<message>
<location filename="../src/mainwindow.ui" line="14"/>
<source>OpenSSH Authentication Passphrase request</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.ui" line="20"/>
<source>Enter your SSH passphrase for request:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../src/main.cpp" line="39"/>
<source>unknown request</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
| Fix target language in translation file template | Fix target language in translation file template
The translation file template was configured for a target language. This
prevented Linguist from showing the selection dialog when the file was
opened after copying it to a language-specific version. Not explicitly
querying the language then could have led translators to not setting a
target language and just keep the default which would have been wrong.
| TypeScript | lgpl-2.1 | smart2128/lxqt-openssh-askpass,lxde/lxqt-openssh-askpass | ---
+++
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="en_US">
+<TS version="2.1">
<context>
<name>MainWindow</name>
<message> |
1cb93b969f35cadd6f7e746911e8ed2c0a2cba4c | src/marketplace/resources/terminate/TerminateAction.ts | src/marketplace/resources/terminate/TerminateAction.ts | import { translate } from '@waldur/i18n';
import { marketplaceIsVisible } from '@waldur/marketplace/utils';
import { validateState } from '@waldur/resource/actions/base';
import { ResourceAction } from '@waldur/resource/actions/types';
export default function createAction(ctx): ResourceAction {
return {
name: 'terminate_resource',
type: 'form',
method: 'POST',
component: 'marketplaceResourceTerminateDialog',
title: translate('Terminate'),
useResolve: true,
isVisible: marketplaceIsVisible() && ctx.resource.marketplace_resource_uuid !== null,
validators: [validateState('OK')],
};
}
| import { translate } from '@waldur/i18n';
import { marketplaceIsVisible } from '@waldur/marketplace/utils';
import { validateState } from '@waldur/resource/actions/base';
import { ResourceAction } from '@waldur/resource/actions/types';
export default function createAction(ctx): ResourceAction {
return {
name: 'terminate_resource',
type: 'form',
method: 'POST',
component: 'marketplaceResourceTerminateDialog',
title: translate('Terminate'),
useResolve: true,
isVisible: marketplaceIsVisible() && ctx.resource.marketplace_resource_uuid !== null,
validators: [validateState('OK', 'Erred')],
};
}
| Allow to terminate ERRED resources. | Allow to terminate ERRED resources.
| TypeScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | ---
+++
@@ -12,6 +12,6 @@
title: translate('Terminate'),
useResolve: true,
isVisible: marketplaceIsVisible() && ctx.resource.marketplace_resource_uuid !== null,
- validators: [validateState('OK')],
+ validators: [validateState('OK', 'Erred')],
};
} |
76df423518780eac802b5e49111fac906b562d42 | ui/src/shared/decorators/errors.tsx | ui/src/shared/decorators/errors.tsx | /*
tslint:disable no-console
tslint:disable max-classes-per-file
*/
import React, {ComponentClass, Component} from 'react'
class DefaultError extends Component {
public render() {
return (
<p className="error">
A Chronograf error has occurred. Please report the issue
<a href="https://github.com/influxdata/influxdb/chronograf/issues">
here
</a>
.
</p>
)
}
}
export function ErrorHandlingWith(
Error: ComponentClass, // Must be a class based component and not an SFC
alwaysDisplay = false
) {
return <P, S, T extends {new (...args: any[]): Component<P, S>}>(
constructor: T
) => {
class Wrapped extends constructor {
public static get displayName(): string {
return constructor.name
}
private error: boolean = false
public componentDidCatch(err, info) {
console.error(err)
console.warn(info)
this.error = true
this.forceUpdate()
}
public render() {
if (this.error || alwaysDisplay) {
return <Error />
}
return super.render()
}
}
return Wrapped
}
}
export const ErrorHandling = ErrorHandlingWith(DefaultError)
| /*
tslint:disable no-console
tslint:disable max-classes-per-file
*/
import React, {ComponentClass, Component} from 'react'
class DefaultError extends Component {
public render() {
return (
<p className="error">
An InfluxDB error has occurred. Please report the issue
<a href="https://github.com/influxdata/influxdb/issues">here</a>.
</p>
)
}
}
export function ErrorHandlingWith(
Error: ComponentClass, // Must be a class based component and not an SFC
alwaysDisplay = false
) {
return <P, S, T extends {new (...args: any[]): Component<P, S>}>(
constructor: T
) => {
class Wrapped extends constructor {
public static get displayName(): string {
return constructor.name
}
private error: boolean = false
public componentDidCatch(err, info) {
console.error(err)
console.warn(info)
this.error = true
this.forceUpdate()
}
public render() {
if (this.error || alwaysDisplay) {
return <Error />
}
return super.render()
}
}
return Wrapped
}
}
export const ErrorHandling = ErrorHandlingWith(DefaultError)
| Change error text and link to point to influxdb | Change error text and link to point to influxdb
| TypeScript | mit | influxdata/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,li-ang/influxdb,nooproblem/influxdb,li-ang/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,nooproblem/influxdb | ---
+++
@@ -9,11 +9,8 @@
public render() {
return (
<p className="error">
- A Chronograf error has occurred. Please report the issue
- <a href="https://github.com/influxdata/influxdb/chronograf/issues">
- here
- </a>
- .
+ An InfluxDB error has occurred. Please report the issue
+ <a href="https://github.com/influxdata/influxdb/issues">here</a>.
</p>
)
} |
e6616755214313191235b397f7d8e63c8e645e17 | src/Core/StoreCreator.ts | src/Core/StoreCreator.ts | ///<reference path="./Interfaces/IStoreCreator.ts" />
import {
compose,
createStore,
applyMiddleware,
combineReducers
} from 'redux';
import {
routerReducer,
routerMiddleware
} from 'react-router-redux';
import {
persistStore,
autoRehydrate
} from 'redux-persist';
import thunk from 'redux-thunk';
import Reducers from 'Reducers/Index';
import * as objectAssign from 'object-assign';
class StoreCreator<T> implements IStoreCreator<T>
{
private store: Redux.Store<T>;
/**
* @param {ReactRouter.History} historyInstance
*/
constructor(historyInstance: ReactRouter.History)
{
/*
* Setup the middlewares and reducers
*/
const router = routerMiddleware(historyInstance);
const reducers = combineReducers(objectAssign({}, Reducers, {
routing : routerReducer
}));
/*
* Further middleware and enhancer prep
*/
const middlewares = [thunk, router];
const enhancer = compose(applyMiddleware(...middlewares), autoRehydrate());
/*
* Create our store with the reducers and enhancers.
* Persist this state in localStorage, minus routing!
*/
this.store = createStore(reducers, undefined, enhancer) as Redux.Store<T>;
persistStore(this.store, {
blacklist : ['routing']
});
}
/**
* @returns Redux
*/
public getStore(): Redux.Store<T>
{
return this.store;
};
};
export default StoreCreator; | ///<reference path="./Interfaces/IStoreCreator.ts" />
import {
compose,
createStore,
applyMiddleware,
combineReducers
} from 'redux';
import {
routerReducer,
routerMiddleware
} from 'react-router-redux';
import {
persistStore,
autoRehydrate
} from 'redux-persist';
import thunk from 'redux-thunk';
import Reducers from 'Reducers/Index';
import * as objectAssign from 'object-assign';
class StoreCreator<T> implements IStoreCreator<T>
{
private store: Redux.Store<T>;
/**
* @param {ReactRouter.History} historyInstance
*/
constructor(historyInstance: ReactRouter.History)
{
/*
* Setup the middlewares and reducers
*/
const router = routerMiddleware(historyInstance);
const reducers = combineReducers(objectAssign({}, Reducers, {
routing : routerReducer
}));
/*
* Further middleware and enhancer prep
*/
const middlewares = [thunk, router];
const enhancer = compose(applyMiddleware(...middlewares), autoRehydrate());
/*
* Create our store with the reducers and enhancers.
* Persist this state in localStorage, minus routing!
*/
this.store = createStore(reducers, undefined, enhancer) as Redux.Store<T>;
persistStore(this.store, {
blacklist : [
'routing',
'authentication'
]
});
}
/**
* @returns Redux
*/
public getStore(): Redux.Store<T>
{
return this.store;
};
};
export default StoreCreator; | Add Authentication to persistStore blacklist | Add Authentication to persistStore blacklist
| TypeScript | mit | harksys/HawkEye,harksys/HawkEye,harksys/HawkEye | ---
+++
@@ -48,7 +48,10 @@
*/
this.store = createStore(reducers, undefined, enhancer) as Redux.Store<T>;
persistStore(this.store, {
- blacklist : ['routing']
+ blacklist : [
+ 'routing',
+ 'authentication'
+ ]
});
}
|
5bcfd0a3c1ef8d1e379dcf3ab363bd0ed76aa6bb | tools/env/base.ts | tools/env/base.ts | import { EnvConfig } from './env-config.interface';
const BaseConfig: EnvConfig = {
// Sample API url
API: 'https://demo.com',
RELEASEURL: 'https://github.com/nie-ine/raeber-website/releases/tag/0.18.0',
RELEASEVERSION: '0.18.0'
};
export = BaseConfig;
| import { EnvConfig } from './env-config.interface';
const BaseConfig: EnvConfig = {
// Sample API url
API: 'https://demo.com',
RELEASEURL: 'https://github.com/nie-ine/raeber-website/releases/tag/0.18.1',
RELEASEVERSION: '0.18.1'
};
export = BaseConfig;
| Update release version to 0.18.1. | Update release version to 0.18.1.
| TypeScript | mit | nie-ine/raeber-website,nie-ine/raeber-website,nie-ine/raeber-website,nie-ine/raeber-website | ---
+++
@@ -3,8 +3,8 @@
const BaseConfig: EnvConfig = {
// Sample API url
API: 'https://demo.com',
- RELEASEURL: 'https://github.com/nie-ine/raeber-website/releases/tag/0.18.0',
- RELEASEVERSION: '0.18.0'
+ RELEASEURL: 'https://github.com/nie-ine/raeber-website/releases/tag/0.18.1',
+ RELEASEVERSION: '0.18.1'
};
export = BaseConfig; |
eb5c176616cbd183b4d984a660b74ef39701cfb3 | web/src/index.tsx | web/src/index.tsx | import React from "react";
import ReactDOM from "react-dom";
import { App } from "./App";
import "./index.css";
import reportWebVitals from "./reportWebVitals";
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById("root")
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
| import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import { App } from "./App";
import reportWebVitals from "./reportWebVitals";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
| Revert "Revert "refactor(ui): ♻️ use new createRoot"" | Revert "Revert "refactor(ui): ♻️ use new createRoot""
This reverts commit 77c53b0b3f8dd75e8d42ad3bf26219ef07a8a3f3.
| TypeScript | mit | collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists | ---
+++
@@ -1,14 +1,16 @@
import React from "react";
-import ReactDOM from "react-dom";
+import ReactDOM from "react-dom/client";
+import "./index.css";
import { App } from "./App";
-import "./index.css";
import reportWebVitals from "./reportWebVitals";
-ReactDOM.render(
+const root = ReactDOM.createRoot(
+ document.getElementById("root") as HTMLElement
+);
+root.render(
<React.StrictMode>
<App />
- </React.StrictMode>,
- document.getElementById("root")
+ </React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function |
47671367b1c86877e181be9ce30a9fc6d235ab46 | src/SyntaxNodes/OrderedListNode.ts | src/SyntaxNodes/OrderedListNode.ts | import { OutlineSyntaxNode } from './OutlineSyntaxNode'
export class OrderedListNode implements OutlineSyntaxNode {
constructor(public listItems: OrderedListNode.Item[]) { }
start(): number {
return this.listItems[0].ordinal
}
order(): OrderedListNode.Order {
const withExplicitOrdinals =
this.listItems.filter(item => item.ordinal != null)
if (withExplicitOrdinals.length < 2) {
return OrderedListNode.Order.Ascending
}
return (
withExplicitOrdinals[0].ordinal > withExplicitOrdinals[1].ordinal
? OrderedListNode.Order.Descrending
: OrderedListNode.Order.Ascending
)
}
OUTLINE_SYNTAX_NODE(): void { }
}
export module OrderedListNode {
export class Item {
// During parsing, `ordinal` can be either `null` or a number. Defaulting `ordinal` to `null`
// rather than `undefined` allows our unit tests to be cleaner.
constructor(public children: OutlineSyntaxNode[], public ordinal: number = null) { }
protected ORDERED_LIST_ITEM(): void { }
}
export enum Order {
Ascending,
Descrending
}
} | import { OutlineSyntaxNode } from './OutlineSyntaxNode'
export class OrderedListNode implements OutlineSyntaxNode {
constructor(public listItems: OrderedListNode.Item[]) { }
start(): number {
return this.listItems[0].ordinal
}
order(): OrderedListNode.Order {
const withExplicitOrdinals =
this.listItems.filter(item => item.ordinal != null)
if (withExplicitOrdinals.length < 2) {
return OrderedListNode.Order.Ascending
}
return (
withExplicitOrdinals[0].ordinal > withExplicitOrdinals[1].ordinal
? OrderedListNode.Order.Descrending
: OrderedListNode.Order.Ascending
)
}
OUTLINE_SYNTAX_NODE(): void { }
}
export module OrderedListNode {
export class Item {
// During parsing, `ordinal` can be either `null` or a number. Defaulting `ordinal` to `null`
// rather than `undefined` allows our unit tests to be cleaner.
constructor(public children: OutlineSyntaxNode[], public ordinal: number = null) { }
protected ORDERED_LIST_ITEM(): void { }
}
export enum Order {
Ascending = 1,
Descrending
}
} | Make ordered list's order enum start at 1 | Make ordered list's order enum start at 1
| TypeScript | mit | start/up,start/up | ---
+++
@@ -37,7 +37,7 @@
}
export enum Order {
- Ascending,
+ Ascending = 1,
Descrending
}
} |
808e63d5966d8de6d4d9cdd55283d7def622f04b | packages/components/components/version/AppVersion.tsx | packages/components/components/version/AppVersion.tsx | import React from 'react';
import { APPS_CONFIGURATION } from 'proton-shared/lib/constants';
import { useModals, useConfig } from '../../hooks';
import ChangelogModal from './ChangelogModal';
import { getAppVersion } from '../../helpers';
interface Props {
appName?: string;
appVersion?: string;
changelog?: string;
}
const AppVersion = ({ appVersion: maybeAppVersion, appName: maybeAppName, changelog }: Props) => {
const { APP_NAME, APP_VERSION, APP_VERSION_DISPLAY, DATE_VERSION } = useConfig();
const { createModal } = useModals();
const handleModal = () => {
createModal(<ChangelogModal changelog={changelog} />);
};
const appName = maybeAppName || APPS_CONFIGURATION[APP_NAME]?.name;
const appVersion = getAppVersion(maybeAppVersion || APP_VERSION_DISPLAY || APP_VERSION);
return (
<button
onClick={handleModal}
disabled={!changelog}
title={DATE_VERSION}
className="smallest aligncenter opacity-50 mt0 mb0-5"
>
{appName} {appVersion}
</button>
);
};
export default AppVersion;
| import React from 'react';
import { APPS_CONFIGURATION } from 'proton-shared/lib/constants';
import { useModals, useConfig } from '../../hooks';
import ChangelogModal from './ChangelogModal';
import { getAppVersion } from '../../helpers';
interface Props {
appName?: string;
appVersion?: string;
changelog?: string;
}
const AppVersion = ({ appVersion: maybeAppVersion, appName: maybeAppName, changelog }: Props) => {
const { APP_NAME, APP_VERSION, APP_VERSION_DISPLAY, DATE_VERSION } = useConfig();
const { createModal } = useModals();
const handleModal = () => {
createModal(<ChangelogModal changelog={changelog} />);
};
const appName = maybeAppName || APPS_CONFIGURATION[APP_NAME]?.name;
const appVersion = getAppVersion(maybeAppVersion || APP_VERSION_DISPLAY || APP_VERSION);
const className = 'smallest aligncenter opacity-50 mt0 mb0-5';
const title = DATE_VERSION;
const children = (
<>
{appName} {appVersion}
</>
);
if (!changelog) {
return (
<span title={title} className={className}>
{children}
</span>
);
}
return (
<button type="button" onClick={handleModal} title={title} className={className}>
{children}
</button>
);
};
export default AppVersion;
| Use span instead of button if no changelog on app version | Use span instead of button if no changelog on app version
| TypeScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient | ---
+++
@@ -21,15 +21,25 @@
const appName = maybeAppName || APPS_CONFIGURATION[APP_NAME]?.name;
const appVersion = getAppVersion(maybeAppVersion || APP_VERSION_DISPLAY || APP_VERSION);
+ const className = 'smallest aligncenter opacity-50 mt0 mb0-5';
+ const title = DATE_VERSION;
+ const children = (
+ <>
+ {appName} {appVersion}
+ </>
+ );
+
+ if (!changelog) {
+ return (
+ <span title={title} className={className}>
+ {children}
+ </span>
+ );
+ }
return (
- <button
- onClick={handleModal}
- disabled={!changelog}
- title={DATE_VERSION}
- className="smallest aligncenter opacity-50 mt0 mb0-5"
- >
- {appName} {appVersion}
+ <button type="button" onClick={handleModal} title={title} className={className}>
+ {children}
</button>
);
}; |
e321e28a28c24b95803b1f991244b8437be0ff19 | www/src/app/components/register/register.component.ts | www/src/app/components/register/register.component.ts | import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { CustomerAuthService } from 'app/services/customer-auth.service';
import { Contact} from 'app/components/contact/contact.component'
import { CustomFormsModule } from 'ng2-validation'
@Component({
selector: 'app-register',
templateUrl: './register.component.html',
styleUrls: ['./register.component.scss'],
providers: [CustomerAuthService]
})
export class RegisterComponent implements OnInit {
contact = new Contact('testuser', 'Test', 'User', 'test', '[email protected]', '', '', 0, 0, '');
submitted = false;
active = true;
// dependencies
constructor(private customer : CustomerAuthService, private router : Router) { }
ngOnInit() {
}
onSubmit() {
this.submitted = true;
this.customer.register(this.contact).subscribe(
data => {this.router.navigate(['/login'])},
err => {console.log(err); this.submitted = false;}
);
}
newContact() {
this.contact = new Contact('', '', '', '', '', '', '', 0, +421, '');
this.active = false;
this.submitted = false;
setTimeout(()=> this.active=true, 0);
}
}
| import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
//import { Contact} from 'app/components/contact/contact.component'
import { CustomerAuthService } from 'app/services/customer-auth.service';
import { CustomFormsModule } from 'ng2-validation'
export class Contact {
constructor(
public username : string,
public first_name : string,
public last_name : string,
public password : string,
public email : string,
public address1 : string,
public city : string,
public postal_code : number,
public telephone : number,
public country : string
) { }
}
@Component({
selector: 'app-register',
templateUrl: './register.component.html',
styleUrls: ['./register.component.scss'],
providers: [CustomerAuthService]
})
export class RegisterComponent implements OnInit {
contact = new Contact('', '', '', '', '', '', '', 0, 0, '');
submitted = false;
active = true;
// dependencies
constructor(private customer : CustomerAuthService, private router : Router) { }
ngOnInit() {
}
onSubmit() {
this.submitted = true;
this.customer.register(this.contact).subscribe(
data => {this.router.navigate(['/login'])},
err => {console.log(err); this.submitted = false;}
);
}
newContact() {
this.contact = new Contact('', '', '', '', '', '', '', 0, 0, '');
this.active = false;
this.submitted = false;
setTimeout(()=> this.active=true, 0);
}
}
| Remove default values from register page | Remove default values from register page
| TypeScript | mit | petrstehlik/pyngShop,petrstehlik/pyngShop,petrstehlik/pyngShop,petrstehlik/pyngShop | ---
+++
@@ -1,8 +1,24 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
+//import { Contact} from 'app/components/contact/contact.component'
import { CustomerAuthService } from 'app/services/customer-auth.service';
-import { Contact} from 'app/components/contact/contact.component'
import { CustomFormsModule } from 'ng2-validation'
+
+export class Contact {
+
+ constructor(
+ public username : string,
+ public first_name : string,
+ public last_name : string,
+ public password : string,
+ public email : string,
+ public address1 : string,
+ public city : string,
+ public postal_code : number,
+ public telephone : number,
+ public country : string
+ ) { }
+}
@Component({
selector: 'app-register',
@@ -12,7 +28,7 @@
})
export class RegisterComponent implements OnInit {
- contact = new Contact('testuser', 'Test', 'User', 'test', '[email protected]', '', '', 0, 0, '');
+ contact = new Contact('', '', '', '', '', '', '', 0, 0, '');
submitted = false;
active = true;
@@ -31,7 +47,7 @@
}
newContact() {
- this.contact = new Contact('', '', '', '', '', '', '', 0, +421, '');
+ this.contact = new Contact('', '', '', '', '', '', '', 0, 0, '');
this.active = false;
this.submitted = false;
setTimeout(()=> this.active=true, 0); |
092d488a7445b691ab61d337650a9f6e0ad09a04 | src/components/StoreProvider.ts | src/components/StoreProvider.ts | import { Component } from 'react';
import { AppStore } from '../services/';
import { loadAndBundleSpec } from '../utils';
interface SpecProps {
specUrl?: string;
spec?: object;
store?: AppStore;
children?: any;
}
interface SpecState {
error?: Error;
loading: boolean;
store?: AppStore;
}
export class StoreProvider extends Component<SpecProps, SpecState> {
store: AppStore;
constructor(props: SpecProps) {
super(props);
this.state = {
loading: true,
};
this.load();
}
async load() {
let { specUrl, spec } = this.props;
this.setState({
loading: true,
});
try {
const resolvedSpec = await loadAndBundleSpec(spec || specUrl!);
this.setState({
loading: false,
store: new AppStore(resolvedSpec, specUrl),
});
} catch (e) {
this.setState({
error: e,
});
}
}
setError(e?: Error) {
this.setState({
error: e,
});
}
render() {
if (this.state.error) throw this.state.error;
return this.props.children(this.state);
}
}
| import { Component } from 'react';
import { AppStore } from '../services/';
import { loadAndBundleSpec } from '../utils';
interface SpecProps {
specUrl?: string;
spec?: object;
store?: AppStore;
children?: any;
}
interface SpecState {
error?: Error;
loading: boolean;
store?: AppStore;
}
export class StoreProvider extends Component<SpecProps, SpecState> {
store: AppStore;
constructor(props: SpecProps) {
super(props);
this.state = {
loading: true,
};
}
componentDidMount() {
this.load();
}
async load() {
let { specUrl, spec } = this.props;
this.setState({
loading: true,
});
try {
const resolvedSpec = await loadAndBundleSpec(spec || specUrl!);
this.setState({
loading: false,
store: new AppStore(resolvedSpec, specUrl),
});
} catch (e) {
this.setState({
error: e,
});
}
}
setError(e?: Error) {
this.setState({
error: e,
});
}
render() {
if (this.state.error) throw this.state.error;
return this.props.children(this.state);
}
}
| Fix setState run before mount | Fix setState run before mount
| TypeScript | mit | Rebilly/ReDoc,Rebilly/ReDoc,Rebilly/ReDoc,Rebilly/ReDoc | ---
+++
@@ -25,7 +25,9 @@
this.state = {
loading: true,
};
+ }
+ componentDidMount() {
this.load();
}
|
d3b113cdf05decdc7b3d94b44f102fe8cfa13a80 | packages/notebook-app-component/src/decorators/undoable-delete.tsx | packages/notebook-app-component/src/decorators/undoable-delete.tsx | import * as React from "react";
interface Props {
secondsDelay: number;
message: string;
isDeleting: boolean;
doDelete: () => void;
doUndo: () => void;
children?: React.ReactNode;
}
class TimedUndoableDelete
extends React.PureComponent<Props> {
timer: NodeJS.Timeout | null = null;
componentDidMount(): void {
this.timer = setTimeout(
this.props.doDelete,
this.props.secondsDelay * 1000,
);
}
componentWillUnmount(): void {
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
}
render(): JSX.Element {
return (
<div className="undo-deletion">
{this.props.message}
<button onClick={this.props.doUndo}>Undo</button>
</div>
);
}
}
const UndoableDelete = (props: Props) =>
props.isDeleting
? <TimedUndoableDelete {...props}/>
: <React.Fragment>{props.children}</React.Fragment>;
UndoableDelete.displayName = "UndoableDelete";
export default UndoableDelete;
| import * as React from "react";
interface Props {
secondsDelay: number;
message: string;
isDeleting: boolean;
doDelete: () => void;
doUndo: () => void;
children?: React.ReactNode;
}
class TimedUndoableDelete
extends React.PureComponent<Props> {
timer: number | null = null;
componentDidMount(): void {
this.timer = setTimeout(
this.props.doDelete,
this.props.secondsDelay * 1000,
);
}
componentWillUnmount(): void {
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
}
render(): JSX.Element {
return (
<div className="undo-deletion">
{this.props.message}
<button onClick={this.props.doUndo}>Undo</button>
</div>
);
}
}
const UndoableDelete = (props: Props) =>
props.isDeleting
? <TimedUndoableDelete {...props}/>
: <React.Fragment>{props.children}</React.Fragment>;
UndoableDelete.displayName = "UndoableDelete";
export default UndoableDelete;
| Fix type in UndoableDelete component | Fix type in UndoableDelete component
| TypeScript | bsd-3-clause | nteract/composition,nteract/composition,nteract/nteract,nteract/composition,nteract/nteract,nteract/nteract,nteract/nteract,nteract/nteract | ---
+++
@@ -12,7 +12,7 @@
class TimedUndoableDelete
extends React.PureComponent<Props> {
- timer: NodeJS.Timeout | null = null;
+ timer: number | null = null;
componentDidMount(): void {
this.timer = setTimeout( |
aaf72bf42e197e5cc300a3f722103ad5cedc3a90 | packages/expo/src/environment/logging.ts | packages/expo/src/environment/logging.ts | import { Constants } from 'expo-constants';
import Logs from '../logs/Logs';
import RemoteLogging from '../logs/RemoteLogging';
if (Constants.manifest && Constants.manifest.logUrl) {
// Enable logging to the Expo dev tools only if this JS is not running in a web browser (ex: the
// remote debugger)
if (!navigator.hasOwnProperty('userAgent')) {
Logs.enableExpoCliLogging();
} else {
RemoteLogging.enqueueRemoteLogAsync('info', {}, [
'You are now debugging remotely; check your browser console for your application logs.',
]);
}
}
// NOTE(2018-10-29): temporarily filter out cyclic dependency warnings here since they are noisy and
// each warning symbolicates a stack trace, which is slow when there are many warnings
const originalWarn = console.warn;
console.warn = function warn(...args) {
if (
args.length > 0 &&
typeof args[0] === 'string' &&
/^Require cycle: .*\/node_modules\//.test(args[0])
) {
return;
}
originalWarn.apply(console, args);
};
| import { Constants } from 'expo-constants';
import Logs from '../logs/Logs';
import RemoteLogging from '../logs/RemoteLogging';
if (Constants.manifest && Constants.manifest.logUrl) {
// Enable logging to the Expo dev tools only if this JS is not running in a web browser (ex: the
// remote debugger)
if (!navigator.hasOwnProperty('userAgent')) {
Logs.enableExpoCliLogging();
} else {
RemoteLogging.enqueueRemoteLogAsync('info', {}, [
'You are now debugging remotely; check your browser console for your application logs.',
]);
}
}
// NOTE(2018-10-29): temporarily filter out cyclic dependency warnings here since they are noisy and
// each warning symbolicates a stack trace, which is slow when there are many warnings
const originalWarn = console.warn;
console.warn = function warn(...args) {
if (
args.length > 0 &&
typeof args[0] === 'string' &&
/^Require cycle: .*node_modules\//.test(args[0])
) {
return;
}
originalWarn.apply(console, args);
};
| Remove slash before the "node_modules" string in "Require cycle" warn message regex | Remove slash before the "node_modules" string in "Require cycle" warn message regex
Previous regex doesn't match any of "Require cycle" warns as they all contain not absolute warned modules path, but relative to project directory and without starting slash.
Example warn message "Require cycle: node_modules/react-native-gesture-handler/GestureHandler.js -> node_modules/react-native-gesture-handler/Swipeable.js -> node_modules/react-native-gesture-handler/GestureHandler.js" | TypeScript | bsd-3-clause | exponentjs/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent | ---
+++
@@ -22,7 +22,7 @@
if (
args.length > 0 &&
typeof args[0] === 'string' &&
- /^Require cycle: .*\/node_modules\//.test(args[0])
+ /^Require cycle: .*node_modules\//.test(args[0])
) {
return;
} |
85e01a4437e7d64518b7137520368b21262734cc | src/app/data/services/local_storage_service.ts | src/app/data/services/local_storage_service.ts | ///<reference path="../models/content_block.ts"/>
///<reference path="ajax_content_blocks_hash_serializer.ts"/>
class LocalStorageService {
static EXPIRATIONTIME:number = 1000 * 60 * 60; // 1h in ms
private expiryDate:{[key:string]:number} = {};
private serializer:AjaxContentBlocksHashSerializer = new AjaxContentBlocksHashSerializer();
fetch(key:string):AjaxContentBlocksHash {
if (this.isExpired(key)) {
return {};
}
const result = this.serializer.parse(localStorage.getItem(key));
return result ? result : {};
}
put(key:string, hash:AjaxContentBlocksHash) {
try {
localStorage.setItem(key, this.serializer.stringify(hash));
this.setExpiryDate(key);
} catch (error) {
if( console && console.error) {
console.error(error);
}
}
}
private isExpired(key:string) {
return this.expiryDate[key] <= this.timestamp();
}
private setExpiryDate(key:string) {
this.expiryDate[key] = this.timestamp() + LocalStorageService.EXPIRATIONTIME;
}
private timestamp():number {
return Date.now();
}
}
| ///<reference path="../models/content_block.ts"/>
///<reference path="ajax_content_blocks_hash_serializer.ts"/>
class LocalStorageService {
static EXPIRATIONTIME:number = 1000 * 60 * 60; // 1h in ms
private expiryDate:{[key:string]:number} = {};
private serializer:AjaxContentBlocksHashSerializer = new AjaxContentBlocksHashSerializer();
fetch(key:string):AjaxContentBlocksHash {
if (this.isExpired(key)) {
return {};
}
const result = this.serializer.parse(localStorage.getItem(key));
return result ? result : {};
}
put(key:string, hash:AjaxContentBlocksHash) {
try {
localStorage.setItem(key, this.serializer.stringify(hash));
this.setExpiryDate(key);
} catch (error) {
if( console && console.error) {
console.error(error);
}
}
}
private isExpired(key:string) {
return this.expiryDate[key] <= this.timestamp();
}
private setExpiryDate(key:string) {
this.expiryDate[key] = this.timestamp() + LocalStorageService.EXPIRATIONTIME;
}
public timestamp():number {
return Date.now();
}
}
| Revert "Don't expose your privates!" | Revert "Don't expose your privates!"
This reverts commit d1be2bb82d7353d66090929e3e02e375638d3774.
| TypeScript | mit | renuo/renuo-cms-client,renuo/renuo-cms-client,renuo/renuo-cms-client,renuo/renuo-cms-client | ---
+++
@@ -33,7 +33,7 @@
this.expiryDate[key] = this.timestamp() + LocalStorageService.EXPIRATIONTIME;
}
- private timestamp():number {
+ public timestamp():number {
return Date.now();
}
} |
a7e5b07203a151741044a12807a12455f45ab77c | src/desktop/components/react/stitch_components/index.tsx | src/desktop/components/react/stitch_components/index.tsx | /**
* Export globally available React components from this file.
*
* Keep in mind that components exported from here (and their dependencies)
* increase the size of our `common.js` bundle, so when the stitched component
* is no longer used be sure to remove it from this list.
*
* To find which components are still being stiched can search for
* ".SomeComponentName(", since this is how the component is invoked from our
* jade / pug components.
*/
export { StitchWrapper } from "./StitchWrapper"
export { NavBar } from "./NavBar"
export { CollectionsHubsHomepageNav } from "./CollectionsHubsHomepageNav"
export {
UserSettingsPaymentsQueryRenderer as UserSettingsPayments,
} from "reaction/Components/Payment/UserSettingsPayments"
export {
UserSettingsTwoFactorAuthenticationQueryRenderer as UserSettingsTwoFactorAuthentication,
} from "reaction/Components/UserSettingsTwoFactorAuthentication"
export { ReactionCCPARequest as CCPARequest } from "./CCPARequest"
| /**
* Export globally available React components from this file.
*
* Keep in mind that components exported from here (and their dependencies)
* increase the size of our `common.js` bundle, so when the stitched component
* is no longer used be sure to remove it from this list.
*
* To find which components are still being stiched can search for
* ".SomeComponentName(", since this is how the component is invoked from our
* jade / pug components.
*/
export { StitchWrapper } from "./StitchWrapper"
export { NavBar } from "./NavBar"
export { CollectionsHubsHomepageNav } from "./CollectionsHubsHomepageNav"
export {
UserSettingsPaymentsQueryRenderer as UserSettingsPayments,
} from "reaction/Components/Payment/UserSettingsPayments"
export {
UserSettingsTwoFactorAuthenticationQueryRenderer as UserSettingsTwoFactorAuthentication,
} from "reaction/Components/UserSettingsTwoFactorAuthentication/UserSettingsTwoFactorAuthentication"
export { ReactionCCPARequest as CCPARequest } from "./CCPARequest"
| Update stitched UserSettingsTwoFactorAuthentication component import | Update stitched UserSettingsTwoFactorAuthentication component import
| TypeScript | mit | joeyAghion/force,damassi/force,artsy/force-public,eessex/force,joeyAghion/force,yuki24/force,erikdstock/force,joeyAghion/force,izakp/force,erikdstock/force,eessex/force,oxaudo/force,anandaroop/force,damassi/force,artsy/force-public,artsy/force,oxaudo/force,oxaudo/force,oxaudo/force,yuki24/force,erikdstock/force,joeyAghion/force,izakp/force,anandaroop/force,yuki24/force,artsy/force,eessex/force,anandaroop/force,yuki24/force,izakp/force,izakp/force,artsy/force,anandaroop/force,damassi/force,erikdstock/force,damassi/force,artsy/force,eessex/force | ---
+++
@@ -18,5 +18,5 @@
} from "reaction/Components/Payment/UserSettingsPayments"
export {
UserSettingsTwoFactorAuthenticationQueryRenderer as UserSettingsTwoFactorAuthentication,
-} from "reaction/Components/UserSettingsTwoFactorAuthentication"
+} from "reaction/Components/UserSettingsTwoFactorAuthentication/UserSettingsTwoFactorAuthentication"
export { ReactionCCPARequest as CCPARequest } from "./CCPARequest" |
0dadb1c816ffc2bc51910c267500c8a34164752d | packages/lesswrong/lib/collections/messages/schema.ts | packages/lesswrong/lib/collections/messages/schema.ts | import { foreignKeyField } from '../../utils/schemaUtils'
const schema: SchemaType<DbMessage> = {
userId: {
...foreignKeyField({
idFieldName: "userId",
resolverName: "user",
collectionName: "Users",
type: "User",
nullable: true
}),
viewableBy: ['members'],
insertableBy: ['members'],
optional: true,
},
createdAt: {
optional: true,
type: Date,
viewableBy: ['members'],
onInsert: (document, currentUser) => new Date(),
},
conversationId: {
...foreignKeyField({
idFieldName: "conversationId",
resolverName: "conversation",
collectionName: "Conversations",
type: "Conversation",
nullable: false,
}),
viewableBy: ['members'],
insertableBy: ['members'],
hidden: true,
}
};
export default schema;
| import { foreignKeyField } from '../../utils/schemaUtils'
const schema: SchemaType<DbMessage> = {
userId: {
...foreignKeyField({
idFieldName: "userId",
resolverName: "user",
collectionName: "Users",
type: "User",
nullable: true
}),
viewableBy: ['members'],
insertableBy: ['members'],
hidden: true,
optional: true,
},
createdAt: {
optional: true,
type: Date,
viewableBy: ['members'],
onInsert: (document, currentUser) => new Date(),
},
conversationId: {
...foreignKeyField({
idFieldName: "conversationId",
resolverName: "conversation",
collectionName: "Conversations",
type: "Conversation",
nullable: false,
}),
viewableBy: ['members'],
insertableBy: ['members'],
hidden: true,
}
};
export default schema;
| Hide userId field in PM form | Hide userId field in PM form
| TypeScript | mit | Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2 | ---
+++
@@ -11,6 +11,7 @@
}),
viewableBy: ['members'],
insertableBy: ['members'],
+ hidden: true,
optional: true,
},
createdAt: { |
917144d8f520b4940a299cb2f076c0d18210cf50 | src/lib/plugins/menu/menu-trigger.directive.ts | src/lib/plugins/menu/menu-trigger.directive.ts | import {
Directive,
ContentChild,
EventEmitter,
Output,
Input,
AfterViewInit
} from '@angular/core';
import { ViewChild } from '@angular/core';
import { MatMenuTrigger } from '@angular/material';
@Directive({
selector: '[q-grid-menu-trigger]'
})
export class MenuTriggerDirective implements AfterViewInit {
@ContentChild(MatMenuTrigger) public trigger: MatMenuTrigger;
@Output('q-grid-menu-trigger') public onClose = new EventEmitter<any>();
constructor() {}
ngAfterViewInit() {
this.trigger.openMenu();
this.trigger.menuClosed.subscribe(() => {
if (this.onClose) {
setTimeout(() => this.onClose.emit(), 10);
}
});
}
}
| import {
Directive,
ContentChild,
EventEmitter,
Output,
Input,
AfterViewInit
} from '@angular/core';
import { MatMenuTrigger } from '@angular/material';
@Directive({
selector: '[q-grid-menu-trigger]'
})
export class MenuTriggerDirective implements AfterViewInit {
@ContentChild(MatMenuTrigger) public trigger: MatMenuTrigger;
@Output('q-grid-menu-trigger') public onClose = new EventEmitter<any>();
constructor() {}
ngAfterViewInit() {
Promise.resolve(null).then(() => this.trigger.openMenu());
this.trigger.menuClosed.subscribe(() => {
if (this.onClose) {
setTimeout(() => this.onClose.emit(), 10);
}
});
}
}
| Fix 'Expression has changed' issue | Fix 'Expression has changed' issue
| TypeScript | mit | azkurban/ng2,azkurban/ng2,qgrid/ng2,azkurban/ng2,qgrid/ng2,qgrid/ng2 | ---
+++
@@ -6,7 +6,6 @@
Input,
AfterViewInit
} from '@angular/core';
-import { ViewChild } from '@angular/core';
import { MatMenuTrigger } from '@angular/material';
@Directive({
@@ -19,7 +18,8 @@
constructor() {}
ngAfterViewInit() {
- this.trigger.openMenu();
+ Promise.resolve(null).then(() => this.trigger.openMenu());
+
this.trigger.menuClosed.subscribe(() => {
if (this.onClose) {
setTimeout(() => this.onClose.emit(), 10); |
60886fc1f8fc4c34837a5da0dbc32093cfe32153 | src/devices/components/e_stop_btn.tsx | src/devices/components/e_stop_btn.tsx | import * as React from "react";
import { t } from "i18next";
import { emergencyLock, emergencyUnlock } from "../actions";
import { EStopButtonProps } from "../interfaces";
import { SyncStatus } from "farmbot/dist";
// Leave this here. Type checker will notify us if we ever need to change
// this string.
const LOCKED: SyncStatus = "locked";
export class EStopButton extends React.Component<EStopButtonProps, {}> {
render() {
let { sync_status } = this.props.bot.hardware.informational_settings;
let locked = sync_status === LOCKED;
let toggleEmergencyLock = locked ? emergencyUnlock : emergencyLock;
let emergencyLockStatusColor = locked ? "yellow" : "red";
let emergencyLockStatusText = locked ? "UNLOCK" : "E-STOP";
if (this.props.user) {
return <button
className={`fb-button red e-stop ${emergencyLockStatusColor}`}
onClick={toggleEmergencyLock}>
{t(emergencyLockStatusText)}
</button>;
} else {
return <span></span>;
}
}
}
| import * as React from "react";
import { t } from "i18next";
import { emergencyLock, emergencyUnlock } from "../actions";
import { EStopButtonProps } from "../interfaces";
import { SyncStatus } from "farmbot/dist";
import { get } from "lodash";
// Leave this here. Type checker will notify us if we ever need to change
// this string.
const LOCKED: SyncStatus = "locked";
export class EStopButton extends React.Component<EStopButtonProps, {}> {
render() {
let i = this.props.bot.hardware.informational_settings;
let { sync_status } = i;
// TODO: ADD `.locked` to FBJS interface!
let lock1 = get(i, "locked", false);
let lock2 = sync_status === LOCKED;
let isLocked = lock1 || lock2;
let toggleEmergencyLock = isLocked ? emergencyUnlock : emergencyLock;
let emergencyLockStatusColor = isLocked ? "yellow" : "red";
let emergencyLockStatusText = isLocked ? "UNLOCK" : "E-STOP";
if (this.props.user) {
return <button
className={`fb-button red e-stop ${emergencyLockStatusColor}`}
onClick={toggleEmergencyLock}>
{t(emergencyLockStatusText)}
</button>;
} else {
return <span></span>;
}
}
}
| Update to locking button CC @gabriel | Update to locking button CC @gabriel
| TypeScript | mit | RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API,RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,FarmBot/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,RickCarlino/farmbot-web-app,RickCarlino/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,FarmBot/farmbot-web-app,FarmBot/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,FarmBot/farmbot-web-app,FarmBot/farmbot-web-app,RickCarlino/farmbot-web-app,MrChristofferson/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App | ---
+++
@@ -3,17 +3,22 @@
import { emergencyLock, emergencyUnlock } from "../actions";
import { EStopButtonProps } from "../interfaces";
import { SyncStatus } from "farmbot/dist";
+import { get } from "lodash";
// Leave this here. Type checker will notify us if we ever need to change
// this string.
const LOCKED: SyncStatus = "locked";
export class EStopButton extends React.Component<EStopButtonProps, {}> {
render() {
- let { sync_status } = this.props.bot.hardware.informational_settings;
- let locked = sync_status === LOCKED;
- let toggleEmergencyLock = locked ? emergencyUnlock : emergencyLock;
- let emergencyLockStatusColor = locked ? "yellow" : "red";
- let emergencyLockStatusText = locked ? "UNLOCK" : "E-STOP";
+ let i = this.props.bot.hardware.informational_settings;
+ let { sync_status } = i;
+ // TODO: ADD `.locked` to FBJS interface!
+ let lock1 = get(i, "locked", false);
+ let lock2 = sync_status === LOCKED;
+ let isLocked = lock1 || lock2;
+ let toggleEmergencyLock = isLocked ? emergencyUnlock : emergencyLock;
+ let emergencyLockStatusColor = isLocked ? "yellow" : "red";
+ let emergencyLockStatusText = isLocked ? "UNLOCK" : "E-STOP";
if (this.props.user) {
return <button |
666760c5f2a2a0cc958579b641b699b32943606a | packages/lesswrong/lib/collections/messages/schema.ts | packages/lesswrong/lib/collections/messages/schema.ts | import { foreignKeyField } from '../../utils/schemaUtils'
const schema: SchemaType<DbMessage> = {
userId: {
...foreignKeyField({
idFieldName: "userId",
resolverName: "user",
collectionName: "Users",
type: "User",
nullable: true
}),
viewableBy: ['members'],
insertableBy: ['members'],
hidden: true,
optional: true,
},
createdAt: {
optional: true,
type: Date,
viewableBy: ['members'],
onInsert: (document, currentUser) => new Date(),
},
conversationId: {
...foreignKeyField({
idFieldName: "conversationId",
resolverName: "conversation",
collectionName: "Conversations",
type: "Conversation",
nullable: false,
}),
viewableBy: ['members'],
insertableBy: ['members'],
hidden: true,
}
};
export default schema;
| import { foreignKeyField } from '../../utils/schemaUtils'
const schema: SchemaType<DbMessage> = {
userId: {
...foreignKeyField({
idFieldName: "userId",
resolverName: "user",
collectionName: "Users",
type: "User",
nullable: true
}),
viewableBy: ['members'],
insertableBy: ['admins'],
optional: true,
},
createdAt: {
optional: true,
type: Date,
viewableBy: ['members'],
onInsert: (document, currentUser) => new Date(),
},
conversationId: {
...foreignKeyField({
idFieldName: "conversationId",
resolverName: "conversation",
collectionName: "Conversations",
type: "Conversation",
nullable: false,
}),
viewableBy: ['members'],
insertableBy: ['members'],
hidden: true,
}
};
export default schema;
| Change the permissions, not just visibility | Change the permissions, not just visibility
| TypeScript | mit | Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Lesswrong2 | ---
+++
@@ -10,8 +10,7 @@
nullable: true
}),
viewableBy: ['members'],
- insertableBy: ['members'],
- hidden: true,
+ insertableBy: ['admins'],
optional: true,
},
createdAt: { |
c862095b025576340b236f7790ebf9722c6d5640 | src/app/store/action/action.store.ts | src/app/store/action/action.store.ts | import { Injectable } from '@angular/core';
import { ActionService } from './Action.service';
import { Actions, Action } from '../../model';
import { AbstractStore } from '../entity/entity.store';
import { EventsService } from '../entity/events.service';
@Injectable()
export class ActionStore extends AbstractStore<Action, Actions, ActionService> {
constructor(ActionService: ActionService, eventService: EventsService) {
super(ActionService, eventService, [], <Action>{});
}
protected get kind() {
return 'Action';
}
}
| import { Injectable } from '@angular/core';
import { ActionService } from './action.service';
import { Actions, Action } from '../../model';
import { AbstractStore } from '../entity/entity.store';
import { EventsService } from '../entity/events.service';
@Injectable()
export class ActionStore extends AbstractStore<Action, Actions, ActionService> {
constructor(ActionService: ActionService, eventService: EventsService) {
super(ActionService, eventService, [], <Action>{});
}
protected get kind() {
return 'Action';
}
}
| Fix obvious typo that has nothing to do with search/replace | Fix obvious typo that has nothing to do with search/replace
| TypeScript | apache-2.0 | kahboom/ipaas-client,kahboom/ipaas-client,kahboom/ipaas-client,kahboom/ipaas-client | ---
+++
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
-import { ActionService } from './Action.service';
+import { ActionService } from './action.service';
import { Actions, Action } from '../../model';
import { AbstractStore } from '../entity/entity.store'; |
38fe6b28b8a4b54c1f2f81fa72bccc65ddba5618 | src/com/mendix/widget/carousel/components/Carousel.ts | src/com/mendix/widget/carousel/components/Carousel.ts | import { CarouselItem } from "./CarouselItem";
import { Component, DOM, createElement } from "react";
import "../ui/Carousel.css";
import { CarouselControl } from "./CarouselControl";
export interface Image {
url: string;
}
export interface CarouselProps {
images?: Image[];
}
interface CarouselState {
activeIndex: number;
}
export class Carousel extends Component<CarouselProps, CarouselState> {
constructor(props: CarouselProps) {
super(props);
this.state = {
activeIndex: 0
};
}
render() {
return (
DOM.div({ className: "carousel" },
DOM.div({ className: "carousel-inner" },
this.createCarouselItems(this.props.images, this.state.activeIndex)
),
createElement(CarouselControl, { direction: "left" }),
createElement(CarouselControl, { direction: "right" })
)
);
}
private createCarouselItems(images: Image[] = [], activeIndex: number) {
return images.map((image, index) => createElement(CarouselItem, {
active: index === activeIndex,
key: index,
url: image.url
}));
}
}
| import { CarouselItem } from "./CarouselItem";
import { Component, DOM, createElement } from "react";
import "../ui/Carousel.css";
import { CarouselControl } from "./CarouselControl";
export interface Image {
url: string;
}
export interface CarouselProps {
images?: Image[];
}
interface CarouselState {
activeIndex: number;
}
type Direction = "right" | "left";
export class Carousel extends Component<CarouselProps, CarouselState> {
constructor(props: CarouselProps) {
super(props);
this.state = {
activeIndex: 0
};
}
render() {
return (
DOM.div({ className: "carousel" },
DOM.div({ className: "carousel-inner" },
this.createCarouselItems(this.props.images, this.state.activeIndex)
),
createElement(CarouselControl, { direction: "left", onClick: () => this.moveInDirection("left") }),
createElement(CarouselControl, { direction: "right", onClick: () => this.moveInDirection("right") })
)
);
}
private createCarouselItems(images: Image[] = [], activeIndex: number) {
return images.map((image, index) => createElement(CarouselItem, {
active: index === activeIndex,
key: index,
url: image.url
}));
}
private moveInDirection(direction: Direction) {
const { activeIndex } = this.state;
const imageCount = this.props.images.length;
if (direction === "right") {
this.setState({
activeIndex: activeIndex < imageCount - 1 ? activeIndex + 1 : 0
});
} else {
this.setState({
activeIndex: activeIndex === 0 ? imageCount - 1 : activeIndex - 1
});
}
}
}
| Add function that changes image based on direction | Add function that changes image based on direction
| TypeScript | apache-2.0 | mendixlabs/carousel,mendixlabs/carousel,FlockOfBirds/carousel,FlockOfBirds/carousel | ---
+++
@@ -16,6 +16,8 @@
activeIndex: number;
}
+type Direction = "right" | "left";
+
export class Carousel extends Component<CarouselProps, CarouselState> {
constructor(props: CarouselProps) {
super(props);
@@ -31,8 +33,8 @@
DOM.div({ className: "carousel-inner" },
this.createCarouselItems(this.props.images, this.state.activeIndex)
),
- createElement(CarouselControl, { direction: "left" }),
- createElement(CarouselControl, { direction: "right" })
+ createElement(CarouselControl, { direction: "left", onClick: () => this.moveInDirection("left") }),
+ createElement(CarouselControl, { direction: "right", onClick: () => this.moveInDirection("right") })
)
);
}
@@ -44,4 +46,18 @@
url: image.url
}));
}
+
+ private moveInDirection(direction: Direction) {
+ const { activeIndex } = this.state;
+ const imageCount = this.props.images.length;
+ if (direction === "right") {
+ this.setState({
+ activeIndex: activeIndex < imageCount - 1 ? activeIndex + 1 : 0
+ });
+ } else {
+ this.setState({
+ activeIndex: activeIndex === 0 ? imageCount - 1 : activeIndex - 1
+ });
+ }
+ }
} |
63d6b865d2822ea2195fe85ddc818d0d96475d48 | docs/examples/CustomIndicatorsContainer.tsx | docs/examples/CustomIndicatorsContainer.tsx | // @flow
import React from 'react';
import Select, { components } from 'react-select';
import { colourOptions } from '../data';
const IndicatorsContainer = props => {
return (
<div style={{ background: colourOptions[2].color }}>
<components.IndicatorsContainer {...props} />
</div>
);
};
export default () => (
<Select
closeMenuOnSelect={false}
components={{ IndicatorsContainer }}
defaultValue={[colourOptions[4], colourOptions[5]]}
isMulti
options={colourOptions}
/>
);
| import React from 'react';
import Select, { components, IndicatorContainerProps } from 'react-select';
import { ColourOption, colourOptions } from '../data';
const IndicatorsContainer = (
props: IndicatorContainerProps<ColourOption, true>
) => {
return (
<div style={{ background: colourOptions[2].color }}>
<components.IndicatorsContainer {...props} />
</div>
);
};
export default () => (
<Select
closeMenuOnSelect={false}
components={{ IndicatorsContainer }}
defaultValue={[colourOptions[4], colourOptions[5]]}
isMulti
options={colourOptions}
/>
);
| Convert more examples to TypeScript | Convert more examples to TypeScript
| TypeScript | mit | JedWatson/react-select,JedWatson/react-select | ---
+++
@@ -1,10 +1,10 @@
-// @flow
+import React from 'react';
+import Select, { components, IndicatorContainerProps } from 'react-select';
+import { ColourOption, colourOptions } from '../data';
-import React from 'react';
-import Select, { components } from 'react-select';
-import { colourOptions } from '../data';
-
-const IndicatorsContainer = props => {
+const IndicatorsContainer = (
+ props: IndicatorContainerProps<ColourOption, true>
+) => {
return (
<div style={{ background: colourOptions[2].color }}>
<components.IndicatorsContainer {...props} /> |
0d5355c940377a84ffc780b5b4a86e8043eb650a | src/dashboard-refactor/header/sync-status-menu/util.ts | src/dashboard-refactor/header/sync-status-menu/util.ts | import { RootState } from './types'
export const deriveStatusIconColor = ({
syncState,
backupState,
}: RootState): 'green' | 'red' | 'yellow' => {
if (syncState === 'error' || backupState === 'error') {
return 'red'
}
if (syncState === 'disabled' && backupState === 'disabled') {
return 'yellow'
}
return 'green'
}
| import moment from 'moment'
import type { RootState } from './types'
export const deriveStatusIconColor = ({
syncState,
backupState,
lastSuccessfulSyncDate,
}: RootState): 'green' | 'red' | 'yellow' => {
const daysSinceLastSync = moment().diff(
moment(lastSuccessfulSyncDate),
'days',
)
if (
syncState === 'error' ||
daysSinceLastSync > 7 ||
backupState === 'error'
) {
return 'red'
}
if (
(syncState === 'disabled' || daysSinceLastSync > 3) &&
backupState === 'disabled'
) {
return 'yellow'
}
return 'green'
}
| Update sync/backup status indicator conditions | Update sync/backup status indicator conditions
- yellow if last sync > 3 days ago
- red if last sync > 7 days ago
| TypeScript | mit | WorldBrain/WebMemex,WorldBrain/WebMemex | ---
+++
@@ -1,14 +1,29 @@
-import { RootState } from './types'
+import moment from 'moment'
+
+import type { RootState } from './types'
export const deriveStatusIconColor = ({
syncState,
backupState,
+ lastSuccessfulSyncDate,
}: RootState): 'green' | 'red' | 'yellow' => {
- if (syncState === 'error' || backupState === 'error') {
+ const daysSinceLastSync = moment().diff(
+ moment(lastSuccessfulSyncDate),
+ 'days',
+ )
+
+ if (
+ syncState === 'error' ||
+ daysSinceLastSync > 7 ||
+ backupState === 'error'
+ ) {
return 'red'
}
- if (syncState === 'disabled' && backupState === 'disabled') {
+ if (
+ (syncState === 'disabled' || daysSinceLastSync > 3) &&
+ backupState === 'disabled'
+ ) {
return 'yellow'
}
|
1e7b867564fd1a8d07b9e78739f8bbb6a4bb3117 | projects/igniteui-angular/src/lib/action-strip/index.ts | projects/igniteui-angular/src/lib/action-strip/index.ts | export * from './action-strip.module';
| export { IgxGridActionsBaseDirective } from './grid-actions/grid-actions-base.directive';
export { IgxGridEditingActionsComponent } from './grid-actions/grid-editing-actions.component';
export { IgxGridPinningActionsComponent } from './grid-actions/grid-pinning-actions.component';
export { IgxActionStripComponent } from './action-strip.component';
export * from './action-strip.module';
| Revert - "Remove not needed exports" | chore(*): Revert - "Remove not needed exports"
This reverts commit 200c9dc5bc933910ed72761ec820f06478465e3c.
| TypeScript | mit | Infragistics/zero-blocks,Infragistics/zero-blocks,Infragistics/zero-blocks | ---
+++
@@ -1 +1,5 @@
+export { IgxGridActionsBaseDirective } from './grid-actions/grid-actions-base.directive';
+export { IgxGridEditingActionsComponent } from './grid-actions/grid-editing-actions.component';
+export { IgxGridPinningActionsComponent } from './grid-actions/grid-pinning-actions.component';
+export { IgxActionStripComponent } from './action-strip.component';
export * from './action-strip.module'; |
05230d275430dd95393db6f035120fc3e2ad6b6e | src/configuration/model/valuelist-definition.ts | src/configuration/model/valuelist-definition.ts | /**
* @author Daniel de Oliveira
*
*
*/
export interface ValuelistDefinition {
description: { [language: string]: string }
extends?: string; // TODO review
createdBy: string;
creationDate: string;
constraints?: any; // TODO to be defined
values: { [key: string]: ValueDefinition }
}
export module ValuelistDefinition {
export function isValid(valuelistDefinition: ValuelistDefinition): boolean {
return true; // TODO implement properly, see if we can unify handling with cases like Document.isValid
}
export function assertIsValid(valuelistDefinition: ValuelistDefinition) {
// TODO throw if not is Valid
}
}
export interface ValueDefinition {
translation?: { [label: string]: string },
references?: { [referenceKey: string]: string },
}
export interface ValuelistDefinitions { [key: string]: ValuelistDefinition } | /**
* @author Daniel de Oliveira
*
*
*/
export interface ValuelistDefinition {
description: { [language: string]: string }
extends?: string; // TODO review
createdBy: string;
creationDate: string;
constraints?: any; // TODO to be defined
values: { [key: string]: ValueDefinition }
order?: string[]; // optional, default is alphabetical TODO to be implemented, see #11413
}
export module ValuelistDefinition {
export function isValid(valuelistDefinition: ValuelistDefinition): boolean {
return true; // TODO implement properly, see if we can unify handling with cases like Document.isValid
}
export function assertIsValid(valuelistDefinition: ValuelistDefinition) {
// TODO throw if not is Valid
}
}
export interface ValueDefinition {
translation?: { [label: string]: string },
references?: { [referenceKey: string]: string },
}
export interface ValuelistDefinitions { [key: string]: ValuelistDefinition } | Add order field for valuelists | Add order field for valuelists
| TypeScript | apache-2.0 | dainst/idai-components-2,dainst/idai-components-2,dainst/idai-components-2 | ---
+++
@@ -11,6 +11,7 @@
creationDate: string;
constraints?: any; // TODO to be defined
values: { [key: string]: ValueDefinition }
+ order?: string[]; // optional, default is alphabetical TODO to be implemented, see #11413
}
|
5a97b88e17aa4b896c993c295ef643786a6a7733 | scripts/uninstall.ts | scripts/uninstall.ts | #! /usr/bin/env node
// Modules
import * as fs from 'fs';
import * as path from 'path';
import * as readline from 'readline';
import * as chalk from 'chalk';
let rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// Directories
let cwd: string = process.cwd();
let minifyJsPath: string = path.join(cwd, "..", "..", "hooks", "after_prepare", "ionic-minify.js");
let configFilePath: string = path.join(cwd, "..", "..", "hooks", "minify-conf.json");
// Delete ionic-minify.js
fs.unlink(minifyJsPath, (error) => {
if (error === undefined) {
console.log(chalk.red(`Cannot find hook to remove at ${minifyJsPath}. It may already have been removed!`));
}
});
// Delete minify-conf.json
rl.question("Do you want to keep your configuration file (Y/N)?[Y] ", (answer: string) => {
if(answer.toUpperCase() === "N"){
fs.unlinkSync(configFilePath);
console.log(chalk.red("Configuration file was deleted..."));
}
console.log(chalk.green("ionic-minify was uninstalled successfuly!"));
process.exit(0);
}); | #! /usr/bin/env node
// Modules
import * as fs from "fs";
import * as path from "path";
import * as readline from "readline";
import * as chalk from "chalk";
let rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// Directories
let cwd: string = process.cwd();
let minifyJsPath: string = path.join(cwd, "..", "..", "hooks", "after_prepare", "ionic-minify.js");
let configFilePath: string = path.join(cwd, "..", "..", "hooks", "minify-conf.json");
// Delete ionic-minify.js
fs.unlink(minifyJsPath, (error) => {
if (error === undefined) {
console.log(chalk.red(`Cannot find hook to remove at ${minifyJsPath}. It may already have been removed!`));
}
});
// Delete minify-conf.json
rl.question("Do you want to keep your configuration file (Y/N)?[Y] ", (answer: string) => {
if(answer.toUpperCase() === "N"){
fs.unlinkSync(configFilePath);
console.log(chalk.red("Configuration file was deleted..."));
}
console.log(chalk.green("ionic-minify was uninstalled successfuly!"));
process.exit(0);
});
| Change single quotes for double quotes | Change single quotes for double quotes | TypeScript | mit | Kurtz1993/ionic-minify,Kurtz1993/ionic-minify | ---
+++
@@ -1,10 +1,10 @@
#! /usr/bin/env node
// Modules
-import * as fs from 'fs';
-import * as path from 'path';
-import * as readline from 'readline';
-import * as chalk from 'chalk';
+import * as fs from "fs";
+import * as path from "path";
+import * as readline from "readline";
+import * as chalk from "chalk";
let rl = readline.createInterface({
input: process.stdin, |
cee2855c0c031d51a45017f465f75eafa21cb548 | packages/design-studio/structure/index.ts | packages/design-studio/structure/index.ts | import S from '@sanity/desk-tool/structure-builder'
import CogIcon from 'part:@sanity/base/cog-icon'
import {JSONPreviewDocumentView} from '../documentViews/jsonPreview'
const STRUCTURE_CUSTOM_TYPES = ['settings']
const STRUCTURE_LIST_ITEM_DIVIDER = S.divider()
// Add `JSON` tab to the `author` document form
export const getDefaultDocumentNode = ({schemaType}) => {
// Conditionally return a different configuration based on the schema type
if (schemaType === 'author') {
return S.document().views([
S.view.form(),
S.view.component(JSONPreviewDocumentView).title('JSON')
])
}
return undefined
}
// The `Settings` root list item
const settingsListItem = S.listItem()
.title('Settings')
.icon(CogIcon)
.child(
S.editor()
.id('settings')
.schemaType('settings')
.documentId('settings')
)
// The default root list items (except custom ones)
const defaultListItems = S.documentTypeListItems().filter(
listItem => !STRUCTURE_CUSTOM_TYPES.includes(listItem.getId())
)
export default () =>
S.list()
.title('Content')
.items([settingsListItem, STRUCTURE_LIST_ITEM_DIVIDER, ...defaultListItems])
| import S from '@sanity/desk-tool/structure-builder'
import CogIcon from 'part:@sanity/base/cog-icon'
import {JSONPreviewDocumentView} from '../documentViews/jsonPreview'
const STRUCTURE_CUSTOM_TYPES = ['settings']
const STRUCTURE_LIST_ITEM_DIVIDER = S.divider()
// Add `JSON` tab to the `author` document form
export const getDefaultDocumentNode = ({schemaType}) => {
// Conditionally return a different configuration based on the schema type
if (schemaType === 'author') {
return S.document().views([
S.view.form(),
S.view.component(JSONPreviewDocumentView).title('JSON')
])
}
if (schemaType === 'allInputs') {
return S.document().views([
S.view.form(),
S.view.component(JSONPreviewDocumentView).title('JSON')
])
}
return undefined
}
// The `Settings` root list item
const settingsListItem = S.listItem()
.title('Settings')
.icon(CogIcon)
.child(
S.editor()
.id('settings')
.schemaType('settings')
.documentId('settings')
)
// The default root list items (except custom ones)
const defaultListItems = S.documentTypeListItems().filter(
listItem => !STRUCTURE_CUSTOM_TYPES.includes(listItem.getId())
)
export default () =>
S.list()
.title('Content')
.items([settingsListItem, STRUCTURE_LIST_ITEM_DIVIDER, ...defaultListItems])
| Add JSON tab to allInputs type | [design-studio] Add JSON tab to allInputs type
| TypeScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity | ---
+++
@@ -9,6 +9,13 @@
export const getDefaultDocumentNode = ({schemaType}) => {
// Conditionally return a different configuration based on the schema type
if (schemaType === 'author') {
+ return S.document().views([
+ S.view.form(),
+ S.view.component(JSONPreviewDocumentView).title('JSON')
+ ])
+ }
+
+ if (schemaType === 'allInputs') {
return S.document().views([
S.view.form(),
S.view.component(JSONPreviewDocumentView).title('JSON') |
54d76b8531e70c16f54791c37930a610e6540a7d | src/app/models/workout.ts | src/app/models/workout.ts | import { Tag } from './tag';
import { Sport } from './sport';
import { Address } from './address';
import { Image } from './image';
export class Workout {
public id: number;
public coach: number;
public title: string;
public sport: any;
public startdate: Date;
public enddate: Date;
public duration: string;
public nbTicketAvailable: number;
public nbTicketBooked: number;
public price: number;
public address: any;
public photo: any;
public description: string;
public outfit: string;
public notice: string;
public tags: Tag[];
public styleTop: string;
public styleHeight: string;
constructor(
) {
this.sport = new Sport();
this.address = new Address();
this.startdate = new Date();
this.enddate = new Date();
this.tags = new Array();
this.photo = new Image();
}
}
| import { Tag } from './tag';
import { Sport } from './sport';
import { Address } from './address';
import { Image } from './image';
export class Workout {
public id: number;
public coach: number;
public title: string;
public sport: any;
public startdate: Date;
public enddate: Date;
public duration: string;
public nbTicketAvailable: number;
public nbTicketBooked: number;
public price: number;
public address: any;
public photo: any;
public description: string;
public outfit: string;
public notice: string;
public tags: Tag[];
public styleTop: string;
public styleHeight: string;
constructor(sport = new Sport(), address = new Address(), startdate = new Date(), enddate = new Date(), tags = new Array(), photo = new Image()
) {
this.sport = sport;
this.address = address;
if (startdate instanceof Date) {
this.startdate = new Date(startdate);
console.log(this.startdate);
} else { this.startdate = startdate; }
if (enddate instanceof Date) {
this.enddate = new Date(enddate);
} else { this.enddate = enddate; }
this.tags = tags;
this.photo = photo;
}
}
| Add parameters on constructor to init default values | Add parameters on constructor to init default values
| TypeScript | mit | XavierGuichet/bemoove-front,XavierGuichet/bemoove-front,XavierGuichet/bemoove-front | ---
+++
@@ -23,14 +23,19 @@
public styleTop: string;
public styleHeight: string;
- constructor(
+ constructor(sport = new Sport(), address = new Address(), startdate = new Date(), enddate = new Date(), tags = new Array(), photo = new Image()
) {
- this.sport = new Sport();
- this.address = new Address();
- this.startdate = new Date();
- this.enddate = new Date();
- this.tags = new Array();
- this.photo = new Image();
+ this.sport = sport;
+ this.address = address;
+ if (startdate instanceof Date) {
+ this.startdate = new Date(startdate);
+ console.log(this.startdate);
+ } else { this.startdate = startdate; }
+ if (enddate instanceof Date) {
+ this.enddate = new Date(enddate);
+ } else { this.enddate = enddate; }
+ this.tags = tags;
+ this.photo = photo;
}
} |
02281d435b03156eacfaa7e6ec8413da4b4e888f | src/StringHelpers.ts | src/StringHelpers.ts | import { escapeForRegex } from './PatternHelpers'
// Returns a new string consisting of `count` copies of `text`
export function repeat(text: string, count: number): string {
return new Array(count + 1).join(text)
}
// Returns true if `first` equals `second` (ignoring any capitalization)
export function isEqualIgnoringCapitalization(first: string, second: string): boolean {
const pattern =
new RegExp('^' + escapeForRegex(first) + '$', 'i')
return pattern.test(second)
}
// Returns true if `haystack` contains `needle` (ignoring any capitalization)
export function containsStringIgnoringCapitalization(args: { haystack: string, needle: string }): boolean {
const pattern =
new RegExp(escapeForRegex(args.needle), 'i')
return pattern.test(args.haystack)
} | import { escapeForRegex } from './PatternHelpers'
// Returns a new string consisting of `count` copies of `text`
export function repeat(text: string, count: number): string {
return new Array(count + 1).join(text)
}
// Returns true if `first` equals `second` (ignoring any capitalization)
export function isEqualIgnoringCapitalization(first: string, second: string): boolean {
const pattern =
new RegExp('^' + escapeForRegex(first) + '$', 'i')
return pattern.test(second)
}
// Returns true if `haystack` contains `needle` (ignoring any capitalization)
export function containsStringIgnoringCapitalization(args: { haystack: string, needle: string }): boolean {
const pattern =
new RegExp(escapeForRegex(args.needle), 'i')
return pattern.test(args.haystack)
}
| Add missing end-of-file line break | Add missing end-of-file line break
| TypeScript | mit | start/up,start/up | |
511bb05cb987d605f377d97fa4424facb0e14841 | tests/config-tests.ts | tests/config-tests.ts | /**
* @license
* Copyright 2020 Balena Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { EventEmitter } from 'events';
EventEmitter.defaultMaxListeners = 35; // it appears that 'nock' adds a bunch of listeners - bug?
// SL: Looks like it's not nock causing this, as have seen the problem triggered from help.spec,
// which is not using nock. Perhaps mocha/chai? (unlikely), or something in the CLI?
import { config as chaiCfg } from 'chai';
chaiCfg.showDiff = true;
// enable diff comparison of large objects / arrays
chaiCfg.truncateThreshold = 0;
| /**
* @license
* Copyright 2020 Balena Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as tmp from 'tmp';
tmp.setGracefulCleanup();
// Use a temporary dir for tests data
process.env.BALENARC_DATA_DIRECTORY = tmp.dirSync().name;
import { EventEmitter } from 'events';
EventEmitter.defaultMaxListeners = 35; // it appears that 'nock' adds a bunch of listeners - bug?
// SL: Looks like it's not nock causing this, as have seen the problem triggered from help.spec,
// which is not using nock. Perhaps mocha/chai? (unlikely), or something in the CLI?
import { config as chaiCfg } from 'chai';
chaiCfg.showDiff = true;
// enable diff comparison of large objects / arrays
chaiCfg.truncateThreshold = 0;
| Use a tmp data dir to avoid conflicts/overwriting existing data | Tests: Use a tmp data dir to avoid conflicts/overwriting existing data
Change-type: patch
| TypeScript | apache-2.0 | resin-io/resin-cli,resin-io/resin-cli,resin-io/resin-cli,resin-io/resin-cli | ---
+++
@@ -15,6 +15,11 @@
* limitations under the License.
*/
+import * as tmp from 'tmp';
+tmp.setGracefulCleanup();
+// Use a temporary dir for tests data
+process.env.BALENARC_DATA_DIRECTORY = tmp.dirSync().name;
+
import { EventEmitter } from 'events';
EventEmitter.defaultMaxListeners = 35; // it appears that 'nock' adds a bunch of listeners - bug?
// SL: Looks like it's not nock causing this, as have seen the problem triggered from help.spec, |
07c5ad736c890b480ba7d4372aba0de35c20e041 | spec/Enumerable.DefaultIfEmpty.spec.ts | spec/Enumerable.DefaultIfEmpty.spec.ts | import { Enumerable, ResetableIterator } from '../src/Enumerable';
describe('Enumerable', () => {
describe('DefaultIfEmpty', () => {
it('Should return itself if sequence has items', () => {
const source = Enumerable.Of([1, 2, 3, 4, 5]);
const expected = source;
const result = source.DefaultIfEmpty(1);
expect(result).toEqual(expected);
});
it('Should return an a sequence with the default value if the sequence is empty', () => {
const source = Enumerable.Of(<number[]>[]);
const expected = [1];
const result = source.DefaultIfEmpty(1).ToArray();
expect(result).toEqual(expected);
});
});
});
| import { Enumerable, ResetableIterator } from '../src/Enumerable';
describe('Enumerable', () => {
describe('DefaultIfEmpty', () => {
it('Should return itself if sequence has items', () => {
const originalSource = [1, 2, 3, 4, 5];
const source = Enumerable.Of(originalSource);
const expected = originalSource;
const result = source.DefaultIfEmpty(1).ToArray();
expect(result).toEqual(expected);
});
it('Should return an a sequence with the default value if the sequence is empty', () => {
const source = Enumerable.Of(<number[]>[]);
const expected = [1];
const result = source.DefaultIfEmpty(1).ToArray();
expect(result).toEqual(expected);
});
});
});
| Add example of incorrect consumption of enumerable. Test here should be passing | Add example of incorrect consumption of enumerable. Test here should be passing
| TypeScript | mit | rjrudman/TSLinq | ---
+++
@@ -3,11 +3,12 @@
describe('Enumerable', () => {
describe('DefaultIfEmpty', () => {
it('Should return itself if sequence has items', () => {
- const source = Enumerable.Of([1, 2, 3, 4, 5]);
+ const originalSource = [1, 2, 3, 4, 5];
+ const source = Enumerable.Of(originalSource);
- const expected = source;
+ const expected = originalSource;
- const result = source.DefaultIfEmpty(1);
+ const result = source.DefaultIfEmpty(1).ToArray();
expect(result).toEqual(expected);
}); |
760ff7d9a18b543a31a40b7ceb3fa10bd8c26506 | src/sagas/statusDetail.ts | src/sagas/statusDetail.ts | import { call, put } from 'redux-saga/effects';
import {
FetchStatusDetailFailure,
FetchStatusDetailRequest,
FetchStatusDetailSuccess,
statusDetailRequest,
statusDetailFailure,
statusDetailSuccess
} from '../actions/statusDetail';
import {
fetchStatusDetailPage,
StatusDetailPageInfo
} from '../api/statusDetail';
import { statusDetailToast, statusDetailErrorToast } from '../utils/toaster';
export function* handleStatusDetailRequest(action: FetchStatusDetailRequest) {
try {
const pageInfo: StatusDetailPageInfo = yield call(
fetchStatusDetailPage,
action.dateString
);
const { data, morePages } = pageInfo;
if (data.isEmpty()) {
yield put<FetchStatusDetailFailure>(statusDetailFailure());
} else {
yield put<FetchStatusDetailSuccess>(statusDetailSuccess(data));
}
conditionallyDisplayToast(action, data.isEmpty());
/**
* Recursively call this function with page+1.
*/
if (morePages) {
yield put<FetchStatusDetailRequest>(
statusDetailRequest(action.dateString, action.page + 1)
);
}
} catch (e) {
statusDetailErrorToast(action.dateString);
console.warn(e);
yield put<FetchStatusDetailFailure>(statusDetailFailure());
}
}
const conditionallyDisplayToast = (
action: FetchStatusDetailRequest,
noDataFound: boolean
) => {
if (action.withToast) {
statusDetailToast(action.dateString, noDataFound);
}
};
| import { call, put } from 'redux-saga/effects';
import {
FetchStatusDetailFailure,
FetchStatusDetailRequest,
FetchStatusDetailSuccess,
statusDetailRequest,
statusDetailFailure,
statusDetailSuccess
} from '../actions/statusDetail';
import {
fetchStatusDetailPage,
StatusDetailPageInfo
} from '../api/statusDetail';
import { statusDetailToast, statusDetailErrorToast } from '../utils/toaster';
export function* handleStatusDetailRequest(action: FetchStatusDetailRequest) {
try {
const pageInfo: StatusDetailPageInfo = yield call(
fetchStatusDetailPage,
action.dateString,
action.page
);
const { data, morePages } = pageInfo;
if (data.isEmpty()) {
yield put<FetchStatusDetailFailure>(statusDetailFailure());
} else {
yield put<FetchStatusDetailSuccess>(statusDetailSuccess(data));
}
conditionallyDisplayToast(action, data.isEmpty());
/**
* Recursively call this function with page+1.
*/
if (morePages) {
yield put<FetchStatusDetailRequest>(
statusDetailRequest(action.dateString, action.page + 1)
);
}
} catch (e) {
statusDetailErrorToast(action.dateString);
console.warn(e);
yield put<FetchStatusDetailFailure>(statusDetailFailure());
}
}
const conditionallyDisplayToast = (
action: FetchStatusDetailRequest,
noDataFound: boolean
) => {
if (action.withToast) {
statusDetailToast(action.dateString, noDataFound);
}
};
| Fix issue with handleStatusDetailRequest calling itself infinitely when additional pages are present. | Fix issue with handleStatusDetailRequest calling itself infinitely when additional pages are present.
| TypeScript | mit | Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine | ---
+++
@@ -17,7 +17,8 @@
try {
const pageInfo: StatusDetailPageInfo = yield call(
fetchStatusDetailPage,
- action.dateString
+ action.dateString,
+ action.page
);
const { data, morePages } = pageInfo;
|
c9fe24daec32d23ac675f57e3c37854e5ecffbde | packages/webamp/js/components/PlaylistWindow/MiscOptionsContextMenu.tsx | packages/webamp/js/components/PlaylistWindow/MiscOptionsContextMenu.tsx | import { Node } from "../ContextMenu";
import ContextMenuTarget from "../ContextMenuTarget";
import * as Actions from "../../actionCreators";
import { useActionCreator } from "../../hooks";
const MiscOptionsContextMenu = () => {
const downloadHtmlPlaylist = useActionCreator(Actions.downloadHtmlPlaylist);
return (
<ContextMenuTarget
top
renderMenu={() => (
<Node onClick={downloadHtmlPlaylist} label="Generate HTML playlist" />
)}
>
<div />
</ContextMenuTarget>
);
};
export default MiscOptionsContextMenu;
| import { Node } from "../ContextMenu";
import ContextMenuTarget from "../ContextMenuTarget";
import * as Actions from "../../actionCreators";
import { useActionCreator } from "../../hooks";
const MiscOptionsContextMenu = () => {
const downloadHtmlPlaylist = useActionCreator(Actions.downloadHtmlPlaylist);
return (
<ContextMenuTarget
style={{ width: "100%", height: "100%" }}
top
renderMenu={() => (
<Node onClick={downloadHtmlPlaylist} label="Generate HTML playlist" />
)}
>
<div />
</ContextMenuTarget>
);
};
export default MiscOptionsContextMenu;
| Fix menu item for downloading playlist as HTML | Fix menu item for downloading playlist as HTML
| TypeScript | mit | captbaritone/winamp2-js,captbaritone/winamp2-js,captbaritone/winamp2-js | ---
+++
@@ -7,6 +7,7 @@
const downloadHtmlPlaylist = useActionCreator(Actions.downloadHtmlPlaylist);
return (
<ContextMenuTarget
+ style={{ width: "100%", height: "100%" }}
top
renderMenu={() => (
<Node onClick={downloadHtmlPlaylist} label="Generate HTML playlist" /> |
38c8c9b2d20dd0d875d2d26648f71c7b9301ccff | desktop/app/src/chrome/plugin-manager/PluginManager.tsx | desktop/app/src/chrome/plugin-manager/PluginManager.tsx | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import React from 'react';
import {Tab, Tabs} from 'flipper-plugin';
import PluginDebugger from './PluginDebugger';
import PluginInstaller from './PluginInstaller';
import {Modal} from 'antd';
export default function (props: {onHide: () => any}) {
return (
<Modal width={800} visible onCancel={props.onHide} footer={null}>
<Tabs>
<Tab tab="Plugin Status">
<PluginDebugger />
</Tab>
<Tab tab="Install Plugins">
<PluginInstaller />
</Tab>
</Tabs>
</Modal>
);
}
| /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import React from 'react';
import {Tab, Tabs} from 'flipper-plugin';
import PluginDebugger from './PluginDebugger';
import PluginInstaller from './PluginInstaller';
import {Modal} from 'antd';
export default function (props: {onHide: () => any}) {
return (
<Modal width={800} visible onCancel={props.onHide} footer={null}>
<Tabs>
<Tab tab="Plugin Status">
<PluginDebugger />
</Tab>
<Tab tab="Install Plugins">
<PluginInstaller autoHeight />
</Tab>
</Tabs>
</Modal>
);
}
| Set required prop for PluginInstaller | Set required prop for PluginInstaller
Summary: TSC is raising this for a missing property.
Reviewed By: timur-valiev
Differential Revision: D29933795
fbshipit-source-id: 2acb3ea3b504f1bce1fb4bd0f7e4b52fd49e00b0
| TypeScript | mit | facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper | ---
+++
@@ -21,7 +21,7 @@
<PluginDebugger />
</Tab>
<Tab tab="Install Plugins">
- <PluginInstaller />
+ <PluginInstaller autoHeight />
</Tab>
</Tabs>
</Modal> |
fbf61714b3e073037084e8fac2968512d167e2b7 | ui/src/idai_field/projects.ts | ui/src/idai_field/projects.ts | import { ResultDocument } from '../api/result';
const MAX_LABEL_LENGTH = 25;
export const getProjectLabel = (projectDocument: ResultDocument): string => {
return projectDocument.resource.shortDescription
&& projectDocument.resource.shortDescription.length <= MAX_LABEL_LENGTH
? projectDocument.resource.shortDescription
: projectDocument.resource.identifier;
};
| import { ResultDocument } from '../api/result';
const MAX_LABEL_LENGTH = 35;
export const getProjectLabel = (projectDocument: ResultDocument): string => {
return projectDocument.resource.shortDescription
&& projectDocument.resource.shortDescription.length <= MAX_LABEL_LENGTH
? projectDocument.resource.shortDescription
: projectDocument.resource.identifier;
};
| Set max length for project labels to 35 | Set max length for project labels to 35
| TypeScript | apache-2.0 | dainst/idai-field-web,dainst/idai-field-web,dainst/idai-field-web | ---
+++
@@ -1,7 +1,7 @@
import { ResultDocument } from '../api/result';
-const MAX_LABEL_LENGTH = 25;
+const MAX_LABEL_LENGTH = 35;
export const getProjectLabel = (projectDocument: ResultDocument): string => { |
95f6cb516cfd8945298263eeb2050a0b0835dd6d | app/src/lib/shells/linux.ts | app/src/lib/shells/linux.ts | import { spawn } from 'child_process'
import { IFoundShell } from './found-shell'
export enum Shell {
Gnome = 'gnome-terminal',
}
export const Default = Shell.Gnome
export function parse(label: string): Shell {
return Default
}
export async function getAvailableShells(): Promise<
ReadonlyArray<IFoundShell<Shell>>
> {
return [{ shell: Shell.Gnome, path: '/usr/bin/gnome-terminal' }]
}
export async function launch(
shell: IFoundShell<Shell>,
path: string
): Promise<void> {
const commandArgs = ['--working-directory', path]
await spawn('gnome-terminal', commandArgs)
}
| import { spawn } from 'child_process'
import * as fs from 'fs'
import { assertNever, fatalError } from '../fatal-error'
import { IFoundShell } from './found-shell'
export enum Shell {
Gnome = 'gnome-terminal',
Tilix = 'tilix'
}
export const Default = Shell.Gnome
export function parse(label: string): Shell {
if (label === Shell.Gnome) {
return Shell.Gnome
}
if (label === Shell.Tilix) {
return Shell.Tilix
}
return Default
}
async function getPathIfAvailable(path: string): Promise<string | null> {
return new Promise<string | null>((resolve) => {
fs.stat(path, (err) => {
if (err) {
resolve(null)
} else {
resolve(path)
}
})
})
}
async function getShellPath(shell: Shell): Promise<string | null> {
switch (shell) {
case Shell.Gnome:
return await getPathIfAvailable('/usr/bin/gnome-terminal')
case Shell.Tilix:
return await getPathIfAvailable('/usr/bin/tilix')
default:
return assertNever(shell, `Unknown shell: ${shell}`)
}
}
export async function getAvailableShells(): Promise<
ReadonlyArray<IFoundShell<Shell>>
> {
const [gnomeTerminalPath, tilixPath] = await Promise.all([
getShellPath(Shell.Gnome),
getShellPath(Shell.Tilix)
])
const shells: Array<IFoundShell<Shell>> = []
if (gnomeTerminalPath) {
shells.push({ shell: Shell.Gnome, path: gnomeTerminalPath })
}
if (tilixPath) {
shells.push({ shell: Shell.Tilix, path: tilixPath })
}
return shells
}
export async function launch(
shell: IFoundShell<Shell>,
path: string
): Promise<void> {
const shellPath = await getShellPath(shell.shell)
if (!shellPath) {
fatalError(`${shell.shell} is not installed`)
return
}
const commandArgs = ['--working-directory', path]
await spawn(shellPath, commandArgs)
}
| Add Tilix as available Shell | Add Tilix as available Shell
| TypeScript | mit | desktop/desktop,kactus-io/kactus,artivilla/desktop,desktop/desktop,j-f1/forked-desktop,say25/desktop,j-f1/forked-desktop,say25/desktop,kactus-io/kactus,artivilla/desktop,j-f1/forked-desktop,shiftkey/desktop,shiftkey/desktop,kactus-io/kactus,artivilla/desktop,shiftkey/desktop,artivilla/desktop,say25/desktop,desktop/desktop,j-f1/forked-desktop,shiftkey/desktop,desktop/desktop,say25/desktop,kactus-io/kactus | ---
+++
@@ -1,26 +1,81 @@
import { spawn } from 'child_process'
+import * as fs from 'fs'
+import { assertNever, fatalError } from '../fatal-error'
import { IFoundShell } from './found-shell'
export enum Shell {
Gnome = 'gnome-terminal',
+ Tilix = 'tilix'
}
export const Default = Shell.Gnome
export function parse(label: string): Shell {
+ if (label === Shell.Gnome) {
+ return Shell.Gnome
+ }
+
+ if (label === Shell.Tilix) {
+ return Shell.Tilix
+ }
+
return Default
+}
+
+async function getPathIfAvailable(path: string): Promise<string | null> {
+ return new Promise<string | null>((resolve) => {
+ fs.stat(path, (err) => {
+ if (err) {
+ resolve(null)
+ } else {
+ resolve(path)
+ }
+ })
+ })
+}
+
+async function getShellPath(shell: Shell): Promise<string | null> {
+ switch (shell) {
+ case Shell.Gnome:
+ return await getPathIfAvailable('/usr/bin/gnome-terminal')
+ case Shell.Tilix:
+ return await getPathIfAvailable('/usr/bin/tilix')
+ default:
+ return assertNever(shell, `Unknown shell: ${shell}`)
+ }
}
export async function getAvailableShells(): Promise<
ReadonlyArray<IFoundShell<Shell>>
-> {
- return [{ shell: Shell.Gnome, path: '/usr/bin/gnome-terminal' }]
+ > {
+ const [gnomeTerminalPath, tilixPath] = await Promise.all([
+ getShellPath(Shell.Gnome),
+ getShellPath(Shell.Tilix)
+ ])
+
+ const shells: Array<IFoundShell<Shell>> = []
+ if (gnomeTerminalPath) {
+ shells.push({ shell: Shell.Gnome, path: gnomeTerminalPath })
+ }
+
+ if (tilixPath) {
+ shells.push({ shell: Shell.Tilix, path: tilixPath })
+ }
+
+ return shells
}
export async function launch(
shell: IFoundShell<Shell>,
path: string
): Promise<void> {
+ const shellPath = await getShellPath(shell.shell)
+
+ if (!shellPath) {
+ fatalError(`${shell.shell} is not installed`)
+ return
+ }
+
const commandArgs = ['--working-directory', path]
- await spawn('gnome-terminal', commandArgs)
+ await spawn(shellPath, commandArgs)
} |
229517d7d4300fd4dd1ba87616f253249256a240 | src/dashboard-refactor/search-results/types.ts | src/dashboard-refactor/search-results/types.ts | import { AnnotationsSorter } from 'src/sidebar/annotations-sidebar/sorting'
type Note = any
type Page = any
type NoteType = 'search' | 'user' | 'followed'
interface NewNoteFormState {
inputValue: string
// TODO: work out these states (may re-use from sidebar state)
}
interface NoteState {
id: string
// TODO: work out individual note states
}
interface PageState {
id: string
noteType: NoteType
areNotesShown: boolean
sortingFn: AnnotationsSorter
newNoteForm: NewNoteFormState
notes: { [name in NoteType]: NoteState[] }
}
interface ResultsByDay {
date: Date
pages: PageState[]
}
export interface RootState {
results: ResultsByDay[]
areAllNotesShown: boolean
searchType: 'pages' | 'notes'
pagesLookup: { [id: string]: Page }
notesLookup: { [id: string]: Note }
}
| import { TaskState } from 'ui-logic-core/lib/types'
import { AnnotationsSorter } from 'src/sidebar/annotations-sidebar/sorting'
export type NotesType = 'search' | 'user' | 'followed'
interface NormalizedState<T> {
allIds: string[]
byId: { [id: string]: T }
}
interface Note {
url: string
comment?: string
highlight?: string
editedAt?: Date
createdAt: Date
}
interface Page {
url: string
title: string
createdAt: Date
isBookmarked: boolean
}
interface NewNoteFormState {
inputValue: string
// TODO: work out these states (may re-use from sidebar state)
}
interface ResultsByDay {
day: number
pages: NormalizedState<{
id: string
notesType: NotesType
areNotesShown: boolean
loadNotesState: TaskState
sortingFn: AnnotationsSorter
newNoteForm: NewNoteFormState
noteIds: { [key in NotesType]: string[] }
}>
}
export interface RootState {
results: { [day: number]: ResultsByDay }
areAllNotesShown: boolean
searchType: 'pages' | 'notes'
searchState: TaskState
paginationState: TaskState
pagesLookup: NormalizedState<Page>
notesLookup: NormalizedState<Note>
}
| Revise state shape again so it's less nested | Revise state shape again so it's less nested
Really difficult for me to think about this. They last state shape was valid, but it proved to be a major pain to work with, trying to access pages and notes in nested arrays.
Spent some time reading some different ways to deal with similar shaped states, and this really helped with coming up with the new shape (read this years ago, but it was never so relevant until now):
https://redux.js.org/recipes/structuring-reducers/normalizing-state-shape
| TypeScript | mit | WorldBrain/WebMemex,WorldBrain/WebMemex | ---
+++
@@ -1,37 +1,54 @@
+import { TaskState } from 'ui-logic-core/lib/types'
+
import { AnnotationsSorter } from 'src/sidebar/annotations-sidebar/sorting'
-type Note = any
-type Page = any
-type NoteType = 'search' | 'user' | 'followed'
+export type NotesType = 'search' | 'user' | 'followed'
+
+interface NormalizedState<T> {
+ allIds: string[]
+ byId: { [id: string]: T }
+}
+
+interface Note {
+ url: string
+ comment?: string
+ highlight?: string
+ editedAt?: Date
+ createdAt: Date
+}
+
+interface Page {
+ url: string
+ title: string
+ createdAt: Date
+ isBookmarked: boolean
+}
interface NewNoteFormState {
inputValue: string
// TODO: work out these states (may re-use from sidebar state)
}
-interface NoteState {
- id: string
- // TODO: work out individual note states
-}
-
-interface PageState {
- id: string
- noteType: NoteType
- areNotesShown: boolean
- sortingFn: AnnotationsSorter
- newNoteForm: NewNoteFormState
- notes: { [name in NoteType]: NoteState[] }
-}
-
interface ResultsByDay {
- date: Date
- pages: PageState[]
+ day: number
+ pages: NormalizedState<{
+ id: string
+ notesType: NotesType
+ areNotesShown: boolean
+ loadNotesState: TaskState
+ sortingFn: AnnotationsSorter
+ newNoteForm: NewNoteFormState
+ noteIds: { [key in NotesType]: string[] }
+ }>
}
export interface RootState {
- results: ResultsByDay[]
+ results: { [day: number]: ResultsByDay }
areAllNotesShown: boolean
searchType: 'pages' | 'notes'
- pagesLookup: { [id: string]: Page }
- notesLookup: { [id: string]: Note }
+ searchState: TaskState
+ paginationState: TaskState
+
+ pagesLookup: NormalizedState<Page>
+ notesLookup: NormalizedState<Note>
} |
98bd56c028d7ce4a4ee1e5ecee2ab539066f7491 | modules/posts/post-header-image.tsx | modules/posts/post-header-image.tsx | /* eslint-disable @next/next/no-img-element */
import * as React from 'react';
import { Container } from '~/components/layout';
export interface PostHeaderImageProps {
src: string;
alt?: string;
}
export const PostHeaderImage: React.FC<PostHeaderImageProps> = ({ alt, src }) => {
return (
<section className="px-4 lg:px-6 pt-12">
<Container>
<div className="relative w-full h-full aspect-video overflow-hidden rounded-md shadow-lg">
<img loading="lazy" src={src} alt={alt} className="object-cover" />
</div>
</Container>
</section>
);
};
| import Image from 'next/image';
import * as React from 'react';
import { Container } from '~/components/layout';
export interface PostHeaderImageProps {
src: string;
alt?: string;
}
export const PostHeaderImage: React.FC<PostHeaderImageProps> = ({ alt, src }) => {
return (
<section className="px-4 lg:px-6 pt-12">
<Container>
<div className="relative w-full h-full aspect-video overflow-hidden rounded-md shadow-lg">
<Image loading="lazy" src={src} alt={alt} layout="fill" objectFit="cover" />
</div>
</Container>
</section>
);
};
| Revert "fix image element in post header" | Revert "fix image element in post header"
This reverts commit 90c28bc053ddf8df01d177de98afc9f04af74a57.
| TypeScript | mit | resir014/resir014.xyz,resir014/resir014.xyz,resir014/resir014.xyz | ---
+++
@@ -1,4 +1,4 @@
-/* eslint-disable @next/next/no-img-element */
+import Image from 'next/image';
import * as React from 'react';
import { Container } from '~/components/layout';
@@ -12,7 +12,7 @@
<section className="px-4 lg:px-6 pt-12">
<Container>
<div className="relative w-full h-full aspect-video overflow-hidden rounded-md shadow-lg">
- <img loading="lazy" src={src} alt={alt} className="object-cover" />
+ <Image loading="lazy" src={src} alt={alt} layout="fill" objectFit="cover" />
</div>
</Container>
</section> |
b02ed6056b0158766949c892b6a7917a5dcc0860 | src/components/TabNavigation/SettingsTab.tsx | src/components/TabNavigation/SettingsTab.tsx | import * as React from 'react';
import TurkopticonSettings from '../TurkopticonSettings/TurkopticonSettings';
import AudioSettings from '../AudioSettings/AudioSettings';
import ToggleNoTO from '../TurkopticonSettings/ToggleNoTO';
import BackupUserSettings from '../BackupUserSettings/BackupUserSettings';
const SearchTab: React.SFC<{}> = () => {
return (
<div>
<BackupUserSettings />
<AudioSettings />
<ToggleNoTO />
<TurkopticonSettings />
</div>
);
};
export default SearchTab;
| import * as React from 'react';
import TurkopticonSettings from '../TurkopticonSettings/TurkopticonSettings';
import AudioSettings from '../AudioSettings/AudioSettings';
import ToggleNoTO from '../TurkopticonSettings/ToggleNoTO';
import BackupUserSettings from '../BackupUserSettings/BackupUserSettings';
const SearchTab: React.SFC<{}> = () => {
return (
<>
<BackupUserSettings />
<AudioSettings />
<ToggleNoTO />
<TurkopticonSettings />
</>
);
};
export default SearchTab;
| Return Fragment instead of wrapping <div> | Return Fragment instead of wrapping <div>
| TypeScript | mit | Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine | ---
+++
@@ -7,12 +7,12 @@
const SearchTab: React.SFC<{}> = () => {
return (
- <div>
+ <>
<BackupUserSettings />
<AudioSettings />
<ToggleNoTO />
<TurkopticonSettings />
- </div>
+ </>
);
};
|
808572f7e85eff89137a5f98c0bb7315ae118517 | src/ast/import-descriptor.ts | src/ast/import-descriptor.ts | /**
* @license
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
export class ImportDescriptor {
type: string;
url: string;
constructor(type: string, url: string) {
this.type = type;
this.url = url;
}
}
| /**
* @license
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
export class ImportDescriptor {
type: 'html-import' | 'html-script' | 'html-style' | string;
url: string;
constructor(type: string, url: string) {
this.type = type;
this.url = url;
}
}
| Add known values to the type of ImportDesriptor.type as documentation. | Add known values to the type of ImportDesriptor.type as documentation. | TypeScript | bsd-3-clause | Polymer/tools,Polymer/tools,Polymer/tools,Polymer/tools | ---
+++
@@ -7,9 +7,9 @@
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-
+
export class ImportDescriptor {
- type: string;
+ type: 'html-import' | 'html-script' | 'html-style' | string;
url: string;
constructor(type: string, url: string) { |
8ddfe04f08d25580e14001cd695b8b4710f56e99 | components/BlogPostPreview.tsx | components/BlogPostPreview.tsx | import Link from 'next/link';
import { FunctionComponent } from 'react';
import TagsList from './TagsList';
import { format } from 'date-fns';
import BlogPost from "../models/BlogPost";
import ReactMarkdown from 'react-markdown';
interface Props {
post: BlogPost
}
const BlogPostPreview: FunctionComponent<Props> = ({ post }) => {
// Without `new Date` is will sometimes crash 🤷♂️
const formattedDate = format(new Date(post.date), 'do MMMM, y')
return (
<article key={post.slug}>
<header>
<Link href={post.url}>
<a>
<h1>{post.title}</h1>
</a>
</Link>
Published { formattedDate }
{post.tags.length > 0 &&
<TagsList tags={post.tags}/>
}
</header>
<div>
<ReactMarkdown source={post.excerpt ?? post.content} />
</div>
</article>
)
}
export default BlogPostPreview;
| import Link from 'next/link';
import { FunctionComponent } from 'react';
import TagsList from './TagsList';
import { format } from 'date-fns';
import BlogPost from "../models/BlogPost";
import ReactMarkdown from 'react-markdown';
interface Props {
post: BlogPost
}
const BlogPostPreview: FunctionComponent<Props> = ({ post }) => {
// Without `new Date` is will sometimes crash 🤷♂️
const formattedDate = format(new Date(post.date), 'do MMMM, y')
return (
<article key={post.slug}>
<header>
<Link href={post.url}>
<a>
<h1>{post.title}</h1>
</a>
</Link>
Published { formattedDate }
{post.tags.length > 0 &&
<TagsList tags={post.tags}/>
}
</header>
<div>
<ReactMarkdown source={post.excerpt ?? post.content} />
{post.excerpt &&
<Link href={post.url}>
<a>Read More</a>
</Link>
}
</div>
</article>
)
}
export default BlogPostPreview;
| Add Read More link to blog posts with exerpts | Add Read More link to blog posts with exerpts
| TypeScript | mit | JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk | ---
+++
@@ -27,6 +27,11 @@
</header>
<div>
<ReactMarkdown source={post.excerpt ?? post.content} />
+ {post.excerpt &&
+ <Link href={post.url}>
+ <a>Read More</a>
+ </Link>
+ }
</div>
</article>
) |
25274cd6005ad8d43b465949b024af17d5cbf2f0 | projects/igniteui-angular/src/lib/grids/watch-changes.ts | projects/igniteui-angular/src/lib/grids/watch-changes.ts | import { SimpleChanges, SimpleChange } from '@angular/core';
/**
* @hidden
*/
export function WatchChanges(): PropertyDecorator {
return (target: any, key: string, propDesc?: PropertyDescriptor) => {
const privateKey = '_' + key.toString();
propDesc = propDesc || {
configurable: true,
enumerable: true,
};
propDesc.get = propDesc.get || (function (this: any) { return this[privateKey]; });
const originalSetter = propDesc.set || (function (this: any, val: any) { this[privateKey] = val; });
propDesc.set = function (this: any, val: any) {
const oldValue = this[key];
if (val !== oldValue) {
originalSetter.call(this, val);
if (this.ngOnChanges) {
// in case wacthed prop changes trigger ngOnChanges manually
const changes: SimpleChanges = {
[key]: new SimpleChange(oldValue, val, false)
};
this.ngOnChanges(changes);
}
}
};
return propDesc;
};
}
| import { SimpleChanges, SimpleChange } from '@angular/core';
/**
* @hidden
*/
export function WatchChanges(): PropertyDecorator {
return (target: any, key: string, propDesc?: PropertyDescriptor) => {
const privateKey = '_' + key.toString();
propDesc = propDesc || {
configurable: true,
enumerable: true,
};
propDesc.get = propDesc.get || (function (this: any) { return this[privateKey]; });
const originalSetter = propDesc.set || (function (this: any, val: any) { this[privateKey] = val; });
propDesc.set = function (this: any, val: any) {
const oldValue = this[key];
if (val !== oldValue || (typeof val === 'object' && val === oldValue)) {
originalSetter.call(this, val);
if (this.ngOnChanges) {
// in case wacthed prop changes trigger ngOnChanges manually
const changes: SimpleChanges = {
[key]: new SimpleChange(oldValue, val, false)
};
this.ngOnChanges(changes);
}
}
};
return propDesc;
};
}
| Allow @WatchChanges to trigger original setter and ngOnChanges when setting the same object reference. | chore(*): Allow @WatchChanges to trigger original setter and ngOnChanges when setting the same object reference.
| TypeScript | mit | Infragistics/zero-blocks,Infragistics/zero-blocks,Infragistics/zero-blocks | ---
+++
@@ -15,7 +15,7 @@
propDesc.set = function (this: any, val: any) {
const oldValue = this[key];
- if (val !== oldValue) {
+ if (val !== oldValue || (typeof val === 'object' && val === oldValue)) {
originalSetter.call(this, val);
if (this.ngOnChanges) {
// in case wacthed prop changes trigger ngOnChanges manually |
66e02e3ea68ed2723547f91e821d709bc6a6ce93 | src/Unosquare.Tubular2.Web/wwwroot/app/form.component.ts | src/Unosquare.Tubular2.Web/wwwroot/app/form.component.ts | import { Component, Output, EventEmitter, } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { FormGroup, FormBuilder } from '@angular/forms';
import { TubularDataService } from '@tubular2/tubular2';
@Component({
selector: 'sample-form',
templateUrl: '/app/form.component.html'
})
export class FormComponent {
request: any;
detailsForm: FormGroup;
@Output() dataRequest = new EventEmitter<any>();
constructor(private route: ActivatedRoute, public formBuilder: FormBuilder, private dataService: TubularDataService) { }
ngOnInit() {
let id: number;
this.route.params.forEach((params: Params) => {
id = params['id'];
});
if (id != undefined) {
this.getRow(id);
} else {
this.emptyRow();
}
}
getRow(id: number): void {
this.dataService.getData("http://tubular.azurewebsites.net/api/orders/" + id).subscribe(
data => { this.dataRequest.emit(data); }
);
}
emptyRow(): void {
this.detailsForm = this.formBuilder.group({
CustomerName: "",
ShippedDate: Date,
ShipperCity: ""
});
}
}
| import { Component } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { FormGroup, FormBuilder } from '@angular/forms';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { TubularDataService } from '@tubular2/tubular2';
@Component({
selector: 'sample-form',
templateUrl: '/app/form.component.html'
})
export class FormComponent {
request: any;
detailsForm: FormGroup;
private _row = new BehaviorSubject(this.emptyRow());
row = this._row.asObservable();
constructor(private route: ActivatedRoute, public formBuilder: FormBuilder, private dataService: TubularDataService) { }
ngOnInit() {
let id: number;
this.row.subscribe(() => {
this.formBuild();
});
this.route.params.forEach((params: Params) => {
id = params['id'];
});
if (id != undefined) {
this.getRow(id);
}
}
getRow(id: number): void {
this.dataService.getData("http://tubular.azurewebsites.net/api/orders/" + id).subscribe(
data => { this._row.next(data); }
);
}
formBuild(): void {
this.detailsForm = this.formBuilder.group(this._row.value);
}
emptyRow(): any {
return {
CustomerName: "",
ShippedDate: Date,
ShipperCity: ""
};
}
}
| Add observables to manipulate from data | Add observables to manipulate from data
| TypeScript | mit | unosquare/tubular2,unosquare/tubular2,unosquare/tubular2,unosquare/tubular2 | ---
+++
@@ -1,6 +1,8 @@
-import { Component, Output, EventEmitter, } from '@angular/core';
-import { Router, ActivatedRoute, Params } from '@angular/router';
+import { Component } from '@angular/core';
+import { ActivatedRoute, Params } from '@angular/router';
import { FormGroup, FormBuilder } from '@angular/forms';
+
+import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { TubularDataService } from '@tubular2/tubular2';
@@ -12,12 +14,16 @@
request: any;
detailsForm: FormGroup;
- @Output() dataRequest = new EventEmitter<any>();
+ private _row = new BehaviorSubject(this.emptyRow());
+ row = this._row.asObservable();
constructor(private route: ActivatedRoute, public formBuilder: FormBuilder, private dataService: TubularDataService) { }
ngOnInit() {
let id: number;
+ this.row.subscribe(() => {
+ this.formBuild();
+ });
this.route.params.forEach((params: Params) => {
id = params['id'];
@@ -25,22 +31,25 @@
if (id != undefined) {
this.getRow(id);
- } else {
- this.emptyRow();
}
}
getRow(id: number): void {
this.dataService.getData("http://tubular.azurewebsites.net/api/orders/" + id).subscribe(
- data => { this.dataRequest.emit(data); }
+ data => { this._row.next(data); }
);
}
- emptyRow(): void {
- this.detailsForm = this.formBuilder.group({
+ formBuild(): void {
+ this.detailsForm = this.formBuilder.group(this._row.value);
+ }
+
+
+ emptyRow(): any {
+ return {
CustomerName: "",
ShippedDate: Date,
ShipperCity: ""
- });
+ };
}
} |
2c271e7302ad13f7dc127717e49a15a982d2e678 | client/StatBlockEditor/SavedEncounterEditor.tsx | client/StatBlockEditor/SavedEncounterEditor.tsx | import { Form, Formik } from "formik";
import React = require("react");
import { SavedEncounter } from "../../common/SavedEncounter";
import { Button } from "../Components/Button";
import { TextField } from "./components/TextField";
export function SavedEncounterEditor(props: {
savedEncounter: SavedEncounter;
onSave: (newSavedEncounter: SavedEncounter) => void;
onClose: () => void;
}) {
return (
<Formik
initialValues={props.savedEncounter}
onSubmit={props.onSave}
children={api => {
return (
<Form
className="c-statblock-editor"
autoComplete="false"
translate="no"
onSubmit={api.handleSubmit}
>
<div className="c-statblock-editor__title-row">
<h2 className="c-statblock-editor__title">
Edit Saved Encounter`
</h2>
<Button
onClick={props.onClose}
tooltip="Cancel"
fontAwesomeIcon="times"
/>
<Button
onClick={api.submitForm}
tooltip="Save"
fontAwesomeIcon="save"
/>
</div>
<TextField label="Saved Encounter Name" fieldName="Name" />
<TextField label="Folder" fieldName="Path" />
</Form>
);
}}
/>
);
}
| import { Form, Formik } from "formik";
import React = require("react");
import { SavedEncounter } from "../../common/SavedEncounter";
import { Button } from "../Components/Button";
import { env } from "../Environment";
import { TextField } from "./components/TextField";
export function SavedEncounterEditor(props: {
savedEncounter: SavedEncounter;
onSave: (newSavedEncounter: SavedEncounter) => void;
onClose: () => void;
}) {
return (
<Formik
initialValues={props.savedEncounter}
onSubmit={props.onSave}
children={api => {
return (
<Form
className="c-statblock-editor"
autoComplete="false"
translate="no"
onSubmit={api.handleSubmit}
>
<div className="c-statblock-editor__title-row">
<h2 className="c-statblock-editor__title">
Edit Saved Encounter
</h2>
<Button
onClick={props.onClose}
tooltip="Cancel"
fontAwesomeIcon="times"
/>
<Button
onClick={api.submitForm}
tooltip="Save"
fontAwesomeIcon="save"
/>
</div>
<TextField label="Saved Encounter Name" fieldName="Name" />
<TextField label="Folder" fieldName="Path" />
{env.HasEpicInitiative && (
<TextField
label="Background Image URL"
fieldName="BackgroundImageUrl"
/>
)}
</Form>
);
}}
/>
);
}
| Add Background Image URL field | Add Background Image URL field
| TypeScript | mit | cynicaloptimist/improved-initiative,cynicaloptimist/improved-initiative,cynicaloptimist/improved-initiative | ---
+++
@@ -2,6 +2,7 @@
import React = require("react");
import { SavedEncounter } from "../../common/SavedEncounter";
import { Button } from "../Components/Button";
+import { env } from "../Environment";
import { TextField } from "./components/TextField";
export function SavedEncounterEditor(props: {
@@ -23,7 +24,7 @@
>
<div className="c-statblock-editor__title-row">
<h2 className="c-statblock-editor__title">
- Edit Saved Encounter`
+ Edit Saved Encounter
</h2>
<Button
onClick={props.onClose}
@@ -39,6 +40,12 @@
<TextField label="Saved Encounter Name" fieldName="Name" />
<TextField label="Folder" fieldName="Path" />
+ {env.HasEpicInitiative && (
+ <TextField
+ label="Background Image URL"
+ fieldName="BackgroundImageUrl"
+ />
+ )}
</Form>
);
}} |
5d4e50ebea377986e73d526bac3d10dce8470402 | projects/ng-bootstrap-form-validation/src/lib/ng-bootstrap-form-validation.module.ts | projects/ng-bootstrap-form-validation/src/lib/ng-bootstrap-form-validation.module.ts | import { CommonModule } from "@angular/common";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { FormValidationDirective } from "./Directives/form-validation.directive";
import { MessagesComponent } from "./Components/messages/messages.component";
import { ErrorMessageService } from "./Services/error-message.service";
import { CUSTOM_ERROR_MESSAGES, BOOTSTRAP_VERSION } from "./Tokens/tokens";
import { BootstrapVersion } from "./Enums/BootstrapVersion";
import { FormGroupComponent } from "./Components/form-group/form-group.component";
import { NgBootstrapFormValidationModuleOptions } from "./Models/NgBootstrapFormValidationModuleOptions";
import { FormControlDirective } from "./Directives/form-control.directive";
@NgModule({
imports: [CommonModule],
declarations: [
FormValidationDirective,
FormGroupComponent,
MessagesComponent,
FormControlDirective
],
exports: [
FormValidationDirective,
FormGroupComponent,
MessagesComponent,
FormControlDirective
]
})
export class NgBootstrapFormValidationModule {
static forRoot(
userOptions: NgBootstrapFormValidationModuleOptions = {
bootstrapVersion: BootstrapVersion.Four
}
): ModuleWithProviders {
return {
ngModule: NgBootstrapFormValidationModule,
providers: [
{
provide: CUSTOM_ERROR_MESSAGES,
useValue: userOptions.customErrorMessages,
multi: true
},
{
provide: BOOTSTRAP_VERSION,
useValue: userOptions.bootstrapVersion
},
ErrorMessageService
]
};
}
}
| import { CommonModule } from "@angular/common";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { FormValidationDirective } from "./Directives/form-validation.directive";
import { MessagesComponent } from "./Components/messages/messages.component";
import { ErrorMessageService } from "./Services/error-message.service";
import { CUSTOM_ERROR_MESSAGES, BOOTSTRAP_VERSION } from "./Tokens/tokens";
import { BootstrapVersion } from "./Enums/BootstrapVersion";
import { FormGroupComponent } from "./Components/form-group/form-group.component";
import { NgBootstrapFormValidationModuleOptions } from "./Models/NgBootstrapFormValidationModuleOptions";
import { FormControlDirective } from "./Directives/form-control.directive";
@NgModule({
imports: [CommonModule],
declarations: [
FormValidationDirective,
FormGroupComponent,
MessagesComponent,
FormControlDirective
],
exports: [
FormValidationDirective,
FormGroupComponent,
MessagesComponent,
FormControlDirective
]
})
export class NgBootstrapFormValidationModule {
static forRoot(
userOptions: NgBootstrapFormValidationModuleOptions = {
bootstrapVersion: BootstrapVersion.Four
}
): ModuleWithProviders {
return {
ngModule: NgBootstrapFormValidationModule,
providers: [
{
provide: CUSTOM_ERROR_MESSAGES,
useValue: userOptions.customErrorMessages || [],
multi: true
},
{
provide: BOOTSTRAP_VERSION,
useValue: userOptions.bootstrapVersion
},
ErrorMessageService
]
};
}
}
| Add fallthrough empty array for customErrorMessages | Add fallthrough empty array for customErrorMessages
| TypeScript | mit | third774/ng-bootstrap-form-validation,third774/ng-bootstrap-form-validation,third774/ng-bootstrap-form-validation | ---
+++
@@ -35,7 +35,7 @@
providers: [
{
provide: CUSTOM_ERROR_MESSAGES,
- useValue: userOptions.customErrorMessages,
+ useValue: userOptions.customErrorMessages || [],
multi: true
},
{ |
4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 | extensions/typescript-language-features/src/test/index.ts | extensions/typescript-language-features/src/test/index.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
//
// This file is providing the test runner to use when running extension tests.
// By default the test runner in use is Mocha based.
//
// You can provide your own test runner if you want to override it by exporting
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
// host can call to run the tests. The test runner is expected to use console.log
// to report the results back to the caller. When the tests are finished, return
// a possible error to the callback or null if none.
const testRunner = require('vscode/lib/testrunner');
// You can directly control Mocha options by uncommenting the following lines
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
testRunner.configure({
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle)
timeout: 60000,
grep: 'References'
});
export = testRunner;
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
//
// This file is providing the test runner to use when running extension tests.
// By default the test runner in use is Mocha based.
//
// You can provide your own test runner if you want to override it by exporting
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
// host can call to run the tests. The test runner is expected to use console.log
// to report the results back to the caller. When the tests are finished, return
// a possible error to the callback or null if none.
const testRunner = require('vscode/lib/testrunner');
// You can directly control Mocha options by uncommenting the following lines
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
testRunner.configure({
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle)
timeout: 60000,
});
export = testRunner;
| Remove grep for ts tests | Remove grep for ts tests
| TypeScript | mit | microsoft/vscode,the-ress/vscode,microsoft/vscode,Microsoft/vscode,the-ress/vscode,microsoft/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,hoovercj/vscode,microsoft/vscode,Microsoft/vscode,eamodio/vscode,Microsoft/vscode,hoovercj/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,hoovercj/vscode,joaomoreno/vscode,eamodio/vscode,the-ress/vscode,hoovercj/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,the-ress/vscode,eamodio/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,hoovercj/vscode,Microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,joaomoreno/vscode,eamodio/vscode,hoovercj/vscode,microsoft/vscode,eamodio/vscode,joaomoreno/vscode,Microsoft/vscode,hoovercj/vscode,joaomoreno/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,joaomoreno/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,joaomoreno/vscode,eamodio/vscode,microsoft/vscode,the-ress/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,the-ress/vscode,Microsoft/vscode,Microsoft/vscode,joaomoreno/vscode,Microsoft/vscode,Microsoft/vscode,eamodio/vscode,Microsoft/vscode,joaomoreno/vscode,hoovercj/vscode,joaomoreno/vscode,eamodio/vscode,joaomoreno/vscode,Microsoft/vscode,Microsoft/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,hoovercj/vscode,the-ress/vscode,Microsoft/vscode,the-ress/vscode,microsoft/vscode,joaomoreno/vscode,joaomoreno/vscode,hoovercj/vscode,microsoft/vscode,joaomoreno/vscode,eamodio/vscode,eamodio/vscode,hoovercj/vscode,hoovercj/vscode,the-ress/vscode,Microsoft/vscode,the-ress/vscode,hoovercj/vscode,hoovercj/vscode,microsoft/vscode,the-ress/vscode,the-ress/vscode,eamodio/vscode,the-ress/vscode,the-ress/vscode,the-ress/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,the-ress/vscode,eamodio/vscode,eamodio/vscode,joaomoreno/vscode,hoovercj/vscode | ---
+++
@@ -23,7 +23,6 @@
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'), // colored output from test results (only windows cannot handle)
timeout: 60000,
- grep: 'References'
});
export = testRunner; |
fc62c22205b4b9e6a4c52a33e60c1377466ce90d | applications/desktop/src/main/prepare-env.ts | applications/desktop/src/main/prepare-env.ts | import shellEnv from "shell-env";
import { from } from "rxjs";
import { first, tap, publishReplay } from "rxjs/operators";
// Bring in the current user's environment variables from running a shell session so that
// launchctl on the mac and the windows process manager propagate the proper values for the
// user
//
// TODO: This should be cased off for when the user is already in a proper shell session (possibly launched
// from the nteract CLI
const env$ = from(shellEnv()).pipe(
first(),
tap(env => {
// no need to change the env if started from the terminal on Mac
if (
process.platform !== "darwin" ||
(process.env != null && process.env.TERM == null)
) {
Object.assign(process.env, env);
}
}),
publishReplay(1)
);
// $FlowFixMe
env$.connect();
export default env$;
| import shellEnv from "shell-env";
import { ConnectableObservable, from } from "rxjs";
import { first, tap, publishReplay } from "rxjs/operators";
// Bring in the current user's environment variables from running a shell session so that
// launchctl on the mac and the windows process manager propagate the proper values for the
// user
//
// TODO: This should be cased off for when the user is already in a proper shell session (possibly launched
// from the nteract CLI
const env$ = from(shellEnv()).pipe(
first(),
tap(env => {
// no need to change the env if started from the terminal on Mac
if (
process.platform !== "darwin" ||
(process.env != null && process.env.TERM == null)
) {
Object.assign(process.env, env);
}
}),
publishReplay(1)
);
(env$ as ConnectableObservable<{}>).connect();
export default env$;
| Add workaround for ConnectableObservable type error | Add workaround for ConnectableObservable type error
| TypeScript | bsd-3-clause | nteract/nteract,nteract/composition,nteract/composition,nteract/nteract,nteract/nteract,nteract/composition,nteract/nteract,nteract/nteract | ---
+++
@@ -1,5 +1,5 @@
import shellEnv from "shell-env";
-import { from } from "rxjs";
+import { ConnectableObservable, from } from "rxjs";
import { first, tap, publishReplay } from "rxjs/operators";
// Bring in the current user's environment variables from running a shell session so that
@@ -22,7 +22,6 @@
publishReplay(1)
);
-// $FlowFixMe
-env$.connect();
+(env$ as ConnectableObservable<{}>).connect();
export default env$; |
1fb4a65027ca01b4a193090144273d7b5022de68 | src/app/plugins/platform/Docker/installGesso.ts | src/app/plugins/platform/Docker/installGesso.ts | import decompress from 'decompress';
import fetch from 'node-fetch';
import { posix } from 'path';
import { URL } from 'url';
export interface InstallGessoOptions {
repository: string;
branch: string;
targetPath: string;
}
async function installGesso({
branch,
repository,
targetPath: target,
}: InstallGessoOptions) {
const endpoint = new URL('https://github.com');
endpoint.pathname = posix.join(
'forumone',
repository,
'archive',
`${branch}.zip`,
);
const response = await fetch(String(endpoint));
if (!response.ok) {
const { status, statusText, url } = response;
throw new Error(`fetch(${url}): ${status} ${statusText}`);
}
const buffer = await response.buffer();
await decompress(buffer, target, { strip: 1 });
}
export default installGesso;
| import decompress from 'decompress';
import fetch from 'node-fetch';
import { posix } from 'path';
import { URL } from 'url';
import { existsSync, promises as fs } from 'fs';
export interface InstallGessoOptions {
repository: string;
branch: string;
targetPath: string;
}
async function installGesso({
branch,
repository,
targetPath: target,
}: InstallGessoOptions) {
const endpoint = new URL('https://github.com');
endpoint.pathname = posix.join(
'forumone',
repository,
'archive',
`${branch}.zip`,
);
const response = await fetch(String(endpoint));
if (!response.ok) {
const { status, statusText, url } = response;
throw new Error(`fetch(${url}): ${status} ${statusText}`);
}
const buffer = await response.buffer();
await decompress(buffer, target, {
strip: 1,
// Filter out files used for development of Gesso itself.
filter: file =>
posix.basename(file.path).indexOf('docker-compose') !== 0 &&
posix.dirname(file.path).indexOf('.buildkite') === -1,
});
// Remove the .buildkite directory.
const buildkiteDir = posix.join(target, '.buildkite');
if (existsSync(buildkiteDir)) {
await fs.rmdir(buildkiteDir);
}
}
export default installGesso;
| Remove docker-compose and Buildkite files from Gesso | Remove docker-compose and Buildkite files from Gesso
| TypeScript | mit | forumone/generator-web-starter,forumone/generator-web-starter,forumone/generator-web-starter,forumone/generator-web-starter,forumone/generator-web-starter | ---
+++
@@ -2,6 +2,7 @@
import fetch from 'node-fetch';
import { posix } from 'path';
import { URL } from 'url';
+import { existsSync, promises as fs } from 'fs';
export interface InstallGessoOptions {
repository: string;
@@ -31,7 +32,19 @@
const buffer = await response.buffer();
- await decompress(buffer, target, { strip: 1 });
+ await decompress(buffer, target, {
+ strip: 1,
+ // Filter out files used for development of Gesso itself.
+ filter: file =>
+ posix.basename(file.path).indexOf('docker-compose') !== 0 &&
+ posix.dirname(file.path).indexOf('.buildkite') === -1,
+ });
+
+ // Remove the .buildkite directory.
+ const buildkiteDir = posix.join(target, '.buildkite');
+ if (existsSync(buildkiteDir)) {
+ await fs.rmdir(buildkiteDir);
+ }
}
export default installGesso; |
276f88c4d54729e2627c33964dc5c81475e3052f | jquery.postMessage/jquery.postMessage-test.ts | jquery.postMessage/jquery.postMessage-test.ts | /// <reference path="jquery.postMessage.d.ts" />
/// <reference path="../jquery/jquery.d.ts" />
function test_postMessage() {
// post plain message
$.postMessage('test message', 'http://dummy.url/', parent);
// post object message
$.postMessage({
'a': '1',
'b': '2'
}, 'http://dummy.url/', parent);
};
function test_receiveMessage() {
// receive plain source origin
$.receiveMessage((e) => {
// e is an instance of MessageEvent
console.log(e.data);
console.log(e.source);
console.log(e.origin);
}, 'http://dummy.url');
// receive source origin callback
$.receiveMessage((e) => {}, (sourceOrigin) => {
return sourceOrigin === 'http://dummy.url';
}, 100);
}; | /// <reference path="jquery.postMessage.d.ts" />
/// <reference path="../jquery/jquery.d.ts" />
function test_postMessage() {
// post plain message
$.postMessage('test message', 'http://dummy.url/', parent);
// post object message
$.postMessage({
'a': '1',
'b': '2'
}, 'http://dummy.url/', parent);
};
function test_receiveMessage() {
// receive plain source origin
$.receiveMessage((e) => {
// e is an instance of MessageEvent
console.log(e.data);
console.log(e.source);
console.log(e.origin);
}, 'http://dummy.url');
// receive source origin callback
$.receiveMessage((e) => {}, (sourceOrigin) => {
return sourceOrigin === 'http://dummy.url';
}, 100);
};
| Add new line at the end of the test file. | Add new line at the end of the test file.
| TypeScript | mit | panuhorsmalahti/DefinitelyTyped,masonkmeyer/DefinitelyTyped,takfjt/DefinitelyTyped,rerezz/DefinitelyTyped,the41/DefinitelyTyped,opichals/DefinitelyTyped,GiedriusGrabauskas/DefinitelyTyped,pocke/DefinitelyTyped,scsouthw/DefinitelyTyped,rcchen/DefinitelyTyped,psnider/DefinitelyTyped,raijinsetsu/DefinitelyTyped,nakakura/DefinitelyTyped,scatcher/DefinitelyTyped,gedaiu/DefinitelyTyped,furny/DefinitelyTyped,martinduparc/DefinitelyTyped,DeluxZ/DefinitelyTyped,vpineda1996/DefinitelyTyped,laco0416/DefinitelyTyped,mcrawshaw/DefinitelyTyped,DenEwout/DefinitelyTyped,pocesar/DefinitelyTyped,use-strict/DefinitelyTyped,Kuniwak/DefinitelyTyped,samdark/DefinitelyTyped,stephenjelfs/DefinitelyTyped,drillbits/DefinitelyTyped,bdoss/DefinitelyTyped,OpenMaths/DefinitelyTyped,jimthedev/DefinitelyTyped,laball/DefinitelyTyped,tomtarrot/DefinitelyTyped,kuon/DefinitelyTyped,mrk21/DefinitelyTyped,HereSinceres/DefinitelyTyped,gcastre/DefinitelyTyped,dumbmatter/DefinitelyTyped,psnider/DefinitelyTyped,glenndierckx/DefinitelyTyped,lukehoban/DefinitelyTyped,Riron/DefinitelyTyped,shiwano/DefinitelyTyped,syuilo/DefinitelyTyped,xica/DefinitelyTyped,acepoblete/DefinitelyTyped,sergey-buturlakin/DefinitelyTyped,Syati/DefinitelyTyped,vagarenko/DefinitelyTyped,pafflique/DefinitelyTyped,lightswitch05/DefinitelyTyped,duongphuhiep/DefinitelyTyped,timramone/DefinitelyTyped,MugeSo/DefinitelyTyped,billccn/DefinitelyTyped,one-pieces/DefinitelyTyped,mareek/DefinitelyTyped,benishouga/DefinitelyTyped,cherrydev/DefinitelyTyped,mszczepaniak/DefinitelyTyped,donnut/DefinitelyTyped,Gmulti/DefinitelyTyped,applesaucers/lodash-invokeMap,mjjames/DefinitelyTyped,CodeZombieCH/DefinitelyTyped,abmohan/DefinitelyTyped,Nemo157/DefinitelyTyped,nabeix/DefinitelyTyped,fnipo/DefinitelyTyped,olemp/DefinitelyTyped,Almouro/DefinitelyTyped,magny/DefinitelyTyped,Ptival/DefinitelyTyped,musakarakas/DefinitelyTyped,optical/DefinitelyTyped,akonwi/DefinitelyTyped,schmuli/DefinitelyTyped,vincentw56/DefinitelyTyped,jraymakers/DefinitelyTyped,duncanmak/DefinitelyTyped,TrabacchinLuigi/DefinitelyTyped,GlennQuirynen/DefinitelyTyped,chadoliver/DefinitelyTyped,leoromanovsky/DefinitelyTyped,alvarorahul/DefinitelyTyped,teddyward/DefinitelyTyped,SebastianCoetzee/DefinitelyTyped,blink1073/DefinitelyTyped,shovon/DefinitelyTyped,arma-gast/DefinitelyTyped,behzad888/DefinitelyTyped,gandjustas/DefinitelyTyped,newclear/DefinitelyTyped,benishouga/DefinitelyTyped,iCoreSolutions/DefinitelyTyped,georgemarshall/DefinitelyTyped,rolandzwaga/DefinitelyTyped,vasek17/DefinitelyTyped,spearhead-ea/DefinitelyTyped,Litee/DefinitelyTyped,mattblang/DefinitelyTyped,eekboom/DefinitelyTyped,greglo/DefinitelyTyped,dariajung/DefinitelyTyped,xswordsx/DefinitelyTyped,jacqt/DefinitelyTyped,theyelllowdart/DefinitelyTyped,ashwinr/DefinitelyTyped,Karabur/DefinitelyTyped,deeleman/DefinitelyTyped,johnnycrab/DefinitelyTyped,tan9/DefinitelyTyped,KonaTeam/DefinitelyTyped,emanuelhp/DefinitelyTyped,haskellcamargo/DefinitelyTyped,takenet/DefinitelyTyped,arusakov/DefinitelyTyped,mjjames/DefinitelyTyped,yuit/DefinitelyTyped,cesarmarinhorj/DefinitelyTyped,smrq/DefinitelyTyped,tigerxy/DefinitelyTyped,GlennQuirynen/DefinitelyTyped,philippsimon/DefinitelyTyped,syuilo/DefinitelyTyped,bridge-ufsc/DefinitelyTyped,muenchdo/DefinitelyTyped,frogcjn/DefinitelyTyped,jpevarnek/DefinitelyTyped,ayanoin/DefinitelyTyped,igorraush/DefinitelyTyped,rschmukler/DefinitelyTyped,ducin/DefinitelyTyped,QuatroCode/DefinitelyTyped,fishgoh0nk/DefinitelyTyped,darkl/DefinitelyTyped,DustinWehr/DefinitelyTyped,benliddicott/DefinitelyTyped,nitintutlani/DefinitelyTyped,mendix/DefinitelyTyped,jasonswearingen/DefinitelyTyped,hypno2000/typings,bpowers/DefinitelyTyped,Zorgatone/DefinitelyTyped,bayitajesi/DefinitelyTyped,johnnycrab/DefinitelyTyped,GodsBreath/DefinitelyTyped,sandersky/DefinitelyTyped,gandjustas/DefinitelyTyped,gdi2290/DefinitelyTyped,dsebastien/DefinitelyTyped,uestcNaldo/DefinitelyTyped,amanmahajan7/DefinitelyTyped,EnableSoftware/DefinitelyTyped,wkrueger/DefinitelyTyped,HPFOD/DefinitelyTyped,robert-voica/DefinitelyTyped,awerlang/DefinitelyTyped,TanakaYutaro/DefinitelyTyped,borisyankov/DefinitelyTyped,Trapulo/DefinitelyTyped,forumone/DefinitelyTyped,stanislavHamara/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,nainslie/DefinitelyTyped,fredgalvao/DefinitelyTyped,ciriarte/DefinitelyTyped,angelobelchior8/DefinitelyTyped,lekaha/DefinitelyTyped,chrootsu/DefinitelyTyped,YousefED/DefinitelyTyped,TrabacchinLuigi/DefinitelyTyped,slavomirvojacek/DefinitelyTyped,ajtowf/DefinitelyTyped,AyaMorisawa/DefinitelyTyped,icereed/DefinitelyTyped,smrq/DefinitelyTyped,chbrown/DefinitelyTyped,DzmitryDulko/DefinitelyTyped,bencoveney/DefinitelyTyped,alexdresko/DefinitelyTyped,Garciat/DefinitelyTyped,esperco/DefinitelyTyped,abner/DefinitelyTyped,sledorze/DefinitelyTyped,GiedriusGrabauskas/DefinitelyTyped,iislucas/DefinitelyTyped,drinchev/DefinitelyTyped,drinchev/DefinitelyTyped,alextkachman/DefinitelyTyped,stephenjelfs/DefinitelyTyped,mrozhin/DefinitelyTyped,ryan10132/DefinitelyTyped,bobslaede/DefinitelyTyped,schmuli/DefinitelyTyped,MarlonFan/DefinitelyTyped,kabogo/DefinitelyTyped,corps/DefinitelyTyped,unknownloner/DefinitelyTyped,scriby/DefinitelyTyped,rushi216/DefinitelyTyped,kalloc/DefinitelyTyped,jccarvalhosa/DefinitelyTyped,paulmorphy/DefinitelyTyped,bluong/DefinitelyTyped,dydek/DefinitelyTyped,jraymakers/DefinitelyTyped,Pipe-shen/DefinitelyTyped,wbuchwalter/DefinitelyTyped,ryan-codingintrigue/DefinitelyTyped,gyohk/DefinitelyTyped,mcliment/DefinitelyTyped,lbesson/DefinitelyTyped,DeadAlready/DefinitelyTyped,gildorwang/DefinitelyTyped,hafenr/DefinitelyTyped,gregoryagu/DefinitelyTyped,Softpagehomeware/DefinitelyTyped,bennett000/DefinitelyTyped,axelcostaspena/DefinitelyTyped,RedSeal-co/DefinitelyTyped,isman-usoh/DefinitelyTyped,frogcjn/DefinitelyTyped,mvarblow/DefinitelyTyped,Syati/DefinitelyTyped,shiwano/DefinitelyTyped,nycdotnet/DefinitelyTyped,AGBrown/DefinitelyTyped-ABContrib,hellopao/DefinitelyTyped,panuhorsmalahti/DefinitelyTyped,richardTowers/DefinitelyTyped,UzEE/DefinitelyTyped,M-Zuber/DefinitelyTyped,erosb/DefinitelyTyped,reppners/DefinitelyTyped,basp/DefinitelyTyped,jtlan/DefinitelyTyped,mcrawshaw/DefinitelyTyped,arcticwaters/DefinitelyTyped,tgfjt/DefinitelyTyped,bkristensen/DefinitelyTyped,nmalaguti/DefinitelyTyped,timjk/DefinitelyTyped,sixinli/DefinitelyTyped,alexdresko/DefinitelyTyped,nojaf/DefinitelyTyped,wcomartin/DefinitelyTyped,aindlq/DefinitelyTyped,isman-usoh/DefinitelyTyped,bdoss/DefinitelyTyped,minodisk/DefinitelyTyped,greglo/DefinitelyTyped,tscho/DefinitelyTyped,vsavkin/DefinitelyTyped,olivierlemasle/DefinitelyTyped,Wordenskjold/DefinitelyTyped,Softpagehomeware/DefinitelyTyped,vote539/DefinitelyTyped,innerverse/DefinitelyTyped,wilfrem/DefinitelyTyped,igorsechyn/DefinitelyTyped,ml-workshare/DefinitelyTyped,nmalaguti/DefinitelyTyped,tjoskar/DefinitelyTyped,kmeurer/DefinitelyTyped,alainsahli/DefinitelyTyped,jasonswearingen/DefinitelyTyped,pwelter34/DefinitelyTyped,IAPark/DefinitelyTyped,RX14/DefinitelyTyped,bayitajesi/DefinitelyTyped,OpenMaths/DefinitelyTyped,abbasmhd/DefinitelyTyped,dragouf/DefinitelyTyped,borisyankov/DefinitelyTyped,Fraegle/DefinitelyTyped,hor-crux/DefinitelyTyped,progre/DefinitelyTyped,hellopao/DefinitelyTyped,ahmedalsudani/DefinitelyTyped,teves-castro/DefinitelyTyped,rockclimber90/DefinitelyTyped,miguelmq/DefinitelyTyped,damianog/DefinitelyTyped,mhegazy/DefinitelyTyped,wilfrem/DefinitelyTyped,mshmelev/DefinitelyTyped,johan-gorter/DefinitelyTyped,slavomirvojacek/adbrain-typescript-definitions,subash-a/DefinitelyTyped,aciccarello/DefinitelyTyped,superduper/DefinitelyTyped,adammartin1981/DefinitelyTyped,nakakura/DefinitelyTyped,munxar/DefinitelyTyped,laurentiustamate94/DefinitelyTyped,Saneyan/DefinitelyTyped,UzEE/DefinitelyTyped,pkhayundi/DefinitelyTyped,dreampulse/DefinitelyTyped,jsaelhof/DefinitelyTyped,RX14/DefinitelyTyped,jiaz/DefinitelyTyped,paxibay/DefinitelyTyped,glenndierckx/DefinitelyTyped,goaty92/DefinitelyTyped,behzad88/DefinitelyTyped,DzmitryDulko/DefinitelyTyped,ErykB2000/DefinitelyTyped,PopSugar/DefinitelyTyped,Zzzen/DefinitelyTyped,Minishlink/DefinitelyTyped,florentpoujol/DefinitelyTyped,emanuelhp/DefinitelyTyped,raijinsetsu/DefinitelyTyped,cvrajeesh/DefinitelyTyped,trystanclarke/DefinitelyTyped,Shiak1/DefinitelyTyped,Chris380/DefinitelyTyped,markogresak/DefinitelyTyped,pocesar/DefinitelyTyped,psnider/DefinitelyTyped,sergey-buturlakin/DefinitelyTyped,greglockwood/DefinitelyTyped,jimthedev/DefinitelyTyped,dwango-js/DefinitelyTyped,Karabur/DefinitelyTyped,vagarenko/DefinitelyTyped,jaysoo/DefinitelyTyped,bennett000/DefinitelyTyped,MugeSo/DefinitelyTyped,schmuli/DefinitelyTyped,jeffbcross/DefinitelyTyped,AgentME/DefinitelyTyped,PascalSenn/DefinitelyTyped,use-strict/DefinitelyTyped,newclear/DefinitelyTyped,zalamtech/DefinitelyTyped,aroder/DefinitelyTyped,sledorze/DefinitelyTyped,TildaLabs/DefinitelyTyped,georgemarshall/DefinitelyTyped,Jwsonic/DefinitelyTyped,LordJZ/DefinitelyTyped,Pro/DefinitelyTyped,micurs/DefinitelyTyped,Ridermansb/DefinitelyTyped,moonpyk/DefinitelyTyped,zuohaocheng/DefinitelyTyped,hiraash/DefinitelyTyped,chocolatechipui/DefinitelyTyped,onecentlin/DefinitelyTyped,omidkrad/DefinitelyTyped,giggio/DefinitelyTyped,philippsimon/DefinitelyTyped,bardt/DefinitelyTyped,dmoonfire/DefinitelyTyped,rfranco/DefinitelyTyped,gcastre/DefinitelyTyped,slavomirvojacek/DefinitelyTyped,syntax42/DefinitelyTyped,Seltzer/DefinitelyTyped,nelsonmorais/DefinitelyTyped,tan9/DefinitelyTyped,CSharpFan/DefinitelyTyped,bridge-ufsc/DefinitelyTyped,progre/DefinitelyTyped,michalczukm/DefinitelyTyped,arusakov/DefinitelyTyped,chrismbarr/DefinitelyTyped,tgfjt/DefinitelyTyped,AgentME/DefinitelyTyped,arusakov/DefinitelyTyped,tomtheisen/DefinitelyTyped,Ptival/DefinitelyTyped,OfficeDev/DefinitelyTyped,musicist288/DefinitelyTyped,dydek/DefinitelyTyped,nobuoka/DefinitelyTyped,Dashlane/DefinitelyTyped,robl499/DefinitelyTyped,damianog/DefinitelyTyped,shlomiassaf/DefinitelyTyped,AgentME/DefinitelyTyped,pocesar/DefinitelyTyped,chrilith/DefinitelyTyped,zhiyiting/DefinitelyTyped,almstrand/DefinitelyTyped,akonwi/DefinitelyTyped,dsebastien/DefinitelyTyped,danfma/DefinitelyTyped,davidsidlinger/DefinitelyTyped,mwain/DefinitelyTyped,nfriend/DefinitelyTyped,onecentlin/DefinitelyTyped,NelsonLamprecht/DefinitelyTyped,takenet/DefinitelyTyped,MidnightDesign/DefinitelyTyped,JaminFarr/DefinitelyTyped,Bunkerbewohner/DefinitelyTyped,fredgalvao/DefinitelyTyped,robertbaker/DefinitelyTyped,zuzusik/DefinitelyTyped,bilou84/DefinitelyTyped,jsaelhof/DefinitelyTyped,tdmckinn/DefinitelyTyped,Dashlane/DefinitelyTyped,jesseschalken/DefinitelyTyped,bruennijs/DefinitelyTyped,lbguilherme/DefinitelyTyped,davidpricedev/DefinitelyTyped,danfma/DefinitelyTyped,slavomirvojacek/adbrain-typescript-definitions,hatz48/DefinitelyTyped,mshmelev/DefinitelyTyped,shahata/DefinitelyTyped,ajtowf/DefinitelyTyped,aqua89/DefinitelyTyped,arueckle/DefinitelyTyped,EnableSoftware/DefinitelyTyped,Zorgatone/DefinitelyTyped,aciccarello/DefinitelyTyped,modifyink/DefinitelyTyped,rolandzwaga/DefinitelyTyped,bjfletcher/DefinitelyTyped,philippstucki/DefinitelyTyped,xStrom/DefinitelyTyped,felipe3dfx/DefinitelyTyped,tboyce/DefinitelyTyped,ashwinr/DefinitelyTyped,mattanja/DefinitelyTyped,QuatroCode/DefinitelyTyped,arma-gast/DefinitelyTyped,chrootsu/DefinitelyTyped,kanreisa/DefinitelyTyped,dmoonfire/DefinitelyTyped,johnnycrab/DefinitelyTyped,aciccarello/DefinitelyTyped,zensh/DefinitelyTyped,scriby/DefinitelyTyped,benishouga/DefinitelyTyped,stacktracejs/DefinitelyTyped,amanmahajan7/DefinitelyTyped,zuzusik/DefinitelyTyped,nodeframe/DefinitelyTyped,evansolomon/DefinitelyTyped,applesaucers/lodash-invokeMap,Zenorbi/DefinitelyTyped,AgentME/DefinitelyTyped,nobuoka/DefinitelyTyped,egeland/DefinitelyTyped,nseckinoral/DefinitelyTyped,AyaMorisawa/DefinitelyTyped,Seikho/DefinitelyTyped,algorithme/DefinitelyTyped,mweststrate/DefinitelyTyped,digitalpixies/DefinitelyTyped,eugenpodaru/DefinitelyTyped,tarruda/DefinitelyTyped,olemp/DefinitelyTyped,NCARalph/DefinitelyTyped,iislucas/DefinitelyTyped,CodeZombieCH/DefinitelyTyped,maglar0/DefinitelyTyped,hellopao/DefinitelyTyped,lseguin42/DefinitelyTyped,martinduparc/DefinitelyTyped,grahammendick/DefinitelyTyped,magny/DefinitelyTyped,HPFOD/DefinitelyTyped,gyohk/DefinitelyTyped,fearthecowboy/DefinitelyTyped,daptiv/DefinitelyTyped,florentpoujol/DefinitelyTyped,hatz48/DefinitelyTyped,elisee/DefinitelyTyped,yuit/DefinitelyTyped,abbasmhd/DefinitelyTyped,pwelter34/DefinitelyTyped,subjectix/DefinitelyTyped,Litee/DefinitelyTyped,aldo-roman/DefinitelyTyped,georgemarshall/DefinitelyTyped,paulmorphy/DefinitelyTyped,mattblang/DefinitelyTyped,shlomiassaf/DefinitelyTyped,BrandonCKrueger/DefinitelyTyped,dflor003/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,Pro/DefinitelyTyped,alvarorahul/DefinitelyTyped,brainded/DefinitelyTyped,nainslie/DefinitelyTyped,nycdotnet/DefinitelyTyped,behzad888/DefinitelyTyped,adamcarr/DefinitelyTyped,reppners/DefinitelyTyped,samwgoldman/DefinitelyTyped,whoeverest/DefinitelyTyped,flyfishMT/DefinitelyTyped,Zzzen/DefinitelyTyped,WritingPanda/DefinitelyTyped,abner/DefinitelyTyped,amir-arad/DefinitelyTyped,modifyink/DefinitelyTyped,hesselink/DefinitelyTyped,sclausen/DefinitelyTyped,herrmanno/DefinitelyTyped,xStrom/DefinitelyTyped,bobslaede/DefinitelyTyped,Deathspike/DefinitelyTyped,Bobjoy/DefinitelyTyped,Lorisu/DefinitelyTyped,Wordenskjold/DefinitelyTyped,dpsthree/DefinitelyTyped,brettle/DefinitelyTyped,esperco/DefinitelyTyped,akonwi/DefinitelyTyped,johan-gorter/DefinitelyTyped,donnut/DefinitelyTyped,Dominator008/DefinitelyTyped,vote539/DefinitelyTyped,musically-ut/DefinitelyTyped,mareek/DefinitelyTyped,stacktracejs/DefinitelyTyped,ecramer89/DefinitelyTyped,minodisk/DefinitelyTyped,mattanja/DefinitelyTyped,zuzusik/DefinitelyTyped,Penryn/DefinitelyTyped,chrismbarr/DefinitelyTyped,georgemarshall/DefinitelyTyped,tinganho/DefinitelyTyped,subash-a/DefinitelyTyped,gorcz/DefinitelyTyped,miguelmq/DefinitelyTyped,manekovskiy/DefinitelyTyped,optical/DefinitelyTyped,jbrantly/DefinitelyTyped,bayitajesi/DefinitelyTyped,rschmukler/DefinitelyTyped,Carreau/DefinitelyTyped,mhegazy/DefinitelyTyped,Mek7/DefinitelyTyped,egeland/DefinitelyTyped,jimthedev/DefinitelyTyped,alextkachman/DefinitelyTyped,arcticwaters/DefinitelyTyped,YousefED/DefinitelyTyped,biomassives/DefinitelyTyped,TheBay0r/DefinitelyTyped,hx0day/DefinitelyTyped,martinduparc/DefinitelyTyped,quantumman/DefinitelyTyped,nitintutlani/DefinitelyTyped,elisee/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,Penryn/DefinitelyTyped,sclausen/DefinitelyTyped,jeremyhayes/DefinitelyTyped,stylelab-io/DefinitelyTyped,lucyhe/DefinitelyTyped,evandrewry/DefinitelyTyped,flyfishMT/DefinitelyTyped,teves-castro/DefinitelyTyped,maxlang/DefinitelyTyped,trystanclarke/DefinitelyTyped,davidpricedev/DefinitelyTyped,rcchen/DefinitelyTyped,brentonhouse/DefinitelyTyped,Dominator008/DefinitelyTyped,GregOnNet/DefinitelyTyped,philippstucki/DefinitelyTyped | |
429e524b52cf6d015d721b481b6a87d608c75a19 | generators/target/templates/app/components/about/components/ng-react/index.tsx | generators/target/templates/app/components/about/components/ng-react/index.tsx | /// <reference path="../../../../../../typings/tsd.d.ts" />
var React = require('react');
var ReactDOM = require('react-dom');
var NotificationSystem = require('react-notification-system');
var NGReactComponent = React.createClass<any>({
_notificationSystem: null,
_addNotification: function(event) {
event.preventDefault();
this._notificationSystem.addNotification({
message: this.props.message,
level: 'success'
});
},
componentDidMount: function() {
this._notificationSystem = this.refs.notificationSystem;
},
render: function(){
return (
<div>
<p>Say Hello From React!</p>
<p>
<button onClick={this._addNotification}>Hello</button>
</p>
<NotificationSystem ref="notificationSystem" />
</div>
);
}
});
export class NGReact{
static initialize(message){
ReactDOM.render(<NGReactComponent message={message} />, document.getElementById('ng-react-component'));
}
} | /// <reference path="../../../../../../typings/tsd.d.ts" />
import * as React from 'react';
import * as ReactDOM from 'react-dom';
// No type definition available quick and dirty require instead
var NotificationSystem = require('react-notification-system');
class NGReactProps {
public message: string;
}
class NGReactComponent extends React.Component<NGReactProps, any> {
public _notificationSystem = null;
constructor(props:NGReactProps) {
super(props);
}
componentDidMount() {
this._notificationSystem = this.refs.notificationSystem;
}
_addNotification() {
this._notificationSystem.addNotification({
message: this.props.message,
level: 'success'
});
}
render() {
return (
<div>
<p>Say Hello From React!</p>
<p>
<button onClick={this._addNotification.bind(this)}>Hello</button>
</p>
<NotificationSystem ref="notificationSystem" />
</div>
)
}
}
export class NGReact{
static initialize(message){
ReactDOM.render(<NGReactComponent message={message}/>, document.getElementById('ng-react-component'));
}
} | Use ES6 style classes instead of React.creatClass. | Use ES6 style classes instead of React.creatClass.
| TypeScript | mit | cmelion/generator-ng2-webpack,cmelion/generator-ng2-webpack,cmelion/generator-ng2-webpack,cmelion/generator-ng2-webpack | ---
+++
@@ -1,42 +1,49 @@
/// <reference path="../../../../../../typings/tsd.d.ts" />
-var React = require('react');
-var ReactDOM = require('react-dom');
+import * as React from 'react';
+import * as ReactDOM from 'react-dom';
+
+// No type definition available quick and dirty require instead
var NotificationSystem = require('react-notification-system');
+class NGReactProps {
+ public message: string;
+}
-var NGReactComponent = React.createClass<any>({
- _notificationSystem: null,
+class NGReactComponent extends React.Component<NGReactProps, any> {
+ public _notificationSystem = null;
- _addNotification: function(event) {
- event.preventDefault();
+ constructor(props:NGReactProps) {
+ super(props);
+ }
+
+ componentDidMount() {
+ this._notificationSystem = this.refs.notificationSystem;
+ }
+
+ _addNotification() {
this._notificationSystem.addNotification({
message: this.props.message,
level: 'success'
});
- },
+ }
- componentDidMount: function() {
- this._notificationSystem = this.refs.notificationSystem;
- },
- render: function(){
-
+ render() {
return (
<div>
<p>Say Hello From React!</p>
<p>
- <button onClick={this._addNotification}>Hello</button>
+ <button onClick={this._addNotification.bind(this)}>Hello</button>
</p>
<NotificationSystem ref="notificationSystem" />
</div>
- );
+ )
}
-});
+}
export class NGReact{
-
static initialize(message){
- ReactDOM.render(<NGReactComponent message={message} />, document.getElementById('ng-react-component'));
+ ReactDOM.render(<NGReactComponent message={message}/>, document.getElementById('ng-react-component'));
}
} |
8cdacb77840451089cd9f436ee962ab0e634402a | modules/tinymce/src/plugins/hr/test/ts/browser/HrSanityTest.ts | modules/tinymce/src/plugins/hr/test/ts/browser/HrSanityTest.ts | import { ApproxStructure, Log, Pipeline } from '@ephox/agar';
import { UnitTest } from '@ephox/bedrock-client';
import { TinyApis, TinyLoader, TinyUi } from '@ephox/mcagar';
import HrPlugin from 'tinymce/plugins/hr/Plugin';
import SilverTheme from 'tinymce/themes/silver/Theme';
UnitTest.asynctest('browser.tinymce.plugins.fullscreen.HrSanitytest', (success, failure) => {
HrPlugin();
SilverTheme();
TinyLoader.setupLight((editor, onSuccess, onFailure) => {
const tinyUi = TinyUi(editor);
const tinyApis = TinyApis(editor);
Pipeline.async({}, Log.steps('TBA', 'HorizontalRule: Click on the horizontal rule toolbar button and assert hr is added to the editor', [
tinyUi.sClickOnToolbar('click on hr button', 'button[aria-label="Horizontal line"]'),
tinyApis.sAssertContentStructure(ApproxStructure.build((s, _str) => {
return s.element('body', {
children: [
s.element('hr', {}),
s.anything()
]
});
}))
]), onSuccess, onFailure);
}, {
plugins: 'hr',
toolbar: 'hr',
theme: 'silver',
base_url: '/project/tinymce/js/tinymce'
}, success, failure);
});
| import { ApproxStructure } from '@ephox/agar';
import { describe, it } from '@ephox/bedrock-client';
import { TinyAssertions, TinyHooks, TinyUiActions } from '@ephox/mcagar';
import Editor from 'tinymce/core/api/Editor';
import Plugin from 'tinymce/plugins/hr/Plugin';
import Theme from 'tinymce/themes/silver/Theme';
describe('browser.tinymce.plugins.hr.HrSanitytest', () => {
const hook = TinyHooks.bddSetupLight<Editor>({
plugins: 'hr',
toolbar: 'hr',
base_url: '/project/tinymce/js/tinymce'
}, [ Plugin, Theme ]);
it('TBA: Click on the horizontal rule toolbar button and assert hr is added to the editor', () => {
const editor = hook.editor();
TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Horizontal line"]');
TinyAssertions.assertContentStructure(editor, ApproxStructure.build((s) => {
return s.element('body', {
children: [
s.element('hr', {}),
s.anything()
]
});
}));
});
});
| Switch hr plugin to use BDD style tests | TINY-6870: Switch hr plugin to use BDD style tests
| TypeScript | mit | tinymce/tinymce,tinymce/tinymce,tinymce/tinymce,TeamupCom/tinymce,TeamupCom/tinymce | ---
+++
@@ -1,34 +1,28 @@
-import { ApproxStructure, Log, Pipeline } from '@ephox/agar';
-import { UnitTest } from '@ephox/bedrock-client';
-import { TinyApis, TinyLoader, TinyUi } from '@ephox/mcagar';
+import { ApproxStructure } from '@ephox/agar';
+import { describe, it } from '@ephox/bedrock-client';
+import { TinyAssertions, TinyHooks, TinyUiActions } from '@ephox/mcagar';
-import HrPlugin from 'tinymce/plugins/hr/Plugin';
-import SilverTheme from 'tinymce/themes/silver/Theme';
+import Editor from 'tinymce/core/api/Editor';
+import Plugin from 'tinymce/plugins/hr/Plugin';
+import Theme from 'tinymce/themes/silver/Theme';
-UnitTest.asynctest('browser.tinymce.plugins.fullscreen.HrSanitytest', (success, failure) => {
-
- HrPlugin();
- SilverTheme();
-
- TinyLoader.setupLight((editor, onSuccess, onFailure) => {
- const tinyUi = TinyUi(editor);
- const tinyApis = TinyApis(editor);
-
- Pipeline.async({}, Log.steps('TBA', 'HorizontalRule: Click on the horizontal rule toolbar button and assert hr is added to the editor', [
- tinyUi.sClickOnToolbar('click on hr button', 'button[aria-label="Horizontal line"]'),
- tinyApis.sAssertContentStructure(ApproxStructure.build((s, _str) => {
- return s.element('body', {
- children: [
- s.element('hr', {}),
- s.anything()
- ]
- });
- }))
- ]), onSuccess, onFailure);
- }, {
+describe('browser.tinymce.plugins.hr.HrSanitytest', () => {
+ const hook = TinyHooks.bddSetupLight<Editor>({
plugins: 'hr',
toolbar: 'hr',
- theme: 'silver',
base_url: '/project/tinymce/js/tinymce'
- }, success, failure);
+ }, [ Plugin, Theme ]);
+
+ it('TBA: Click on the horizontal rule toolbar button and assert hr is added to the editor', () => {
+ const editor = hook.editor();
+ TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Horizontal line"]');
+ TinyAssertions.assertContentStructure(editor, ApproxStructure.build((s) => {
+ return s.element('body', {
+ children: [
+ s.element('hr', {}),
+ s.anything()
+ ]
+ });
+ }));
+ });
}); |
0bcad4e6537924116f203849846f18a7810169d1 | capstone-project/src/main/angular-webapp/src/app/info-window/info-window.component.ts | capstone-project/src/main/angular-webapp/src/app/info-window/info-window.component.ts | import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { MarkerAction } from '../marker-action';
import { } from 'googlemaps';
import { SocialUser } from "angularx-social-login";
import { UserService } from "../user.service";
@Component({
selector: 'app-info-window',
templateUrl: './info-window.component.html',
styleUrls: ['./info-window.component.css']
})
export class InfoWindowComponent implements OnInit {
user: SocialUser;
@Input() animal: string;
@Input() description: string;
@Input() reporter: string;
@Input() type: MarkerAction;
@Output() submitEvent = new EventEmitter();
@Output() deleteEvent = new EventEmitter();
@Output() updateEvent = new EventEmitter();
MarkerAction = MarkerAction; // For the ngIf in template
constructor(private userService: UserService) { }
ngOnInit(): void {
// Get the current user
this.userService.currentUser.subscribe(user => this.user = user);
}
// Update the fields according to user input and emit the submitEvent to receive the data in mapComponenet
submit(animalValue, descriptionValue, reporterValue){
this.animal = animalValue;
this.description = descriptionValue;
this.reporter = reporterValue;
this.submitEvent.emit({animal: animalValue, description: descriptionValue, reporter: reporterValue})
}
// Indicates that the user pressed on the Delete button
delete(){
this.deleteEvent.emit()
}
// Indicates that the user pressed on the Update button
update(){
this.updateEvent.emit()
}
}
| import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { MarkerAction } from '../marker-action';
import { } from 'googlemaps';
import { SocialUser } from "angularx-social-login";
import { UserService } from "../user.service";
@Component({
selector: 'app-info-window',
templateUrl: './info-window.component.html',
styleUrls: ['./info-window.component.css']
})
export class InfoWindowComponent implements OnInit {
user: SocialUser;
@Input() animal: string;
@Input() description: string;
@Input() reporter: string;
@Input() type: MarkerAction;
@Output() submitEvent = new EventEmitter();
@Output() deleteEvent = new EventEmitter();
@Output() updateEvent = new EventEmitter();
MarkerAction = MarkerAction; // For the ngIf in template
constructor(private userService: UserService) { }
ngOnInit(): void {
// Get the current user
this.userService.currentUser.subscribe(user => this.user = user);
}
// Update the fields according to user input and emit the submitEvent to receive the data in mapComponenet
submit(animalValue, descriptionValue, reporterValue){
this.animal = animalValue;
this.description = descriptionValue;
this.reporter = reporterValue;
this.submitEvent.emit({animal: animalValue, description: descriptionValue, reporter: reporterValue, userToken: this.user.idToken})
}
// Indicates that the user pressed on the Delete button
delete(){
this.deleteEvent.emit()
}
// Indicates that the user pressed on the Update button
update(){
this.updateEvent.emit()
}
}
| Add idToken as a field in marker submit event | Add idToken as a field in marker submit event
| TypeScript | apache-2.0 | googleinterns/step263-2020,googleinterns/step263-2020,googleinterns/step263-2020,googleinterns/step263-2020 | ---
+++
@@ -36,7 +36,7 @@
this.animal = animalValue;
this.description = descriptionValue;
this.reporter = reporterValue;
- this.submitEvent.emit({animal: animalValue, description: descriptionValue, reporter: reporterValue})
+ this.submitEvent.emit({animal: animalValue, description: descriptionValue, reporter: reporterValue, userToken: this.user.idToken})
}
// Indicates that the user pressed on the Delete button |
9fedacdef43854a45733842c1c3d9511835f2bf3 | packages/truffle-db/src/loaders/test/index.ts | packages/truffle-db/src/loaders/test/index.ts | import fs from "fs";
import path from "path";
import gql from "graphql-tag";
import { TruffleDB } from "truffle-db";
const fixturesDirectory = path.join(__dirname, "..", "artifacts", "test");
// minimal config
const config = {
contracts_build_directory: path.join(fixturesDirectory, "build"),
contracts_directory: path.join(fixturesDirectory, "compilationSources"),
all: true
};
const db = new TruffleDB(config);
const Build = require(path.join(fixturesDirectory, "build", "SimpleStorage.json"));
const Load = gql `
mutation LoadArtifacts {
loaders {
artifactsLoad {
success
}
}
}
`
it("loads artifacts and returns true ", async () => {
const {
data: {
loaders: {
artifactsLoad: {
success
}
}
}
} = await db.query(Load);
expect(success).toEqual(true);
});
| import fs from "fs";
import path from "path";
import gql from "graphql-tag";
import { TruffleDB } from "truffle-db";
import * as Contracts from "truffle-workflow-compile";
jest.mock("truffle-workflow-compile", () => ({
compile: function(config, callback) {
const magicSquare= require(path.join(__dirname,"..", "artifacts", "test", "sources", "MagicSquare.json"));
const migrations = require(path.join(__dirname, "..", "artifacts", "test", "sources", "Migrations.json"));
const squareLib = require(path.join(__dirname, "..", "artifacts", "test", "sources", "SquareLib.json"));
callback(null, {
"contracts": [{
"contract_name": "MagicSquare",
...magicSquare
},
{
"contract_name": "Migrations",
...migrations
},
{
"contract_name": "SquareLib",
...squareLib
}
]
});
}
}));
const fixturesDirectory = path.join(__dirname, "..", "artifacts", "test");
// minimal config
const config = {
contracts_build_directory: path.join(fixturesDirectory, "sources"),
contracts_directory: path.join(fixturesDirectory, "compilationSources"),
all: true
};
const db = new TruffleDB(config);
const Load = gql `
mutation LoadArtifacts {
loaders {
artifactsLoad {
success
}
}
}
`
it("loads artifacts and returns true ", async () => {
const {
data: {
loaders: {
artifactsLoad: {
success
}
}
}
} = await db.query(Load);
expect(success).toEqual(true);
});
| Add mocking of manual compilation to loader test file | Add mocking of manual compilation to loader test file
| TypeScript | mit | ConsenSys/truffle | ---
+++
@@ -1,22 +1,42 @@
import fs from "fs";
import path from "path";
import gql from "graphql-tag";
+import { TruffleDB } from "truffle-db";
+import * as Contracts from "truffle-workflow-compile";
-import { TruffleDB } from "truffle-db";
-
+jest.mock("truffle-workflow-compile", () => ({
+ compile: function(config, callback) {
+ const magicSquare= require(path.join(__dirname,"..", "artifacts", "test", "sources", "MagicSquare.json"));
+ const migrations = require(path.join(__dirname, "..", "artifacts", "test", "sources", "Migrations.json"));
+ const squareLib = require(path.join(__dirname, "..", "artifacts", "test", "sources", "SquareLib.json"));
+ callback(null, {
+ "contracts": [{
+ "contract_name": "MagicSquare",
+ ...magicSquare
+ },
+ {
+ "contract_name": "Migrations",
+ ...migrations
+ },
+ {
+ "contract_name": "SquareLib",
+ ...squareLib
+ }
+ ]
+ });
+ }
+}));
const fixturesDirectory = path.join(__dirname, "..", "artifacts", "test");
// minimal config
const config = {
- contracts_build_directory: path.join(fixturesDirectory, "build"),
+ contracts_build_directory: path.join(fixturesDirectory, "sources"),
contracts_directory: path.join(fixturesDirectory, "compilationSources"),
all: true
};
const db = new TruffleDB(config);
-
-const Build = require(path.join(fixturesDirectory, "build", "SimpleStorage.json"));
const Load = gql `
mutation LoadArtifacts {
@@ -26,7 +46,7 @@
}
}
}
-`
+`
it("loads artifacts and returns true ", async () => {
const {
@@ -38,5 +58,5 @@
}
}
} = await db.query(Load);
- expect(success).toEqual(true);
+ expect(success).toEqual(true);
}); |
6ea17dec9b50d79cbb378fcd0e938c837cc7e0e5 | applications/mail/src/app/components/list/ItemLocation.tsx | applications/mail/src/app/components/list/ItemLocation.tsx | import React from 'react';
import { Icon, useFolders } from 'react-components';
import { MailSettings } from 'proton-shared/lib/interfaces';
import { Message } from '../../models/message';
import { getCurrentFolders } from '../../helpers/labels';
interface Props {
message?: Message;
mailSettings: MailSettings;
shouldStack?: boolean;
}
const ItemLocation = ({ message, mailSettings, shouldStack = false }: Props) => {
const [customFolders = []] = useFolders();
let infos = getCurrentFolders(message, customFolders, mailSettings);
if (infos.length > 1 && shouldStack) {
infos = [
{
to: infos.map((info) => info.to).join(','),
name: infos.map((info) => info.name).join(', '),
icon: 'parent-folder'
}
];
}
return (
<>
{infos.map(({ icon, name, to }) => (
<span className="inline-flex flex-item-noshrink" key={to} title={name}>
<Icon name={icon} alt={name} />
</span>
))}
</>
);
};
export default ItemLocation;
| import React from 'react';
import { Icon, useFolders, Tooltip } from 'react-components';
import { MailSettings } from 'proton-shared/lib/interfaces';
import { Message } from '../../models/message';
import { getCurrentFolders } from '../../helpers/labels';
interface Props {
message?: Message;
mailSettings: MailSettings;
shouldStack?: boolean;
}
const ItemLocation = ({ message, mailSettings, shouldStack = false }: Props) => {
const [customFolders = []] = useFolders();
let infos = getCurrentFolders(message, customFolders, mailSettings);
if (infos.length > 1 && shouldStack) {
infos = [
{
to: infos.map((info) => info.to).join(','),
name: infos.map((info) => info.name).join(', '),
icon: 'parent-folder'
}
];
}
return (
<>
{infos.map(({ icon, name, to }) => (
<Tooltip title={name} key={to}>
<span className="inline-flex flex-item-noshrink">
<Icon name={icon} alt={name} />
</span>
</Tooltip>
))}
</>
);
};
export default ItemLocation;
| Use tooltips instead of title for folder icons in element list | [MAILWEB-1149] Use tooltips instead of title for folder icons in element list
| TypeScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient | ---
+++
@@ -1,5 +1,5 @@
import React from 'react';
-import { Icon, useFolders } from 'react-components';
+import { Icon, useFolders, Tooltip } from 'react-components';
import { MailSettings } from 'proton-shared/lib/interfaces';
import { Message } from '../../models/message';
@@ -28,9 +28,11 @@
return (
<>
{infos.map(({ icon, name, to }) => (
- <span className="inline-flex flex-item-noshrink" key={to} title={name}>
- <Icon name={icon} alt={name} />
- </span>
+ <Tooltip title={name} key={to}>
+ <span className="inline-flex flex-item-noshrink">
+ <Icon name={icon} alt={name} />
+ </span>
+ </Tooltip>
))}
</>
); |
54ca5939bcb293bad8de2db2b077d7af065c8568 | ui/src/dashboards/components/DashboardEmpty.tsx | ui/src/dashboards/components/DashboardEmpty.tsx | import React, {Component} from 'react'
import {Cell} from 'src/types/dashboard'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import {addDashboardCellAsync} from 'src/dashboards/actions'
import {GRAPH_TYPES} from 'src/dashboards/graphics/graph'
interface Dashboard {
id: string
cells: Cell[]
}
interface Props {
dashboard: Dashboard
addDashboardCell: (dashboard: Dashboard, cell?: Cell) => void
}
const mapDispatchToProps = dispatch => ({
addDashboardCell: bindActionCreators(addDashboardCellAsync, dispatch),
})
@connect(null, mapDispatchToProps)
class DashboardEmpty extends Component<Props> {
constructor(props) {
super(props)
}
public handleAddCell = type => () => {
const {dashboard, addDashboardCell} = this.props
addDashboardCell(dashboard, type)
}
public render() {
return (
<div className="dashboard-empty">
<p>
This Dashboard doesn't have any <strong>Cells</strong>,<br />why not
add one?
</p>
<div className="dashboard-empty--menu">
{GRAPH_TYPES.map(graphType => (
<div key={graphType.type} className="dashboard-empty--menu-option">
<div onClick={this.handleAddCell(graphType.type)}>
{graphType.graphic}
<p>{graphType.menuOption}</p>
</div>
</div>
))}
</div>
</div>
)
}
}
export default DashboardEmpty
| import React, {Component} from 'react'
import {Cell} from 'src/types/dashboard'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import {addDashboardCellAsync} from 'src/dashboards/actions'
import {ErrorHandling} from 'src/shared/decorators/errors'
import {GRAPH_TYPES} from 'src/dashboards/graphics/graph'
interface Dashboard {
id: string
cells: Cell[]
}
interface Props {
dashboard: Dashboard
addDashboardCell: (dashboard: Dashboard, cell?: Cell) => void
}
const mapDispatchToProps = dispatch => ({
addDashboardCell: bindActionCreators(addDashboardCellAsync, dispatch),
})
@ErrorHandling
@connect(null, mapDispatchToProps)
class DashboardEmpty extends Component<Props> {
constructor(props) {
super(props)
}
public handleAddCell = type => () => {
const {dashboard, addDashboardCell} = this.props
addDashboardCell(dashboard, type)
}
public render() {
return (
<div className="dashboard-empty">
<p>
This Dashboard doesn't have any <strong>Cells</strong>,<br />why not
add one?
</p>
<div className="dashboard-empty--menu">
{GRAPH_TYPES.map(graphType => (
<div key={graphType.type} className="dashboard-empty--menu-option">
<div onClick={this.handleAddCell(graphType.type)}>
{graphType.graphic}
<p>{graphType.menuOption}</p>
</div>
</div>
))}
</div>
</div>
)
}
}
export default DashboardEmpty
| Add error handling decorator to component | Add error handling decorator to component
| TypeScript | mit | li-ang/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,li-ang/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdata/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb | ---
+++
@@ -4,6 +4,7 @@
import {bindActionCreators} from 'redux'
import {addDashboardCellAsync} from 'src/dashboards/actions'
+import {ErrorHandling} from 'src/shared/decorators/errors'
import {GRAPH_TYPES} from 'src/dashboards/graphics/graph'
interface Dashboard {
@@ -20,6 +21,7 @@
addDashboardCell: bindActionCreators(addDashboardCellAsync, dispatch),
})
+@ErrorHandling
@connect(null, mapDispatchToProps)
class DashboardEmpty extends Component<Props> {
constructor(props) { |
555d0f5c5f31f7f05621f818cd71400d7946225d | handlebars/handlebars.d.ts | handlebars/handlebars.d.ts | // Type definitions for Handlebars 1.0
// Project: http://handlebarsjs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface HandlebarsStatic {
registerHelper(name: string, fn: Function, inverse?: bool): void;
registerPartial(name: string, str): void;
K();
createFrame(object);
Exception(message: string): void;
SafeString(str: string): void;
parse(string: string);
print(ast);
logger;
log(level, str): void;
compile(environment, options?, context?, asObject?);
}
declare var Handlebars: HandlebarsStatic; | // Type definitions for Handlebars 1.0
// Project: http://handlebarsjs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface HandlebarsStatic {
registerHelper(name: string, fn: Function, inverse?: boolean): void;
registerPartial(name: string, str): void;
K();
createFrame(object);
Exception(message: string): void;
SafeString(str: string): void;
parse(string: string);
print(ast);
logger;
log(level, str): void;
compile(environment, options?, context?, asObject?);
}
declare var Handlebars: HandlebarsStatic;
| Replace bool with boolean (for TypeScript 0.9.0+) | Replace bool with boolean (for TypeScript 0.9.0+) | TypeScript | mit | YousefED/DefinitelyTyped,Stephanvs/DefinitelyTyped,Chris380/DefinitelyTyped,bkristensen/DefinitelyTyped,zoetrope/DefinitelyTyped,onecentlin/DefinitelyTyped,robl499/DefinitelyTyped,hellopao/DefinitelyTyped,seikichi/DefinitelyTyped,blittle/DefinitelyTyped,QuatroCode/DefinitelyTyped,kanreisa/DefinitelyTyped,forumone/DefinitelyTyped,behzad888/DefinitelyTyped,OliveTreeBible/DefinitelyTyped,DzmitryDulko/DefinitelyTyped,gedaiu/DefinitelyTyped,stimms/DefinitelyTyped,PawelStroinski/DefinitelyTyped,syuilo/DefinitelyTyped,mrk21/DefinitelyTyped,gildorwang/DefinitelyTyped,Zorgatone/DefinitelyTyped,elisee/DefinitelyTyped,scatcher/DefinitelyTyped,teves-castro/DefinitelyTyped,demerzel3/DefinitelyTyped,vote539/DefinitelyTyped,Zenorbi/DefinitelyTyped,progre/DefinitelyTyped,musicist288/DefinitelyTyped,bobslaede/DefinitelyTyped,PascalSenn/DefinitelyTyped,TiddoLangerak/DefinitelyTyped,Kuniwak/DefinitelyTyped,ctaggart/DefinitelyTyped,Trapulo/DefinitelyTyped,danludwig/DefinitelyTyped,paulmorphy/DefinitelyTyped,abner/DefinitelyTyped,manekovskiy/DefinitelyTyped,bdoss/DefinitelyTyped,fishgoh0nk/DefinitelyTyped,ctaggart/DefinitelyTyped,paulbakker/DefinitelyTyped,s093294/DefinitelyTyped,billccn/DefinitelyTyped,borisyankov/DefinitelyTyped,tgrospic/DefinitelyTyped,nseckinoral/DefinitelyTyped,blittle/DefinitelyTyped,newclear/DefinitelyTyped,harcher81/DefinitelyTyped,arusakov/DefinitelyTyped,paypac/DefinitelyTyped,giabao/DefinitelyTyped,aldo-roman/DefinitelyTyped,wkrueger/DefinitelyTyped,donnut/DefinitelyTyped,lcorneliussen/DefinitelyTyped,giggio/DefinitelyTyped,progre/DefinitelyTyped,abbasmhd/DefinitelyTyped,sorskoot/DefinitelyTyped,psnider/DefinitelyTyped,3x14159265/DefinitelyTyped,MugeSo/DefinitelyTyped,timjk/DefinitelyTyped,greglo/DefinitelyTyped,fredgalvao/DefinitelyTyped,gerich-home/DefinitelyTyped,tan9/DefinitelyTyped,jasonswearingen/DefinitelyTyped,subjectix/DefinitelyTyped,mszczepaniak/DefinitelyTyped,hastebrot/DefinitelyTyped,rschmukler/DefinitelyTyped,pocesar/DefinitelyTyped,dariajung/DefinitelyTyped,AyaMorisawa/DefinitelyTyped,tgrospic/DefinitelyTyped,blittle/DefinitelyTyped,davidsidlinger/DefinitelyTyped,ayanoin/DefinitelyTyped,esperco/DefinitelyTyped,Riron/DefinitelyTyped,mariokostelac/DefinitelyTyped,abbasmhd/DefinitelyTyped,furny/DefinitelyTyped,maglar0/DefinitelyTyped,xswordsx/DefinitelyTyped,GiedriusGrabauskas/DefinitelyTyped,stylelab-io/DefinitelyTyped,sventschui/DefinitelyTyped,bridge-ufsc/DefinitelyTyped,rockclimber90/DefinitelyTyped,shiwano/DefinitelyTyped,lseguin42/DefinitelyTyped,damianog/DefinitelyTyped,aqua89/DefinitelyTyped,jasonswearingen/DefinitelyTyped,benishouga/DefinitelyTyped,gdi2290/DefinitelyTyped,ashwinr/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,jraymakers/DefinitelyTyped,designxtek/DefinitelyTyped,olivierlemasle/DefinitelyTyped,shovon/DefinitelyTyped,xStrom/DefinitelyTyped,sledorze/DefinitelyTyped,Stephanvs/DefinitelyTyped,GodsBreath/DefinitelyTyped,wilkerlucio/DefinitelyTyped,stimms/DefinitelyTyped,modifyink/DefinitelyTyped,mhegazy/DefinitelyTyped,balassy/DefinitelyTyped,nicholashead/DefinitelyTyped,vincentw56/DefinitelyTyped,amanmahajan7/DefinitelyTyped,bruennijs/DefinitelyTyped,kabogo/DefinitelyTyped,schmuli/DefinitelyTyped,Belelros/DefinitelyTyped,pkaul/DefinitelyTyped,mhegazy/DefinitelyTyped,richardTowers/DefinitelyTyped,dmorosinotto/DefinitelyTyped,brentonhouse/DefinitelyTyped,paulbakker/DefinitelyTyped,ciriarte/DefinitelyTyped,bilou84/DefinitelyTyped,alvarorahul/DefinitelyTyped,UzEE/DefinitelyTyped,subash-a/DefinitelyTyped,jfoliveira/DefinitelyTyped,felipe3dfx/DefinitelyTyped,chrismbarr/DefinitelyTyped,RupertAvery/DefinitelyTyped,theyelllowdart/DefinitelyTyped,bayitajesi/DefinitelyTyped,johan-gorter/DefinitelyTyped,chrootsu/DefinitelyTyped,jtlan/DefinitelyTyped,pafflique/DefinitelyTyped,munxar/DefinitelyTyped,balassy/DefinitelyTyped,georgemarshall/DefinitelyTyped,AndrewGaspar/DefinitelyTyped,ryan10132/DefinitelyTyped,magny/DefinitelyTyped,philippstucki/DefinitelyTyped,gerich-home/DefinitelyTyped,subash-a/DefinitelyTyped,takenet/DefinitelyTyped,minodisk/DefinitelyTyped,ArturSoler/DefinitelyTyped,nfriend/DefinitelyTyped,blink1073/DefinitelyTyped,tgfjt/DefinitelyTyped,nwolverson/DefinitelyTyped,OliveTreeBible/DefinitelyTyped,mattanja/DefinitelyTyped,moonpyk/DefinitelyTyped,bencoveney/DefinitelyTyped,wcomartin/DefinitelyTyped,maxlang/DefinitelyTyped,antiveeranna/DefinitelyTyped,thSoft/DefinitelyTyped,rerezz/DefinitelyTyped,axefrog/DefinitelyTyped,JoshRosen/DefinitelyTyped,nestalk/DefinitelyTyped,JanVoracek/DefinitelyTyped,Litee/DefinitelyTyped,applesaucers/lodash-invokeMap,davidpricedev/DefinitelyTyped,Bunkerbewohner/DefinitelyTyped,almstrand/DefinitelyTyped,martinduparc/DefinitelyTyped,fdecampredon/DefinitelyTyped,jpevarnek/DefinitelyTyped,wilkerlucio/DefinitelyTyped,varju/DefinitelyTyped,tgrospic/DefinitelyTyped,spion/DefinitelyTyped,behzad888/DefinitelyTyped,stacktracejs/DefinitelyTyped,aaharu/DefinitelyTyped,RupertAvery/DefinitelyTyped,trystanclarke/DefinitelyTyped,tomtarrot/DefinitelyTyped,vasek17/DefinitelyTyped,drillbits/DefinitelyTyped,emanuelhp/DefinitelyTyped,nycdotnet/DefinitelyTyped,superduper/DefinitelyTyped,Airblader/DefinitelyTyped,teves-castro/DefinitelyTyped,martinduparc/DefinitelyTyped,harcher81/DefinitelyTyped,DenEwout/DefinitelyTyped,eugenpodaru/DefinitelyTyped,tgfjt/DefinitelyTyped,axefrog/DefinitelyTyped,sandersky/DefinitelyTyped,sventschui/DefinitelyTyped,vpineda1996/DefinitelyTyped,behzad88/DefinitelyTyped,alextkachman/DefinitelyTyped,sorskoot/DefinitelyTyped,HPFOD/DefinitelyTyped,cesarmarinhorj/DefinitelyTyped,Asido/DefinitelyTyped,paulmorphy/DefinitelyTyped,colindembovsky/DefinitelyTyped,olemp/DefinitelyTyped,demerzel3/DefinitelyTyped,hellopao/DefinitelyTyped,colindembovsky/DefinitelyTyped,drinchev/DefinitelyTyped,david-driscoll/DefinitelyTyped,IAPark/DefinitelyTyped,sclausen/DefinitelyTyped,ajtowf/DefinitelyTyped,paypac/DefinitelyTyped,leoromanovsky/DefinitelyTyped,s093294/DefinitelyTyped,nwolverson/DefinitelyTyped,antiveeranna/DefinitelyTyped,iCoreSolutions/DefinitelyTyped,jimthedev/DefinitelyTyped,johnnycrab/DefinitelyTyped,sergey-buturlakin/DefinitelyTyped,arusakov/DefinitelyTyped,arueckle/DefinitelyTyped,Dominator008/DefinitelyTyped,daptiv/DefinitelyTyped,tarruda/DefinitelyTyped,hatz48/DefinitelyTyped,gandjustas/DefinitelyTyped,hafenr/DefinitelyTyped,benishouga/DefinitelyTyped,opichals/DefinitelyTyped,slavomirvojacek/adbrain-typescript-definitions,innerverse/DefinitelyTyped,JeremyCBrooks/DefinitelyTyped,Belelros/DefinitelyTyped,jfoliveira/DefinitelyTyped,RedSeal-co/DefinitelyTyped,alainsahli/DefinitelyTyped,arcticwaters/DefinitelyTyped,miguelmq/DefinitelyTyped,JaminFarr/DefinitelyTyped,docgit/DefinitelyTyped,nwolverson/DefinitelyTyped,biomassives/DefinitelyTyped,gamesbrainiac/DefinitelyTyped,applesaucers/lodash-invokeMap,georgemarshall/DefinitelyTyped,fredgalvao/DefinitelyTyped,tdmckinn/DefinitelyTyped,OliveTreeBible/DefinitelyTyped,bdukes/DefinitelyTyped,igorraush/DefinitelyTyped,sventschui/DefinitelyTyped,nestalk/DefinitelyTyped,one-pieces/DefinitelyTyped,colindembovsky/DefinitelyTyped,hypno2000/typings,stanislavHamara/DefinitelyTyped,designxtek/DefinitelyTyped,bdukes/DefinitelyTyped,Garciat/DefinitelyTyped,rgripper/DefinitelyTyped,NelsonLamprecht/DefinitelyTyped,sergey-buturlakin/DefinitelyTyped,zuohaocheng/DefinitelyTyped,lcorneliussen/DefinitelyTyped,YusukeHirao/DefinitelyTyped,michaelbromley/DefinitelyTyped,Mek7/DefinitelyTyped,tinganho/DefinitelyTyped,Stephanvs/DefinitelyTyped,jaysoo/DefinitelyTyped,mwain/DefinitelyTyped,nainslie/DefinitelyTyped,darkl/DefinitelyTyped,kalloc/DefinitelyTyped,PawelStroinski/DefinitelyTyped,musakarakas/DefinitelyTyped,giabao/DefinitelyTyped,david-driscoll/DefinitelyTyped,algas/DefinitelyTyped,Zzzen/DefinitelyTyped,bridge-ufsc/DefinitelyTyped,dsebastien/DefinitelyTyped,gyohk/DefinitelyTyped,BrandonCKrueger/DefinitelyTyped,wbuchwalter/DefinitelyTyped,pwelter34/DefinitelyTyped,Syati/DefinitelyTyped,jiaz/DefinitelyTyped,mweststrate/DefinitelyTyped,greglo/DefinitelyTyped,xica/DefinitelyTyped,aciccarello/DefinitelyTyped,rgripper/DefinitelyTyped,mattblang/DefinitelyTyped,vote539/DefinitelyTyped,stacktracejs/DefinitelyTyped,stephenjelfs/DefinitelyTyped,RX14/DefinitelyTyped,elisee/DefinitelyTyped,pocesar/DefinitelyTyped,paxibay/DefinitelyTyped,AgentME/DefinitelyTyped,arusakov/DefinitelyTyped,danludwig/DefinitelyTyped,bdukes/DefinitelyTyped,Maplecroft/DefinitelyTyped,florentpoujol/DefinitelyTyped,EnableSoftware/DefinitelyTyped,brettle/DefinitelyTyped,reppners/DefinitelyTyped,slavomirvojacek/DefinitelyTyped,pocesar/DefinitelyTyped,masonkmeyer/DefinitelyTyped,AndrewGaspar/DefinitelyTyped,schmuli/DefinitelyTyped,jimthedev/DefinitelyTyped,vagarenko/DefinitelyTyped,markogresak/DefinitelyTyped,cvrajeesh/DefinitelyTyped,sclausen/DefinitelyTyped,wilkerlucio/DefinitelyTyped,tan9/DefinitelyTyped,arma-gast/DefinitelyTyped,DustinWehr/DefinitelyTyped,Wordenskjold/DefinitelyTyped,Belelros/DefinitelyTyped,scriby/DefinitelyTyped,evansolomon/DefinitelyTyped,bjfletcher/DefinitelyTyped,AndrewGaspar/DefinitelyTyped,zhiyiting/DefinitelyTyped,HPFOD/DefinitelyTyped,zoetrope/DefinitelyTyped,GiedriusGrabauskas/DefinitelyTyped,GlennQuirynen/DefinitelyTyped,3x14159265/DefinitelyTyped,Asido/DefinitelyTyped,Saneyan/DefinitelyTyped,spion/DefinitelyTyped,giabao/DefinitelyTyped,glenndierckx/DefinitelyTyped,laurentiustamate94/DefinitelyTyped,abmohan/DefinitelyTyped,nainslie/DefinitelyTyped,trystanclarke/DefinitelyTyped,Minishlink/DefinitelyTyped,rcchen/DefinitelyTyped,tigerxy/DefinitelyTyped,dflor003/DefinitelyTyped,zuzusik/DefinitelyTyped,Gmulti/DefinitelyTyped,ArturSoler/DefinitelyTyped,danfma/DefinitelyTyped,KhodeN/DefinitelyTyped,mendix/DefinitelyTyped,mvarblow/DefinitelyTyped,alvarorahul/DefinitelyTyped,AgentME/DefinitelyTyped,laco0416/DefinitelyTyped,bennett000/DefinitelyTyped,MarlonFan/DefinitelyTyped,TyOverby/DefinitelyTyped,mcrawshaw/DefinitelyTyped,Litee/DefinitelyTyped,flyfishMT/DefinitelyTyped,pocke/DefinitelyTyped,bayitajesi/DefinitelyTyped,designxtek/DefinitelyTyped,stimms/DefinitelyTyped,Lorisu/DefinitelyTyped,Carreau/DefinitelyTyped,cherrydev/DefinitelyTyped,evandrewry/DefinitelyTyped,Karabur/DefinitelyTyped,alextkachman/DefinitelyTyped,ErykB2000/DefinitelyTyped,scriby/DefinitelyTyped,AgentME/DefinitelyTyped,fdecampredon/DefinitelyTyped,DeluxZ/DefinitelyTyped,samdark/DefinitelyTyped,quantumman/DefinitelyTyped,algas/DefinitelyTyped,kuon/DefinitelyTyped,dragouf/DefinitelyTyped,Penryn/DefinitelyTyped,Fraegle/DefinitelyTyped,sixinli/DefinitelyTyped,nojaf/DefinitelyTyped,johan-gorter/DefinitelyTyped,GregOnNet/DefinitelyTyped,tomtheisen/DefinitelyTyped,jeremyhayes/DefinitelyTyped,sorskoot/DefinitelyTyped,angelobelchior8/DefinitelyTyped,dmoonfire/DefinitelyTyped,algorithme/DefinitelyTyped,kyo-ago/DefinitelyTyped,Softpagehomeware/DefinitelyTyped,gerich-home/DefinitelyTyped,dsebastien/DefinitelyTyped,pkhayundi/DefinitelyTyped,Pro/DefinitelyTyped,dmoonfire/DefinitelyTyped,ecramer89/DefinitelyTyped,ctaggart/DefinitelyTyped,harcher81/DefinitelyTyped,Deathspike/DefinitelyTyped,shiwano/DefinitelyTyped,zalamtech/DefinitelyTyped,chadoliver/DefinitelyTyped,timramone/DefinitelyTyped,greglockwood/DefinitelyTyped,Dashlane/DefinitelyTyped,gandjustas/DefinitelyTyped,sledorze/DefinitelyTyped,Airblader/DefinitelyTyped,Seikho/DefinitelyTyped,esperco/DefinitelyTyped,docgit/DefinitelyTyped,axelcostaspena/DefinitelyTyped,WritingPanda/DefinitelyTyped,philippstucki/DefinitelyTyped,HereSinceres/DefinitelyTyped,Shiak1/DefinitelyTyped,Wordenskjold/DefinitelyTyped,dwango-js/DefinitelyTyped,JoshRosen/DefinitelyTyped,fearthecowboy/DefinitelyTyped,bdukes/DefinitelyTyped,algas/DefinitelyTyped,kyo-ago/DefinitelyTyped,chocolatechipui/DefinitelyTyped,pinoyyid/DefinitelyTyped,Stephanvs/DefinitelyTyped,aciccarello/DefinitelyTyped,designxtek/DefinitelyTyped,syuilo/DefinitelyTyped,axefrog/DefinitelyTyped,hor-crux/DefinitelyTyped,lbguilherme/DefinitelyTyped,raijinsetsu/DefinitelyTyped,TiddoLangerak/DefinitelyTyped,frogcjn/DefinitelyTyped,nestalk/DefinitelyTyped,lekaha/DefinitelyTyped,shahata/DefinitelyTyped,CodeZombieCH/DefinitelyTyped,kmeurer/DefinitelyTyped,optical/DefinitelyTyped,dreampulse/DefinitelyTyped,TyOverby/DefinitelyTyped,fdecampredon/DefinitelyTyped,xStrom/DefinitelyTyped,johnnycrab/DefinitelyTyped,Jwsonic/DefinitelyTyped,muenchdo/DefinitelyTyped,JeremyCBrooks/DefinitelyTyped,spion/DefinitelyTyped,jsaelhof/DefinitelyTyped,Belelros/DefinitelyTyped,AndyBursh/DefinitelyTyped,takenet/DefinitelyTyped,nmalaguti/DefinitelyTyped,ajtowf/DefinitelyTyped,use-strict/DefinitelyTyped,ml-workshare/DefinitelyTyped,abner/DefinitelyTyped,deeleman/DefinitelyTyped,shlomiassaf/DefinitelyTyped,Almouro/DefinitelyTyped,TheBay0r/DefinitelyTyped,rfranco/DefinitelyTyped,nobuoka/DefinitelyTyped,demerzel3/DefinitelyTyped,Pro/DefinitelyTyped,glenndierckx/DefinitelyTyped,44ka28ta/DefinitelyTyped,benishouga/DefinitelyTyped,tboyce/DefinitelyTyped,isman-usoh/DefinitelyTyped,akonwi/DefinitelyTyped,Dominator008/DefinitelyTyped,gyohk/DefinitelyTyped,Zorgatone/DefinitelyTyped,varju/DefinitelyTyped,teddyward/DefinitelyTyped,JoshRosen/DefinitelyTyped,dydek/DefinitelyTyped,nitintutlani/DefinitelyTyped,lcorneliussen/DefinitelyTyped,RX14/DefinitelyTyped,bdoss/DefinitelyTyped,adamcarr/DefinitelyTyped,dmorosinotto/DefinitelyTyped,hastebrot/DefinitelyTyped,UzEE/DefinitelyTyped,KonaTeam/DefinitelyTyped,stephenjelfs/DefinitelyTyped,rolandzwaga/DefinitelyTyped,mattanja/DefinitelyTyped,herrmanno/DefinitelyTyped,donnut/DefinitelyTyped,gerich-home/DefinitelyTyped,sventschui/DefinitelyTyped,jraymakers/DefinitelyTyped,gorcz/DefinitelyTyped,gcastre/DefinitelyTyped,DzmitryDulko/DefinitelyTyped,pinoyyid/DefinitelyTyped,egeland/DefinitelyTyped,antiveeranna/DefinitelyTyped,mareek/DefinitelyTyped,michalczukm/DefinitelyTyped,dumbmatter/DefinitelyTyped,akonwi/DefinitelyTyped,rgripper/DefinitelyTyped,samwgoldman/DefinitelyTyped,acepoblete/DefinitelyTyped,david-driscoll/DefinitelyTyped,aindlq/DefinitelyTyped,OpenMaths/DefinitelyTyped,zuzusik/DefinitelyTyped,bardt/DefinitelyTyped,JanVoracek/DefinitelyTyped,zensh/DefinitelyTyped,paulbakker/DefinitelyTyped,paypac/DefinitelyTyped,Syati/DefinitelyTyped,ArturSoler/DefinitelyTyped,docgit/DefinitelyTyped,TrabacchinLuigi/DefinitelyTyped,takfjt/DefinitelyTyped,toedter/DefinitelyTyped,varju/DefinitelyTyped,RupertAvery/DefinitelyTyped,CodeZombieCH/DefinitelyTyped,hatz48/DefinitelyTyped,TildaLabs/DefinitelyTyped,OliveTreeBible/DefinitelyTyped,SebastianCoetzee/DefinitelyTyped,raijinsetsu/DefinitelyTyped,kyo-ago/DefinitelyTyped,axefrog/DefinitelyTyped,lcorneliussen/DefinitelyTyped,mareek/DefinitelyTyped,PawelStroinski/DefinitelyTyped,jesseschalken/DefinitelyTyped,gamesbrainiac/DefinitelyTyped,panuhorsmalahti/DefinitelyTyped,hastebrot/DefinitelyTyped,nakakura/DefinitelyTyped,anweiss/DefinitelyTyped,tjoskar/DefinitelyTyped,mattblang/DefinitelyTyped,lbesson/DefinitelyTyped,wilkerlucio/DefinitelyTyped,mshmelev/DefinitelyTyped,KhodeN/DefinitelyTyped,mrozhin/DefinitelyTyped,icereed/DefinitelyTyped,haskellcamargo/DefinitelyTyped,Penryn/DefinitelyTyped,optical/DefinitelyTyped,fdecampredon/DefinitelyTyped,artch/DefinitelyTyped,use-strict/DefinitelyTyped,magny/DefinitelyTyped,algas/DefinitelyTyped,Ptival/DefinitelyTyped,MugeSo/DefinitelyTyped,Bobjoy/DefinitelyTyped,corps/DefinitelyTyped,thSoft/DefinitelyTyped,ashwinr/DefinitelyTyped,fnipo/DefinitelyTyped,vsavkin/DefinitelyTyped,olemp/DefinitelyTyped,AyaMorisawa/DefinitelyTyped,GlennQuirynen/DefinitelyTyped,rcchen/DefinitelyTyped,nycdotnet/DefinitelyTyped,smrq/DefinitelyTyped,aciccarello/DefinitelyTyped,ryan-codingintrigue/DefinitelyTyped,Pipe-shen/DefinitelyTyped,rolandzwaga/DefinitelyTyped,wilfrem/DefinitelyTyped,PopSugar/DefinitelyTyped,TrabacchinLuigi/DefinitelyTyped,adammartin1981/DefinitelyTyped,Nemo157/DefinitelyTyped,zoetrope/DefinitelyTyped,syntax42/DefinitelyTyped,aaharu/DefinitelyTyped,toedter/DefinitelyTyped,robert-voica/DefinitelyTyped,nitintutlani/DefinitelyTyped,grahammendick/DefinitelyTyped,digitalpixies/DefinitelyTyped,nwolverson/DefinitelyTyped,chrismbarr/DefinitelyTyped,anweiss/DefinitelyTyped,minodisk/DefinitelyTyped,rgripper/DefinitelyTyped,robertbaker/DefinitelyTyped,Maplecroft/DefinitelyTyped,balassy/DefinitelyTyped,panuhorsmalahti/DefinitelyTyped,dydek/DefinitelyTyped,mshmelev/DefinitelyTyped,44ka28ta/DefinitelyTyped,Maplecroft/DefinitelyTyped,duncanmak/DefinitelyTyped,KhodeN/DefinitelyTyped,drinchev/DefinitelyTyped,thSoft/DefinitelyTyped,AndyBursh/DefinitelyTyped,jeffbcross/DefinitelyTyped,EnableSoftware/DefinitelyTyped,jbrantly/DefinitelyTyped,georgemarshall/DefinitelyTyped,michaelbromley/DefinitelyTyped,mcliment/DefinitelyTyped,damianog/DefinitelyTyped,NCARalph/DefinitelyTyped,akonwi/DefinitelyTyped,nmalaguti/DefinitelyTyped,mjjames/DefinitelyTyped,newclear/DefinitelyTyped,psnider/DefinitelyTyped,AGBrown/DefinitelyTyped-ABContrib,awerlang/DefinitelyTyped,vagarenko/DefinitelyTyped,nicholashead/DefinitelyTyped,nakakura/DefinitelyTyped,pwelter34/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,M-Zuber/DefinitelyTyped,micurs/DefinitelyTyped,igorsechyn/DefinitelyTyped,jimthedev/DefinitelyTyped,paypac/DefinitelyTyped,jacqt/DefinitelyTyped,philippsimon/DefinitelyTyped,TanakaYutaro/DefinitelyTyped,ctaggart/DefinitelyTyped,toedter/DefinitelyTyped,benliddicott/DefinitelyTyped,musically-ut/DefinitelyTyped,demerzel3/DefinitelyTyped,ducin/DefinitelyTyped,michaelbromley/DefinitelyTyped,TiddoLangerak/DefinitelyTyped,laball/DefinitelyTyped,dmorosinotto/DefinitelyTyped,gregoryagu/DefinitelyTyped,brainded/DefinitelyTyped,slavomirvojacek/adbrain-typescript-definitions,anweiss/DefinitelyTyped,lightswitch05/DefinitelyTyped,arma-gast/DefinitelyTyped,lucyhe/DefinitelyTyped,aroder/DefinitelyTyped,hiraash/DefinitelyTyped,bpowers/DefinitelyTyped,modifyink/DefinitelyTyped,s093294/DefinitelyTyped,nodeframe/DefinitelyTyped,flyfishMT/DefinitelyTyped,aaharu/DefinitelyTyped,chrilith/DefinitelyTyped,wilfrem/DefinitelyTyped,uestcNaldo/DefinitelyTyped,isman-usoh/DefinitelyTyped,Ridermansb/DefinitelyTyped,davidpricedev/DefinitelyTyped,nelsonmorais/DefinitelyTyped,florentpoujol/DefinitelyTyped,jccarvalhosa/DefinitelyTyped,spion/DefinitelyTyped,philippsimon/DefinitelyTyped,hx0day/DefinitelyTyped,omidkrad/DefinitelyTyped,bayitajesi/DefinitelyTyped,yuit/DefinitelyTyped,martinduparc/DefinitelyTyped,seikichi/DefinitelyTyped,KhodeN/DefinitelyTyped,erosb/DefinitelyTyped,giabao/DefinitelyTyped,bobslaede/DefinitelyTyped,nobuoka/DefinitelyTyped,balassy/DefinitelyTyped,ArturSoler/DefinitelyTyped,smrq/DefinitelyTyped,amir-arad/DefinitelyTyped,hellopao/DefinitelyTyped,nabeix/DefinitelyTyped,DeadAlready/DefinitelyTyped,danludwig/DefinitelyTyped,miguelmq/DefinitelyTyped,mariokostelac/DefinitelyTyped,bennett000/DefinitelyTyped,schmuli/DefinitelyTyped,harcher81/DefinitelyTyped,tscho/DefinitelyTyped,frogcjn/DefinitelyTyped,alexdresko/DefinitelyTyped,nicholashead/DefinitelyTyped,onecentlin/DefinitelyTyped,jsaelhof/DefinitelyTyped,duongphuhiep/DefinitelyTyped,gcastre/DefinitelyTyped,Ptival/DefinitelyTyped,eekboom/DefinitelyTyped,slavomirvojacek/DefinitelyTyped,amanmahajan7/DefinitelyTyped,nestalk/DefinitelyTyped,mjjames/DefinitelyTyped,Zzzen/DefinitelyTyped,Karabur/DefinitelyTyped,alexdresko/DefinitelyTyped,goaty92/DefinitelyTyped,hesselink/DefinitelyTyped,Airblader/DefinitelyTyped,lukehoban/DefinitelyTyped,colindembovsky/DefinitelyTyped,QuatroCode/DefinitelyTyped,AgentME/DefinitelyTyped,Seltzer/DefinitelyTyped,sorskoot/DefinitelyTyped,unknownloner/DefinitelyTyped,chbrown/DefinitelyTyped,iislucas/DefinitelyTyped,rushi216/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,shlomiassaf/DefinitelyTyped,bluong/DefinitelyTyped,pkaul/DefinitelyTyped,basp/DefinitelyTyped,yuit/DefinitelyTyped,spearhead-ea/DefinitelyTyped,pinoyyid/DefinitelyTyped,OfficeDev/DefinitelyTyped,pkaul/DefinitelyTyped,JeremyCBrooks/DefinitelyTyped,rschmukler/DefinitelyTyped,emanuelhp/DefinitelyTyped,hudon/DefinitelyTyped,3x14159265/DefinitelyTyped,johnnycrab/DefinitelyTyped,MidnightDesign/DefinitelyTyped,iislucas/DefinitelyTyped,zoetrope/DefinitelyTyped,Airblader/DefinitelyTyped,zuzusik/DefinitelyTyped,LordJZ/DefinitelyTyped,44ka28ta/DefinitelyTyped,psnider/DefinitelyTyped,YousefED/DefinitelyTyped,borisyankov/DefinitelyTyped,reppners/DefinitelyTyped,YusukeHirao/DefinitelyTyped,scsouthw/DefinitelyTyped,pkaul/DefinitelyTyped,mcrawshaw/DefinitelyTyped,hudon/DefinitelyTyped,the41/DefinitelyTyped,Maplecroft/DefinitelyTyped,OpenMaths/DefinitelyTyped,whoeverest/DefinitelyTyped,44ka28ta/DefinitelyTyped,3x14159265/DefinitelyTyped,chrootsu/DefinitelyTyped,AndrewGaspar/DefinitelyTyped,artch/DefinitelyTyped,JoshRosen/DefinitelyTyped,Softpagehomeware/DefinitelyTyped,mariokostelac/DefinitelyTyped,georgemarshall/DefinitelyTyped,CSharpFan/DefinitelyTyped,Dashlane/DefinitelyTyped,dpsthree/DefinitelyTyped,egeland/DefinitelyTyped,arcticwaters/DefinitelyTyped,ahmedalsudani/DefinitelyTyped,danfma/DefinitelyTyped,RupertAvery/DefinitelyTyped | ---
+++
@@ -5,7 +5,7 @@
interface HandlebarsStatic {
- registerHelper(name: string, fn: Function, inverse?: bool): void;
+ registerHelper(name: string, fn: Function, inverse?: boolean): void;
registerPartial(name: string, str): void;
K();
createFrame(object); |
77bb25ae1f43becb7573d36f3bef0ef006f3b563 | src/app/initiative-tracker/initiative-tracker.component.ts | src/app/initiative-tracker/initiative-tracker.component.ts | import { Component, ViewChild } from "@angular/core";
import * as _ from "lodash";
import { InitiativeListComponent } from "./initiative-list/initiative-list.component";
import { CreatureInitiative } from "./models/creature-initiative";
@Component({
selector: "dnd-initiative-tracker",
templateUrl: "./initiative-tracker.component.html"
})
export class InitiativeTrackerComponent {
@ViewChild("list") initiativeList: InitiativeListComponent;
currentInitiative: number;
currentRound = 0;
onResetClick() {
this.initiativeList.clear();
this.currentInitiative = undefined;
this.currentRound = 0;
}
onNextClick() {
const creatures = this.initiativeList.creatures;
if (!this.currentInitiative) {
this.currentInitiative = creatures[0].initiative;
this.currentRound = 1;
} else {
const nextCreatures = creatures.filter(c => c.initiative < this.currentInitiative && c.active);
if (nextCreatures.length > 0) {
this.currentInitiative = nextCreatures[0].initiative;
} else {
this.currentInitiative = creatures[0].initiative;
this.currentRound++;
}
}
}
};
| import { Component, ViewChild } from "@angular/core";
import * as _ from "lodash";
import { InitiativeListComponent } from "./initiative-list/initiative-list.component";
import { CreatureInitiative } from "./models/creature-initiative";
@Component({
selector: "dnd-initiative-tracker",
templateUrl: "./initiative-tracker.component.html"
})
export class InitiativeTrackerComponent {
@ViewChild("list") initiativeList: InitiativeListComponent;
currentInitiative: number;
currentRound = 0;
onResetClick() {
this.initiativeList.clear();
this.currentInitiative = undefined;
this.currentRound = 0;
}
onNextClick() {
const activeCreatures = this.initiativeList.creatures.filter(c => c.active);
if (!this.currentInitiative) {
this.currentInitiative = activeCreatures[0].initiative;
this.currentRound = 1;
} else {
const nextCreatures = activeCreatures.filter(c => c.initiative < this.currentInitiative);
if (nextCreatures.length > 0) {
this.currentInitiative = nextCreatures[0].initiative;
} else {
this.currentInitiative = activeCreatures[0].initiative;
this.currentRound++;
}
}
}
};
| Fix initiative when first creature is inactive. | Fix initiative when first creature is inactive.
| TypeScript | mit | trwolfe13/dnd-5e-tools,trwolfe13/dnd-5e-tools,trwolfe13/dnd-5e-npc-gen,trwolfe13/dnd-5e-npc-gen,trwolfe13/dnd-5e-tools,trwolfe13/dnd-5e-npc-gen | ---
+++
@@ -22,16 +22,16 @@
}
onNextClick() {
- const creatures = this.initiativeList.creatures;
+ const activeCreatures = this.initiativeList.creatures.filter(c => c.active);
if (!this.currentInitiative) {
- this.currentInitiative = creatures[0].initiative;
+ this.currentInitiative = activeCreatures[0].initiative;
this.currentRound = 1;
} else {
- const nextCreatures = creatures.filter(c => c.initiative < this.currentInitiative && c.active);
+ const nextCreatures = activeCreatures.filter(c => c.initiative < this.currentInitiative);
if (nextCreatures.length > 0) {
this.currentInitiative = nextCreatures[0].initiative;
} else {
- this.currentInitiative = creatures[0].initiative;
+ this.currentInitiative = activeCreatures[0].initiative;
this.currentRound++;
}
} |
49b17dc8e4553ed3d541f10a01a4c812bacaa2cd | src/app/shared/security/auth.service.ts | src/app/shared/security/auth.service.ts | import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Observable, Subject, BehaviorSubject } from 'rxjs/Rx';
import { FirebaseAuth, FirebaseAuthState } from 'angularfire2';
@Injectable()
export class AuthService {
auth$: BehaviorSubject<FirebaseAuthState> = new BehaviorSubject(undefined);
constructor (private auth: FirebaseAuth, private router: Router) {
this.auth.subscribe(
data => {
this.auth$.next(data);
},
err => {
this.auth$.error(err);
}
);
}
login(email: string, password: string): Observable<FirebaseAuthState> {
return this.fromFirebaseAuthPromise(this.auth.login({ email, password }));
}
register(email: string, password: string): Observable<FirebaseAuthState> {
return this.fromFirebaseAuthPromise(this.auth.createUser({ email, password }));
}
fromFirebaseAuthPromise(promise): Observable<any> {
const subject = new Subject<any>();
promise
.then(res => {
subject.next(res);
subject.complete();
})
.catch(err => {
subject.error(err);
subject.complete();
});
return subject.asObservable();
}
logout() {
this.auth.logout();
this.router.navigate(['/home']);
}
}
| import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Observable, Subject, BehaviorSubject } from 'rxjs/Rx';
import { AngularFire, FirebaseAuthState } from 'angularfire2';
@Injectable()
export class AuthService {
auth$: BehaviorSubject<FirebaseAuthState> = new BehaviorSubject(undefined);
constructor (private af: AngularFire, private router: Router) {
this.af.auth.subscribe(
data => {
this.auth$.next(data);
},
err => {
this.auth$.error(err);
}
);
}
login(email: string, password: string): Observable<FirebaseAuthState> {
return this.fromFirebaseAuthPromise(this.af.auth.login({ email, password }));
}
register(email: string, password: string): Observable<FirebaseAuthState> {
return this.fromFirebaseAuthPromise(this.af.auth.createUser({ email, password }));
}
fromFirebaseAuthPromise(promise): Observable<any> {
const subject = new Subject<any>();
promise
.then(res => {
subject.next(res);
subject.complete();
})
.catch(err => {
subject.error(err);
subject.complete();
});
return subject.asObservable();
}
logout() {
this.af.auth.logout();
this.router.navigate(['/home']);
}
}
| Migrate FirebaseAuth to AngularFire only | Migrate FirebaseAuth to AngularFire only
Angularfire 2 updated
| TypeScript | mit | michaelgira23/Pear-Tutoring,michaelgira23/Pear-Tutoring,michaelgira23/Pear-Tutoring | ---
+++
@@ -1,15 +1,15 @@
import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Observable, Subject, BehaviorSubject } from 'rxjs/Rx';
-import { FirebaseAuth, FirebaseAuthState } from 'angularfire2';
+import { AngularFire, FirebaseAuthState } from 'angularfire2';
@Injectable()
export class AuthService {
auth$: BehaviorSubject<FirebaseAuthState> = new BehaviorSubject(undefined);
- constructor (private auth: FirebaseAuth, private router: Router) {
- this.auth.subscribe(
+ constructor (private af: AngularFire, private router: Router) {
+ this.af.auth.subscribe(
data => {
this.auth$.next(data);
},
@@ -20,11 +20,11 @@
}
login(email: string, password: string): Observable<FirebaseAuthState> {
- return this.fromFirebaseAuthPromise(this.auth.login({ email, password }));
+ return this.fromFirebaseAuthPromise(this.af.auth.login({ email, password }));
}
register(email: string, password: string): Observable<FirebaseAuthState> {
- return this.fromFirebaseAuthPromise(this.auth.createUser({ email, password }));
+ return this.fromFirebaseAuthPromise(this.af.auth.createUser({ email, password }));
}
fromFirebaseAuthPromise(promise): Observable<any> {
@@ -45,7 +45,7 @@
}
logout() {
- this.auth.logout();
+ this.af.auth.logout();
this.router.navigate(['/home']);
}
|
20840d43ac29982bb16408e0c6e35183f693d8cd | src/components/ContactDetails/index.tsx | src/components/ContactDetails/index.tsx | import * as React from 'react';
import {Component} from 'react';
import {observer} from 'mobx-react';
import Contact from '../../interfaces/Contact';
import {ProfilePicture} from './ProfilePicture';
@observer
export class ContactDetails extends Component<{selectedContact: Contact}, {}> {
render() {
return (
<div className="details">
<header>
<ProfilePicture contact={this.props.selectedContact} />
<div className="title">
<h1 className="name">{this.props.selectedContact.firstName} {this.props.selectedContact.lastName}</h1>
<div className="subtitle">{this.props.selectedContact.nickName}</div>
</div>
</header>
<table>
<tbody>
<tr>
<td>email</td>
<td>[email protected]</td>
</tr>
</tbody>
</table>
<footer>
<div className="left">
<button>+</button>
</div>
<div className="right">
<button>Delete</button>
<button>Edit</button>
</div>
</footer>
</div>
)
}
} | import * as React from 'react';
import {Component} from 'react';
import {observer} from 'mobx-react';
import Contact from '../../interfaces/Contact';
import {ProfilePicture} from './ProfilePicture';
@observer
export class ContactDetails extends Component<{selectedContact: Contact}, {}> {
render() {
const contact = this.props.selectedContact;
if (!contact) {
return <div className="details"></div>
}
return (
<div className="details">
<header>
<ProfilePicture contact={contact} />
<div className="title">
<h1 className="name">{contact.firstName} {contact.lastName}</h1>
<div className="subtitle">{contact.nickName}</div>
</div>
</header>
<table>
<tbody>
<tr>
<td>email</td>
<td>[email protected]</td>
</tr>
</tbody>
</table>
<footer>
<div className="left">
<button>+</button>
</div>
<div className="right">
<button>Delete</button>
<button>Edit</button>
</div>
</footer>
</div>
)
}
} | Handle no contact in ContactDetails | Handle no contact in ContactDetails
| TypeScript | mit | contacts-mvc/mobx-react-typescript,contacts-mvc/mobx-react-typescript,contacts-mvc/mobx-react-typescript | ---
+++
@@ -9,13 +9,19 @@
@observer
export class ContactDetails extends Component<{selectedContact: Contact}, {}> {
render() {
+ const contact = this.props.selectedContact;
+
+ if (!contact) {
+ return <div className="details"></div>
+ }
+
return (
<div className="details">
<header>
- <ProfilePicture contact={this.props.selectedContact} />
+ <ProfilePicture contact={contact} />
<div className="title">
- <h1 className="name">{this.props.selectedContact.firstName} {this.props.selectedContact.lastName}</h1>
- <div className="subtitle">{this.props.selectedContact.nickName}</div>
+ <h1 className="name">{contact.firstName} {contact.lastName}</h1>
+ <div className="subtitle">{contact.nickName}</div>
</div>
</header>
<table> |
f7c77c678ec0e2018fd000c1305125fe2a1dd4d6 | src/enums/predefined-strategies.enum.ts | src/enums/predefined-strategies.enum.ts | export enum NgxPermissionsPredefinedStrategies {
REMOVE = 'remove',
SHOW = 'show'
} | export enum NgxPermissionsPredefinedStrategies {
REMOVE = <any>'remove',
SHOW = <any>'show'
} | Add eny for fixing build | Add eny for fixing build
| TypeScript | mit | AlexKhymenko/ngx-permissions,AlexKhymenko/ngx-permissions,AlexKhymenko/ngx-permissions | ---
+++
@@ -1,4 +1,4 @@
export enum NgxPermissionsPredefinedStrategies {
- REMOVE = 'remove',
- SHOW = 'show'
+ REMOVE = <any>'remove',
+ SHOW = <any>'show'
} |
ce6b818683bdebbd0e0ea1c2708612ecd8f03594 | src/app/gallery/gallery.module.ts | src/app/gallery/gallery.module.ts | import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../shared/shared.module';
import { AlbumComponent } from './album/album.component';
import { AlbumListComponent } from './album-list/album-list.component';
import { ImageComponent } from './image/image.component';
import { ImageContainerComponent } from './image-container/image-container.component';
import { ThumbnailComponent } from './thumbnail/thumbnail.component';
import { ImageService } from './image.service';
import { AlbumService } from './album.service';
import { GalleryFormatPipe } from './gallery-format.pipe';
const galleryRoutes: Routes = [
{path: '', component: AlbumComponent, pathMatch: 'full' },
{path: 'albums', component: AlbumListComponent },
{path: 'album/:name', component: AlbumComponent },
{path: 'album/:name/page/:page', component: AlbumComponent },
{path: 'view/:id', component: ImageComponent },
];
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(galleryRoutes),
SharedModule
],
declarations: [AlbumComponent, AlbumListComponent, GalleryFormatPipe, ImageComponent, ImageContainerComponent, ThumbnailComponent],
exports: [ImageContainerComponent],
providers: [ImageService, AlbumService]
})
export class GalleryModule { }
| import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { SharedModule } from '../shared/shared.module';
import { AlbumComponent } from './album/album.component';
import { AlbumListComponent } from './album-list/album-list.component';
import { ImageComponent } from './image/image.component';
import { ImageContainerComponent } from './image-container/image-container.component';
import { ThumbnailComponent } from './thumbnail/thumbnail.component';
import { ImageService } from './image.service';
import { AlbumService } from './album.service';
import { GalleryFormatPipe } from './gallery-format.pipe';
const galleryRoutes: Routes = [
{path: '', component: AlbumComponent, pathMatch: 'full' },
{path: 'albums', component: AlbumListComponent },
{path: 'album/:name/page/:page', component: AlbumComponent },
{path: 'album/:name', component: AlbumComponent },
{path: 'view/:id', component: ImageComponent },
];
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(galleryRoutes),
SharedModule
],
declarations: [AlbumComponent, AlbumListComponent, GalleryFormatPipe, ImageComponent, ImageContainerComponent, ThumbnailComponent],
exports: [ImageContainerComponent],
providers: [ImageService, AlbumService]
})
export class GalleryModule { }
| Fix issue with gallery album component | Fix issue with gallery album component
Having these `album/:name` route before the `album/:name/page/:pagenumber` caused Angular to throw an error in some cases. | TypeScript | apache-2.0 | jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog | ---
+++
@@ -18,8 +18,8 @@
const galleryRoutes: Routes = [
{path: '', component: AlbumComponent, pathMatch: 'full' },
{path: 'albums', component: AlbumListComponent },
+ {path: 'album/:name/page/:page', component: AlbumComponent },
{path: 'album/:name', component: AlbumComponent },
- {path: 'album/:name/page/:page', component: AlbumComponent },
{path: 'view/:id', component: ImageComponent },
];
|
5295dc83c8ac3893b4a7b85569d04da891874fd0 | app/javascript/retrospring/features/answerbox/subscribe.ts | app/javascript/retrospring/features/answerbox/subscribe.ts | import Rails from '@rails/ujs';
import I18n from 'retrospring/i18n';
import { showNotification, showErrorNotification } from 'utilities/notifications';
export function answerboxSubscribeHandler(event: Event): void {
const button = event.target as HTMLButtonElement;
const id = button.dataset.aId;
let torpedo = 0;
let targetUrl;
event.preventDefault();
if (button.dataset.torpedo === 'yes') {
torpedo = 1;
}
if (torpedo) {
targetUrl = '/ajax/subscribe';
} else {
targetUrl = '/ajax/unsubscribe';
}
Rails.ajax({
url: targetUrl,
type: 'POST',
data: new URLSearchParams({
answer: id
}).toString(),
success: (data) => {
if (data.success) {
button.dataset.torpedo = ["yes", "no"][torpedo];
button.children[0].nextSibling.textContent = ' ' + (torpedo ? I18n.translate('voc.unsubscribe') : I18n.translate('voc.subscribe'));
showNotification(I18n.translate(`frontend.subscription.${torpedo ? 'subscribe' : 'unsubscribe'}`));
} else {
showErrorNotification(I18n.translate(`frontend.subscription.fail.${torpedo ? 'subscribe' : 'unsubscribe'}`));
}
},
error: (data, status, xhr) => {
console.log(data, status, xhr);
showErrorNotification(I18n.translate('frontend.error.message'));
}
});
} | import { post } from '@rails/request.js';
import I18n from 'retrospring/i18n';
import { showNotification, showErrorNotification } from 'utilities/notifications';
export function answerboxSubscribeHandler(event: Event): void {
const button = event.target as HTMLButtonElement;
const id = button.dataset.aId;
let torpedo = 0;
let targetUrl;
event.preventDefault();
if (button.dataset.torpedo === 'yes') {
torpedo = 1;
}
if (torpedo) {
targetUrl = '/ajax/subscribe';
} else {
targetUrl = '/ajax/unsubscribe';
}
post(targetUrl, {
body: {
answer: id
},
contentType: 'application/json'
})
.then(async response => {
const data = await response.json;
if (data.success) {
button.dataset.torpedo = ["yes", "no"][torpedo];
button.children[0].nextSibling.textContent = ' ' + (torpedo ? I18n.translate('voc.unsubscribe') : I18n.translate('voc.subscribe'));
showNotification(I18n.translate(`frontend.subscription.${torpedo ? 'subscribe' : 'unsubscribe'}`));
} else {
showErrorNotification(I18n.translate(`frontend.subscription.fail.${torpedo ? 'subscribe' : 'unsubscribe'}`));
}
})
.catch(err => {
console.log(err);
showErrorNotification(I18n.translate('frontend.error.message'));
});
} | Refactor answer subscribing to use request.js | Refactor answer subscribing to use request.js
| TypeScript | agpl-3.0 | Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring | ---
+++
@@ -1,4 +1,4 @@
-import Rails from '@rails/ujs';
+import { post } from '@rails/request.js';
import I18n from 'retrospring/i18n';
import { showNotification, showErrorNotification } from 'utilities/notifications';
@@ -20,13 +20,15 @@
targetUrl = '/ajax/unsubscribe';
}
- Rails.ajax({
- url: targetUrl,
- type: 'POST',
- data: new URLSearchParams({
+ post(targetUrl, {
+ body: {
answer: id
- }).toString(),
- success: (data) => {
+ },
+ contentType: 'application/json'
+ })
+ .then(async response => {
+ const data = await response.json;
+
if (data.success) {
button.dataset.torpedo = ["yes", "no"][torpedo];
button.children[0].nextSibling.textContent = ' ' + (torpedo ? I18n.translate('voc.unsubscribe') : I18n.translate('voc.subscribe'));
@@ -34,10 +36,9 @@
} else {
showErrorNotification(I18n.translate(`frontend.subscription.fail.${torpedo ? 'subscribe' : 'unsubscribe'}`));
}
- },
- error: (data, status, xhr) => {
- console.log(data, status, xhr);
+ })
+ .catch(err => {
+ console.log(err);
showErrorNotification(I18n.translate('frontend.error.message'));
- }
- });
+ });
} |
107e6b25ae9dfdd17a9c39a9b34c36a5318ae001 | Rnwood.Smtp4dev/ClientApp/components/hubconnectionstatus.ts | Rnwood.Smtp4dev/ClientApp/components/hubconnectionstatus.ts | import Vue from "vue";
import { Component, Prop } from "vue-property-decorator";
import HubConnectionManager from "../HubConnectionManager";
@Component
export default class HubConnectionStatus extends Vue {
constructor() {
super();
}
@Prop({ default: undefined })
connection: HubConnectionManager | undefined;
buttonType(): string {
return this.connection && this.connection.connected ? "success" : this.connection && this.connection.started ? "warning" : "danger";
}
buttonTitle(): string {
var errorText = this.connection && this.connection.error ? "\nError: " + this.connection.error.message : "";
return (this.connection && this.connection.started ? "Auto refresh enabled - Click to disconnect" : "Auto refresh disabled - click to enable") + errorText;
}
buttonIcon(): string {
return this.connection && this.connection.connected ? "el-icon-success" : this.connection && this.connection.started ? "el-icon-warning" : "el-icon-warning";
}
buttonClick = () => {
if (this.connection) {
if (!this.connection.started) {
this.connection.start();
} else {
this.connection.stop();
}
}
}
async created() {
}
async destroyed() {
}
} | import Vue from "vue";
import { Component, Prop } from "vue-property-decorator";
import HubConnectionManager from "../HubConnectionManager";
@Component
export default class HubConnectionStatus extends Vue {
constructor() {
super();
}
@Prop({ default: undefined })
connection: HubConnectionManager | undefined;
buttonType(): string {
return this.connection && this.connection.connected ? "success" : this.connection && this.connection.started ? "warning" : "danger";
}
buttonTitle(): string {
var errorText = this.connection && this.connection.error ? "\nError: " + this.connection.error.message : "";
return (this.connection && this.connection.connected ? "Auto refresh enabled - Click to disconnect" : this.connection && this.connection.started ? "Auto refresh re-connecting..." : "Auto refresh disabled - click to enable") + errorText;
}
buttonIcon(): string {
return this.connection && this.connection.connected ? "el-icon-success" : this.connection && this.connection.started ? "el-icon-warning" : "el-icon-warning";
}
buttonClick = () => {
if (this.connection) {
if (!this.connection.started) {
this.connection.start();
} else {
this.connection.stop();
}
}
}
async created() {
}
async destroyed() {
}
} | Correct status tooltip when autorefresh is connecting. | Correct status tooltip when autorefresh is connecting.
| TypeScript | bsd-3-clause | rnwood/smtp4dev,rnwood/smtp4dev,rnwood/smtp4dev,rnwood/smtp4dev | ---
+++
@@ -19,7 +19,7 @@
buttonTitle(): string {
var errorText = this.connection && this.connection.error ? "\nError: " + this.connection.error.message : "";
- return (this.connection && this.connection.started ? "Auto refresh enabled - Click to disconnect" : "Auto refresh disabled - click to enable") + errorText;
+ return (this.connection && this.connection.connected ? "Auto refresh enabled - Click to disconnect" : this.connection && this.connection.started ? "Auto refresh re-connecting..." : "Auto refresh disabled - click to enable") + errorText;
}
buttonIcon(): string { |
b9aef3a9ac9cf0ee9f5f4d18cefbe65725e22af9 | types/npm/npm-tests.ts | types/npm/npm-tests.ts | /**
* Test suite created by Maxime LUCE <https://github.com/SomaticIT>
*
* Created by using code samples from https://github.com/npm/npm#using-npm-programmatically.
*/
import npm = require("npm");
npm.load({}, function (er) {
if (er) {
return console.error(er);
}
npm.commands.install(["some", "args"], function (er, data) {
if (er) {
return console.error(er);
}
// command succeeded, and data might have some info
});
npm.on("log", function (message: string) {
console.log(message);
});
})
| /**
* Test suite created by Maxime LUCE <https://github.com/SomaticIT>
*
* Created by using code samples from https://github.com/npm/npm#using-npm-programmatically.
*/
import npm = require("npm");
npm.load({}, function (er) {
if (er) {
return console.error(er);
}
npm.commands.install(["some", "args"], function (er, data) {
if (er) {
return console.error(er);
}
// command succeeded, and data might have some info
});
npm.on("log", function (message: string) {
console.log(message);
});
npm.config.set('audit', false);
})
| Add test for generic setter | Add test for generic setter | TypeScript | mit | georgemarshall/DefinitelyTyped,georgemarshall/DefinitelyTyped,georgemarshall/DefinitelyTyped,dsebastien/DefinitelyTyped,dsebastien/DefinitelyTyped,markogresak/DefinitelyTyped,borisyankov/DefinitelyTyped,mcliment/DefinitelyTyped,borisyankov/DefinitelyTyped,georgemarshall/DefinitelyTyped | ---
+++
@@ -22,4 +22,6 @@
npm.on("log", function (message: string) {
console.log(message);
});
+
+ npm.config.set('audit', false);
}) |
ef69a806aa4150699169e141370231a524c223cd | src/app/chapter-discussion/chapter-discussion.component.ts | src/app/chapter-discussion/chapter-discussion.component.ts | import {Component, Input, OnInit} from '@angular/core'
import {CommentService} from '../comment.service'
import {Comment} from '../../models/comment'
import {AuthenticationService} from '../authentication.service'
@Component({
selector: 'wn-chapter-discussion',
templateUrl: './chapter-discussion.component.html',
styleUrls: ['./chapter-discussion.component.css']
})
export class ChapterDiscussionComponent implements OnInit {
@Input() chapterId: string
comments: Comment[] = []
commentsLoaded = false
isExpanded = false
constructor(private _commentService: CommentService,
private _authService: AuthenticationService) {
}
ngOnInit() {
}
addNewComment(comment: Comment) {
this.comments = [comment].concat(this.comments)
}
toggleExpand() {
this._commentService.getDiscussionRootComments(this.chapterId).subscribe(comments => {
this.comments = comments
this.commentsLoaded = true
})
this.isExpanded = !this.isExpanded
}
isLoggedIn() {
return this._authService.isLoggedIn()
}
}
| import {Component, Input, OnInit} from '@angular/core'
import {CommentService} from '../comment.service'
import {Comment} from '../../models/comment'
import {AuthenticationService} from '../authentication.service'
@Component({
selector: 'wn-chapter-discussion',
templateUrl: './chapter-discussion.component.html',
styleUrls: ['./chapter-discussion.component.css']
})
export class ChapterDiscussionComponent implements OnInit {
@Input() chapterId: string
comments: Comment[] = []
commentsLoaded = false
isExpanded = false
constructor(private _commentService: CommentService,
private _authService: AuthenticationService) {
}
ngOnInit() {
}
addNewComment(comment: Comment) {
this.comments = [comment].concat(this.comments)
this.isExpanded = true
}
toggleExpand() {
this._commentService.getDiscussionRootComments(this.chapterId).subscribe(comments => {
this.comments = comments
this.commentsLoaded = true
})
this.isExpanded = !this.isExpanded
}
isLoggedIn() {
return this._authService.isLoggedIn()
}
}
| Comment section should be expanded when submitting a comment | Comment section should be expanded when submitting a comment
| TypeScript | mit | oleeskild/WebNovel,oleeskild/WebNovel,oleeskild/WebNovel | ---
+++
@@ -25,6 +25,7 @@
addNewComment(comment: Comment) {
this.comments = [comment].concat(this.comments)
+ this.isExpanded = true
}
toggleExpand() { |
b13efe117ff83556e2fa32a8f1af72b939489d87 | WeaveTSJS/src/weavejs/ui/flexbox/BoxProps.tsx | WeaveTSJS/src/weavejs/ui/flexbox/BoxProps.tsx | namespace weavejs.ui.flexbox
{
export interface BoxProps <T> extends React.HTMLProps<T>
{
padded?:boolean;
overflow?:boolean;
}
export class BoxProps<T>
{
static renderBox<T>(props:BoxProps<T>, options:{flexDirection:string, unpaddedClassName:string, paddedClassName:string}):JSX.Element
{
var attributes:React.HTMLAttributes = _.omit(props, 'padded', 'overflow');
var style:React.CSSProperties = _.merge(
{
display: "flex",
},
props.style,
{
flexDirection: options.flexDirection
}
);
var className:string = classNames(
props.padded ? options.paddedClassName : options.unpaddedClassName,
{"weave-auto-overflow": props.overflow},
props.className
);
return <div {...attributes} style={style} className={className}/>;
}
}
}
| namespace weavejs.ui.flexbox
{
export interface BoxProps <T> extends React.HTMLProps<T>
{
padded?:boolean;
overflow?:boolean;
}
export class BoxProps<T>
{
static renderBox<T>(props:BoxProps<T>, options:{flexDirection:string, unpaddedClassName:string, paddedClassName:string}):JSX.Element
{
var attributes:React.HTMLAttributes = _.omit(props, 'padded', 'overflow');
var style:React.CSSProperties = _.merge(
{
display: "flex",
},
props.style,
{
flexDirection: options.flexDirection
}
);
var className:string = classNames(
props.padded ? options.paddedClassName : options.unpaddedClassName,
{"weave-auto-overflow": !props.overflow},
props.className
);
return <div {...attributes} style={style} className={className}/>;
}
}
}
| Fix for default overflow for FlexBox | Fix for default overflow for FlexBox
| TypeScript | mpl-2.0 | WeaveTeam/WeaveJS,WeaveTeam/WeaveJS,WeaveTeam/WeaveJS,WeaveTeam/WeaveJS | ---
+++
@@ -22,7 +22,7 @@
);
var className:string = classNames(
props.padded ? options.paddedClassName : options.unpaddedClassName,
- {"weave-auto-overflow": props.overflow},
+ {"weave-auto-overflow": !props.overflow},
props.className
);
return <div {...attributes} style={style} className={className}/>; |
55120b994ec429b991181e27278e1f435ea78e1d | app/src/ui/diff/hidden-bidi-chars-warning.tsx | app/src/ui/diff/hidden-bidi-chars-warning.tsx | import React from 'react'
import { Octicon } from '../octicons'
import * as OcticonSymbol from '../octicons/octicons.generated'
import { LinkButton } from '../lib/link-button'
export class HiddenBidiCharsWarning extends React.Component {
public render() {
return (
<div className="hidden-bidi-chars-warning">
<Octicon symbol={OcticonSymbol.alert} />
This file contains 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.{' '}
<LinkButton uri="https://github.co/hiddenchars">
Learn more about bidirectional Unicode characters
</LinkButton>
</div>
)
}
}
| import React from 'react'
import { Octicon } from '../octicons'
import * as OcticonSymbol from '../octicons/octicons.generated'
import { LinkButton } from '../lib/link-button'
export class HiddenBidiCharsWarning extends React.Component {
public render() {
return (
<div className="hidden-bidi-chars-warning">
<Octicon symbol={OcticonSymbol.alert} />
This diff contains 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.{' '}
<LinkButton uri="https://github.co/hiddenchars">
Learn more about bidirectional Unicode characters
</LinkButton>
</div>
)
}
}
| Make the bidi chars warning diff specific | Make the bidi chars warning diff specific
Co-Authored-By: tidy-dev <1461e01e04d43338bd0e74c1f0f8ac6b8d625527@users.noreply.github.com>
| TypeScript | mit | j-f1/forked-desktop,say25/desktop,desktop/desktop,say25/desktop,j-f1/forked-desktop,artivilla/desktop,desktop/desktop,j-f1/forked-desktop,say25/desktop,shiftkey/desktop,desktop/desktop,shiftkey/desktop,artivilla/desktop,say25/desktop,artivilla/desktop,shiftkey/desktop,shiftkey/desktop,j-f1/forked-desktop,artivilla/desktop,desktop/desktop | ---
+++
@@ -8,7 +8,7 @@
return (
<div className="hidden-bidi-chars-warning">
<Octicon symbol={OcticonSymbol.alert} />
- This file contains bidirectional Unicode text that may be interpreted or
+ This diff contains 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.{' '}
<LinkButton uri="https://github.co/hiddenchars"> |
8022362d6e485504c562f068491ec66e2ead0441 | src/services/rating.service.ts | src/services/rating.service.ts | import {Injectable} from "@angular/core";
@Injectable()
export class RatingService{
private p1NewRating: number;
private p2NewRating: number;
private p1RatingChange: number;
private p2RatingChange: number;
calculateRating(rating1: number, rating2: number, score1: number, score2: number){
let K = 32;
let T1 = Math.pow(10, rating1/400);
let T2 = Math.pow(10, rating2/400);
let E1 = T1 / (T1 + T2);
let S1;
if(score1 > score2){
S1 = 1;
}else if(score1 == score2){
S1 = 0.5;
}else{
S1 = 0;
}
let D1 = Math.round(K * (S1 - E1));
let D2 = -D1;
let R1 = rating1 + D1;
let R2 = rating2 + D2;
this.p1RatingChange = D1;
this.p2RatingChange = D2;
this.p1NewRating = R1;
this.p2NewRating = R2;
}
getP1NewRating(){
return this.p1NewRating;
}
getP2NewRating(){
return this.p2NewRating;
}
getP1RatingChange(){
return this.p1RatingChange;
}
getP2RatingChange(){
return this.p2RatingChange;
}
}
| import {Injectable} from "@angular/core";
@Injectable()
export class RatingService{
private p1NewRating: number;
private p2NewRating: number;
private p1RatingChange: number;
private p2RatingChange: number;
calculateRating(rating1: number, rating2: number, score1: number, score2: number){
let K = 50;
let T1 = Math.pow(10, rating1/400);
let T2 = Math.pow(10, rating2/400);
let E1 = T1 / (T1 + T2);
let S1;
if(score1 > score2){
S1 = 1;
}else if(score1 == score2){
S1 = 0.5;
}else{
S1 = 0;
}
let D1 = Math.round(K * (S1 - E1));
let D2 = -D1;
let R1 = rating1 + D1;
let R2 = rating2 + D2;
this.p1RatingChange = D1;
this.p2RatingChange = D2;
this.p1NewRating = R1;
this.p2NewRating = R2;
}
getP1NewRating(){
return this.p1NewRating;
}
getP2NewRating(){
return this.p2NewRating;
}
getP1RatingChange(){
return this.p1RatingChange;
}
getP2RatingChange(){
return this.p2RatingChange;
}
}
| Increase K value for Elo rating | Increase K value for Elo rating
| TypeScript | mit | casperchia/foosmate,casperchia/foosmate,casperchia/foosmate | ---
+++
@@ -8,7 +8,7 @@
private p2RatingChange: number;
calculateRating(rating1: number, rating2: number, score1: number, score2: number){
- let K = 32;
+ let K = 50;
let T1 = Math.pow(10, rating1/400);
let T2 = Math.pow(10, rating2/400);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.