Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Use mock server to retrieve a project | import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import 'rxjs/add/operator/toPromise';
import { Group, Project } from '../+models';
import { ApiService, AuthenticationService } from './';
@Injectable()
export class ProjectsService {
private project... | import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import 'rxjs/add/operator/toPromise';
import { Group, Project } from '../+models';
import { ApiService, AuthenticationService } from './';
@Injectable()
export class ProjectsService {
private all = (... |
Remove rxjs from media queries | import store from '../store/store';
import { setPhonePortrait } from '../shell/actions';
import { Observable, defer, fromEventPattern, asapScheduler } from 'rxjs';
import { map, startWith, subscribeOn } from 'rxjs/operators';
// This seems like a good breakpoint for portrait based on https://material.io/devices/
// We... | import store from '../store/store';
import { setPhonePortrait } from '../shell/actions';
// This seems like a good breakpoint for portrait based on https://material.io/devices/
// We can't use orientation:portrait because Android Chrome messes up when the keyboard is shown: https://www.chromestatus.com/feature/5656077... |
Disable js/ts features for the private scheme | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
Use Object.assign instead of _.clone. | import * as e from "./Enums";
import * as _ from "lodash";
import {memoize} from "./Decorators";
import {Attributes} from "./Interfaces";
export const attributesFlyweight = _.memoize(
(attributes: Attributes): Attributes => _.clone(attributes),
(attributes: Dictionary<any>) => {
const ordered: Dictiona... | import * as e from "./Enums";
import * as _ from "lodash";
import {memoize} from "./Decorators";
import {Attributes} from "./Interfaces";
export const attributesFlyweight = _.memoize(
(attributes: Attributes): Attributes => Object.assign({}, attributes),
(attributes: Dictionary<any>) => {
const ordered... |
Fix openerTabId warning on Android | import TabPresenter from '../presenters/TabPresenter';
export default class LinkUseCase {
private tabPresenter: TabPresenter;
constructor() {
this.tabPresenter = new TabPresenter();
}
openToTab(url: string, tabId: number): Promise<any> {
return this.tabPresenter.open(url, tabId);
}
openNewTab(ur... | import TabPresenter from '../presenters/TabPresenter';
export default class LinkUseCase {
private tabPresenter: TabPresenter;
constructor() {
this.tabPresenter = new TabPresenter();
}
openToTab(url: string, tabId: number): Promise<any> {
return this.tabPresenter.open(url, tabId);
}
openNewTab(ur... |
Make security service contract's loginWithCredentionals of ts client sync with its default implementation | module Bit.Contracts {
export interface Token {
access_token: string;
expires_in: number;
token_type: string;
login_date: Date;
}
export interface ISecurityService {
isLoggedIn(): boolean;
login(state?: any): void;
logout(): void;
loginWithC... | module Bit.Contracts {
export interface Token {
access_token: string;
expires_in: number;
token_type: string;
login_date: Date;
}
export interface ISecurityService {
isLoggedIn(): boolean;
login(state?: any): void;
logout(): void;
loginWithC... |
Change key size from 1538 bits to 2048 bits | // Copyright 2018 The Outline Authors
//
// 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 agre... | // Copyright 2018 The Outline Authors
//
// 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 agre... |
Disable save button when saving is happening in the background | import { Component, OnInit } from '@angular/core';
import {ChapterService} from "../chapter.service";
import {ActivatedRoute, Router} from "@angular/router";
import {Chapter} from "../../models/chapter";
@Component({
selector: 'wn-write',
templateUrl: './write.component.html',
styleUrls: ['./write.component.css'... | import { Component, OnInit } from '@angular/core';
import {ChapterService} from "../chapter.service";
import {ActivatedRoute, Router} from "@angular/router";
import {Chapter} from "../../models/chapter";
@Component({
selector: 'wn-write',
templateUrl: './write.component.html',
styleUrls: ['./write.component.css'... |
Check that tests for comments in tsconfig tests extended files | import { } from 'jest';
import { } from 'node';
import * as ts from 'typescript';
import * as fs from 'fs';
jest.mock('path');
describe('parse tsconfig with comments', () => {
const configFile1 = './tests/tsconfig-test/allows-comments.json';
const configFile2 = './tests/tsconfig-test/allows-comments2.json';
be... | import { } from 'jest';
import { } from 'node';
import * as ts from 'typescript';
import * as fs from 'fs';
import * as tsconfig from 'tsconfig';
jest.mock('path');
describe('parse tsconfig with comments', () => {
const configFile1 = './tests/tsconfig-test/allows-comments.json';
const configFile2 = './tests/tscon... |
Create secure (https) XMLRPC client | import puppeteer from 'puppeteer';
import * as xmlrpc from 'xmlrpc';
import { Bot } from './bot';
import { Doku } from './doku';
import { onExit } from './on_exit';
import { Renderer } from './render';
// Used by our .service initfile to find the bot process.
process.title = 'comicsbot';
interface Config {
discordT... | import puppeteer from 'puppeteer';
import * as xmlrpc from 'xmlrpc';
import { Bot } from './bot';
import { Doku } from './doku';
import { onExit } from './on_exit';
import { Renderer } from './render';
// Used by our .service initfile to find the bot process.
process.title = 'comicsbot';
interface Config {
discordT... |
Add thank-you component to routing | // tslint:disable-next-line:max-line-length
import { AudiologistNavigationComponent } from './audiologist-navigation/audiologist-navigation.component';
import { CheckInComponent } from './check-in/check-in.component';
import { Routes } from '@angular/router';
import { HomeComponent } from './home';
import { NoContentCo... | // tslint:disable-next-line:max-line-length
import { AudiologistNavigationComponent } from './audiologist-navigation/audiologist-navigation.component';
import { CheckInComponent } from './check-in/check-in.component';
import { Routes } from '@angular/router';
import { HomeComponent } from './home';
import { NoContentCo... |
Fix maches matchMedia to render horizontal or vertical menu by adding max-height check also | import React, { ReactElement } from 'react'
import { useMatchMedia, useI18n } from 'hooks'
import { Header, Title } from 'components/Layout'
import Menu, { Item } from 'components/Layout/Menu'
import AnimatedPatterns from 'components/AnimatedPatterns'
import LanguageSwitcher from 'components/LanguageSwitcher'
import s... | import React, { ReactElement } from 'react'
import { useMatchMedia, useI18n } from 'hooks'
import { Header, Title } from 'components/Layout'
import Menu, { Item } from 'components/Layout/Menu'
import AnimatedPatterns from 'components/AnimatedPatterns'
import LanguageSwitcher from 'components/LanguageSwitcher'
import s... |
Reset search on page change | import { filter, map } from 'rxjs/operators'
import { Component, OnInit } from '@angular/core'
import { NavigationEnd, Router } from '@angular/router'
import { getParameterByName } from '../shared/misc/utils'
@Component({
selector: 'my-header',
templateUrl: './header.component.html',
styleUrls: [ './header.compo... | import { filter, map } from 'rxjs/operators'
import { Component, OnInit } from '@angular/core'
import { NavigationEnd, Router } from '@angular/router'
import { getParameterByName } from '../shared/misc/utils'
@Component({
selector: 'my-header',
templateUrl: './header.component.html',
styleUrls: [ './header.compo... |
Change symbol type to lowercase | import { Emitter } from "event-emitter";
declare namespace pipe {
interface EmitterPipe {
close(): void;
}
}
declare function pipe(source: Emitter, target: Emitter, emitMethodName?: string | Symbol): pipe.EmitterPipe;
export = pipe;
| import { Emitter } from "event-emitter";
declare namespace pipe {
interface EmitterPipe {
close(): void;
}
}
declare function pipe(source: Emitter, target: Emitter, emitMethodName?: string | symbol): pipe.EmitterPipe;
export = pipe;
|
Refactor mocks - add seed | import faker from 'faker';
export class Faker {
private static get positiveInteger(): number {
return faker.random.number({
min: 0,
max: Number.MAX_SAFE_INTEGER,
precision: 1,
});
}
private static get className(): string {
return faker.lorem.word();
}
static get modelName(): s... | import faker from 'faker';
import {
Filter,
Schema,
ModelConstructor,
} from '../types';
function positiveInteger(): number {
return faker.random.number(Number.MAX_SAFE_INTEGER);
}
function className(): string {
return faker.lorem.word();
}
function propertyName(): string {
return faker.lorem.word().toL... |
Add compare ids into state. | import {MstSvt} from "../../../model/master/Master";
import {MstSkillContainer, MstSvtSkillContainer, MstCombineSkillContainer} from "../../../model/impl/MstContainer";
export interface MstGoal {
appVer: string;
svtRawData: Array<MstSvt>;
svtSkillData: MstSvtSkillContainer;
skillCombineData: MstCombine... | import {MstSvt} from "../../../model/master/Master";
import {MstSkillContainer, MstSvtSkillContainer, MstCombineSkillContainer} from "../../../model/impl/MstContainer";
export interface MstGoal {
appVer: string;
svtRawData: Array<MstSvt>;
svtSkillData: MstSvtSkillContainer;
skillCombineData: MstCombine... |
Remove extraneous channel type in Context model. | import * as Discord from 'discord.js';
import * as mongoose from 'mongoose';
import { logInteraction } from '../helpers/logger';
export default class Context {
id: string;
bot: Discord.Client;
channel: Discord.TextChannel | Discord.DMChannel | Discord.NewsChannel;
guild: Discord.Guild;
msg: string;... | import * as Discord from 'discord.js';
import * as mongoose from 'mongoose';
import { logInteraction } from '../helpers/logger';
export default class Context {
id: string;
bot: Discord.Client;
channel: Discord.TextChannel | Discord.DMChannel;
guild: Discord.Guild;
msg: string;
preferences: mong... |
Add Nightwatch schematics to e2e command | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ArchitectCommand } from '../models/architect-command';
import { Arguments } from '../models/interface';
impo... | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ArchitectCommand } from '../models/architect-command';
import { Arguments } from '../models/interface';
impo... |
Use basename to extract class name | import * as fs from "fs";
import * as vscode from "vscode";
import MemberTypes from "./MemberTypes";
class ParsedPhpClass {
public name: string;
public properties: MemberTypes = new MemberTypes();
public methods: MemberTypes = new MemberTypes();
}
function parsePhpToObject(phpClass: string): ParsedPhpClass {
... | import * as fs from "fs";
import * as path from "path";
import * as vscode from "vscode";
import MemberTypes from "./MemberTypes";
class ParsedPhpClass {
public name: string;
public properties: MemberTypes = new MemberTypes();
public methods: MemberTypes = new MemberTypes();
}
function parsePhpToObject(phpClass... |
Use Page component in books page | import * as React from "react";
import { connect } from "react-redux";
import { Redirect } from "react-router-dom";
import { IBook } from "../lib/books";
import "./style/Books.css";
interface IProps {
books: IBook[];
signedIn: boolean;
}
class Books extends React.Component<IProps> {
public render() {
... | import * as React from "react";
import { connect } from "react-redux";
import { Redirect } from "react-router-dom";
import { IBook } from "../lib/books";
import Page from "./Page";
import "./style/Books.css";
interface IProps {
books: IBook[];
signedIn: boolean;
}
class Books extends React.Component<IProps> ... |
Introduce snapshot size limit as plugin option for OpenStack offering | import * as React from 'react';
import { FormContainer, SelectField } from '@waldur/form-react';
import { translate } from '@waldur/i18n';
export const OpenStackPluginOptionsForm = ({ container, locale }) => {
const STORAGE_MODE_OPTIONS = React.useMemo(
() => [
{
label: translate('Fixed — use comm... | import * as React from 'react';
import { FormContainer, SelectField, NumberField } from '@waldur/form-react';
import { translate } from '@waldur/i18n';
export const OpenStackPluginOptionsForm = ({ container }) => {
const STORAGE_MODE_OPTIONS = React.useMemo(
() => [
{
label: translate('Fixed — use... |
Fix image positioning to be absolute centered and scale both w/h | import * as React from 'react';
import * as mobxReact from 'mobx-react';
import * as mio from '../';
@mobxReact.observer
export class ChapterView extends React.Component<{vm: mio.ChapterViewModel}> {
// TODO: Inline styles like this are pretty bad, eh.
render() {
return (
<div onClick={e => this._onClick... | import * as React from 'react';
import * as mobxReact from 'mobx-react';
import * as mio from '../';
@mobxReact.observer
export class ChapterView extends React.Component<{vm: mio.ChapterViewModel}> {
// TODO: Inline styles like this are pretty bad, eh.
render() {
return (
<div onClick={e => this._onClick... |
Update logic for feedback status bar color | import {Response} from "quill-marking-logic"
interface Attempt {
response: Response
}
function getAnswerState(attempt: Attempt|undefined): boolean {
if (attempt) {
return (!!attempt.response.optimal && attempt.response.author === undefined)
}
return false
}
export default getAnswerState; | import {Response} from "quill-marking-logic"
interface Attempt {
response: Response
}
function getAnswerState(attempt: Attempt|undefined): boolean {
if (attempt) {
return (attempt.response.optimal)
}
return false
}
export default getAnswerState; |
Add support for new blockchain fields. | import { ProjectWizardData } from './project-wizard-data.model';
export class Project {
public projectName: string;
public freelancer: string;
public client: string;
public startDate: number;
public endDate: number;
public budget: number;
public paymentType: string;
public paymentTrigger: string;
pub... | import { ProjectWizardData } from './project-wizard-data.model';
export class Project {
public projectName: string;
public freelancer: string;
public client: string;
public startDate: number;
public endDate: number;
public budget: number;
public billingMethod: string;
public paymentType: string;
publ... |
Disable accept and preview buttons according to user's qualifications. | import * as React from 'react';
import { ButtonGroup, Button } from '@shopify/polaris';
import { SearchResult } from '../../types';
import TOpticonButton from './TOpticonButton';
import { generateAcceptUrl, generatePreviewUrl } from '../../utils/urls';
export interface Props {
readonly hit: SearchResult;
}
... | import * as React from 'react';
import { ButtonGroup, Button } from '@shopify/polaris';
import { SearchResult } from '../../types';
import TOpticonButton from './TOpticonButton';
import { generateAcceptUrl, generatePreviewUrl } from '../../utils/urls';
export interface Props {
readonly hit: SearchResult;
}
... |
Add a contextual type in test case | /// <reference path='fourslash.ts' />
////var x = "/*1*/string";
////function f(a = "/*2*/initial value") { }
goTo.marker("1");
verify.renameInfoFailed();
goTo.marker("2");
verify.renameInfoFailed();
| /// <reference path='fourslash.ts' />
////var y: "string" = "string;
////var x = "/*1*/string";
////function f(a = "/*2*/initial value") { }
goTo.marker("1");
verify.renameInfoFailed();
goTo.marker("2");
verify.renameInfoFailed();
|
Fix "empty textures" error on empty canvas | /**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { DrawPass } from './draw';
import { PickPass } from './pick';
import { MultiSamplePass } from './multi-sample';
import { WebGLContext } from '../../mol... | /**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { DrawPass } from './draw';
import { PickPass } from './pick';
import { MultiSamplePass } from './multi-sample';
import { WebGLContext } from '../../mol... |
Fix parse function return in shell-quote | // Type definitions for shell-quote 1.6
// Project: https://github.com/substack/node-shell-quote
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export function quote(args: string[]): string;
export function ... | // Type definitions for shell-quote 1.6
// Project: https://github.com/substack/node-shell-quote
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
// Cameron Diver <https://github.com/CameronDiver>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2... |
Fix tslint issue in test env | import React from 'react';
import ModalContext from './context';
// eslint-disable-next-line
import { IModalContext } from './types';
const withModalContext = <T extends object>(Component: React.ComponentType<T>): React.ComponentType<T> => {
class ComponentHOC extends React.Component<T> {
modal: React.Ref... | import React from 'react';
import ModalContext from './context';
// eslint-disable-next-line
import { IModalContext } from './types';
const withModalContext = <T extends object>(Component: React.ComponentType<T>): React.ComponentType<T> => {
class ComponentHOC extends React.Component<T> {
modal: React.Ref... |
Include headings within blockquotes in TOC | import { RichOutlineSyntaxNode } from './RichOutlineSyntaxNode'
import { UpDocument } from './UpDocument'
import { Writer } from '../Writing/Writer'
export class Blockquote extends RichOutlineSyntaxNode {
// As a rule, we don't want to include any blockquoted content in the table of contents.
descendantsToInclude... | import { RichOutlineSyntaxNode } from './RichOutlineSyntaxNode'
import { Writer } from '../Writing/Writer'
export class Blockquote extends RichOutlineSyntaxNode {
write(writer: Writer): string {
return writer.blockquote(this)
}
protected BLOCKQUOTE(): void { }
}
|
Add missing semicolon in test | /*
highlight.js definition by Niklas Mollenhauer
Last Update: 10.09.2013
Source Code: https://github.com/isagalaev/highlight.js
Project Page: http://softwaremaniacs.org/soft/highlight/en/
*/
/// <reference path="highlightjs.d.ts" />
import hljs = require("highlight.js");
var code = "using System;\npublic class T... | /*
highlight.js definition by Niklas Mollenhauer
Last Update: 10.09.2013
Source Code: https://github.com/isagalaev/highlight.js
Project Page: http://softwaremaniacs.org/soft/highlight/en/
*/
/// <reference path="highlightjs.d.ts" />
import hljs = require("highlight.js");
var code = "using System;\npublic class T... |
Sort domotics devices by label/name | import { Component, OnInit } from '@angular/core';
import { ConfigService } from '../_services/config.service';
import { timer } from 'rxjs';
import { OpenhabService } from '../_services/openhab.service';
@Component({
selector: 'app-domotics',
templateUrl: './domotics.component.html',
styleUrls: ['./domoti... | import { Component, OnInit } from '@angular/core';
import { ConfigService } from '../_services/config.service';
import { timer } from 'rxjs';
import { OpenhabService } from '../_services/openhab.service';
@Component({
selector: 'app-domotics',
templateUrl: './domotics.component.html',
styleUrls: ['./domoti... |
Add import in unit test | import {async, TestBed} from "@angular/core/testing";
import {AppComponent} from "./app.component";
import {MdSidenavModule, MdSnackBarModule} from "@angular/material";
import {MainToolbarComponent} from "./main-toolbar/main-toolbar.component";
import {AccountButtonComponent} from "./account-button/account-button.comp... | import {async, TestBed} from "@angular/core/testing";
import {AppComponent} from "./app.component";
import {MdSidenavModule, MdSnackBarModule} from "@angular/material";
import {MainToolbarComponent} from "./main-toolbar/main-toolbar.component";
import {AccountButtonComponent} from "./account-button/account-button.comp... |
Create privateClassName for the sticky header | import { classNamePrefix } from "./consts";
export const sortArrowClassName = classNamePrefix + "sortArrow";
export const activeSortArrowClassName = classNamePrefix + "sortArrow--active";
export const ascendantSortArrowClassName = classNamePrefix + "sortArrow--ascendant";
export const descendantSortArrowClassName = cl... | import { classNamePrefix } from "./consts";
export const sortArrowClassName = classNamePrefix + "sortArrow";
export const activeSortArrowClassName = classNamePrefix + "sortArrow--active";
export const ascendantSortArrowClassName = classNamePrefix + "sortArrow--ascendant";
export const descendantSortArrowClassName = cl... |
Return empty array when include not defined | import { JSONAPIResourceObject } from './jsonapi-resource-object.model';
export class JSONAPIResponse<T extends JSONAPIResourceObject | JSONAPIResourceObject[]> {
public data: T;
public included: JSONAPIResourceObject[];
public constructor(json: {data: any, included?: any}) {
this.data = json.data... | import { JSONAPIResourceObject } from './jsonapi-resource-object.model';
export class JSONAPIResponse<T extends JSONAPIResourceObject | JSONAPIResourceObject[]> {
public data: T;
public included: JSONAPIResourceObject[];
public constructor(json: {data: any, included?: any}) {
this.data = json.data... |
Fix import for bootstrap effects token | import { OpaqueToken, Provider } from '@angular/core';
import { flatten } from './util';
import { CONNECT_EFFECTS_PROVIDER } from './effects';
import { STATE_UPDATES_PROVIDER } from './state-updates';
export const BOOTSTRAP_EFFECTS = new OpaqueToken('@ngrx/effects Bootstrap Effects');
export function runEffects(...e... | import { OpaqueToken, Provider } from '@angular/core';
import { flatten } from './util';
import { CONNECT_EFFECTS_PROVIDER, BOOTSTRAP_EFFECTS } from './effects';
import { STATE_UPDATES_PROVIDER } from './state-updates';
export function runEffects(...effects: any[]) {
const allEffects = flatten(effects).map(effect ... |
Remove unused function in nevercode | import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers"
/**
* Nevercode.io CI Integration
*
* Environment Variables Documented: https://developer.nevercode.io/v1.0/docs/environment-variables-files
*/
export class Nevercode implements CISource {
... | import { Env, CISource } from "../ci_source"
import { ensureEnvKeysExist, ensureEnvKeysAreInt } from "../ci_source_helpers"
/**
* Nevercode.io CI Integration
*
* Environment Variables Documented: https://developer.nevercode.io/v1.0/docs/environment-variables-files
*/
export class Nevercode implements CISource {
... |
Fix - icon alignment for overview | import React from 'react';
import { Icon } from '../../components';
import { usePermissions } from '../../hooks';
import { classnames } from '../../helpers';
import Sections from './Sections';
import { SectionConfig } from '../../components/layout';
const IndexSection = ({ pages, limit = 4 }: { pages: SectionConfig[... | import React from 'react';
import { Icon } from '../../components';
import { usePermissions } from '../../hooks';
import { classnames } from '../../helpers';
import Sections from './Sections';
import { SectionConfig } from '../../components/layout';
const IndexSection = ({ pages, limit = 4 }: { pages: SectionConfig[... |
Add template support for random number | import 'zone.js';
import 'reflect-metadata';
import { Component } from '@angular/core';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
@Component({
selector: 'i-am',
template: '<h2... | import 'zone.js';
import 'reflect-metadata';
import { Component } from '@angular/core';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
@Component({
selector: 'i-am',
template: '<h2... |
Support tags with "issues" in their name, i.e. "known_issues". | import { match } from 'tiny-types';
import { ArbitraryTag, IssueTag, ManualTag, Tag } from './';
/**
* @package
*/
export class Tags {
private static Pattern = /^@([\w-]+)[:\s]?(.*)/i;
public static from(text: string): Tag[] {
const [ , type, val ] = Tags.Pattern.exec(text);
return match<T... | import { match } from 'tiny-types';
import { ArbitraryTag, IssueTag, ManualTag, Tag } from './';
/**
* @package
*/
export class Tags {
private static Pattern = /^@([\w-]+)[:\s]?(.*)/i;
public static from(text: string): Tag[] {
const [ , type, val ] = Tags.Pattern.exec(text);
return match<T... |
Add semicolon to separate styles | import React from "react"
import styled from "styled-components"
import * as fonts from "../Assets/Fonts"
import { media } from "./Helpers"
type TitleSize = "xxsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge"
interface TitleProps extends React.HTMLProps<HTMLDivElement> {
titleSize?: TitleSize
color?: ... | import React from "react"
import styled from "styled-components"
import * as fonts from "../Assets/Fonts"
import { media } from "./Helpers"
type TitleSize = "xxsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge"
interface TitleProps extends React.HTMLProps<HTMLDivElement> {
titleSize?: TitleSize
color?: ... |
Add test for new position format | import {SunAndMoonConfigCtrl} from "../src/config_ctrl";
describe("SunAndMoonConfigCtrl", () => {
it("config_ctrl should support old position format", () => {
SunAndMoonConfigCtrl.prototype.current = {
jsonData: {
position: {
latitude: 48,
longitude: 10
}
}
};
... | import {SunAndMoonConfigCtrl} from "../src/config_ctrl";
describe("SunAndMoonConfigCtrl", () => {
it("config_ctrl should support new position format", () => {
SunAndMoonConfigCtrl.prototype.current = {
jsonData: {
latitude: 48,
longitude: 10
}
};
const cc = new SunAndMoonConfi... |
Make select field more robust if options list is not defined. | import * as React from 'react';
import Select from 'react-select';
export const SelectField = (props) => {
const { input, simpleValue, options, ...rest } = props;
return (
<Select
{...rest}
name={input.name}
value={
simpleValue || typeof input.value !== 'object'
? options.fi... | import * as React from 'react';
import Select from 'react-select';
export const SelectField = (props) => {
const { input, simpleValue, options, ...rest } = props;
return (
<Select
{...rest}
name={input.name}
value={
(simpleValue || typeof input.value !== 'object') && options
... |
Add className to Tooltip component | import React from 'react';
import { Manager, Popper, Arrow } from 'react-popper';
interface IwithTooltipProps {
placement?: string;
content: string | ((props: any) => JSX.Element);
}
export default function withTooltip(WrappedComponent) {
return class extends React.Component<IwithTooltipProps, any> {
const... | import React from 'react';
import { Manager, Popper, Arrow } from 'react-popper';
interface IwithTooltipProps {
placement?: string;
content: string | ((props: any) => JSX.Element);
className?: string;
}
export default function withTooltip(WrappedComponent) {
return class extends React.Component<IwithTooltipP... |
Set size of slides to 100% width and height | /**
* Created by sigurdbergsvela on 15.01.14.
*/
///<reference path="defs/jquery.d.ts"/>
class JSlider {
private _options = {
};
private sliderWrapper : JQuery;
private slidesWrapper : JQuery;
private slides : JQuery;
private currentSlide : number;
/**
* Creates a new slider out of an HTMLElement
* ... | /**
* Created by sigurdbergsvela on 15.01.14.
*/
///<reference path="defs/jquery.d.ts"/>
class JSlider {
private _options = {
};
private sliderWrapper : JQuery;
private slidesWrapper : JQuery;
private slides : JQuery;
private currentSlide : number;
/**
* Creates a new slider out of an HTMLElement
* ... |
Add passing NSFL block test | import { expect } from 'chai'
import Up from '../../../index'
import { InlineNsflNode } from '../../../SyntaxNodes/InlineNsflNode'
describe("The text in an inline NSFL convention's label", () => {
it("uses the provided term for 'toggleNsfl'", () => {
const up = new Up({
i18n: {
terms: { toggleNsfl... | import { expect } from 'chai'
import Up from '../../../index'
import { InlineNsflNode } from '../../../SyntaxNodes/InlineNsflNode'
import { NsflBlockNode } from '../../../SyntaxNodes/NsflBlockNode'
describe("The text in an inline NSFL convention's label", () => {
it("uses the provided term for 'toggleNsfl'", () => ... |
Create project object before running tasks | /// <reference path="./typings/bundle.d.ts" />
import {task, src, dest, watch} from 'gulp';
import * as ts from 'gulp-typescript';
import * as tslint from 'gulp-tslint';
import * as babel from 'gulp-babel';
task('build', ['build:ts']);
function buildTypeScript(): ts.CompilationStream {
const project = ts.createProj... | /// <reference path="./typings/bundle.d.ts" />
import {task, src, dest, watch} from 'gulp';
import * as ts from 'gulp-typescript';
import * as tslint from 'gulp-tslint';
import * as babel from 'gulp-babel';
task('build', ['build:ts']);
const project = ts.createProject('tsconfig.json', {
typescript: require('typescr... |
Set static to send method | import { Component, Inject, Injector, bind } from 'angular2/angular2';
import {Router, ROUTER_DIRECTIVES} from 'angular2/router';
@Component({
directives: [ ROUTER_DIRECTIVES ]
})
export class AnalyticsService {
//Set the analytics id of the page we want to send data
id : string = "UA-70134683-1";
constructo... | import { Component, Inject, Injector, bind } from 'angular2/angular2';
import {Router, ROUTER_DIRECTIVES} from 'angular2/router';
@Component({
directives: [ ROUTER_DIRECTIVES ]
})
export class AnalyticsService {
//Set the analytics id of the page we want to send data
id : string = "UA-70134683-1";
constructo... |
Add 'Hajime-chan is No. 1' to the invalid list | export * from "./interface";
import {GinBuilder} from "./builder";
export {GinBuilder} from "./builder";
export * from "./enum";
export * from "./filter";
export const gindownloader = new GinBuilder();
| export * from "./interface";
import {GinBuilder} from "./builder";
export {GinBuilder, MangaHereBuilder} from "./builder";
export * from "./enum";
export * from "./filter";
export * from "./parser";
export const gindownloader = new GinBuilder();
export {MangaHereConfig} from "./manga/mangahere/config";
export ... |
Add refrence to the shim so VSCode does not throw errors | import { expect } from "chai";
import * as skinview3d from "../src/skinview3d";
import skin1_8Default from "./textures/skin-1.8-default-no_hd.png";
import skin1_8Slim from "./textures/skin-1.8-slim-no_hd.png";
import skinOldDefault from "./textures/skin-old-default-no_hd.png";
describe("detect model of texture", () =... | /// <reference path="shims.d.ts"/>
import { expect } from "chai";
import * as skinview3d from "../src/skinview3d";
import skin1_8Default from "./textures/skin-1.8-default-no_hd.png";
import skin1_8Slim from "./textures/skin-1.8-slim-no_hd.png";
import skinOldDefault from "./textures/skin-old-default-no_hd.png";
impor... |
Update group detail state to props mapping | import { connect, Dispatch } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { AppState } from '../constants/types';
import GroupDetail from '../components/groupDetail';
import * as actions from '../actions/group';
export function mapStateToProps(state: AppState, params: any) {
let groupS... | import { connect, Dispatch } from 'react-redux';
import { withRouter } from 'react-router-dom';
import * as _ from 'lodash';
import { AppState } from '../constants/types';
import GroupDetail from '../components/groupDetail';
import * as actions from '../actions/group';
import { getGroupUniqueName } from '../constants/... |
Rename expert contract state: Pending -> Waiting for proposals | import * as classNames from 'classnames';
import * as React from 'react';
import { react2angular } from 'react2angular';
import { RequestState } from './types';
interface ExpertRequestStateProps {
model: {
state: RequestState;
};
}
const LabelClasses = {
Active: '',
Pending: 'progress-bar-warning',
Can... | import * as classNames from 'classnames';
import * as React from 'react';
import { react2angular } from 'react2angular';
import { RequestState } from './types';
interface ExpertRequestStateProps {
model: {
state: RequestState;
};
}
const LabelClasses = {
Active: '',
Pending: 'progress-bar-warning',
Can... |
Fix computeRadiationValue for scan measures | import { Store } from '@ngxs/store';
import { Observable } from 'rxjs';
import { Measure, Step } from '../measures/measure';
import { AbstractDevice } from './abstract-device';
export abstract class AbstractDeviceService<T extends AbstractDevice> {
protected textDecoder = new TextDecoder('utf8');
constructor(prot... | import { Store } from '@ngxs/store';
import { Observable } from 'rxjs';
import { Measure, Step } from '../measures/measure';
import { AbstractDevice } from './abstract-device';
export abstract class AbstractDeviceService<T extends AbstractDevice> {
protected textDecoder = new TextDecoder('utf8');
constructor(prot... |
Allow text to be entered into custom css editor | import * as React from "react";
import { ChangeEvent } from "react";
import { ColorResult, SketchPicker } from "react-color";
import { PlayerViewCustomStyles } from "../../../common/PlayerViewSettings";
import { StylesChooser } from "./StylesChooser";
export interface CustomCSSEditorProps {
currentCSS: string;
... | import * as React from "react";
import { ChangeEvent } from "react";
import { ColorResult, SketchPicker } from "react-color";
import { PlayerViewCustomStyles } from "../../../common/PlayerViewSettings";
import { StylesChooser } from "./StylesChooser";
export interface CustomCSSEditorProps {
currentCSS: string;
... |
Add ability to disable rows from being sorted | import { ReactNode } from 'react';
import Icon from '../icon/Icon';
import { TableRow } from '../table';
import { OrderableElement, OrderableHandle } from '../orderable';
interface Props {
index: number;
className?: string;
cells?: ReactNode[];
}
const OrderableTableRow = ({ index, cells = [], className, ... | import { ReactNode } from 'react';
import Icon from '../icon/Icon';
import { TableRow } from '../table';
import { OrderableElement, OrderableHandle } from '../orderable';
interface Props {
index: number;
className?: string;
cells?: ReactNode[];
disableSort?: boolean;
}
const OrderableTableRow = ({ ind... |
Fix storybook issue trying to import type only json-schema package | import { FormatValidator, FormatDefinition } from 'ajv';
import { UiSchema as rjsfUiSchema } from '@rjsf/core';
import { Widget } from './widgets/widget-util';
export { JSONSchema7 as JSONSchema } from 'json-schema';
export const JsonTypes = {
array: 'array',
object: 'object',
number: 'number',
integer: 'integer',... | import { FormatValidator, FormatDefinition } from 'ajv';
import { UiSchema as rjsfUiSchema } from '@rjsf/core';
import { Widget } from './widgets/widget-util';
export type { JSONSchema7 as JSONSchema } from 'json-schema';
export const JsonTypes = {
array: 'array',
object: 'object',
number: 'number',
integer: 'inte... |
Change the page-header component to import template. | import { Component, Inject, Input } from 'ng-metadata/core';
@Component({
selector: 'gj-page-header',
templateUrl: '/app/components/page-header/page-header.html',
legacy: {
transclude: {
coverButtons: '?gjPageHeaderCoverButtons',
content: 'gjPageHeaderContent',
spotlight: '?gjPageHeaderSpotlight',
nav... | import { Component, Inject, Input } from 'ng-metadata/core';
import template from './page-header.html';
@Component({
selector: 'gj-page-header',
templateUrl: template,
legacy: {
transclude: {
coverButtons: '?gjPageHeaderCoverButtons',
content: 'gjPageHeaderContent',
spotlight: '?gjPageHeaderSpotlight',
... |
Use the user's endpoint when creating an API | import User from '../user'
const Octokat = require('octokat')
export interface Repo {
cloneUrl: string,
htmlUrl: string,
name: string
owner: {
avatarUrl: string,
login: string
type: 'user' | 'org'
},
private: boolean,
stargazersCount: number
}
export default class API {
private client: an... | import User from '../user'
const Octokat = require('octokat')
export interface Repo {
cloneUrl: string,
htmlUrl: string,
name: string
owner: {
avatarUrl: string,
login: string
type: 'user' | 'org'
},
private: boolean,
stargazersCount: number
}
export default class API {
private client: an... |
Clear localstorage release notes flag | import {Extension} from './extension';
// Initialize extension
const extension = new Extension();
extension.start();
chrome.runtime.onInstalled.addListener(({reason}) => {
if (reason === 'install') {
// TODO: Show help page.
chrome.tabs.create({url: 'http://darkreader.org/blog/dynamic-theme/'});
... | import {Extension} from './extension';
// Initialize extension
const extension = new Extension();
extension.start();
chrome.runtime.onInstalled.addListener(({reason}) => {
if (reason === 'install') {
// TODO: Show help page.
chrome.tabs.create({url: 'http://darkreader.org/blog/dynamic-theme/'});
... |
Disable recording network activity in dev tools for now. | import { NativeModules } from "react-native"
const { Emission } = NativeModules
let metaphysicsURL
let gravityURL
if (Emission && Emission.gravityAPIHost && Emission.metaphysicsAPIHost) {
metaphysicsURL = Emission.metaphysicsAPIHost
gravityURL = Emission.gravityAPIHost
} else {
metaphysicsURL = "https://metaphy... | import { NativeModules } from "react-native"
const { Emission } = NativeModules
let metaphysicsURL
let gravityURL
if (Emission && Emission.gravityAPIHost && Emission.metaphysicsAPIHost) {
metaphysicsURL = Emission.metaphysicsAPIHost
gravityURL = Emission.gravityAPIHost
} else {
metaphysicsURL = "https://metaphy... |
Fix documentation: s/public credential/public key credential/ | import {base64urlToBuffer, bufferToBase64url} from "./base64url";
import {CredentialCreationOptionsJSON, CredentialRequestOptionsJSON, PublicKeyCredentialWithAssertionJSON, PublicKeyCredentialWithAttestationJSON} from "./json";
import {convert} from "./schema-format";
import {credentialCreationOptions, credentialReques... | import {base64urlToBuffer, bufferToBase64url} from "./base64url";
import {CredentialCreationOptionsJSON, CredentialRequestOptionsJSON, PublicKeyCredentialWithAssertionJSON, PublicKeyCredentialWithAttestationJSON} from "./json";
import {convert} from "./schema-format";
import {credentialCreationOptions, credentialReques... |
Fix a test so that we don't get duplicate declaration errors. | //@target: ES6
//@declaration: true
class C {
static [Symbol.iterator] = 0;
static [Symbol.toPrimitive]() { }
static get [Symbol.toPrimitive]() { return ""; }
static set [Symbol.toPrimitive](x) { }
} | //@target: ES6
//@declaration: true
class C {
static [Symbol.iterator] = 0;
static [Symbol.isConcatSpreadable]() { }
static get [Symbol.toPrimitive]() { return ""; }
static set [Symbol.toPrimitive](x) { }
} |
Add route to list available routes | /**
* Express routes configurations
*/
export abstract class ExpressRouter {
protected express: any;
public abstract start(): void;
constructor(express: any) {
this.express = express;
this.defaultRoutes();
}
private defaultRoutes(): void {
this.express.get("/", (req, res... | /**
* Express routes configurations
*/
export abstract class ExpressRouter {
protected express: any;
public abstract start(): void;
constructor(express: any) {
this.express = express;
this.defaultRoutes();
}
private defaultRoutes(): void {
this.express.get("/", (req, res... |
Make type and category fields in offering configuration form non-clearable. | import * as React from 'react';
import { FieldArray } from 'redux-form';
import {
SelectAsyncField,
FormContainer,
SelectField,
} from '@waldur/form-react';
import { OfferingAttributes } from './OfferingAttributes';
import { OfferingOptions } from './OfferingOptions';
import { OfferingPlans } from './OfferingPl... | import * as React from 'react';
import { FieldArray } from 'redux-form';
import {
SelectAsyncField,
FormContainer,
SelectField,
} from '@waldur/form-react';
import { OfferingAttributes } from './OfferingAttributes';
import { OfferingOptions } from './OfferingOptions';
import { OfferingPlans } from './OfferingPl... |
Increase release version number to 1.0.4 | 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/1.0.3',
RELEASEVERSION: '1.0.3'
};
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/1.0.4',
RELEASEVERSION: '1.0.4'
};
export = BaseConfig;
|
Fix alias of username argument | import fs from 'fs';
import libpath from 'path';
import _yargs from 'yargs';
const packageInfo = JSON.parse(fs.readFileSync(libpath.resolve(__dirname, '../../package.json'), 'utf8'));
const yargs = _yargs
.demand(1)
.usage(
`
Upload-GPhotos ${packageInfo.version}
Usage: upload-gphotos file [...] [--no-output-... | import fs from 'fs';
import libpath from 'path';
import _yargs from 'yargs';
const packageInfo = JSON.parse(fs.readFileSync(libpath.resolve(__dirname, '../../package.json'), 'utf8'));
const yargs = _yargs
.demand(1)
.usage(
`
Upload-GPhotos ${packageInfo.version}
Usage: upload-gphotos file [...] [--no-output-... |
FIX incorrect style usage of numbers in addon-center | const styles = {
style: {
position: 'fixed',
top: 0,
left: 0,
bottom: 0,
right: 0,
display: 'flex',
alignItems: 'center',
overflow: 'auto',
},
innerStyle: {
margin: 'auto',
maxHeight: '100%', // Hack for centering correctly in IE11
},
} as const;
export default styles;
| const styles = {
style: {
position: 'fixed',
top: '0',
left: '0',
bottom: '0',
right: '0',
display: 'flex',
alignItems: 'center',
overflow: 'auto',
},
innerStyle: {
margin: 'auto',
maxHeight: '100%', // Hack for centering correctly in IE11
},
} as const;
export default s... |
Make types compatible with TS <= 3.6 | declare class OrderedMap<T = any> {
private constructor(content: Array<string | T>)
get(key: string): T | undefined
update(key: string, value: T, newKey?: string): OrderedMap<T>
remove(key: string): OrderedMap<T>
addToStart(key: string, value: T): OrderedMap<T>
addToEnd(key: string, value: T): OrderedM... | declare class OrderedMap<T = any> {
private constructor(content: Array<string | T>)
get(key: string): T | undefined
update(key: string, value: T, newKey?: string): OrderedMap<T>
remove(key: string): OrderedMap<T>
addToStart(key: string, value: T): OrderedMap<T>
addToEnd(key: string, value: T): OrderedM... |
Use store2 instead of direct localStorage. | import { window } from 'global';
import { useCallback, useEffect, useState } from 'react';
import { Selection, StoryRef } from './types';
const retrieveLastViewedStoryIds = (): StoryRef[] => {
try {
const raw = window.localStorage.getItem('lastViewedStoryIds');
const val = typeof raw === 'string' && JSON.pa... | import { useCallback, useEffect, useState } from 'react';
import store from 'store2';
import { Selection, StoryRef } from './types';
const retrieveLastViewedStoryIds = (): StoryRef[] => {
const items = store.get('lastViewedStoryIds');
if (!items || !Array.isArray(items)) return [];
if (!items.some((item) => typ... |
Revert "Commit from LXDE Pootle server by user LStranger.: 391 of 391 strings translated (0 need review)." | <?xml version="1.0" ?><!DOCTYPE TS><TS language="ru" version="2.0">
<context>
<name>ShowDesktop</name>
<message>
<source>Show Desktop: Global shortcut '%1' cannot be registered</source>
<translation>Показать рабочий стол: Глобальное короткие клавиш '%1' не могут быть зарегис... | <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru">
<context>
<name>ShowDesktop</name>
<message>
<location filename="../showdesktop.cpp" line="44"/>
<source>Show desktop</source>
<translation>Показать рабочий стол</translation>
</message>
<messag... |
Add scope and fix templateUrl: | import { SearchController } from './search.controller';
export function digimapSearch(): ng.IDirective {
return {
restrict: 'E',
templateUrl: '/app/components/search/search.html',
controller: SearchController,
controllerAs: 'vm'
};
}
| import { SearchController } from './search.controller';
export function digimapSearch(): ng.IDirective {
return {
restrict: 'E',
scope: {
extraValues: '='
},
templateUrl: 'app/components/search/search.html',
controller: SearchController,
controllerAs: 'vm'
};
}
|
Delete useless trailing white spaces | export class TwitterApplicationComponent implements ng.IComponentOptions {
public template: string = `
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button"
cla... | export class TwitterApplicationComponent implements ng.IComponentOptions {
public template: string = `
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button"
clas... |
Merge module and component as default behavior. | import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
import { Schema as NgComponentOptions } from '@schematics/angular/component/schema';
import { findModuleFromOptions } from '@schematics/angular/utility/find-module';
import { buildDefaultPath, getProject } from '@schematics/angular/utility/pro... | import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
import { Schema as NgComponentOptions } from '@schematics/angular/component/schema';
import { findModuleFromOptions } from '@schematics/angular/utility/find-module';
import { buildDefaultPath, getProject } from '@schematics/angular/utility/pro... |
Fix uncaught exception in request | import * as http from 'http';
import * as https from 'https';
export default {
test: (uri: string): boolean => /^https*:\/\//.test(uri),
read: (url: string): Promise<http.IncomingMessage> => {
return new Promise((resolve, reject) => {
const get = url.indexOf('https') === 0 ? https.get : http.get;
// @ts-ig... | import * as http from 'http';
import * as https from 'https';
export default {
test: (uri: string): boolean => /^https*:\/\//.test(uri),
read: (url: string): Promise<http.IncomingMessage> => {
return new Promise((resolve, reject) => {
const get = url.indexOf('https') === 0 ? https.get : http.get;
let res_ ... |
Set default export path to file location path | import { app, BrowserWindow, dialog } from 'electron'
import { basename } from 'path'
import { supportedFiles } from '../ui/settings/supported-files'
export function showOpenDialog(mainWindow: BrowserWindow): Promise<string> {
return new Promise((resolve) => {
dialog.showOpenDialog(
mainWindow!... | import { BrowserWindow, dialog } from 'electron'
import { basename } from 'path'
import { supportedFiles } from '../ui/settings/supported-files'
export function showOpenDialog(mainWindow: BrowserWindow): Promise<string> {
return new Promise((resolve) => {
dialog.showOpenDialog(
mainWindow!,
... |
Discard milliseconds when parsing dates (sqlite doesn't do milliseconds for datetime) |
import {Schema, transform, arrayOf} from "idealizr";
export const game = new Schema("games");
export const user = new Schema("users");
export const collection = new Schema("collections");
export const downloadKey = new Schema("downloadKeys");
function parseDate(input: string) {
// without `+0` it parses a local da... |
import {Schema, transform, arrayOf} from "idealizr";
export const game = new Schema("games");
export const user = new Schema("users");
export const collection = new Schema("collections");
export const downloadKey = new Schema("downloadKeys");
function parseDate(input: string) {
// without `+0` it parses a local da... |
Call done() when async task finishes | import { getResolvedLocale } from '../helpers/get-resolved-locale.js';
import { APP_INDEX_URL } from './constants.js';
import {
ok, strictEqual,
} from './helpers/typed-assert.js';
describe('timezones', () => {
before(async () => {
await browser.url(APP_INDEX_URL);
});
function hasFullICU() {
try {
... | import { getResolvedLocale } from '../helpers/get-resolved-locale.js';
import { APP_INDEX_URL } from './constants.js';
import {
ok, strictEqual,
} from './helpers/typed-assert.js';
describe('timezones', () => {
before(async () => {
await browser.url(APP_INDEX_URL);
});
function hasFullICU() {
try {
... |
Make datastore helpers test meaningful | import { isProjectDocument } from "../../src/datastore/helpers";
describe('helpers', () => {
it('isProjectDocument', () => {
const result = isProjectDocument({ resource: { id: 'project' }} as any);
expect(true).toBeTruthy();
});
});
| import { isProjectDocument } from '../../src/datastore/helpers';
describe('helpers', () => {
it('isProjectDocument', () => {
const result = isProjectDocument({ resource: { id: 'project' }} as any);
expect(result).toBeTruthy();
});
});
|
Use constructor to set state | import React, { Component } from "react"
import styled from "styled-components"
import { NewsHeadline } from "../News/NewsHeadline"
import { NewsSections } from "../News/NewsSections"
interface Props {
article: any
isTruncated?: boolean
}
interface State {
isTruncated: boolean
}
interface NewsContainerProps {
... | import React, { Component } from "react"
import styled from "styled-components"
import { NewsHeadline } from "../News/NewsHeadline"
import { NewsSections } from "../News/NewsSections"
interface Props {
article: any
isTruncated?: boolean
}
interface State {
isTruncated: boolean
}
interface NewsContainerProps {
... |
Set minimum and maximum to transaction amount | import * as _ from 'lodash';
import * as moment from 'moment';
import { badRequest } from 'boom';
import * as Joi from 'joi';
namespace schemas {
export const username = Joi.string().token().empty().min(2).max(20).label('Username');
export const password = Joi.string().empty().min(1).label('Password');
export co... | import * as _ from 'lodash';
import * as moment from 'moment';
import { badRequest } from 'boom';
import * as Joi from 'joi';
namespace schemas {
export const username = Joi.string().token().empty().min(2).max(20).label('Username');
export const password = Joi.string().empty().min(1).label('Password');
export co... |
Add ability to unselect a team after picking | import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Game } from './game';
@Component({
selector: 'duel-game',
templateUrl: './game.component.html',
styleUrls: ['./game.component.css'],
})
export class GameComponent {
@Input() game: Game;
@Output() onPicked = new EventEmitter<str... | import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Game } from './game';
@Component({
selector: 'duel-game',
templateUrl: './game.component.html',
styleUrls: ['./game.component.css'],
})
export class GameComponent {
@Input() game: Game;
@Output() onPicked = new EventEmitter<str... |
Convert date to usable string to populate input | import {Component, Input, Output, OnInit, EventEmitter} from 'angular2/core';
import {FormBuilder, ControlGroup, Validators} from 'angular2/common';
import {Game} from '../shared/models/game.model';
@Component({
selector: 'agot-game-form',
moduleId: module.id,
templateUrl: './game-form.html',
styleUrls: ['./ga... | import {Component, Input, Output, OnInit, EventEmitter} from 'angular2/core';
import {FormBuilder, ControlGroup, Validators} from 'angular2/common';
import {Game} from '../shared/models/game.model';
@Component({
selector: 'agot-game-form',
moduleId: module.id,
templateUrl: './game-form.html',
styleUrls: ['./ga... |
Allow nested links; fail a test | import { parseInlineConventions } from './ParseInlineConventions'
import { TextConsumer } from '../TextConsumer'
import { applyBackslashEscaping } from '../TextHelpers'
import { LinkNode } from '../../SyntaxNodes/LinkNode'
import { InlineParserArgs, InlineParser } from './InlineParser'
export function parseLink(args: ... | import { parseInlineConventions } from './ParseInlineConventions'
import { TextConsumer } from '../TextConsumer'
import { applyBackslashEscaping } from '../TextHelpers'
import { LinkNode } from '../../SyntaxNodes/LinkNode'
import { InlineParserArgs, InlineParser } from './InlineParser'
export function parseLink(args: ... |
Fix "Form elements do not have associated labels" | import React, { useState, FunctionComponent, ChangeEvent } from "react";
type Props = {
initialVolume: number;
onChangeVolume: (volume: number) => void;
};
const Component: FunctionComponent<Props> = props => {
const [volume, setVolume] = useState(props.initialVolume);
const onChange = (event: ChangeEvent<HT... | import React, { useState, FunctionComponent, ChangeEvent } from "react";
type Props = {
initialVolume: number;
onChangeVolume: (volume: number) => void;
};
const Component: FunctionComponent<Props> = props => {
const [volume, setVolume] = useState(props.initialVolume);
const onChange = (event: ChangeEvent<HT... |
Return unsuccessful on 429 error code. | import axios from 'axios';
import { API_URL } from '../constants';
// import { validateHitAccept } from '../utils/parsing';
export interface HitAcceptResponse {
readonly successful: boolean;
}
/**
* Strange code ahead, explanation:
*
* 1. This API call will *always* hit the catch block in production.
... | import axios from 'axios';
import { API_URL } from '../constants';
import { validateHitAccept } from '../utils/parsing';
export interface HitAcceptResponse {
readonly successful: boolean;
}
/**
* Strange code ahead, explanation:
*
* 1. This API call will *always* hit the catch block in production.
*... |
Fix typo in printIncompatibleYarnError function | import { red, yellow } from "chalk"
import { existsSync } from "fs"
import { join } from "./path"
import { applyPatch } from "./applyPatches"
import { bold, green } from "chalk"
const yarnPatchFile = join(__dirname, "../yarn.patch")
export default function patchYarn(appPath: string) {
try {
applyPatch(yarnPatch... | import { red, yellow } from "chalk"
import { existsSync } from "fs"
import { join } from "./path"
import { applyPatch } from "./applyPatches"
import { bold, green } from "chalk"
const yarnPatchFile = join(__dirname, "../yarn.patch")
export default function patchYarn(appPath: string) {
try {
applyPatch(yarnPatch... |
Move collection* to collections subdirectory. | import '../shims.js';
import { Component } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';
import { RESOURCE_PROVIDERS } from 'ng2-resource-rest';
import { CollectionsComponent } from './collections.component.ts';
@Component({
sele... | import '../shims.js';
import { Component } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';
import { RESOURCE_PROVIDERS } from 'ng2-resource-rest';
import { CollectionsComponent } from './collections/collections.component.ts';
@Compon... |
Tweak color of non-active state | import {
color,
Sans,
sharedTabsStyles,
space,
TabsContainer,
} from "@artsy/palette"
import { Link, LinkProps } from "found"
import React from "react"
import styled from "styled-components"
export const RouteTabs = styled(TabsContainer)`
a {
${sharedTabsStyles.tabContainer};
:not(:last-child) {
... | import {
color,
Sans,
sharedTabsStyles,
space,
TabsContainer,
} from "@artsy/palette"
import { Link, LinkProps } from "found"
import React from "react"
import styled from "styled-components"
export const RouteTabs = styled(TabsContainer)`
a {
${sharedTabsStyles.tabContainer};
:not(:last-child) {
... |
Fix year formatting in accounting period selector. | import { DateTime } from 'luxon';
import { PeriodOption } from '@waldur/form/types';
export const reactSelectMenuPortaling = (): any => ({
menuPortalTarget: document.body,
styles: { menuPortal: (base) => ({ ...base, zIndex: 9999 }) },
menuPosition: 'fixed',
menuPlacement: 'bottom',
});
export const datePicke... | import { DateTime } from 'luxon';
import { PeriodOption } from '@waldur/form/types';
export const reactSelectMenuPortaling = (): any => ({
menuPortalTarget: document.body,
styles: { menuPortal: (base) => ({ ...base, zIndex: 9999 }) },
menuPosition: 'fixed',
menuPlacement: 'bottom',
});
export const datePicke... |
Fix column class for React table: avoid table options modification. | import * as React from 'react';
import './TableHeader.scss';
import { Column, Sorting } from './types';
interface Props {
columns: Column[];
onSortClick?: (orderField: string, currentSorting: Sorting) => any;
currentSorting?: Sorting;
}
const TableHeader = ({ columns, onSortClick, currentSorting }: Props) => ... | import * as classNames from 'classnames';
import * as React from 'react';
import './TableHeader.scss';
import { Column, Sorting } from './types';
interface Props {
columns: Column[];
onSortClick?: (orderField: string, currentSorting: Sorting) => any;
currentSorting?: Sorting;
}
const TableHeader = ({ columns,... |
Allow optional style params to Concierge block | import * as React from 'react';
import Header from '../header/index';
import Sidebar from '../sidebar/index';
import Content from '../content/index';
import * as menus from './navigation';
import Body from './body';
type ConciergeParams = {
params: {
category: string;
item?: string;
},
}
const ... | import * as React from 'react';
import Header from '../header/index';
import Sidebar from '../sidebar/index';
import Content from '../content/index';
import * as menus from './navigation';
import Body from './body';
import mergeToClass from '../merge-style';
type ConciergeParams = {
styles?: {};
params: {
... |
Fix type error in status code | import * as React from 'react';
import {Route} from 'react-router-dom';
export interface StatusCodeProps {
code: number;
children?: React.ReactNode;
}
export default function Status({children, code}: StatusCodeProps) {
return (
<Route
render={({staticContext}) => {
// there is no `staticContex... | import * as React from 'react';
import {Route} from 'react-router-dom';
export interface StatusCodeProps {
code: number;
children?: React.ReactNode;
}
export default function Status({children, code}: StatusCodeProps) {
return (
<Route
render={({staticContext}) => {
// there is no `staticContex... |
Revert "Test if CI fails on a broken unit test." | "use strict";
import chai from "chai";
import {Config} from "../src/app/config";
import {RouterConfigurationStub} from "./stubs";
describe("Config test suite", () => {
it("should initialize correctly", () => {
let routerConfiguration = new RouterConfigurationStub();
let sut = new Config();
... | "use strict";
import chai from "chai";
import {Config} from "../src/app/config";
import {RouterConfigurationStub} from "./stubs";
describe("Config test suite", () => {
it("should initialize correctly", () => {
let routerConfiguration = new RouterConfigurationStub();
let sut = new Config();
... |
Add index to startDate in video view table | import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Table } from 'sequelize-typescript'
import { VideoModel } from './video'
import * as Sequelize from 'sequelize'
@Table({
tableName: 'videoView',
indexes: [
{
fields: [ 'videoId' ]
}
]
})
export class VideoViewModel extends Model<V... | import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Table } from 'sequelize-typescript'
import { VideoModel } from './video'
import * as Sequelize from 'sequelize'
@Table({
tableName: 'videoView',
indexes: [
{
fields: [ 'videoId' ]
},
{
fields: [ 'startDate' ]
}
]
})
... |
Add workaround for the move to a new house. | export class RelativeConverter {
convert(input: number[]): number[] {
const copy: number[] = input.slice(0);
let previousValue = copy.shift();
return copy.map(function (value) {
let result;
if (previousValue != null && value != null) {
result = value - previousValue;
} else {
... | export class RelativeConverter {
convert(input: number[]): number[] {
const copy: number[] = [...input];
let previousValue = copy.shift();
return copy.map(function (value) {
let result;
if (previousValue != null && value != null) {
const diff = valu... |
Include git hash for index view | import { Request, Response } from 'express';
import type { IBoard } from '../types/trello';
import { TrelloService } from '../services/trelloService';
export function index(_: Request, res: Response): Response {
return res.send(':)');
}
export async function healthCheck(_: Request, res: Response): Promise<Response>... | import { Request, Response } from 'express';
import type { IBoard } from '../types/trello';
import { TrelloService } from '../services/trelloService';
export function index(_: Request, res: Response): Response {
return res.send(`:)<br />${process.env.GIT_REV || ''}`);
}
export async function healthCheck(_: Request,... |
Fix employee detection in OSS version | /**
* 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 {useEffect} from 'react';
import LegacyApp from './LegacyApp';
import fbConfig fro... | /**
* 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 {useEffect} from 'react';
import LegacyApp from './LegacyApp';
import fbConfig fro... |
Add todo to where builder | import {WhereLiteralQueryPart} from "../match/WhereLiteralQueryPart";
export class WhereBuilder {
literal(queryPart:string):WhereLiteralQueryPart {
return new WhereLiteralQueryPart(queryPart)
}
} | import {WhereLiteralQueryPart} from "../match/WhereLiteralQueryPart";
export class WhereBuilder<T = any> {
literal(queryPart:string):WhereLiteralQueryPart {
return new WhereLiteralQueryPart(queryPart)
}
//TODO:
attribute<K extends keyof T>(prop:T) {} // where(w => [w.attribute('id').in([1,2,... |
Add the RocketChatAssociationModel back in | import { IRocketletAuthorInfo } from './IRocketletAuthorInfo';
import { IRocketletInfo } from './IRocketletInfo';
export { IRocketletAuthorInfo, IRocketletInfo };
| import { IRocketletAuthorInfo } from './IRocketletAuthorInfo';
import { IRocketletInfo } from './IRocketletInfo';
import { RocketChatAssociationModel } from './RocketChatAssociationModel';
export { IRocketletAuthorInfo, IRocketletInfo, RocketChatAssociationModel };
|
Store an array of entries rather than a map. | import { Command } from "./command";
export class CommandTable {
private name: string;
private inherit: CommandTable[] = [];
private commands: Map<string, Command> = new Map();
constructor (name: string, inherit: CommandTable[]) {
this.name = name;
this.inherit = inherit;
}
}
| import { Command } from "./command";
export class CommandTableEntry {
name: string;
command: Command;
}
export class CommandTable {
private name: string;
private inherit: CommandTable[] = [];
private commands: CommandTableEntry[] = [];
constructor (name: string, inherit: CommandTable[]) {
this.name =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.