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
e178e7852c209b362d4e3105c12d0cefa6e1d199
tests/cases/fourslash/completionListInObjectLiteral.ts
tests/cases/fourslash/completionListInObjectLiteral.ts
/// <reference path="fourslash.ts" /> ////interface point { //// x: number; //// y: number; ////} ////interface thing { //// name: string; //// pos: point; ////} ////var t: thing; ////t.pos = { x: 4, y: 3 + t./**/ }; // Bug 548885: Incorrect member listing in object literal goTo.marker(); verify.memberListContains('x'); verify.not.memberListContains('name'); // verify.not.memberListContains('x'); // verify.memberListContains('name');
Add regression test for object literal member list
Add regression test for object literal member list
TypeScript
apache-2.0
tarruda/typescript,rbirkby/typescript,mbrowne/typescript-dci,fdecampredon/jsx-typescript-old-version,mbebenita/shumway.ts,tarruda/typescript,popravich/typescript,hippich/typescript,guidobouman/typescript,guidobouman/typescript,mbrowne/typescript-dci,mbrowne/typescript-dci,rbirkby/typescript,vcsjones/typescript,turbulenz/typescript,popravich/typescript,fdecampredon/jsx-typescript-old-version,tarruda/typescript,mbebenita/shumway.ts,popravich/typescript,hippich/typescript,rbirkby/typescript,turbulenz/typescript,turbulenz/typescript,mbebenita/shumway.ts,guidobouman/typescript,mbrowne/typescript-dci,fdecampredon/jsx-typescript-old-version,hippich/typescript
--- +++ @@ -0,0 +1,19 @@ +/// <reference path="fourslash.ts" /> + +////interface point { +//// x: number; +//// y: number; +////} +////interface thing { +//// name: string; +//// pos: point; +////} +////var t: thing; +////t.pos = { x: 4, y: 3 + t./**/ }; + +// Bug 548885: Incorrect member listing in object literal +goTo.marker(); +verify.memberListContains('x'); +verify.not.memberListContains('name'); +// verify.not.memberListContains('x'); +// verify.memberListContains('name');
cf2889c63f16d36079eaa15d8d3cbe9459d70d3f
src/functions/alphabets.ts
src/functions/alphabets.ts
import { Alphabet, Letter } from './types' import alphabets from '!!raw-loader!./alphabets.toml' export function getLetter(alphabets: string[], letter: string): Letter { /** * Finds the entry with value `letter` and returns it. * * @param alphabets: the alphabets from which to search. They will be * combined in order of decreasing priority * @param letter: the letter to search for * @returns known data for the given letter */ return null }
Create function for letter retrieval
Create function for letter retrieval
TypeScript
mit
rossjrw/gallifreyo,rossjrw/gallifreyo,rossjrw/gallifreyo
--- +++ @@ -0,0 +1,14 @@ +import { Alphabet, Letter } from './types' +import alphabets from '!!raw-loader!./alphabets.toml' + +export function getLetter(alphabets: string[], letter: string): Letter { + /** + * Finds the entry with value `letter` and returns it. + * + * @param alphabets: the alphabets from which to search. They will be + * combined in order of decreasing priority + * @param letter: the letter to search for + * @returns known data for the given letter + */ + return null +}
80a23effefd61a98d1a4a5e2bd46a5829c2bd61d
test/reducers/slides/actions/updateCurrentPlugin-spec.ts
test/reducers/slides/actions/updateCurrentPlugin-spec.ts
import { expect } from 'chai'; import { UPDATE_CURRENT_PLUGIN } from '../../../../app/constants/slides.constants'; export default function(initialState: any, reducer: any, slide: any) { const _initialState = [ { plugins: [ { state: {} } ] } ]; describe('UPDATE_CURRENT_PLUGIN', () => { it('should update selected plugin with new change', () => { expect( reducer(_initialState, { type: UPDATE_CURRENT_PLUGIN, pluginNumber: 0, slideNumber: 0, changes: { hello: 'world' } }) ).to.deep.equal([ { plugins: [ { state: { hello: 'world' } } ], } ]); }); it('should update selected plugin with multiple changes at once', () => { expect( reducer(_initialState, { type: UPDATE_CURRENT_PLUGIN, pluginNumber: 0, slideNumber: 0, changes: { string: 'world', boolean: true, number: 1, undefined: undefined, null: null, array: [], object: {} } }) ).to.deep.equal([ { plugins: [ { state: { string: 'world', boolean: true, number: 1, undefined: undefined, null: null, array: [], object: {} } } ] } ]); }); it('should be able to accept functions in its state', () => { const nextState: any = reducer(_initialState, { type: UPDATE_CURRENT_PLUGIN, pluginNumber: 0, slideNumber: 0, changes: { function: () => {} } }); expect(nextState[0].plugins[0].state) .to.have.property('function') .that.is.a('function'); }) }); }
Add test for UPDATE_CURRENT_PLUGIN for slides reducer
test: Add test for UPDATE_CURRENT_PLUGIN for slides reducer
TypeScript
mit
DevDecks/devdecks,DevDecks/devdecks,Team-CHAD/DevDecks,DevDecks/devdecks,Team-CHAD/DevDecks,chengsieuly/devdecks,Team-CHAD/DevDecks,chengsieuly/devdecks,chengsieuly/devdecks
--- +++ @@ -0,0 +1,87 @@ +import { expect } from 'chai'; +import { UPDATE_CURRENT_PLUGIN } from '../../../../app/constants/slides.constants'; + +export default function(initialState: any, reducer: any, slide: any) { + const _initialState = [ + { + plugins: [ + { state: {} } + ] + } + ]; + + describe('UPDATE_CURRENT_PLUGIN', () => { + it('should update selected plugin with new change', () => { + expect( + reducer(_initialState, { + type: UPDATE_CURRENT_PLUGIN, + pluginNumber: 0, + slideNumber: 0, + changes: { + hello: 'world' + } + }) + ).to.deep.equal([ + { + plugins: [ + { + state: { + hello: 'world' + } + } + ], + } + ]); + }); + + it('should update selected plugin with multiple changes at once', () => { + expect( + reducer(_initialState, { + type: UPDATE_CURRENT_PLUGIN, + pluginNumber: 0, + slideNumber: 0, + changes: { + string: 'world', + boolean: true, + number: 1, + undefined: undefined, + null: null, + array: [], + object: {} + } + }) + ).to.deep.equal([ + { + plugins: [ + { + state: { + string: 'world', + boolean: true, + number: 1, + undefined: undefined, + null: null, + array: [], + object: {} + } + } + ] + } + ]); + }); + + it('should be able to accept functions in its state', () => { + const nextState: any = reducer(_initialState, { + type: UPDATE_CURRENT_PLUGIN, + pluginNumber: 0, + slideNumber: 0, + changes: { + function: () => {} + } + }); + + expect(nextState[0].plugins[0].state) + .to.have.property('function') + .that.is.a('function'); + }) + }); +}
1c8307fd8d4c97c81d1d3417d948f7101d901aeb
source/data/US/SD/SiouxFalls_.ts
source/data/US/SD/SiouxFalls_.ts
import CSVParse = require('csv-parse/lib/sync'); import { Download } from '../../Download' import { Picnic } from '../../../models/Picnic'; // From https://stackoverflow.com/a/2332821 function capitalize(s: string) { return s.toLowerCase().replace(/\b./g, function (a: string) { return a.toUpperCase(); }); }; // Important Fields let source_name = "City of Sioux Falls" let dataset_name = "Park Amenities (Points)" let dataset_url_human = "https://opendata.arcgis.com/datasets/acd11d56a9394f2889a39e1504c8e088_3" let dataset_url_csv = "https://opendata.arcgis.com/datasets/acd11d56a9394f2889a39e1504c8e088_3.csv" let license_name = "Attribution 4.0 International (CC BY 4.0) " let license_url = "https://creativecommons.org/licenses/by/4.0/" Download.parseDataString(dataset_name, dataset_url_csv, function (res: string) { let database_updates: Array<any> = Array<any>(0); let retrieved = new Date(); CSVParse(res, { columns: true, ltrim: true }).forEach(function (data: any) { let type = data["AmenityType"]; if (type != "PICNIC SHELTER") { // I can't see any data in this dataset for unsheltered picnic tables... return; } let sheltered = true; let lat: number = parseFloat(data["Y"]); let lng: number = parseFloat(data["X"]); let objectID = data["OBJECTID"] let comment: string = capitalize(data["Information"]) if (comment == "") { comment = undefined; } database_updates.push(Picnic.findOneAndUpdate({ "geometry.type": "Point", "geometry.coordinates": [lng, lat] }, { $set: { "type": "Feature", "properties.type": "table", "properties.source.retrieved": retrieved, "properties.source.name": source_name, "properties.source.dataset": dataset_name, "properties.source.url": dataset_url_human, "properties.source.id": objectID, "properties.license.name": license_name, "properties.license.url": license_url, "properties.sheltered": sheltered, "properties.comment": comment, "geometry.type": "Point", "geometry.coordinates": [lng, lat] } }, { "upsert": true, "new": true }).exec()); }) return database_updates; });
Add data for Sioux Falls
Add data for Sioux Falls
TypeScript
mit
earthiverse/picknic,earthiverse/picknic
--- +++ @@ -0,0 +1,66 @@ +import CSVParse = require('csv-parse/lib/sync'); + +import { Download } from '../../Download' +import { Picnic } from '../../../models/Picnic'; + +// From https://stackoverflow.com/a/2332821 +function capitalize(s: string) { + return s.toLowerCase().replace(/\b./g, function (a: string) { return a.toUpperCase(); }); +}; + +// Important Fields +let source_name = "City of Sioux Falls" +let dataset_name = "Park Amenities (Points)" +let dataset_url_human = "https://opendata.arcgis.com/datasets/acd11d56a9394f2889a39e1504c8e088_3" +let dataset_url_csv = "https://opendata.arcgis.com/datasets/acd11d56a9394f2889a39e1504c8e088_3.csv" +let license_name = "Attribution 4.0 International (CC BY 4.0) " +let license_url = "https://creativecommons.org/licenses/by/4.0/" + +Download.parseDataString(dataset_name, dataset_url_csv, function (res: string) { + let database_updates: Array<any> = Array<any>(0); + let retrieved = new Date(); + + CSVParse(res, { columns: true, ltrim: true }).forEach(function (data: any) { + let type = data["AmenityType"]; + if (type != "PICNIC SHELTER") { // I can't see any data in this dataset for unsheltered picnic tables... + return; + } + let sheltered = true; + + let lat: number = parseFloat(data["Y"]); + let lng: number = parseFloat(data["X"]); + + let objectID = data["OBJECTID"] + + let comment: string = capitalize(data["Information"]) + if (comment == "") { + comment = undefined; + } + + database_updates.push(Picnic.findOneAndUpdate({ + "geometry.type": "Point", + "geometry.coordinates": [lng, lat] + }, { + $set: { + "type": "Feature", + "properties.type": "table", + "properties.source.retrieved": retrieved, + "properties.source.name": source_name, + "properties.source.dataset": dataset_name, + "properties.source.url": dataset_url_human, + "properties.source.id": objectID, + "properties.license.name": license_name, + "properties.license.url": license_url, + "properties.sheltered": sheltered, + "properties.comment": comment, + "geometry.type": "Point", + "geometry.coordinates": [lng, lat] + } + }, { + "upsert": true, + "new": true + }).exec()); + }) + + return database_updates; +});
8cf29658baad9941267f44b51941cffb57598d7e
src/components/DatabaseFilter/DatabaseFilterPagination.tsx
src/components/DatabaseFilter/DatabaseFilterPagination.tsx
import * as React from 'react'; import { Pagination } from '@shopify/polaris'; export interface DatabaseFilterPaginationProps { readonly shouldRender: boolean; readonly hasNext: boolean; readonly hasPrevious: boolean; readonly onNext: () => void; readonly onPrevious: () => void; } class DatabaseFilterPagination extends React.Component< DatabaseFilterPaginationProps, never > { private static paginationButtonStyle = { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '24px 16px', borderTop: '1px solid #dfe4e8' }; public render() { return ( this.props.shouldRender && ( <div style={DatabaseFilterPagination.paginationButtonStyle}> <Pagination {...this.props} /> </div> ) ); } } export default DatabaseFilterPagination;
Add pagination component for DatabaseFilter.
Add pagination component for DatabaseFilter.
TypeScript
mit
Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine
--- +++ @@ -0,0 +1,35 @@ +import * as React from 'react'; +import { Pagination } from '@shopify/polaris'; + +export interface DatabaseFilterPaginationProps { + readonly shouldRender: boolean; + readonly hasNext: boolean; + readonly hasPrevious: boolean; + readonly onNext: () => void; + readonly onPrevious: () => void; +} + +class DatabaseFilterPagination extends React.Component< + DatabaseFilterPaginationProps, + never +> { + private static paginationButtonStyle = { + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + padding: '24px 16px', + borderTop: '1px solid #dfe4e8' + }; + + public render() { + return ( + this.props.shouldRender && ( + <div style={DatabaseFilterPagination.paginationButtonStyle}> + <Pagination {...this.props} /> + </div> + ) + ); + } +} + +export default DatabaseFilterPagination;
3d0b74a97b43d942d40742e80c01562291994460
src/utils/hitItem.ts
src/utils/hitItem.ts
import { Hit, Requester } from '../types'; import { calculateAllBadges } from './badges'; import { truncate } from './formatting'; type ExceptionStatus = 'neutral' | 'warning' | 'critical'; export interface ExceptionDescriptor { status?: ExceptionStatus; title?: string; description?: string; } const generateExceptions = (groupId: string): ExceptionDescriptor[] => { return groupId.startsWith('[Error:groupId]-') ? [ { status: 'warning', title: 'You are not qualified.' } ] : []; }; export const generateItemProps = (hit: Hit, requester: Requester | undefined) => { const { requesterName, reward, groupId, title } = hit; const badges = requester ? calculateAllBadges(requester) : []; const actions = [ { content: 'Preview', external: true, url: `https://www.mturk.com/mturk/preview?groupId=${groupId}` }, { content: 'Accept', primary: true, external: true, url: `https://www.mturk.com/mturk/previewandaccept?groupId=${groupId}` } ]; return { attributeOne: truncate(title, 80), attributeTwo: truncate(requesterName, 45), attributeThree: reward, badges, actions, exceptions: generateExceptions(groupId) }; };
Move generating ResourceList.Item props to separate utility file.
Move generating ResourceList.Item props to separate utility file.
TypeScript
mit
Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine
--- +++ @@ -0,0 +1,44 @@ +import { Hit, Requester } from '../types'; +import { calculateAllBadges } from './badges'; +import { truncate } from './formatting'; + +type ExceptionStatus = 'neutral' | 'warning' | 'critical'; +export interface ExceptionDescriptor { + status?: ExceptionStatus; + title?: string; + description?: string; +} + +const generateExceptions = (groupId: string): ExceptionDescriptor[] => { + return groupId.startsWith('[Error:groupId]-') + ? [ { status: 'warning', title: 'You are not qualified.' } ] + : []; +}; + +export const generateItemProps = (hit: Hit, requester: Requester | undefined) => { + const { requesterName, reward, groupId, title } = hit; + const badges = requester ? calculateAllBadges(requester) : []; + + const actions = [ + { + content: 'Preview', + external: true, + url: `https://www.mturk.com/mturk/preview?groupId=${groupId}` + }, + { + content: 'Accept', + primary: true, + external: true, + url: `https://www.mturk.com/mturk/previewandaccept?groupId=${groupId}` + } + ]; + + return { + attributeOne: truncate(title, 80), + attributeTwo: truncate(requesterName, 45), + attributeThree: reward, + badges, + actions, + exceptions: generateExceptions(groupId) + }; +};
2bdebbf2bee19ab64a6b6f20d5c51177997b2667
client/script/output/view/ToggleItem.d.ts
client/script/output/view/ToggleItem.d.ts
/** * @license MIT License * * Copyright (c) 2015 Tetsuharu OHZEKI <[email protected]> * Copyright (c) 2015 Yusuke Suzuki <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ /// <reference path="../../../../tsd/third_party/react/react.d.ts"/> import {ComponentClass} from 'react'; interface ToggleItemProps { key?: any; item: any; } export var ToggleItem: ComponentClass<ToggleItemProps>;
Fix the typescript compiler error
Fix the typescript compiler error
TypeScript
mit
karen-irc/karen,karen-irc/karen
--- +++ @@ -0,0 +1,35 @@ +/** + * @license MIT License + * + * Copyright (c) 2015 Tetsuharu OHZEKI <[email protected]> + * Copyright (c) 2015 Yusuke Suzuki <[email protected]> + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/// <reference path="../../../../tsd/third_party/react/react.d.ts"/> + +import {ComponentClass} from 'react'; + +interface ToggleItemProps { + key?: any; + item: any; +} + +export var ToggleItem: ComponentClass<ToggleItemProps>;
9b237b98c049ffcd10162cc63d79871cabef1d7a
app/src/lib/repository-remote-parsing.ts
app/src/lib/repository-remote-parsing.ts
interface IGitRemoteURL { readonly hostname: string readonly owner: string | null readonly repositoryName: string | null } export function parseRemote(remote: string): IGitRemoteURL | null { // Examples: // https://github.com/octocat/Hello-World.git // [email protected]:octocat/Hello-World.git // git:github.com/octocat/Hello-World.git const regexes = [ new RegExp('https://(.+)/(.+)/(.+)(?:.git)'), new RegExp('https://(.+)/(.+)/(.+)(?:.git)?'), new RegExp('git@(.+):(.+)/(.+)(?:.git)'), new RegExp('git:(.+)/(.+)/(.+)(?:.git)'), ] for (const regex of regexes) { const result = remote.match(regex) if (!result) { continue } const hostname = result[1] const owner = result[2] const repositoryName = result[3] if (hostname) { return { hostname, owner, repositoryName } } } return null }
Split remote parsing into its own thing
Split remote parsing into its own thing
TypeScript
mit
j-f1/forked-desktop,kactus-io/kactus,hjobrien/desktop,hjobrien/desktop,j-f1/forked-desktop,hjobrien/desktop,desktop/desktop,hjobrien/desktop,kactus-io/kactus,BugTesterTest/desktops,shiftkey/desktop,desktop/desktop,BugTesterTest/desktops,gengjiawen/desktop,artivilla/desktop,kactus-io/kactus,artivilla/desktop,artivilla/desktop,shiftkey/desktop,artivilla/desktop,j-f1/forked-desktop,desktop/desktop,kactus-io/kactus,say25/desktop,say25/desktop,shiftkey/desktop,j-f1/forked-desktop,gengjiawen/desktop,shiftkey/desktop,say25/desktop,gengjiawen/desktop,gengjiawen/desktop,BugTesterTest/desktops,desktop/desktop,BugTesterTest/desktops,say25/desktop
--- +++ @@ -0,0 +1,32 @@ +interface IGitRemoteURL { + readonly hostname: string + readonly owner: string | null + readonly repositoryName: string | null +} + +export function parseRemote(remote: string): IGitRemoteURL | null { + // Examples: + // https://github.com/octocat/Hello-World.git + // [email protected]:octocat/Hello-World.git + // git:github.com/octocat/Hello-World.git + const regexes = [ + new RegExp('https://(.+)/(.+)/(.+)(?:.git)'), + new RegExp('https://(.+)/(.+)/(.+)(?:.git)?'), + new RegExp('git@(.+):(.+)/(.+)(?:.git)'), + new RegExp('git:(.+)/(.+)/(.+)(?:.git)'), + ] + + for (const regex of regexes) { + const result = remote.match(regex) + if (!result) { continue } + + const hostname = result[1] + const owner = result[2] + const repositoryName = result[3] + if (hostname) { + return { hostname, owner, repositoryName } + } + } + + return null +}
91d3286a1d08d1c39272ba7376fb649eb6deb38d
src/transformers/TypeInjectorTransformer.ts
src/transformers/TypeInjectorTransformer.ts
import { transform as transformInternal, TransformerFactory, SourceFile, TypeChecker, visitEachChild, visitNode, Node, SyntaxKind, VariableDeclaration, createTypeReferenceNode } from 'typescript'; import { Transformer } from './types'; export class TypeInjectorTransformer implements Transformer { private _typeChecker: TypeChecker; constructor(typeChecker: TypeChecker) { this._typeChecker = typeChecker; } getTransformer(): TransformerFactory<SourceFile> { return context => node => { const injectTypeIfNeeded = (node: Node): Node => { if (node.kind === SyntaxKind.VariableDeclaration) { const declaration = node as VariableDeclaration; if (declaration.type != undefined) return; declaration.type = createTypeReferenceNode(this._typeChecker.typeToString(this._typeChecker.getTypeAtLocation(node)), []); } return visitEachChild(node, injectTypeIfNeeded, context); }; return visitNode(node, injectTypeIfNeeded); } } }
Add a Type Injector Transformer
Add a Type Injector Transformer
TypeScript
mit
AmnisIO/typewriter,AmnisIO/typewriter,AmnisIO/typewriter
--- +++ @@ -0,0 +1,22 @@ +import { transform as transformInternal, TransformerFactory, SourceFile, TypeChecker, visitEachChild, visitNode, Node, SyntaxKind, VariableDeclaration, createTypeReferenceNode } from 'typescript'; +import { Transformer } from './types'; + +export class TypeInjectorTransformer implements Transformer { + private _typeChecker: TypeChecker; + constructor(typeChecker: TypeChecker) { + this._typeChecker = typeChecker; + } + getTransformer(): TransformerFactory<SourceFile> { + return context => node => { + const injectTypeIfNeeded = (node: Node): Node => { + if (node.kind === SyntaxKind.VariableDeclaration) { + const declaration = node as VariableDeclaration; + if (declaration.type != undefined) return; + declaration.type = createTypeReferenceNode(this._typeChecker.typeToString(this._typeChecker.getTypeAtLocation(node)), []); + } + return visitEachChild(node, injectTypeIfNeeded, context); + }; + return visitNode(node, injectTypeIfNeeded); + } + } +}
77b7bc9833b0ca1ca02709003e2875837bb4bff8
src/lib/hooks.ts
src/lib/hooks.ts
/* * Copyright (C) 2012-2022 Online-Go.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import * as React from "react"; import * as data from "data"; export function useUser(): rest_api.UserConfig { const [user, setUser] = React.useState<rest_api.UserConfig>(data.get("user")); React.useEffect(() => { data.watch("user", setUser); return () => data.unwatch("user", setUser); }, []); return user; }
Add useUser hook to simplify having an auto-updating user reference in components
Add useUser hook to simplify having an auto-updating user reference in components
TypeScript
agpl-3.0
online-go/online-go.com,online-go/online-go.com,online-go/online-go.com,online-go/online-go.com,online-go/online-go.com
--- +++ @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012-2022 Online-Go.com + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +import * as React from "react"; +import * as data from "data"; + +export function useUser(): rest_api.UserConfig { + const [user, setUser] = React.useState<rest_api.UserConfig>(data.get("user")); + + React.useEffect(() => { + data.watch("user", setUser); + return () => data.unwatch("user", setUser); + }, []); + + return user; +}
4e705c79fcd3cda0d1c1a2f9ed7dee93271d20ab
app/test/grouped-and-filtered-branches-test.ts
app/test/grouped-and-filtered-branches-test.ts
import * as chai from 'chai' const expect = chai.expect import { groupedAndFilteredBranches } from '../src/ui/branches/grouped-and-filtered-branches' import { Branch } from '../src/lib/local-git-operations' describe('Branches grouping', () => { const currentBranch = new Branch('master', null) const defaultBranch = new Branch('master', null) const recentBranches = [ new Branch('some-recent-branch', null), ] const otherBranch = new Branch('other-branch', null) const allBranches = [ currentBranch, ...recentBranches, otherBranch, ] it('should return all branches when the filter is empty', () => { const results = groupedAndFilteredBranches(defaultBranch, currentBranch, allBranches, recentBranches, '') expect(results.length).to.equal(6) let i = 0 expect(results[i].kind).to.equal('label') i++ expect(results[i].kind).to.equal('branch') expect((results[i] as any).branch).to.equal(defaultBranch) i++ expect(results[i].kind).to.equal('label') i++ expect(results[i].kind).to.equal('branch') expect((results[i] as any).branch).to.equal(recentBranches[0]) i++ expect(results[i].kind).to.equal('label') i++ expect(results[i].kind).to.equal('branch') expect((results[i] as any).branch).to.equal(otherBranch) }) it('should only return branches that include the filter text', () => { const results = groupedAndFilteredBranches(defaultBranch, currentBranch, allBranches, recentBranches, 'ot') expect(results.length).to.equal(2) let i = 0 expect(results[i].kind).to.equal('label') i++ expect(results[i].kind).to.equal('branch') expect((results[i] as any).branch).to.equal(otherBranch) }) })
Test branch grouping and filtering
Test branch grouping and filtering
TypeScript
mit
shiftkey/desktop,shiftkey/desktop,say25/desktop,artivilla/desktop,kactus-io/kactus,j-f1/forked-desktop,hjobrien/desktop,kactus-io/kactus,BugTesterTest/desktops,hjobrien/desktop,BugTesterTest/desktops,artivilla/desktop,artivilla/desktop,kactus-io/kactus,gengjiawen/desktop,desktop/desktop,say25/desktop,artivilla/desktop,say25/desktop,BugTesterTest/desktops,gengjiawen/desktop,j-f1/forked-desktop,hjobrien/desktop,hjobrien/desktop,desktop/desktop,gengjiawen/desktop,desktop/desktop,shiftkey/desktop,say25/desktop,j-f1/forked-desktop,desktop/desktop,j-f1/forked-desktop,kactus-io/kactus,BugTesterTest/desktops,gengjiawen/desktop,shiftkey/desktop
--- +++ @@ -0,0 +1,58 @@ +import * as chai from 'chai' +const expect = chai.expect + +import { groupedAndFilteredBranches } from '../src/ui/branches/grouped-and-filtered-branches' +import { Branch } from '../src/lib/local-git-operations' + +describe('Branches grouping', () => { + const currentBranch = new Branch('master', null) + const defaultBranch = new Branch('master', null) + const recentBranches = [ + new Branch('some-recent-branch', null), + ] + const otherBranch = new Branch('other-branch', null) + + const allBranches = [ + currentBranch, + ...recentBranches, + otherBranch, + ] + + it('should return all branches when the filter is empty', () => { + const results = groupedAndFilteredBranches(defaultBranch, currentBranch, allBranches, recentBranches, '') + expect(results.length).to.equal(6) + + let i = 0 + expect(results[i].kind).to.equal('label') + i++ + + expect(results[i].kind).to.equal('branch') + expect((results[i] as any).branch).to.equal(defaultBranch) + i++ + + expect(results[i].kind).to.equal('label') + i++ + + expect(results[i].kind).to.equal('branch') + expect((results[i] as any).branch).to.equal(recentBranches[0]) + i++ + + expect(results[i].kind).to.equal('label') + i++ + + expect(results[i].kind).to.equal('branch') + expect((results[i] as any).branch).to.equal(otherBranch) + }) + + it('should only return branches that include the filter text', () => { + const results = groupedAndFilteredBranches(defaultBranch, currentBranch, allBranches, recentBranches, 'ot') + expect(results.length).to.equal(2) + + let i = 0 + expect(results[i].kind).to.equal('label') + i++ + + expect(results[i].kind).to.equal('branch') + expect((results[i] as any).branch).to.equal(otherBranch) + }) +})
85108de728a86ef871ee1d76599ef6c94d07c4c9
saleor/static/dashboard-next/storybook/Decorator.tsx
saleor/static/dashboard-next/storybook/Decorator.tsx
import CssBaseline from "@material-ui/core/CssBaseline"; import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider"; import * as React from "react"; import { Provider as DateProvider } from "../components/Date/DateContext"; import { FormProvider } from "../components/Form"; import { MessageManager } from "../components/messages"; import { TimezoneProvider } from "../components/Timezone"; import theme from "../theme"; export const Decorator = storyFn => ( <FormProvider> <DateProvider value={+new Date("2018-08-07T14:30:44+00:00")}> <TimezoneProvider value="America/New_York"> <MuiThemeProvider theme={theme}> <CssBaseline /> <MessageManager> <div>{storyFn()}</div> </MessageManager> </MuiThemeProvider> </TimezoneProvider> </DateProvider> </FormProvider> ); export default Decorator;
import CssBaseline from "@material-ui/core/CssBaseline"; import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider"; import * as React from "react"; import { Provider as DateProvider } from "../components/Date/DateContext"; import { FormProvider } from "../components/Form"; import { MessageManager } from "../components/messages"; import { TimezoneProvider } from "../components/Timezone"; import theme from "../theme"; export const Decorator = storyFn => ( <FormProvider> <DateProvider value={+new Date("2018-08-07T14:30:44+00:00")}> <TimezoneProvider value="America/New_York"> <MuiThemeProvider theme={theme}> <CssBaseline /> <MessageManager> <div style={{ padding: 24 }} > {storyFn()} </div> </MessageManager> </MuiThemeProvider> </TimezoneProvider> </DateProvider> </FormProvider> ); export default Decorator;
Add padding to the story decorator
Add padding to the story decorator
TypeScript
bsd-3-clause
UITools/saleor,mociepka/saleor,maferelo/saleor,maferelo/saleor,UITools/saleor,mociepka/saleor,UITools/saleor,mociepka/saleor,UITools/saleor,maferelo/saleor,UITools/saleor
--- +++ @@ -15,7 +15,13 @@ <MuiThemeProvider theme={theme}> <CssBaseline /> <MessageManager> - <div>{storyFn()}</div> + <div + style={{ + padding: 24 + }} + > + {storyFn()} + </div> </MessageManager> </MuiThemeProvider> </TimezoneProvider>
41a2670e16c1ae9e870807bec656406fbbff0862
src/com/mendix/widget/carousel/components/__tests__/Control.spec.ts
src/com/mendix/widget/carousel/components/__tests__/Control.spec.ts
describe("Control", () => { xit("renders the structure correctly", () => { // }); xit("renders with class carousel-control", () => { // }); xit("renders direction css class", () => { // }); xit("renders direction icon", () => { // }); xit("responds to single click event", () => { // }); });
Add Control component tests outline
Add Control component tests outline
TypeScript
apache-2.0
FlockOfBirds/carousel,FlockOfBirds/carousel,mendixlabs/carousel,mendixlabs/carousel
--- +++ @@ -0,0 +1,22 @@ +describe("Control", () => { + + xit("renders the structure correctly", () => { + // + }); + + xit("renders with class carousel-control", () => { + // + }); + + xit("renders direction css class", () => { + // + }); + + xit("renders direction icon", () => { + // + }); + + xit("responds to single click event", () => { + // + }); +});
5604ed0c49b74124b66df979183a1045046b9f93
src/reducers/databaseFilterSettings.ts
src/reducers/databaseFilterSettings.ts
import { UPDATE_DB_SEARCH_TERM } from '../constants'; import { DatabaseFilterSettings } from 'types'; import { UpdateDatabaseSearchTerm } from 'actions/databaseFilterSettings'; const initial: DatabaseFilterSettings = { searchTerm: '' }; export default ( state = initial, action: UpdateDatabaseSearchTerm ): DatabaseFilterSettings => { switch (action.type) { case UPDATE_DB_SEARCH_TERM: return { ...state, searchTerm: action.data }; default: return state; } };
Add reducer to respond to UPDATE_DB_SEARCH_TERM.
Add reducer to respond to UPDATE_DB_SEARCH_TERM.
TypeScript
mit
Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine
--- +++ @@ -0,0 +1,22 @@ +import { UPDATE_DB_SEARCH_TERM } from '../constants'; +import { DatabaseFilterSettings } from 'types'; +import { UpdateDatabaseSearchTerm } from 'actions/databaseFilterSettings'; + +const initial: DatabaseFilterSettings = { + searchTerm: '' +}; + +export default ( + state = initial, + action: UpdateDatabaseSearchTerm +): DatabaseFilterSettings => { + switch (action.type) { + case UPDATE_DB_SEARCH_TERM: + return { + ...state, + searchTerm: action.data + }; + default: + return state; + } +};
e95bb8197f695159a55e65d980d09124e084148d
components/render-template/render-template.ts
components/render-template/render-template.ts
import { Directive, Input, AfterContentInit, TemplateRef, ViewContainerRef, EmbeddedViewRef } from 'angular2/core'; // Renders the specified template on this element's host // Also assigns the given model as an implicit local @Directive({ selector: 'conf-render', }) export class RenderTemplate implements AfterContentInit { @Input() set template(value: TemplateRef) { // Clear any previously rendered template if (this._view) { this._viewContainer.clear(); this._view = null; } // If template exists, render if (value != null) { this._view = this._viewContainer.createEmbeddedView(value); // If model is present, set as implicit local if (!this._model) { this.setLocal(); } } } @Input() set model(value: any) { this._model = value; // If a template has already been rendered, set as implicit local if (this._view != null) { this.setLocal(); } } _view: EmbeddedViewRef; _model: any; constructor(private _viewContainer: ViewContainerRef) { } private setLocal() { this._view.setLocal('\$implicit', this._model); } }
Add a component for rendering template references
Add a component for rendering template references
TypeScript
mit
SonofNun15/conf-template-components,SonofNun15/conf-template-components,SonofNun15/conf-template-components
--- +++ @@ -0,0 +1,46 @@ +import { + Directive, Input, AfterContentInit, + TemplateRef, ViewContainerRef, EmbeddedViewRef +} from 'angular2/core'; + +// Renders the specified template on this element's host +// Also assigns the given model as an implicit local +@Directive({ + selector: 'conf-render', +}) +export class RenderTemplate implements AfterContentInit { + @Input() set template(value: TemplateRef) { + // Clear any previously rendered template + if (this._view) { + this._viewContainer.clear(); + this._view = null; + } + + // If template exists, render + if (value != null) { + this._view = this._viewContainer.createEmbeddedView(value); + + // If model is present, set as implicit local + if (!this._model) { + this.setLocal(); + } + } + } + @Input() set model(value: any) { + this._model = value; + + // If a template has already been rendered, set as implicit local + if (this._view != null) { + this.setLocal(); + } + } + + _view: EmbeddedViewRef; + _model: any; + + constructor(private _viewContainer: ViewContainerRef) { } + + private setLocal() { + this._view.setLocal('\$implicit', this._model); + } +}
2db90dbe629587965620b4b8e02f4f12f0efa08f
src/components/Watchers/AddWatcherToast.tsx
src/components/Watchers/AddWatcherToast.tsx
import { connect, Dispatch } from 'react-redux'; import { TextContainer } from '@shopify/polaris'; import { AddWatcher, addWatcher } from '../../actions/watcher'; import * as React from 'react'; import { Watcher, SearchResult } from '../../types'; export interface OwnProps { readonly hit: SearchResult; } export interface Handlers { readonly onAddWatcher: (watcher: Watcher) => void; } class AddWatcherToast extends React.Component<OwnProps & Handlers, never> { public render() { return <TextContainer>Sample Text</TextContainer>; } } const mapDispatch = (dispatch: Dispatch<AddWatcher>): Handlers => ({ onAddWatcher: (watcher: Watcher) => dispatch(addWatcher(watcher)) }); export default connect(null, mapDispatch)(AddWatcherToast);
Add a connected component to add watchers from a toast.
Add a connected component to add watchers from a toast.
TypeScript
mit
Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine
--- +++ @@ -0,0 +1,25 @@ +import { connect, Dispatch } from 'react-redux'; +import { TextContainer } from '@shopify/polaris'; +import { AddWatcher, addWatcher } from '../../actions/watcher'; +import * as React from 'react'; +import { Watcher, SearchResult } from '../../types'; + +export interface OwnProps { + readonly hit: SearchResult; +} + +export interface Handlers { + readonly onAddWatcher: (watcher: Watcher) => void; +} + +class AddWatcherToast extends React.Component<OwnProps & Handlers, never> { + public render() { + return <TextContainer>Sample Text</TextContainer>; + } +} + +const mapDispatch = (dispatch: Dispatch<AddWatcher>): Handlers => ({ + onAddWatcher: (watcher: Watcher) => dispatch(addWatcher(watcher)) +}); + +export default connect(null, mapDispatch)(AddWatcherToast);
1a77458cf33b99cb3822526e5db8452837bcaf05
app/components/renderForQuestions/answerState.ts
app/components/renderForQuestions/answerState.ts
import {Response} from "quill-marking-logic" interface Attempt { response: Response } function getAnswerState(attempt): boolean { return (attempt.found && attempt.response.optimal && attempt.response.author === undefined && attempt.author === undefined) } export default getAnswerState;
Add a function for checking if an answer is correct.
Add a function for checking if an answer is correct.
TypeScript
agpl-3.0
empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core
--- +++ @@ -0,0 +1,11 @@ +import {Response} from "quill-marking-logic" + +interface Attempt { + response: Response +} + +function getAnswerState(attempt): boolean { + return (attempt.found && attempt.response.optimal && attempt.response.author === undefined && attempt.author === undefined) +} + +export default getAnswerState;
c5f778754f9e32fb59a1777dc2457e709c86b0fa
app/src/lib/markdown-filters/node-filter.ts
app/src/lib/markdown-filters/node-filter.ts
export interface INodeFilter { /** * Creates a document tree walker filtered to the nodes relevant to the node filter. * * Examples: * 1) An Emoji filter operates on all text nodes. * 2) The issue mention filter operates on all text nodes, but not inside pre, code, or anchor tags */ createFilterTreeWalker(doc: Document): TreeWalker /** * This filter accepts a document node and searches for it's pattern within it. * * If found, returns an array of nodes to replace the node with. * Example: [Node(contents before match), Node(match replacement), Node(contents after match)] * If not found, returns null * * This is asynchronous as some filters have data must be fetched or, like in * emoji, the conversion to base 64 data uri is asynchronous * */ filter(node: Node): Promise<ReadonlyArray<Node> | null> }
Create the base node filter interface
Create the base node filter interface
TypeScript
mit
shiftkey/desktop,desktop/desktop,desktop/desktop,j-f1/forked-desktop,shiftkey/desktop,desktop/desktop,shiftkey/desktop,j-f1/forked-desktop,j-f1/forked-desktop,desktop/desktop,j-f1/forked-desktop,shiftkey/desktop
--- +++ @@ -0,0 +1,23 @@ +export interface INodeFilter { + /** + * Creates a document tree walker filtered to the nodes relevant to the node filter. + * + * Examples: + * 1) An Emoji filter operates on all text nodes. + * 2) The issue mention filter operates on all text nodes, but not inside pre, code, or anchor tags + */ + createFilterTreeWalker(doc: Document): TreeWalker + + /** + * This filter accepts a document node and searches for it's pattern within it. + * + * If found, returns an array of nodes to replace the node with. + * Example: [Node(contents before match), Node(match replacement), Node(contents after match)] + * If not found, returns null + * + * This is asynchronous as some filters have data must be fetched or, like in + * emoji, the conversion to base 64 data uri is asynchronous + * */ + filter(node: Node): Promise<ReadonlyArray<Node> | null> +} +
4f46ad0c1ed3e6702cc372c28b92ed84a59af648
saleor/static/dashboard-next/storybook/stories/navigation/MenuDetailsPage.tsx
saleor/static/dashboard-next/storybook/stories/navigation/MenuDetailsPage.tsx
import { storiesOf } from "@storybook/react"; import * as React from "react"; import MenuDetailsPage, { MenuDetailsPageProps } from "../../../navigation/components/MenuDetailsPage"; import { menu } from "../../../navigation/fixtures"; import Decorator from "../../Decorator"; const props: MenuDetailsPageProps = { disabled: false, menu, onBack: () => undefined, onDelete: () => undefined, onItemAdd: () => undefined, onSubmit: () => undefined, saveButtonState: "default" }; storiesOf("Views / Navigation / Menu details", module) .addDecorator(Decorator) .add("default", () => <MenuDetailsPage {...props} />) .add("loading", () => ( <MenuDetailsPage {...props} disabled={true} menu={undefined} /> ));
import { storiesOf } from "@storybook/react"; import * as React from "react"; import MenuDetailsPage, { MenuDetailsPageProps } from "../../../navigation/components/MenuDetailsPage"; import { menu } from "../../../navigation/fixtures"; import Decorator from "../../Decorator"; const props: MenuDetailsPageProps = { disabled: false, menu, onBack: () => undefined, onDelete: () => undefined, onItemAdd: () => undefined, onSubmit: () => undefined, saveButtonState: "default" }; storiesOf("Views / Navigation / Menu details", module) .addDecorator(Decorator) .add("default", () => <MenuDetailsPage {...props} />) .add("loading", () => ( <MenuDetailsPage {...props} disabled={true} menu={undefined} /> )) .add("no data", () => ( <MenuDetailsPage {...props} menu={{ ...props.menu, items: [] }} /> ));
Add story with empty menu
Add story with empty menu
TypeScript
bsd-3-clause
maferelo/saleor,maferelo/saleor,maferelo/saleor,mociepka/saleor,mociepka/saleor,mociepka/saleor
--- +++ @@ -22,4 +22,13 @@ .add("default", () => <MenuDetailsPage {...props} />) .add("loading", () => ( <MenuDetailsPage {...props} disabled={true} menu={undefined} /> + )) + .add("no data", () => ( + <MenuDetailsPage + {...props} + menu={{ + ...props.menu, + items: [] + }} + /> ));
1308cb80915d13724ad38b6178a1b3b924beb944
resources/assets/lib/interfaces/beatmapset-extended-json.ts
resources/assets/lib/interfaces/beatmapset-extended-json.ts
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. import { BeatmapsetJson } from 'beatmapsets/beatmapset-json'; interface AvailabilityInterface { download_disabled: boolean; download_disabled_url: string; } interface NominationsSummaryInterface { current: number; required: number; } export interface BeatmapsetExtendedJson extends BeatmapsetJson { availability?: AvailabilityInterface; nominations_summary?: NominationsSummaryInterface; ranked_date: string; storyboard: boolean; }
Add interface for beatmapset extended
Add interface for beatmapset extended
TypeScript
agpl-3.0
nanaya/osu-web,nanaya/osu-web,notbakaneko/osu-web,notbakaneko/osu-web,ppy/osu-web,ppy/osu-web,notbakaneko/osu-web,nanaya/osu-web,ppy/osu-web,notbakaneko/osu-web,nanaya/osu-web,ppy/osu-web,LiquidPL/osu-web,LiquidPL/osu-web,LiquidPL/osu-web,LiquidPL/osu-web,nanaya/osu-web,LiquidPL/osu-web,notbakaneko/osu-web,ppy/osu-web
--- +++ @@ -0,0 +1,21 @@ +// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0. +// See the LICENCE file in the repository root for full licence text. + +import { BeatmapsetJson } from 'beatmapsets/beatmapset-json'; + +interface AvailabilityInterface { + download_disabled: boolean; + download_disabled_url: string; +} + +interface NominationsSummaryInterface { + current: number; + required: number; +} + +export interface BeatmapsetExtendedJson extends BeatmapsetJson { + availability?: AvailabilityInterface; + nominations_summary?: NominationsSummaryInterface; + ranked_date: string; + storyboard: boolean; +}
d411fa34a7b771b9682ff6b39bec96f61ff16588
tests/cases/fourslash/codeFixUnusedIdentifier_parameter_modifier.ts
tests/cases/fourslash/codeFixUnusedIdentifier_parameter_modifier.ts
/// <reference path='fourslash.ts' /> // @noUnusedLocals: true // @noUnusedParameters: true ////export class Example { //// prop: any; //// constructor(private arg: any) { //// this.prop = arg; //// } ////} verify.codeFix({ description: "Remove declaration for: 'arg'", newFileContent: `export class Example { prop: any; constructor(arg: any) { this.prop = arg; } }`, });
Add test case for codeFix
Add test case for codeFix
TypeScript
apache-2.0
SaschaNaz/TypeScript,RyanCavanaugh/TypeScript,kitsonk/TypeScript,weswigham/TypeScript,SaschaNaz/TypeScript,donaldpipowitch/TypeScript,kitsonk/TypeScript,weswigham/TypeScript,kpreisser/TypeScript,minestarks/TypeScript,minestarks/TypeScript,Microsoft/TypeScript,nojvek/TypeScript,nojvek/TypeScript,microsoft/TypeScript,weswigham/TypeScript,Microsoft/TypeScript,kitsonk/TypeScript,RyanCavanaugh/TypeScript,donaldpipowitch/TypeScript,nojvek/TypeScript,alexeagle/TypeScript,Microsoft/TypeScript,alexeagle/TypeScript,kpreisser/TypeScript,SaschaNaz/TypeScript,donaldpipowitch/TypeScript,microsoft/TypeScript,nojvek/TypeScript,alexeagle/TypeScript,RyanCavanaugh/TypeScript,kpreisser/TypeScript,minestarks/TypeScript,donaldpipowitch/TypeScript,SaschaNaz/TypeScript,microsoft/TypeScript
--- +++ @@ -0,0 +1,22 @@ +/// <reference path='fourslash.ts' /> + +// @noUnusedLocals: true +// @noUnusedParameters: true + +////export class Example { +//// prop: any; +//// constructor(private arg: any) { +//// this.prop = arg; +//// } +////} + +verify.codeFix({ + description: "Remove declaration for: 'arg'", + newFileContent: +`export class Example { + prop: any; + constructor(arg: any) { + this.prop = arg; + } +}`, +});
ea6c293726e54c72f53f51708e9b1f2c22cb9c2e
desktop/flipper-frontend-core/src/globalObject.tsx
desktop/flipper-frontend-core/src/globalObject.tsx
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ // this list should match `replace-flipper-requires.tsx` and the `builtInModules` in `desktop/.eslintrc` export interface GlobalObject { React: any; ReactDOM: any; ReactDOMClient: any; ReactIs: any; Flipper: any; FlipperPlugin: any; Immer: any; antd: any; emotion_styled: any; antdesign_icons: any; } export const setGlobalObject = (replacements: GlobalObject) => { const globalObject = (function (this: any) { return this; })(); for (const [name, module] of Object.entries(replacements)) { globalObject[name] = module; } };
Set global replacements in flipper-frontend-core
Set global replacements in flipper-frontend-core Summary: Extract setting global replacements from plugin initialization Reviewed By: mweststrate Differential Revision: D36129749 fbshipit-source-id: 6f5b3e27c1b798124b5f2772e9099899ce521d0a
TypeScript
mit
facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper
--- +++ @@ -0,0 +1,31 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +// this list should match `replace-flipper-requires.tsx` and the `builtInModules` in `desktop/.eslintrc` +export interface GlobalObject { + React: any; + ReactDOM: any; + ReactDOMClient: any; + ReactIs: any; + Flipper: any; + FlipperPlugin: any; + Immer: any; + antd: any; + emotion_styled: any; + antdesign_icons: any; +} + +export const setGlobalObject = (replacements: GlobalObject) => { + const globalObject = (function (this: any) { + return this; + })(); + for (const [name, module] of Object.entries(replacements)) { + globalObject[name] = module; + } +};
16457e2adbfddaa1bc445df331a77f75b419b7a6
src/utils/typeUtils.tsx
src/utils/typeUtils.tsx
/** * Copyright 2018-present Facebook. * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * @format */ // Typescript doesn't know Array.filter(Boolean) won't contain nulls. // So use Array.filter(notNull) instead. export function notNull<T>(x: T | null | undefined): x is T { return x !== null && x !== undefined; }
Add notNull filter with type guard
Add notNull filter with type guard Summary: You need to use a type guard when narrowing types in a filter. Reviewed By: danielbuechele Differential Revision: D17163782 fbshipit-source-id: aa78bdd392653ebf1080a04e62e131b607e5181b
TypeScript
mit
facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper
--- +++ @@ -0,0 +1,12 @@ +/** + * Copyright 2018-present Facebook. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * @format + */ + +// Typescript doesn't know Array.filter(Boolean) won't contain nulls. +// So use Array.filter(notNull) instead. +export function notNull<T>(x: T | null | undefined): x is T { + return x !== null && x !== undefined; +}
eeec775da0f3dabe9c73254c02b5254bab84c882
tests/cases/fourslash/server/completionEntryDetailAcrossFiles02.ts
tests/cases/fourslash/server/completionEntryDetailAcrossFiles02.ts
/// <reference path="../fourslash.ts"/> // @allowNonTsExtensions: true // @Filename: a.js //// /** //// * Modify the parameter //// * @param {string} p1 //// */ //// var foo = function (p1) { } //// module.exports.foo = foo; //// fo/*1*/ // @Filename: b.ts //// import a = require("./a"); //// a.fo/*2*/ goTo.marker('1'); verify.completionEntryDetailIs("foo", "var foo: (p1: string) => void", "Modify the parameter"); goTo.marker('2'); verify.completionEntryDetailIs("foo", "(property) a.foo: (p1: string) => void", "Modify the parameter");
Add more test for 10426
Add more test for 10426
TypeScript
apache-2.0
jwbay/TypeScript,donaldpipowitch/TypeScript,weswigham/TypeScript,kitsonk/TypeScript,nojvek/TypeScript,donaldpipowitch/TypeScript,nojvek/TypeScript,basarat/TypeScript,DLehenbauer/TypeScript,basarat/TypeScript,SaschaNaz/TypeScript,microsoft/TypeScript,vilic/TypeScript,erikmcc/TypeScript,jeremyepling/TypeScript,Eyas/TypeScript,alexeagle/TypeScript,TukekeSoft/TypeScript,Microsoft/TypeScript,TukekeSoft/TypeScript,Microsoft/TypeScript,synaptek/TypeScript,mihailik/TypeScript,chuckjaz/TypeScript,minestarks/TypeScript,minestarks/TypeScript,synaptek/TypeScript,jeremyepling/TypeScript,kitsonk/TypeScript,erikmcc/TypeScript,kpreisser/TypeScript,microsoft/TypeScript,alexeagle/TypeScript,Eyas/TypeScript,kitsonk/TypeScript,jeremyepling/TypeScript,microsoft/TypeScript,donaldpipowitch/TypeScript,TukekeSoft/TypeScript,jwbay/TypeScript,chuckjaz/TypeScript,jwbay/TypeScript,vilic/TypeScript,Microsoft/TypeScript,SaschaNaz/TypeScript,synaptek/TypeScript,weswigham/TypeScript,Eyas/TypeScript,synaptek/TypeScript,thr0w/Thr0wScript,erikmcc/TypeScript,jwbay/TypeScript,mihailik/TypeScript,DLehenbauer/TypeScript,minestarks/TypeScript,RyanCavanaugh/TypeScript,thr0w/Thr0wScript,RyanCavanaugh/TypeScript,donaldpipowitch/TypeScript,SaschaNaz/TypeScript,thr0w/Thr0wScript,RyanCavanaugh/TypeScript,vilic/TypeScript,kpreisser/TypeScript,basarat/TypeScript,SaschaNaz/TypeScript,alexeagle/TypeScript,thr0w/Thr0wScript,nojvek/TypeScript,chuckjaz/TypeScript,DLehenbauer/TypeScript,Eyas/TypeScript,kpreisser/TypeScript,DLehenbauer/TypeScript,mihailik/TypeScript,basarat/TypeScript,chuckjaz/TypeScript,mihailik/TypeScript,weswigham/TypeScript,vilic/TypeScript,nojvek/TypeScript,erikmcc/TypeScript
--- +++ @@ -0,0 +1,20 @@ +/// <reference path="../fourslash.ts"/> + +// @allowNonTsExtensions: true +// @Filename: a.js +//// /** +//// * Modify the parameter +//// * @param {string} p1 +//// */ +//// var foo = function (p1) { } +//// module.exports.foo = foo; +//// fo/*1*/ + +// @Filename: b.ts +//// import a = require("./a"); +//// a.fo/*2*/ + +goTo.marker('1'); +verify.completionEntryDetailIs("foo", "var foo: (p1: string) => void", "Modify the parameter"); +goTo.marker('2'); +verify.completionEntryDetailIs("foo", "(property) a.foo: (p1: string) => void", "Modify the parameter");
34ba173e92924d7584700f38265bac709501c7be
src/app/shared/formatted-text/formatted-text.component.stories.ts
src/app/shared/formatted-text/formatted-text.component.stories.ts
import { NgxMdModule } from 'ngx-md'; import { HttpClientModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; import { text } from '@storybook/addon-knobs'; import { storiesOf } from '@storybook/angular'; import { FormattedTextComponent } from './formatted-text.component'; const moduleMetadata: NgModule = { declarations: [FormattedTextComponent], imports: [HttpClientModule, NgxMdModule.forRoot()] }; const markdown = `# Markdown-enabled formatted text To preview the behaviour: 1. Switch to the knobs tab in the addons area (press A if the addons area is not visible) 1. Edit the text field`; storiesOf('Shared', module).add('Formatted text', () => ({ template: `<jblog-text>{{ text }}</jblog-text>`, moduleMetadata, props: { text: text('text', markdown) } }));
Add story for formatted text component
Add story for formatted text component
TypeScript
apache-2.0
jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog
--- +++ @@ -0,0 +1,28 @@ +import { NgxMdModule } from 'ngx-md'; + +import { HttpClientModule } from '@angular/common/http'; +import { NgModule } from '@angular/core'; +import { text } from '@storybook/addon-knobs'; +import { storiesOf } from '@storybook/angular'; + +import { FormattedTextComponent } from './formatted-text.component'; + +const moduleMetadata: NgModule = { + declarations: [FormattedTextComponent], + imports: [HttpClientModule, NgxMdModule.forRoot()] +}; + +const markdown = `# Markdown-enabled formatted text + +To preview the behaviour: + +1. Switch to the knobs tab in the addons area (press A if the addons area is not visible) +1. Edit the text field`; + +storiesOf('Shared', module).add('Formatted text', () => ({ + template: `<jblog-text>{{ text }}</jblog-text>`, + moduleMetadata, + props: { + text: text('text', markdown) + } +}));
0707350c7bcd41a7b0b30b1d71aaf43d8bfc2718
tests/cases/fourslash/formatConflictMarker1.ts
tests/cases/fourslash/formatConflictMarker1.ts
/// <reference path='fourslash.ts' /> ////class C { ////<<<<<<< HEAD //// v = 1; ////======= ////v = 2; ////>>>>>>> Branch - a ////} format.document(); verify.currentFileContentIs("class C {\r\n\ <<<<<<< HEAD\r\n\ v = 1;\r\n\ =======\r\n\ v = 2;\r\n\ >>>>>>> Branch - a\r\n\ }");
/// <reference path='fourslash.ts' /> ////class C { ////<<<<<<< HEAD ////v = 1; ////======= ////v = 2; ////>>>>>>> Branch - a ////} format.document(); verify.currentFileContentIs("class C {\r\n\ <<<<<<< HEAD\r\n\ v = 1;\r\n\ =======\r\n\ v = 2;\r\n\ >>>>>>> Branch - a\r\n\ }");
Update conflict marker formatting test. We now no longer format the second branch of hte merge.
Update conflict marker formatting test. We now no longer format the second branch of hte merge.
TypeScript
apache-2.0
RyanCavanaugh/TypeScript,yortus/TypeScript,shiftkey/TypeScript,kumikumi/TypeScript,Raynos/TypeScript,nagyistoce/TypeScript,mihailik/TypeScript,thr0w/Thr0wScript,billti/TypeScript,nycdotnet/TypeScript,mszczepaniak/TypeScript,JohnZ622/TypeScript,mmoskal/TypeScript,blakeembrey/TypeScript,minestarks/TypeScript,MartyIX/TypeScript,mmoskal/TypeScript,germ13/TypeScript,Viromo/TypeScript,thr0w/Thr0wScript,shiftkey/TypeScript,yazeng/TypeScript,hoanhtien/TypeScript,shovon/TypeScript,jwbay/TypeScript,basarat/TypeScript,synaptek/TypeScript,AbubakerB/TypeScript,ionux/TypeScript,mauricionr/TypeScript,SimoneGianni/TypeScript,evgrud/TypeScript,Eyas/TypeScript,Raynos/TypeScript,msynk/TypeScript,mcanthony/TypeScript,mauricionr/TypeScript,Mqgh2013/TypeScript,tempbottle/TypeScript,SimoneGianni/TypeScript,sassson/TypeScript,yukulele/TypeScript,HereSinceres/TypeScript,basarat/TypeScript,nycdotnet/TypeScript,evgrud/TypeScript,AbubakerB/TypeScript,blakeembrey/TypeScript,sassson/TypeScript,billti/TypeScript,erikmcc/TypeScript,rgbkrk/TypeScript,donaldpipowitch/TypeScript,fdecampredon/jsx-typescript,chuckjaz/TypeScript,ziacik/TypeScript,hoanhtien/TypeScript,JohnZ622/TypeScript,hoanhtien/TypeScript,fearthecowboy/TypeScript,plantain-00/TypeScript,kimamula/TypeScript,shiftkey/TypeScript,yazeng/TypeScript,jeremyepling/TypeScript,impinball/TypeScript,basarat/TypeScript,jamesrmccallum/TypeScript,rodrigues-daniel/TypeScript,fdecampredon/jsx-typescript,chocolatechipui/TypeScript,minestarks/TypeScript,enginekit/TypeScript,jteplitz602/TypeScript,JohnZ622/TypeScript,plantain-00/TypeScript,tempbottle/TypeScript,jbondc/TypeScript,kumikumi/TypeScript,ropik/TypeScript,nojvek/TypeScript,progre/TypeScript,billti/TypeScript,jdavidberger/TypeScript,erikmcc/TypeScript,tinganho/TypeScript,blakeembrey/TypeScript,MartyIX/TypeScript,DLehenbauer/TypeScript,RReverser/TypeScript,webhost/TypeScript,suto/TypeScript,ropik/TypeScript,mcanthony/TypeScript,kpreisser/TypeScript,rgbkrk/TypeScript,vilic/TypeScript,enginekit/TypeScript,impinball/TypeScript,abbasmhd/TypeScript,kpreisser/TypeScript,JohnZ622/TypeScript,kingland/TypeScript,bpowers/TypeScript,jamesrmccallum/TypeScript,SaschaNaz/TypeScript,fearthecowboy/TypeScript,zmaruo/TypeScript,erikmcc/TypeScript,ZLJASON/TypeScript,kitsonk/TypeScript,yukulele/TypeScript,synaptek/TypeScript,bpowers/TypeScript,vilic/TypeScript,jwbay/TypeScript,mihailik/TypeScript,samuelhorwitz/typescript,thr0w/Thr0wScript,rodrigues-daniel/TypeScript,nojvek/TypeScript,zhengbli/TypeScript,plantain-00/TypeScript,vilic/TypeScript,MartyIX/TypeScript,bpowers/TypeScript,kimamula/TypeScript,RReverser/TypeScript,tempbottle/TypeScript,moander/TypeScript,shanexu/TypeScript,minestarks/TypeScript,evgrud/TypeScript,rgbkrk/TypeScript,SimoneGianni/TypeScript,TukekeSoft/TypeScript,jteplitz602/TypeScript,fabioparra/TypeScript,microsoft/TypeScript,samuelhorwitz/typescript,ZLJASON/TypeScript,kingland/TypeScript,kumikumi/TypeScript,sassson/TypeScript,ropik/TypeScript,nojvek/TypeScript,yukulele/TypeScript,DLehenbauer/TypeScript,yazeng/TypeScript,fabioparra/TypeScript,RyanCavanaugh/TypeScript,HereSinceres/TypeScript,mauricionr/TypeScript,OlegDokuka/TypeScript,zmaruo/TypeScript,yortus/TypeScript,SmallAiTT/TypeScript,evgrud/TypeScript,impinball/TypeScript,RyanCavanaugh/TypeScript,shanexu/TypeScript,tinganho/TypeScript,mmoskal/TypeScript,alexeagle/TypeScript,RReverser/TypeScript,matthewjh/TypeScript,zhengbli/TypeScript,matthewjh/TypeScript,TukekeSoft/TypeScript,kpreisser/TypeScript,MartyIX/TypeScript,progre/TypeScript,fabioparra/TypeScript,DanielRosenwasser/TypeScript,erikmcc/TypeScript,webhost/TypeScript,weswigham/TypeScript,DLehenbauer/TypeScript,AbubakerB/TypeScript,shovon/TypeScript,synaptek/TypeScript,OlegDokuka/TypeScript,vilic/TypeScript,plantain-00/TypeScript,moander/TypeScript,DanielRosenwasser/TypeScript,mszczepaniak/TypeScript,jbondc/TypeScript,jteplitz602/TypeScript,SmallAiTT/TypeScript,hitesh97/TypeScript,zhengbli/TypeScript,chocolatechipui/TypeScript,abbasmhd/TypeScript,Viromo/TypeScript,Mqgh2013/TypeScript,nycdotnet/TypeScript,jwbay/TypeScript,mihailik/TypeScript,jeremyepling/TypeScript,donaldpipowitch/TypeScript,Raynos/TypeScript,Microsoft/TypeScript,weswigham/TypeScript,chuckjaz/TypeScript,mcanthony/TypeScript,fdecampredon/jsx-typescript,germ13/TypeScript,keir-rex/TypeScript,mihailik/TypeScript,progre/TypeScript,shanexu/TypeScript,ziacik/TypeScript,jdavidberger/TypeScript,abbasmhd/TypeScript,Microsoft/TypeScript,ropik/TypeScript,suto/TypeScript,kitsonk/TypeScript,kingland/TypeScript,nagyistoce/TypeScript,thr0w/Thr0wScript,gdi2290/TypeScript,chocolatechipui/TypeScript,Microsoft/TypeScript,kitsonk/TypeScript,nycdotnet/TypeScript,OlegDokuka/TypeScript,Eyas/TypeScript,jamesrmccallum/TypeScript,Mqgh2013/TypeScript,SaschaNaz/TypeScript,ziacik/TypeScript,samuelhorwitz/typescript,SaschaNaz/TypeScript,rodrigues-daniel/TypeScript,chuckjaz/TypeScript,mcanthony/TypeScript,hitesh97/TypeScript,Viromo/TypeScript,jeremyepling/TypeScript,mszczepaniak/TypeScript,weswigham/TypeScript,ZLJASON/TypeScript,HereSinceres/TypeScript,microsoft/TypeScript,pcan/TypeScript,keir-rex/TypeScript,microsoft/TypeScript,fabioparra/TypeScript,chuckjaz/TypeScript,alexeagle/TypeScript,jdavidberger/TypeScript,fdecampredon/jsx-typescript,ziacik/TypeScript,webhost/TypeScript,ionux/TypeScript,tinganho/TypeScript,Eyas/TypeScript,kimamula/TypeScript,msynk/TypeScript,kimamula/TypeScript,nojvek/TypeScript,mmoskal/TypeScript,samuelhorwitz/typescript,DLehenbauer/TypeScript,donaldpipowitch/TypeScript,pcan/TypeScript,suto/TypeScript,blakeembrey/TypeScript,DanielRosenwasser/TypeScript,SmallAiTT/TypeScript,moander/TypeScript,shovon/TypeScript,yortus/TypeScript,pcan/TypeScript,DanielRosenwasser/TypeScript,basarat/TypeScript,shanexu/TypeScript,gonifade/TypeScript,gonifade/TypeScript,keir-rex/TypeScript,hitesh97/TypeScript,yortus/TypeScript,matthewjh/TypeScript,rodrigues-daniel/TypeScript,germ13/TypeScript,donaldpipowitch/TypeScript,jwbay/TypeScript,msynk/TypeScript,ionux/TypeScript,AbubakerB/TypeScript,TukekeSoft/TypeScript,synaptek/TypeScript,jbondc/TypeScript,gonifade/TypeScript,Viromo/TypeScript,Eyas/TypeScript,mauricionr/TypeScript,Raynos/TypeScript,zmaruo/TypeScript,SaschaNaz/TypeScript,alexeagle/TypeScript,fearthecowboy/TypeScript,enginekit/TypeScript,nagyistoce/TypeScript,ionux/TypeScript,moander/TypeScript
--- +++ @@ -2,7 +2,7 @@ ////class C { ////<<<<<<< HEAD -//// v = 1; +////v = 1; ////======= ////v = 2; ////>>>>>>> Branch - a @@ -13,6 +13,6 @@ <<<<<<< HEAD\r\n\ v = 1;\r\n\ =======\r\n\ - v = 2;\r\n\ +v = 2;\r\n\ >>>>>>> Branch - a\r\n\ }");
5f1349ed0d7a13d9927cc3e8f1463d718e862b66
src/framework/collect_garbage.ts
src/framework/collect_garbage.ts
// tslint:disable-next-line: no-any declare const Components: any; export function attemptGarbageCollection(): void { // tslint:disable-next-line: no-any const w: any = window; if (w.GCController) { w.GCController.collect(); return; } if (w.opera && w.opera.collect) { w.opera.collect(); return; } try { w.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindowUtils) .garbageCollect(); return; } catch (e) {} if (w.gc) { w.gc(); return; } if (w.CollectGarbage) { w.CollectGarbage(); return; } let i: number; function gcRec(n: number): void { if (n < 1) return; // tslint:disable-next-line: no-any let temp: any = { i: 'ab' + i + i / 100000 }; temp = temp + 'foo'; gcRec(n - 1); } for (i = 0; i < 1000; i++) { gcRec(10); } }
Add garbage collect function from WebGL CTS
Add garbage collect function from WebGL CTS
TypeScript
bsd-3-clause
gpuweb/cts,gpuweb/cts,gpuweb/cts
--- +++ @@ -0,0 +1,45 @@ +// tslint:disable-next-line: no-any +declare const Components: any; + +export function attemptGarbageCollection(): void { + // tslint:disable-next-line: no-any + const w: any = window; + if (w.GCController) { + w.GCController.collect(); + return; + } + + if (w.opera && w.opera.collect) { + w.opera.collect(); + return; + } + + try { + w.QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIDOMWindowUtils) + .garbageCollect(); + return; + } catch (e) {} + + if (w.gc) { + w.gc(); + return; + } + + if (w.CollectGarbage) { + w.CollectGarbage(); + return; + } + + let i: number; + function gcRec(n: number): void { + if (n < 1) return; + // tslint:disable-next-line: no-any + let temp: any = { i: 'ab' + i + i / 100000 }; + temp = temp + 'foo'; + gcRec(n - 1); + } + for (i = 0; i < 1000; i++) { + gcRec(10); + } +}
763fe3ba33bbea919864bd765c3238f912a9d598
server/test/chokidar-test.ts
server/test/chokidar-test.ts
import * as path from 'path'; import { tmpdir } from 'os'; import { expect } from 'chai'; const fs = require('fs-extra'); const chokidar = require('chokidar'); describe('chokidar', function() { let workDir = path.join(tmpdir(), 'chokidar-test'); beforeEach(function() { fs.emptyDirSync(workDir); }); afterEach(function() { fs.removeSync(workDir); }); function withWatcher(cb: Function) { return withCustomWatcher({}, cb); } async function withCustomWatcher(options = {}, cb: Function) { let watcher = chokidar.watch(workDir, options); try { await cb(watcher); } finally { watcher.close(); } } it('watches an empty folder', function() { return withWatcher(async (watcher: any) => { await readyEvent(watcher); let watched = watcher.getWatched(); expect(watched).to.deep.equal({ [tmpdir()]: ['chokidar-test'], [workDir]: [], }); }); }); it('watches a nested project structure', function() { fs.outputFileSync(path.join(workDir, 'a', 'ember-cli-build.js')); fs.outputFileSync(path.join(workDir, 'b', 'c', 'ember-cli-build.js')); return withWatcher(async (watcher: any) => { await readyEvent(watcher); let watched = watcher.getWatched(); expect(watched).to.deep.equal({ [tmpdir()]: ['chokidar-test'], [workDir]: ['a', 'b'], [path.join(workDir, 'a')]: ['ember-cli-build.js'], [path.join(workDir, 'b')]: ['c'], [path.join(workDir, 'b', 'c')]: ['ember-cli-build.js'], }); }); }); }); function readyEvent(watcher: any) { return new Promise(resolve => { watcher.once('ready', resolve); }); }
Add basic integration tests for chokidar
server: Add basic integration tests for chokidar
TypeScript
mit
emberwatch/ember-language-server,emberwatch/ember-language-server
--- +++ @@ -0,0 +1,68 @@ +import * as path from 'path'; +import { tmpdir } from 'os'; + +import { expect } from 'chai'; + +const fs = require('fs-extra'); +const chokidar = require('chokidar'); + +describe('chokidar', function() { + let workDir = path.join(tmpdir(), 'chokidar-test'); + + beforeEach(function() { + fs.emptyDirSync(workDir); + }); + + afterEach(function() { + fs.removeSync(workDir); + }); + + function withWatcher(cb: Function) { + return withCustomWatcher({}, cb); + } + + async function withCustomWatcher(options = {}, cb: Function) { + let watcher = chokidar.watch(workDir, options); + try { + await cb(watcher); + } finally { + watcher.close(); + } + } + + it('watches an empty folder', function() { + return withWatcher(async (watcher: any) => { + await readyEvent(watcher); + + let watched = watcher.getWatched(); + expect(watched).to.deep.equal({ + [tmpdir()]: ['chokidar-test'], + [workDir]: [], + }); + }); + }); + + it('watches a nested project structure', function() { + fs.outputFileSync(path.join(workDir, 'a', 'ember-cli-build.js')); + fs.outputFileSync(path.join(workDir, 'b', 'c', 'ember-cli-build.js')); + + return withWatcher(async (watcher: any) => { + await readyEvent(watcher); + + let watched = watcher.getWatched(); + expect(watched).to.deep.equal({ + [tmpdir()]: ['chokidar-test'], + [workDir]: ['a', 'b'], + [path.join(workDir, 'a')]: ['ember-cli-build.js'], + [path.join(workDir, 'b')]: ['c'], + [path.join(workDir, 'b', 'c')]: ['ember-cli-build.js'], + }); + }); + }); +}); + +function readyEvent(watcher: any) { + return new Promise(resolve => { + watcher.once('ready', resolve); + }); +}
c029aa6a051f47296137110114dc5d7dd527530c
src/datasets/summarizations/utils/time-series.spec.ts
src/datasets/summarizations/utils/time-series.spec.ts
import { groupPointsByXWeek } from './time-series'; describe('groupPointsByXWeek', () => { let points; let groupedPoints; beforeEach(() => { points = []; for (let i = 1; i <= 31; i++) { points.push({ x: new Date(2020, 6, i), y: i, }); } for (let i = 31; i >= 31; i--) { points.push({ x: new Date(2020, 7, i), y: i, }); } groupedPoints = groupPointsByXWeek(points); }); it('should not return empty points array.', () => { for (const weekPoints of groupedPoints) { expect(weekPoints).not.toEqual([]); } }); it('should group points by week number.', () => { for (const weekPoints of groupedPoints) { const weekStart = getWeekStart(weekPoints[0].x); for (const point of weekPoints) { expect(getWeekStart(point.x)).toEqual(weekStart); } } }); it('should sort week points by week number in ascending order.', () => { for (let i = 1; i < groupedPoints.length; i++) { const currentWeekStart = getWeekStart(groupedPoints[i][0].x); const previousWeekStart = getWeekStart(groupedPoints[i - 1][0].x); expect(currentWeekStart.getTime()).toBeGreaterThan(previousWeekStart.getTime()); } }); it('should sort points by date in ascending order', () => { for (const weekPoints of groupedPoints) { for (let j = 1; j < weekPoints.length; j++) { const currentPointDate = weekPoints[j].x; const previousPointDate = weekPoints[j - 1].x; expect(currentPointDate.getTime()).toBeGreaterThanOrEqual(previousPointDate.getTime()); } } }); }); function getWeekStart(date) { const weekStart = new Date(date); weekStart.setHours(0, 0, 0, 0); weekStart.setDate(weekStart.getDate() - (weekStart.getDay() + 6) % 7); // First day of the week is Monday return weekStart; }
Add tests for time-series summarization utils
Add tests for time-series summarization utils
TypeScript
apache-2.0
googleinterns/guide-doge,googleinterns/guide-doge,googleinterns/guide-doge
--- +++ @@ -0,0 +1,64 @@ +import { groupPointsByXWeek } from './time-series'; + +describe('groupPointsByXWeek', () => { + let points; + let groupedPoints; + + beforeEach(() => { + points = []; + for (let i = 1; i <= 31; i++) { + points.push({ + x: new Date(2020, 6, i), + y: i, + }); + } + for (let i = 31; i >= 31; i--) { + points.push({ + x: new Date(2020, 7, i), + y: i, + }); + } + + groupedPoints = groupPointsByXWeek(points); + }); + + it('should not return empty points array.', () => { + for (const weekPoints of groupedPoints) { + expect(weekPoints).not.toEqual([]); + } + }); + + it('should group points by week number.', () => { + for (const weekPoints of groupedPoints) { + const weekStart = getWeekStart(weekPoints[0].x); + for (const point of weekPoints) { + expect(getWeekStart(point.x)).toEqual(weekStart); + } + } + }); + + it('should sort week points by week number in ascending order.', () => { + for (let i = 1; i < groupedPoints.length; i++) { + const currentWeekStart = getWeekStart(groupedPoints[i][0].x); + const previousWeekStart = getWeekStart(groupedPoints[i - 1][0].x); + expect(currentWeekStart.getTime()).toBeGreaterThan(previousWeekStart.getTime()); + } + }); + + it('should sort points by date in ascending order', () => { + for (const weekPoints of groupedPoints) { + for (let j = 1; j < weekPoints.length; j++) { + const currentPointDate = weekPoints[j].x; + const previousPointDate = weekPoints[j - 1].x; + expect(currentPointDate.getTime()).toBeGreaterThanOrEqual(previousPointDate.getTime()); + } + } + }); +}); + +function getWeekStart(date) { + const weekStart = new Date(date); + weekStart.setHours(0, 0, 0, 0); + weekStart.setDate(weekStart.getDate() - (weekStart.getDay() + 6) % 7); // First day of the week is Monday + return weekStart; +}
d9556d5d7d3516bfdcf58a2621481ee47a71a448
test/specs/expressions/jsCodegen/compare.tests.ts
test/specs/expressions/jsCodegen/compare.tests.ts
import * as chai from 'chai'; import { evaluateXPathToBoolean, ReturnType } from 'fontoxpath'; import * as slimdom from 'slimdom'; import jsonMlMapper from 'test-helpers/jsonMlMapper'; import evaluateXPathWithJsCodegen from '../../parsing/jsCodegen/evaluateXPathWithJsCodegen'; describe('compare tests', () => { let documentNode: slimdom.Document; beforeEach(() => { documentNode = new slimdom.Document(); jsonMlMapper.parse(['xml', { attr: 'true' }], documentNode); }); it('does not generate compare function for nodes', () => { const node = documentNode.documentElement; const query = '@attr = true()'; chai.assert.throws( () => evaluateXPathWithJsCodegen(query, node, null, ReturnType.BOOLEAN), 'Unsupported: a base expression used with an operand.' ); chai.assert.equal(evaluateXPathToBoolean(query, node), true); }); });
Add unit test does not generate compare function for nodes
Add unit test does not generate compare function for nodes
TypeScript
mit
FontoXML/fontoxpath,FontoXML/fontoxpath,FontoXML/fontoxpath
--- +++ @@ -0,0 +1,25 @@ +import * as chai from 'chai'; +import { evaluateXPathToBoolean, ReturnType } from 'fontoxpath'; +import * as slimdom from 'slimdom'; +import jsonMlMapper from 'test-helpers/jsonMlMapper'; +import evaluateXPathWithJsCodegen from '../../parsing/jsCodegen/evaluateXPathWithJsCodegen'; + +describe('compare tests', () => { + let documentNode: slimdom.Document; + beforeEach(() => { + documentNode = new slimdom.Document(); + jsonMlMapper.parse(['xml', { attr: 'true' }], documentNode); + }); + + it('does not generate compare function for nodes', () => { + const node = documentNode.documentElement; + const query = '@attr = true()'; + + chai.assert.throws( + () => evaluateXPathWithJsCodegen(query, node, null, ReturnType.BOOLEAN), + 'Unsupported: a base expression used with an operand.' + ); + + chai.assert.equal(evaluateXPathToBoolean(query, node), true); + }); +});
8aa56c1ccedb4070a8d6d8f3f703cd80b9841317
tests/cases/fourslash/memberListOnContextualThis.ts
tests/cases/fourslash/memberListOnContextualThis.ts
/// <reference path='fourslash.ts'/> ////interface A { //// a: string; ////} ////declare function ctx(callback: (this: A) => string): string; ////ctx(function () { return th/*1*/is./*2*/a }); goTo.marker('1'); verify.quickInfoIs("this: A"); goTo.marker('2'); verify.memberListContains('a', '(property) A.a: string');
Add fourslash test for contextually-typed `this`
Add fourslash test for contextually-typed `this` Regression test for #10972
TypeScript
apache-2.0
thr0w/Thr0wScript,SaschaNaz/TypeScript,minestarks/TypeScript,jwbay/TypeScript,RyanCavanaugh/TypeScript,microsoft/TypeScript,kitsonk/TypeScript,TukekeSoft/TypeScript,donaldpipowitch/TypeScript,alexeagle/TypeScript,Microsoft/TypeScript,weswigham/TypeScript,SaschaNaz/TypeScript,alexeagle/TypeScript,minestarks/TypeScript,Eyas/TypeScript,alexeagle/TypeScript,mihailik/TypeScript,mihailik/TypeScript,SaschaNaz/TypeScript,Microsoft/TypeScript,Eyas/TypeScript,jwbay/TypeScript,Eyas/TypeScript,donaldpipowitch/TypeScript,TukekeSoft/TypeScript,erikmcc/TypeScript,nojvek/TypeScript,mihailik/TypeScript,Microsoft/TypeScript,weswigham/TypeScript,basarat/TypeScript,erikmcc/TypeScript,kpreisser/TypeScript,TukekeSoft/TypeScript,basarat/TypeScript,kpreisser/TypeScript,thr0w/Thr0wScript,thr0w/Thr0wScript,basarat/TypeScript,erikmcc/TypeScript,RyanCavanaugh/TypeScript,basarat/TypeScript,jeremyepling/TypeScript,weswigham/TypeScript,jwbay/TypeScript,kitsonk/TypeScript,minestarks/TypeScript,synaptek/TypeScript,nojvek/TypeScript,erikmcc/TypeScript,kitsonk/TypeScript,nojvek/TypeScript,DLehenbauer/TypeScript,synaptek/TypeScript,microsoft/TypeScript,DLehenbauer/TypeScript,synaptek/TypeScript,microsoft/TypeScript,chuckjaz/TypeScript,nojvek/TypeScript,thr0w/Thr0wScript,synaptek/TypeScript,mihailik/TypeScript,jeremyepling/TypeScript,chuckjaz/TypeScript,jwbay/TypeScript,Eyas/TypeScript,donaldpipowitch/TypeScript,chuckjaz/TypeScript,jeremyepling/TypeScript,DLehenbauer/TypeScript,RyanCavanaugh/TypeScript,DLehenbauer/TypeScript,chuckjaz/TypeScript,donaldpipowitch/TypeScript,kpreisser/TypeScript,SaschaNaz/TypeScript
--- +++ @@ -0,0 +1,12 @@ +/// <reference path='fourslash.ts'/> +////interface A { +//// a: string; +////} +////declare function ctx(callback: (this: A) => string): string; +////ctx(function () { return th/*1*/is./*2*/a }); + +goTo.marker('1'); +verify.quickInfoIs("this: A"); +goTo.marker('2'); +verify.memberListContains('a', '(property) A.a: string'); +
beff83d3e8a414665ce9c582ef3eaf159a59e8b1
test/MethodStubCollection.spec.ts
test/MethodStubCollection.spec.ts
import {MethodStubCollection} from "../src/MethodStubCollection"; describe("MethodStubCollection", () => { describe("empty stub collection", () => { it("returns -1 if doesn't find method stub", () => { // given const methodStubCollection = new MethodStubCollection(); // when const index = methodStubCollection.getLastMatchingGroupIndex([]); // then expect(index).toBe(-1); }); }); });
Add unit test for MethodStubCollection
Add unit test for MethodStubCollection
TypeScript
mit
NagRock/ts-mockito,viman/ts-mockito,NagRock/ts-mockito,viman/ts-mockito
--- +++ @@ -0,0 +1,16 @@ +import {MethodStubCollection} from "../src/MethodStubCollection"; + +describe("MethodStubCollection", () => { + describe("empty stub collection", () => { + it("returns -1 if doesn't find method stub", () => { + // given + const methodStubCollection = new MethodStubCollection(); + + // when + const index = methodStubCollection.getLastMatchingGroupIndex([]); + + // then + expect(index).toBe(-1); + }); + }); +});
deb10803380f79326653f3cb6fd17d8d43a938ad
app/src/lib/helpers/default-branch.ts
app/src/lib/helpers/default-branch.ts
import { getGlobalConfigValue, setGlobalConfigValue } from '../git' const DefaultBranchInGit = 'master' const DefaultBranchSettingName = 'init.defaultBranch' /** * The branch names that Desktop shows by default as radio buttons on the * form that allows users to change default branch name. */ export const SuggestedBranchNames: ReadonlyArray<string> = ['master', 'main'] /** * Returns the configured default branch when creating new repositories */ export async function getDefaultBranch(): Promise<string> { return ( (await getGlobalConfigValue(DefaultBranchSettingName)) ?? DefaultBranchInGit ) } /** * Sets the configured default branch when creating new repositories. * * @param branchName The default branch name to use. */ export async function setDefaultBranch(branchName: string) { return setGlobalConfigValue('init.defaultBranch', branchName) }
Add helper to get/set the git default branch
Add helper to get/set the git default branch We store that information in the global git config.
TypeScript
mit
desktop/desktop,j-f1/forked-desktop,kactus-io/kactus,shiftkey/desktop,desktop/desktop,j-f1/forked-desktop,kactus-io/kactus,artivilla/desktop,kactus-io/kactus,say25/desktop,shiftkey/desktop,j-f1/forked-desktop,say25/desktop,shiftkey/desktop,desktop/desktop,shiftkey/desktop,say25/desktop,desktop/desktop,artivilla/desktop,j-f1/forked-desktop,kactus-io/kactus,artivilla/desktop,say25/desktop,artivilla/desktop
--- +++ @@ -0,0 +1,29 @@ +import { getGlobalConfigValue, setGlobalConfigValue } from '../git' + +const DefaultBranchInGit = 'master' + +const DefaultBranchSettingName = 'init.defaultBranch' + +/** + * The branch names that Desktop shows by default as radio buttons on the + * form that allows users to change default branch name. + */ +export const SuggestedBranchNames: ReadonlyArray<string> = ['master', 'main'] + +/** + * Returns the configured default branch when creating new repositories + */ +export async function getDefaultBranch(): Promise<string> { + return ( + (await getGlobalConfigValue(DefaultBranchSettingName)) ?? DefaultBranchInGit + ) +} + +/** + * Sets the configured default branch when creating new repositories. + * + * @param branchName The default branch name to use. + */ +export async function setDefaultBranch(branchName: string) { + return setGlobalConfigValue('init.defaultBranch', branchName) +}
70a57bf937ce382dd5afa799a578ef5e1c50fcdf
packages/@glimmer/node/lib/node-dom-helper.ts
packages/@glimmer/node/lib/node-dom-helper.ts
import * as SimpleDOM from 'simple-dom'; import { DOMTreeConstruction, Bounds, Simple, ConcreteBounds } from '@glimmer/runtime'; export default class NodeDOMTreeConstruction extends DOMTreeConstruction { protected document: SimpleDOM.Document; constructor(doc: Simple.Document) { super(doc); } // override to prevent usage of `this.document` until after the constructor protected setupUselessElement() { } insertHTMLBefore(parent: Simple.Element, html: string, reference: Simple.Node): Bounds { let prev = reference ? reference.previousSibling : parent.lastChild; let raw = this.document.createRawHTMLSection(html); parent.insertBefore(raw, reference); let first = prev ? prev.nextSibling : parent.firstChild; let last = reference ? reference.previousSibling : parent.lastChild; return new ConcreteBounds(parent, first, last); } // override to avoid SVG detection/work when in node (this is not needed in SSR) createElement(tag: string) { return this.document.createElement(tag); } // override to avoid namespace shenanigans when in node (this is not needed in SSR) setAttribute(element: Element, name: string, value: string) { element.setAttribute(name, value); } }
import * as SimpleDOM from 'simple-dom'; import { DOMTreeConstruction, Bounds, Simple, ConcreteBounds } from '@glimmer/runtime'; export default class NodeDOMTreeConstruction extends DOMTreeConstruction { protected document: SimpleDOM.Document; constructor(doc: Simple.Document) { super(doc); } // override to prevent usage of `this.document` until after the constructor protected setupUselessElement() { } insertHTMLBefore(parent: Simple.Element, reference: Simple.Node, html: string): Bounds { let prev = reference ? reference.previousSibling : parent.lastChild; let raw = this.document.createRawHTMLSection(html); parent.insertBefore(raw, reference); let first = prev ? prev.nextSibling : parent.firstChild; let last = reference ? reference.previousSibling : parent.lastChild; return new ConcreteBounds(parent, first, last); } // override to avoid SVG detection/work when in node (this is not needed in SSR) createElement(tag: string) { return this.document.createElement(tag); } // override to avoid namespace shenanigans when in node (this is not needed in SSR) setAttribute(element: Element, name: string, value: string) { element.setAttribute(name, value); } }
Update NodeDOMTreeConstruction to match arg signature of `insertHTMLBefore`.
Update NodeDOMTreeConstruction to match arg signature of `insertHTMLBefore`. The signature was changed in a recent refactor, but since the node tests were not running this was not caught during that refactors CI.
TypeScript
mit
lbdm44/glimmer-vm,tildeio/glimmer,lbdm44/glimmer-vm,tildeio/glimmer,glimmerjs/glimmer-vm,glimmerjs/glimmer-vm,glimmerjs/glimmer-vm,lbdm44/glimmer-vm,tildeio/glimmer
--- +++ @@ -10,7 +10,7 @@ // override to prevent usage of `this.document` until after the constructor protected setupUselessElement() { } - insertHTMLBefore(parent: Simple.Element, html: string, reference: Simple.Node): Bounds { + insertHTMLBefore(parent: Simple.Element, reference: Simple.Node, html: string): Bounds { let prev = reference ? reference.previousSibling : parent.lastChild; let raw = this.document.createRawHTMLSection(html);
027cd34855f10762a7000089313a3d229e07ceab
app/services/help/commands.component.spec.ts
app/services/help/commands.component.spec.ts
/// <reference path="./../../../typings/index.d.ts" /> import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { DebugElement } from '@angular/core'; import { CommandsComponent } from './commands.component'; let comp: CommandsComponent; let fixture: ComponentFixture<CommandsComponent>; let el: DebugElement; describe('CommandsComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ declarations: [ CommandsComponent ] }); fixture = TestBed.createComponent(CommandsComponent); comp = fixture.componentInstance; el = fixture.debugElement.query(By.css('div')); }); it('should display "What can I do?"', () => { expect(el.nativeElement.textContent).toContain('What can I do?'); }); });
Add unit test for commans component
Add unit test for commans component
TypeScript
mit
alvinmvbt/mirror-mirror,alvinmvbt/mirror-mirror,alvinmvbt/mirror-mirror
--- +++ @@ -0,0 +1,28 @@ +/// <reference path="./../../../typings/index.d.ts" /> +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; + +import { CommandsComponent } from './commands.component'; + +let comp: CommandsComponent; +let fixture: ComponentFixture<CommandsComponent>; +let el: DebugElement; + +describe('CommandsComponent', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [ CommandsComponent ] + }); + + fixture = TestBed.createComponent(CommandsComponent); + + comp = fixture.componentInstance; + + el = fixture.debugElement.query(By.css('div')); + }); + + it('should display "What can I do?"', () => { + expect(el.nativeElement.textContent).toContain('What can I do?'); + }); +});
6ce7b8df29501b35125f5909384872b402c80e63
src/app/app.product.service.ts
src/app/app.product.service.ts
import { Injectable } from '@angular/core'; import {Subject} from "rxjs/Rx"; import 'marked'; import * as marked from 'marked'; import {DrupalService} from "./app.drupal.service"; @Injectable() export class ProductService { private taxonomyTerms; constructor(private drupalService:DrupalService) { marked.setOptions({ renderer: new marked.Renderer(), gfm: true, tables: true, breaks: false, pedantic: false, sanitize: true, smartLists: true, smartypants: false }); this.loadTaxonomies(); } isEducation(product) { return product.type == "education"; } isService(product) { return product.type == "service"; } loadTaxonomies() { this.drupalService.getAllTaxonomies().subscribe( data => { this.taxonomyTerms = data; } ); } getFormattedArrayField(arrayField) { let formatted = ""; for(let i = 0; i < arrayField.length; i++) { formatted += arrayField[0]; if((i + 1) < arrayField.length) formatted += ", " } return formatted; } getTermNames(terms) { let termNames = ""; if(this.taxonomyTerms) { for(let i = 0; i < terms.length; i++) { termNames += this.getTermName(terms[i]); if((i + 1) < terms.length) termNames += ", " } } return termNames; } getTermName(term) { if(this.taxonomyTerms) { return this.taxonomyTerms[term.id].name; } return ""; } getBodyHtml(product) { return marked(product.body.value); } getLogoUrl(product) { if(product.field_logo && product.field_logo.alt) return "https://researchit.cer.auckland.ac.nz:8080/sites/default/files/" + product.field_logo.alt; return "assets/service.png"; } }
Add ProductService, which contains all logic for formatting products from the Drupal database.
Add ProductService, which contains all logic for formatting products from the Drupal database.
TypeScript
bsd-3-clause
UoA-eResearch/research-hub,UoA-eResearch/research-hub,UoA-eResearch/research-hub
--- +++ @@ -0,0 +1,95 @@ +import { Injectable } from '@angular/core'; +import {Subject} from "rxjs/Rx"; +import 'marked'; +import * as marked from 'marked'; +import {DrupalService} from "./app.drupal.service"; + +@Injectable() +export class ProductService { + + private taxonomyTerms; + + constructor(private drupalService:DrupalService) + { + marked.setOptions({ + renderer: new marked.Renderer(), + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: true, + smartLists: true, + smartypants: false + }); + + this.loadTaxonomies(); + } + + isEducation(product) + { + return product.type == "education"; + } + + isService(product) + { + return product.type == "service"; + } + + loadTaxonomies() + { + this.drupalService.getAllTaxonomies().subscribe( + data => { + this.taxonomyTerms = data; + } + ); + } + + getFormattedArrayField(arrayField) + { + let formatted = ""; + for(let i = 0; i < arrayField.length; i++) + { + formatted += arrayField[0]; + + if((i + 1) < arrayField.length) + formatted += ", " + } + return formatted; + } + + getTermNames(terms) + { + let termNames = ""; + if(this.taxonomyTerms) { + for(let i = 0; i < terms.length; i++) + { + termNames += this.getTermName(terms[i]); + + if((i + 1) < terms.length) + termNames += ", " + } + } + return termNames; + } + + getTermName(term) + { + if(this.taxonomyTerms) { + return this.taxonomyTerms[term.id].name; + } + + return ""; + } + + getBodyHtml(product) + { + return marked(product.body.value); + } + + getLogoUrl(product) + { + if(product.field_logo && product.field_logo.alt) + return "https://researchit.cer.auckland.ac.nz:8080/sites/default/files/" + product.field_logo.alt; + return "assets/service.png"; + } +}
c15f82e7210e657fc94d0d3257fc22c6fbde634e
src/app/alveo/oauth-callback/oauth-callback.component.ts
src/app/alveo/oauth-callback/oauth-callback.component.ts
import { Component, OnInit, OnDestroy } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { AuthService } from '../shared/auth.service'; import { SessionService } from '../shared/session.service'; import { Paths } from '../shared/paths'; /* Component for handling OAuth callback routes */ @Component({ selector: 'auth-callback', template: '', }) export class OAuthCallbackComponent implements OnInit, OnDestroy { param_sub: any; constructor( private route: ActivatedRoute, private sessionService: SessionService, private authService: AuthService, ) { } /* Takes a route, provided by the routing module which requires an oauth token * as a route parameter. This then fires the auth service, prompting a request * for an API key from the Alveo server. Once the session service is ready, * the sessionService will navigate the user to the last stored route, if one * is available. Else it will redirect them to the most relevant place to be. */ ngOnInit() { this.param_sub = this.route.queryParams.subscribe(params => { if (params['code'] !== undefined) { this.authService.login(params['code']).then( () => { this.sessionService.onReady().then( () => { this.sessionService.navigateToStoredRoute(); } ); } ); } }); } ngOnDestroy() { this.param_sub.unsubscribe(); } }
Move oauth-callback to its own folder
Move oauth-callback to its own folder
TypeScript
bsd-3-clause
Alveo/alveo-transcriber,Alveo/alveo-transcriber,Alveo/alveo-transcriber,Alveo/alveo-transcriber
--- +++ @@ -0,0 +1,48 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { AuthService } from '../shared/auth.service'; +import { SessionService } from '../shared/session.service'; + +import { Paths } from '../shared/paths'; + +/* Component for handling OAuth callback routes */ +@Component({ + selector: 'auth-callback', + template: '', +}) +export class OAuthCallbackComponent implements OnInit, OnDestroy { + param_sub: any; + + constructor( + private route: ActivatedRoute, + private sessionService: SessionService, + private authService: AuthService, + ) { } + + /* Takes a route, provided by the routing module which requires an oauth token + * as a route parameter. This then fires the auth service, prompting a request + * for an API key from the Alveo server. Once the session service is ready, + * the sessionService will navigate the user to the last stored route, if one + * is available. Else it will redirect them to the most relevant place to be. + */ + ngOnInit() { + this.param_sub = this.route.queryParams.subscribe(params => { + if (params['code'] !== undefined) { + this.authService.login(params['code']).then( + () => { + this.sessionService.onReady().then( + () => { + this.sessionService.navigateToStoredRoute(); + } + ); + } + ); + } + }); + } + + ngOnDestroy() { + this.param_sub.unsubscribe(); + } +}
2e1e6eced75ed73bcb4671fb270df5f72da29ecf
ui/src/reusable_ui/components/slide_toggle/SlideToggle.tsx
ui/src/reusable_ui/components/slide_toggle/SlideToggle.tsx
import React, {Component} from 'react' import classnames from 'classnames' import {ErrorHandling} from 'src/shared/decorators/errors' import './slide-toggle.scss' import {ComponentColor, ComponentSize} from 'src/reusable_ui/types' interface Props { onChange: () => void active: boolean size?: ComponentSize color?: ComponentColor disabled?: boolean tooltipText?: string } @ErrorHandling class SlideToggle extends Component<Props> { public static defaultProps: Partial<Props> = { size: ComponentSize.Small, color: ComponentColor.Primary, tooltipText: '', } public render() { const {tooltipText} = this.props return ( <div className={this.className} onClick={this.handleClick} title={tooltipText} > <div className="slide-toggle--knob" /> </div> ) } public handleClick = () => { const {onChange, disabled} = this.props if (disabled) { return } onChange() } private get className(): string { const {size, color, disabled, active} = this.props return classnames( `slide-toggle slide-toggle-${size} slide-toggle-${color}`, {active, disabled} ) } } export default SlideToggle
import React, {Component} from 'react' import classnames from 'classnames' import {ErrorHandling} from 'src/shared/decorators/errors' import './slide-toggle.scss' import {ComponentColor, ComponentSize} from 'src/reusable_ui/types' interface Props { onChange: () => void active: boolean size?: ComponentSize color?: ComponentColor disabled?: boolean tooltipText?: string } @ErrorHandling class SlideToggle extends Component<Props> { public static defaultProps: Partial<Props> = { size: ComponentSize.Small, color: ComponentColor.Primary, tooltipText: '', disabled: false, } public render() { const {tooltipText} = this.props return ( <div className={this.className} onClick={this.handleClick} title={tooltipText} > <div className="slide-toggle--knob" /> </div> ) } public handleClick = () => { const {onChange, disabled} = this.props if (disabled) { return } onChange() } private get className(): string { const {size, color, disabled, active} = this.props return classnames( `slide-toggle slide-toggle-${size} slide-toggle-${color}`, {active, disabled} ) } } export default SlideToggle
Make default value more explicit
Make default value more explicit
TypeScript
mit
mark-rushakoff/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdata/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdata/influxdb,nooproblem/influxdb,li-ang/influxdb,influxdb/influxdb,li-ang/influxdb
--- +++ @@ -20,6 +20,7 @@ size: ComponentSize.Small, color: ComponentColor.Primary, tooltipText: '', + disabled: false, } public render() {
ff5210a891950c1a43e3b01740d9f19b008cbfa6
app/javascript/retrospring/controllers/character_count_controller.ts
app/javascript/retrospring/controllers/character_count_controller.ts
import { Controller } from '@hotwired/stimulus'; export default class extends Controller { static targets = ['input', 'counter', 'action']; declare readonly inputTarget: HTMLInputElement; declare readonly counterTarget: HTMLElement; declare readonly actionTarget: HTMLInputElement; static values = { max: Number }; declare readonly maxValue: number; connect(): void { this.inputTarget.addEventListener('input', this.update.bind(this)); } update(): void { this.counterTarget.innerHTML = String(`${this.inputTarget.value.length} / ${this.maxValue}`); if (this.inputTarget.value.length > this.maxValue) { if (!this.inputTarget.classList.contains('is-invalid') && !this.actionTarget.disabled) { this.inputTarget.classList.add('is-invalid'); this.actionTarget.disabled = true; } } else { if (this.inputTarget.classList.contains('is-invalid') && this.actionTarget.disabled) { this.inputTarget.classList.remove('is-invalid'); this.actionTarget.disabled = false; } } } }
Implement character count as Stimulus controller
Implement character count as Stimulus controller
TypeScript
agpl-3.0
Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring
--- +++ @@ -0,0 +1,36 @@ +import { Controller } from '@hotwired/stimulus'; + +export default class extends Controller { + static targets = ['input', 'counter', 'action']; + + declare readonly inputTarget: HTMLInputElement; + declare readonly counterTarget: HTMLElement; + declare readonly actionTarget: HTMLInputElement; + + static values = { + max: Number + }; + + declare readonly maxValue: number; + + connect(): void { + this.inputTarget.addEventListener('input', this.update.bind(this)); + } + + update(): void { + this.counterTarget.innerHTML = String(`${this.inputTarget.value.length} / ${this.maxValue}`); + + if (this.inputTarget.value.length > this.maxValue) { + if (!this.inputTarget.classList.contains('is-invalid') && !this.actionTarget.disabled) { + this.inputTarget.classList.add('is-invalid'); + this.actionTarget.disabled = true; + } + } + else { + if (this.inputTarget.classList.contains('is-invalid') && this.actionTarget.disabled) { + this.inputTarget.classList.remove('is-invalid'); + this.actionTarget.disabled = false; + } + } + } +}
8323b2ee4878437229045e8464137b2aaa9f57ee
src/app/gallery/insights/insights.component.stories.ts
src/app/gallery/insights/insights.component.stories.ts
import { Component, Input, NgModule } from '@angular/core'; import { storiesOf } from '@storybook/angular'; import { InsightsComponent } from './insights.component'; @Component({ selector: 'jblog-image-container', template: ` <div class="mock-images"> <strong>{{ imageCount }}</strong> images from the album <strong>{{ albumName }}</strong> </div> `, styles: [ '.mock-images{text-align:center;color:var(--color-secondary-foreground);}', '.mock-images::before{content:"("}', '.mock-images::after{content:")"}' ] }) class MockImageContainerComponent { @Input() public albumName: string; @Input() public imageCount: number; } const moduleMetadata: NgModule = { declarations: [MockImageContainerComponent] }; storiesOf('Gallery', module).add('Art Insights', () => ({ component: InsightsComponent, moduleMetadata }));
Add story for art insights
Add story for art insights
TypeScript
apache-2.0
jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog,jbrowneuk/jblog
--- +++ @@ -0,0 +1,33 @@ +import { Component, Input, NgModule } from '@angular/core'; +import { storiesOf } from '@storybook/angular'; + +import { InsightsComponent } from './insights.component'; + +@Component({ + selector: 'jblog-image-container', + template: ` + <div class="mock-images"> + <strong>{{ imageCount }}</strong> + images from the album + <strong>{{ albumName }}</strong> + </div> + `, + styles: [ + '.mock-images{text-align:center;color:var(--color-secondary-foreground);}', + '.mock-images::before{content:"("}', + '.mock-images::after{content:")"}' + ] +}) +class MockImageContainerComponent { + @Input() public albumName: string; + @Input() public imageCount: number; +} + +const moduleMetadata: NgModule = { + declarations: [MockImageContainerComponent] +}; + +storiesOf('Gallery', module).add('Art Insights', () => ({ + component: InsightsComponent, + moduleMetadata +}));
0cc01b430ff912e09e09afca1cf4f949df43bdaf
demo/src/app/shared/services/githubapi.ts
demo/src/app/shared/services/githubapi.ts
/* MIT License Copyright (c) 2017 Temainfo Sistemas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import { Injectable } from "@angular/core"; import {Http} from '@angular/http'; @Injectable() export class GithubAPIService { constructor(private http: Http) {} getReleases() { return this.http.get('https://api.github.com/repos/TemainfoSistemas/truly-ui/releases'); } }
Create a service to get data dynamic from github.
docs(showcase): Create a service to get data dynamic from github.
TypeScript
mit
TemainfoSistemas/truly-ui,TemainfoSistemas/truly-ui,TemainfoSistemas/truly-ui
--- +++ @@ -0,0 +1,34 @@ +/* + MIT License + + Copyright (c) 2017 Temainfo Sistemas + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +import { Injectable } from "@angular/core"; +import {Http} from '@angular/http'; + +@Injectable() +export class GithubAPIService { + constructor(private http: Http) {} + + getReleases() { + return this.http.get('https://api.github.com/repos/TemainfoSistemas/truly-ui/releases'); + } + +}
c79fde462e5d4e252dd42e25d3f9403e3ac4e7ab
src/app/packages/open-layers-map/open-layers-projection.service.ts
src/app/packages/open-layers-map/open-layers-projection.service.ts
import { Injectable } from '@angular/core'; import { ProjectionService } from '@ansyn/imagery/projection-service/projection.service'; import { IMap } from '@ansyn/imagery'; import { Observable } from 'rxjs/Observable'; import { FeatureCollection, GeometryObject, Point, Position } from 'geojson'; import proj from 'ol/proj'; import OLGeoJSON from 'ol/format/geojson'; @Injectable() export class OpenLayersProjectionService extends ProjectionService { private default4326GeoJSONFormat: OLGeoJSON = new OLGeoJSON({ defaultDataProjection: 'EPSG:4326', featureProjection: 'EPSG:4326' }); projectCollectionAccuratelyToImage(featureCollection: FeatureCollection<GeometryObject>, map: IMap): Observable<any> { const view = map.mapObject.getView(); const projection = view.getProjection(); const featuresCollectionGeojson = JSON.stringify(featureCollection); const features = this.default4326GeoJSONFormat.readFeatures(featuresCollectionGeojson, { dataProjection: 'EPSG:4326', featureProjection: projection.getCode() }); return Observable.of(features); } projectCollectionApproximatelyToImage(featureCollection: FeatureCollection<GeometryObject>, map: IMap): Observable<GeometryObject> { return this.projectCollectionAccuratelyToImage(featureCollection, map); } projectAccuratelyToImage(feature: GeometryObject, map: IMap): Observable<any> { const view = map.mapObject.getView(); const projection = view.getProjection(); const newGeometry = this.default4326GeoJSONFormat.readGeometry(feature, { dataProjection: 'EPSG:4326', featureProjection: projection.getCode() }); return Observable.of(newGeometry); } projectApproximatelyToImage(feature: GeometryObject, map: IMap): Observable<GeometryObject> { return this.projectAccuratelyToImage(feature, map); } projectAccurately(pixel: Position, map: IMap): Observable<Point> { const projection = map.mapObject.getView().getProjection(); const projectedCoord = proj.toLonLat(pixel, projection); const projectedPoint: Point = { type: 'Point', coordinates: projectedCoord }; return Observable.of(projectedPoint); } projectApproximately(pixel: Position, map: IMap): Observable<Point> { return this.projectAccurately(pixel, map); } }
Implement the ProjectionService API for OpenLayers
Implement the ProjectionService API for OpenLayers
TypeScript
mit
AnSyn/ansyn,AnSyn/ansyn,AnSyn/ansyn,AnSyn/ansyn
--- +++ @@ -0,0 +1,61 @@ +import { Injectable } from '@angular/core'; +import { ProjectionService } from '@ansyn/imagery/projection-service/projection.service'; +import { IMap } from '@ansyn/imagery'; +import { Observable } from 'rxjs/Observable'; +import { FeatureCollection, GeometryObject, Point, Position } from 'geojson'; +import proj from 'ol/proj'; +import OLGeoJSON from 'ol/format/geojson'; + +@Injectable() +export class OpenLayersProjectionService extends ProjectionService { + + private default4326GeoJSONFormat: OLGeoJSON = new OLGeoJSON({ + defaultDataProjection: 'EPSG:4326', + featureProjection: 'EPSG:4326' + }); + + projectCollectionAccuratelyToImage(featureCollection: FeatureCollection<GeometryObject>, map: IMap): Observable<any> { + const view = map.mapObject.getView(); + const projection = view.getProjection(); + + const featuresCollectionGeojson = JSON.stringify(featureCollection); + const features = this.default4326GeoJSONFormat.readFeatures(featuresCollectionGeojson, { + dataProjection: 'EPSG:4326', + featureProjection: projection.getCode() + }); + + return Observable.of(features); + } + + projectCollectionApproximatelyToImage(featureCollection: FeatureCollection<GeometryObject>, map: IMap): Observable<GeometryObject> { + return this.projectCollectionAccuratelyToImage(featureCollection, map); + } + + projectAccuratelyToImage(feature: GeometryObject, map: IMap): Observable<any> { + const view = map.mapObject.getView(); + const projection = view.getProjection(); + + const newGeometry = this.default4326GeoJSONFormat.readGeometry(feature, { + dataProjection: 'EPSG:4326', + featureProjection: projection.getCode() + }); + + return Observable.of(newGeometry); + } + + projectApproximatelyToImage(feature: GeometryObject, map: IMap): Observable<GeometryObject> { + return this.projectAccuratelyToImage(feature, map); + } + + projectAccurately(pixel: Position, map: IMap): Observable<Point> { + const projection = map.mapObject.getView().getProjection(); + const projectedCoord = proj.toLonLat(pixel, projection); + const projectedPoint: Point = { type: 'Point', coordinates: projectedCoord }; + return Observable.of(projectedPoint); + } + + projectApproximately(pixel: Position, map: IMap): Observable<Point> { + return this.projectAccurately(pixel, map); + } + +}
132097e70b986b7b4ca39adc1072f047c66a4a23
package/src/browser/note/note-list-tools/note-list-sorting-menu.ts
package/src/browser/note/note-list-tools/note-list-sorting-menu.ts
import { Injectable } from '@angular/core'; import { select, Store } from '@ngrx/store'; import { MenuItemConstructorOptions } from 'electron'; import { switchMap, take } from 'rxjs/operators'; import { SortDirection } from '../../../libs/sorting'; import { Menu } from '../../ui/menu/menu'; import { ChangeSortDirectionAction, ChangeSortOrderAction, NoteCollectionActions, } from '../shared/note-collection.actions'; import { NoteCollectionSortBy, NoteCollectionState } from '../shared/note-collection.state'; import { NoteStateWithRoot } from '../shared/note.state'; @Injectable() export class NoteListSortingMenu { constructor( private store: Store<NoteStateWithRoot>, private menu: Menu, ) { } open(): void { this.store.pipe( select(state => state.note.collection), take(1), switchMap(state => this.menu .open(this.buildTemplate(state)) .afterClosed(), ), ).subscribe((item) => { if (item) { this.handleMenuItemClick(item.id); } }); } private buildTemplate(state: NoteCollectionState): MenuItemConstructorOptions[] { const template: MenuItemConstructorOptions[] = [ { id: NoteCollectionSortBy.CREATED, type: 'checkbox', label: 'Date Created', }, { id: NoteCollectionSortBy.UPDATED, type: 'checkbox', label: 'Date Updated', }, { id: NoteCollectionSortBy.TITLE, type: 'checkbox', label: 'Title', }, { type: 'separator' }, { id: SortDirection.DESC, type: 'checkbox', label: 'Desc', }, { id: SortDirection.ASC, type: 'checkbox', label: 'Asc', }, ]; template.forEach((item) => { item.checked = item.id === state.sortBy || item.id === state.sortDirection; }); return template; } private handleMenuItemClick(id: string): void { let action: NoteCollectionActions; if (id === NoteCollectionSortBy.CREATED || id === NoteCollectionSortBy.UPDATED || id === NoteCollectionSortBy.TITLE) { action = new ChangeSortOrderAction({ sortBy: id }); } if (id === SortDirection.DESC || id === SortDirection.ASC) { action = new ChangeSortDirectionAction({ sortDirection: id }); } this.store.dispatch(action); } }
Add note list sorting menu
Add note list sorting menu
TypeScript
mit
seokju-na/geeks-diary,seokju-na/geeks-diary,seokju-na/geeks-diary
--- +++ @@ -0,0 +1,94 @@ +import { Injectable } from '@angular/core'; +import { select, Store } from '@ngrx/store'; +import { MenuItemConstructorOptions } from 'electron'; +import { switchMap, take } from 'rxjs/operators'; +import { SortDirection } from '../../../libs/sorting'; +import { Menu } from '../../ui/menu/menu'; +import { + ChangeSortDirectionAction, + ChangeSortOrderAction, + NoteCollectionActions, +} from '../shared/note-collection.actions'; +import { NoteCollectionSortBy, NoteCollectionState } from '../shared/note-collection.state'; +import { NoteStateWithRoot } from '../shared/note.state'; + + +@Injectable() +export class NoteListSortingMenu { + constructor( + private store: Store<NoteStateWithRoot>, + private menu: Menu, + ) { + } + + open(): void { + this.store.pipe( + select(state => state.note.collection), + take(1), + switchMap(state => this.menu + .open(this.buildTemplate(state)) + .afterClosed(), + ), + ).subscribe((item) => { + if (item) { + this.handleMenuItemClick(item.id); + } + }); + } + + private buildTemplate(state: NoteCollectionState): MenuItemConstructorOptions[] { + const template: MenuItemConstructorOptions[] = [ + { + id: NoteCollectionSortBy.CREATED, + type: 'checkbox', + label: 'Date Created', + }, + { + id: NoteCollectionSortBy.UPDATED, + type: 'checkbox', + label: 'Date Updated', + }, + { + id: NoteCollectionSortBy.TITLE, + type: 'checkbox', + label: 'Title', + }, + { type: 'separator' }, + { + id: SortDirection.DESC, + type: 'checkbox', + label: 'Desc', + }, + { + id: SortDirection.ASC, + type: 'checkbox', + label: 'Asc', + }, + ]; + + template.forEach((item) => { + item.checked = item.id === state.sortBy || item.id === state.sortDirection; + }); + + return template; + } + + private handleMenuItemClick(id: string): void { + let action: NoteCollectionActions; + + if (id === NoteCollectionSortBy.CREATED + || id === NoteCollectionSortBy.UPDATED + || id === NoteCollectionSortBy.TITLE) { + + action = new ChangeSortOrderAction({ sortBy: id }); + } + + if (id === SortDirection.DESC + || id === SortDirection.ASC) { + + action = new ChangeSortDirectionAction({ sortDirection: id }); + } + + this.store.dispatch(action); + } +}
63e2f47c2cb6141fdfa2977f30f5423e706c0d63
front_end/src/app/shared/pipes/phoneNumber.pipe.spec.ts
front_end/src/app/shared/pipes/phoneNumber.pipe.spec.ts
import { PhoneNumberPipe } from './phoneNumber.pipe'; describe('PhoneNumberPipe', () => { // This pipe is a pure, stateless function so no need for BeforeEach let pipe = new PhoneNumberPipe(); it('transforms "8128128123" to "(812) 812-8123"', () => { expect(pipe.transform('8128128123')).toBe('(812) 812-8123'); }); });
Add test for phone number pipe on front end.
Add test for phone number pipe on front end.
TypeScript
bsd-2-clause
crdschurch/crds-signin-checkin,crdschurch/crds-signin-checkin,crdschurch/crds-signin-checkin,crdschurch/crds-signin-checkin
--- +++ @@ -0,0 +1,9 @@ +import { PhoneNumberPipe } from './phoneNumber.pipe'; + +describe('PhoneNumberPipe', () => { + // This pipe is a pure, stateless function so no need for BeforeEach + let pipe = new PhoneNumberPipe(); + it('transforms "8128128123" to "(812) 812-8123"', () => { + expect(pipe.transform('8128128123')).toBe('(812) 812-8123'); + }); +});
367518d5048993b3f640930f9271fa22b91eb3c2
src/file/table/table-column.spec.ts
src/file/table/table-column.spec.ts
import { expect } from "chai"; import { Formatter } from "export/formatter"; import { TableCell } from "./table-cell"; import { TableColumn } from "./table-column"; describe("TableColumn", () => { let cells: TableCell[]; beforeEach(() => { cells = [new TableCell(), new TableCell(), new TableCell()]; }); describe("#getCell", () => { it("should get the correct cell", () => { const tableColumn = new TableColumn(cells); const cell = tableColumn.getCell(0); expect(cell).to.deep.equal(cells[0]); const cell2 = tableColumn.getCell(1); expect(cell2).to.deep.equal(cells[1]); }); }); describe("#mergeCells", () => { it("should add vMerge to correct cells", () => { const tableColumn = new TableColumn(cells); tableColumn.mergeCells(0, 2); const tree = new Formatter().format(cells[0]); expect(tree).to.deep.equal({ "w:tc": [{ "w:tcPr": [{ "w:vMerge": [{ _attr: { "w:val": "restart" } }] }] }, { "w:p": [{ "w:pPr": [] }] }], }); const tree2 = new Formatter().format(cells[1]); expect(tree2).to.deep.equal({ "w:tc": [{ "w:tcPr": [] }, { "w:p": [{ "w:pPr": [] }] }] }); const tree3 = new Formatter().format(cells[2]); expect(tree3).to.deep.equal({ "w:tc": [{ "w:tcPr": [{ "w:vMerge": [{ _attr: { "w:val": "continue" } }] }] }, { "w:p": [{ "w:pPr": [] }] }], }); }); }); });
Add tests for table column
Add tests for table column
TypeScript
mit
dolanmiu/docx,dolanmiu/docx,dolanmiu/docx
--- +++ @@ -0,0 +1,46 @@ +import { expect } from "chai"; + +import { Formatter } from "export/formatter"; + +import { TableCell } from "./table-cell"; +import { TableColumn } from "./table-column"; + +describe("TableColumn", () => { + let cells: TableCell[]; + beforeEach(() => { + cells = [new TableCell(), new TableCell(), new TableCell()]; + }); + + describe("#getCell", () => { + it("should get the correct cell", () => { + const tableColumn = new TableColumn(cells); + const cell = tableColumn.getCell(0); + + expect(cell).to.deep.equal(cells[0]); + + const cell2 = tableColumn.getCell(1); + + expect(cell2).to.deep.equal(cells[1]); + }); + }); + + describe("#mergeCells", () => { + it("should add vMerge to correct cells", () => { + const tableColumn = new TableColumn(cells); + tableColumn.mergeCells(0, 2); + + const tree = new Formatter().format(cells[0]); + expect(tree).to.deep.equal({ + "w:tc": [{ "w:tcPr": [{ "w:vMerge": [{ _attr: { "w:val": "restart" } }] }] }, { "w:p": [{ "w:pPr": [] }] }], + }); + + const tree2 = new Formatter().format(cells[1]); + expect(tree2).to.deep.equal({ "w:tc": [{ "w:tcPr": [] }, { "w:p": [{ "w:pPr": [] }] }] }); + + const tree3 = new Formatter().format(cells[2]); + expect(tree3).to.deep.equal({ + "w:tc": [{ "w:tcPr": [{ "w:vMerge": [{ _attr: { "w:val": "continue" } }] }] }, { "w:p": [{ "w:pPr": [] }] }], + }); + }); + }); +});
8dfe537377f5dfd7068720ea7522d983d7374b32
angular-dropdown-control.directive.ts
angular-dropdown-control.directive.ts
import { Directive, ElementRef, Inject, forwardRef, Input, Host, HostListener } from '@angular/core'; import { AngularDropdownDirective } from './angular-dropdown.directive'; @Directive({ selector: '[ng-dropdown-control],[ngDropdownControl]', host: { '[attr.aria-haspopup]': 'true', '[attr.aria-controls]': 'dropdown.id', '[class.ng-dropdown-control]': 'true' } }) export class AngularDropdownControlDirective { @HostListener('click', [ '$event' ]) onClick(e: Event): void { e.stopPropagation(); if (!this.dropdown.disabled) { this.dropdown.toggle(); } } constructor( @Host() @Inject(forwardRef(() => AngularDropdownDirective)) public dropdown: AngularDropdownDirective, public element: ElementRef) { } }
import { Directive, ElementRef, Inject, forwardRef, Input, Host, HostListener } from '@angular/core'; import { AngularDropdownDirective } from './angular-dropdown.directive'; @Directive({ selector: '[ng-dropdown-control],[ngDropdownControl]', host: { '[attr.aria-haspopup]': 'true', '[attr.aria-controls]': 'dropdown.id', '[class.ng-dropdown-control]': 'true', '[class.active]': 'dropdown.isOpen' } }) export class AngularDropdownControlDirective { @HostListener('click', [ '$event' ]) onClick(e: Event): void { e.stopPropagation(); if (!this.dropdown.disabled) { this.dropdown.toggle(); } } constructor( @Host() @Inject(forwardRef(() => AngularDropdownDirective)) public dropdown: AngularDropdownDirective, public element: ElementRef) { } }
Add active class on control if dropdown is open
Add active class on control if dropdown is open
TypeScript
mit
topaxi/angular-dropdown,topaxi/angular-dropdown,topaxi/angular-dropdown
--- +++ @@ -16,7 +16,8 @@ host: { '[attr.aria-haspopup]': 'true', '[attr.aria-controls]': 'dropdown.id', - '[class.ng-dropdown-control]': 'true' + '[class.ng-dropdown-control]': 'true', + '[class.active]': 'dropdown.isOpen' } }) export class AngularDropdownControlDirective {
fbd7ed7d66d104f5f005d14e575dfdfe114eb076
app/test/unit/name-of-test.ts
app/test/unit/name-of-test.ts
import { expect } from 'chai' import { Repository, nameOf } from '../../src/models/repository' import { GitHubRepository } from '../../src/models/github-repository' import { Owner } from '../../src/models/owner' const repoPath = '/some/cool/path' describe('nameOf', () => { it.only('Returns the repo base path if there is no associated github metadata', () => { const repo = new Repository(repoPath, -1, null, false) const name = nameOf(repo) expect(name).to.equal('path') }) it.only('Returns the name of the repo', () => { const ghRepo = new GitHubRepository( 'name', new Owner('desktop', '', null), null ) const repo = new Repository(repoPath, -1, ghRepo, false) const name = nameOf(repo) expect(name).to.equal('desktop/name') }) })
Add a test or two
Add a test or two
TypeScript
mit
j-f1/forked-desktop,j-f1/forked-desktop,desktop/desktop,artivilla/desktop,shiftkey/desktop,kactus-io/kactus,kactus-io/kactus,shiftkey/desktop,shiftkey/desktop,shiftkey/desktop,artivilla/desktop,j-f1/forked-desktop,say25/desktop,desktop/desktop,desktop/desktop,artivilla/desktop,j-f1/forked-desktop,artivilla/desktop,kactus-io/kactus,say25/desktop,kactus-io/kactus,desktop/desktop,say25/desktop,say25/desktop
--- +++ @@ -0,0 +1,30 @@ +import { expect } from 'chai' + +import { Repository, nameOf } from '../../src/models/repository' +import { GitHubRepository } from '../../src/models/github-repository' +import { Owner } from '../../src/models/owner' + +const repoPath = '/some/cool/path' + +describe('nameOf', () => { + it.only('Returns the repo base path if there is no associated github metadata', () => { + const repo = new Repository(repoPath, -1, null, false) + + const name = nameOf(repo) + + expect(name).to.equal('path') + }) + + it.only('Returns the name of the repo', () => { + const ghRepo = new GitHubRepository( + 'name', + new Owner('desktop', '', null), + null + ) + const repo = new Repository(repoPath, -1, ghRepo, false) + + const name = nameOf(repo) + + expect(name).to.equal('desktop/name') + }) +})
44f4e038f2c4ca80c9985a029b8fa592510b2cdf
danger/regressions.ts
danger/regressions.ts
import { schedule, danger } from "danger"; import { IncomingWebhook } from "@slack/client"; import { Issues } from "github-webhook-event-types" declare const peril: any // danger/danger#351 const gh = danger.github as any as Issues const issue = gh.issue const text = (issue.title + issue.body).toLowerCase() const api = danger.github.api if (text.includes("regression")) { var url = peril.env.SLACK_WEBHOOK_URL || ""; var webhook = new IncomingWebhook(url); schedule( async () => { await webhook.send({ unfurl_links: false, attachments: [{ pretext: "New PR/Issue containing the word 'regression'", color: "error", title: issue.title, title_link: issue.html_url, author_name: issue.user.login, author_icon: issue.user.avatar_url }] }) await api.issues.addLabels({ owner: issue.owner, repo: issue.repo, number: issue.number, labels: ["status: regression"] }) }); }
import { schedule, danger } from "danger"; import { IncomingWebhook } from "@slack/client"; import { Issues } from "github-webhook-event-types" declare const peril: any // danger/danger#351 const gh = danger.github as any as Issues const issue = gh.issue const repo = gh.repository const text = (issue.title + issue.body).toLowerCase() const api = danger.github.api if (text.includes("regression")) { var url = peril.env.SLACK_WEBHOOK_URL || ""; var webhook = new IncomingWebhook(url); schedule( async () => { await webhook.send({ unfurl_links: false, attachments: [{ pretext: "New PR/Issue containing the word 'regression'", color: "error", title: issue.title, title_link: issue.html_url, author_name: issue.user.login, author_icon: issue.user.avatar_url }] }) await api.issues.addLabels({ owner: repo.owner.login, repo: repo.name, number: issue.number, labels: ["status: regression"] }) }); }
Change from PR to issue
Change from PR to issue
TypeScript
mit
fastlane/peril-settings
--- +++ @@ -5,6 +5,7 @@ declare const peril: any // danger/danger#351 const gh = danger.github as any as Issues const issue = gh.issue +const repo = gh.repository const text = (issue.title + issue.body).toLowerCase() const api = danger.github.api @@ -25,8 +26,8 @@ }) await api.issues.addLabels({ - owner: issue.owner, - repo: issue.repo, + owner: repo.owner.login, + repo: repo.name, number: issue.number, labels: ["status: regression"] })
649361b1d4d963e301ae561dacf9906efd0af76a
lib/omnisharp-atom/views/tooltip-view.ts
lib/omnisharp-atom/views/tooltip-view.ts
import spacePen = require("atom-space-pen-views"); import $ = require('jquery'); interface Rect { left: number; right: number; top: number; bottom: number; } class TooltipView extends spacePen.View { constructor(public rect: Rect) { super(); $(document.body).append(this[0]); this.updatePosition(); } private inner: JQuery; static content() { return this.div({ class: 'atom-typescript-tooltip tooltip' }, () => { this.div({ class: 'tooltip-inner', outlet: 'inner' }) }); } updateText(text: string) { this.inner.html(text); this.updatePosition(); this.fadeTo(300, 1); } updatePosition() { var offset = 10; var left = this.rect.right; var top = this.rect.bottom; var right = undefined; // X axis adjust if (left + this[0].offsetWidth >= $(document.body).width()) left = $(document.body).width() - this[0].offsetWidth - offset; if (left < 0) { this.css({ 'white-space': 'pre-wrap' }) left = offset right = offset } // Y axis adjust if (top + this[0].offsetHeight >= $(document.body).height()) { top = this.rect.top - this[0].offsetHeight } this.css({ left, top, right }); } } export = TooltipView;
import spacePen = require('atom-space-pen-views'); var $ = spacePen.jQuery; interface Rect { left: number; right: number; top: number; bottom: number; } class TooltipView extends spacePen.View { constructor(public rect: Rect) { super(); $(document.body).append(this[0]); this.updatePosition(); } private inner: JQuery; static content() { return this.div({ class: 'atom-typescript-tooltip tooltip' }, () => { this.div({ class: 'tooltip-inner', outlet: 'inner' }) }); } updateText(text: string) { this.inner.html(text); this.updatePosition(); this.fadeTo(300, 1); } updatePosition() { var offset = 10; var left = this.rect.right; var top = this.rect.bottom; var right = undefined; // X axis adjust if (left + this[0].offsetWidth >= $(document.body).width()) left = $(document.body).width() - this[0].offsetWidth - offset; if (left < 0) { this.css({ 'white-space': 'pre-wrap' }) left = offset right = offset } // Y axis adjust if (top + this[0].offsetHeight >= $(document.body).height()) { top = this.rect.top - this[0].offsetHeight } this.css({ left, top, right }); } } export = TooltipView;
Fix issue where space pen would throw when it shouldnt (require was getting eatin by compiler?)
Fix issue where space pen would throw when it shouldnt (require was getting eatin by compiler?)
TypeScript
mit
hitesh97/omnisharp-atom,hitesh97/omnisharp-atom,joerter/omnisharp-atom,OmniSharp/omnisharp-atom,rambocoder/omnisharp-atom,RichiCoder1/omnisharp-atom,tmunro/omnisharp-atom,joerter/omnisharp-atom,RichiCoder1/omnisharp-atom,tmunro/omnisharp-atom,joerter/omnisharp-atom,joerter/omnisharp-atom,rambocoder/omnisharp-atom,OmniSharp/omnisharp-atom,sgwill/omnisharp-atom,sgwill/omnisharp-atom,RichiCoder1/omnisharp-atom,rambocoder/omnisharp-atom,OmniSharp/omnisharp-atom,sgwill/omnisharp-atom,sgwill/omnisharp-atom,tmunro/omnisharp-atom,tmunro/omnisharp-atom,hitesh97/omnisharp-atom,RichiCoder1/omnisharp-atom,hitesh97/omnisharp-atom
--- +++ @@ -1,5 +1,5 @@ -import spacePen = require("atom-space-pen-views"); -import $ = require('jquery'); +import spacePen = require('atom-space-pen-views'); +var $ = spacePen.jQuery; interface Rect { left: number; @@ -17,6 +17,7 @@ } private inner: JQuery; + static content() { return this.div({ class: 'atom-typescript-tooltip tooltip' }, () => { this.div({ class: 'tooltip-inner', outlet: 'inner' })
e9adbe8f1929b8360f496df8afd13dfc177156cf
lib/components/src/Loader/Loader.tsx
lib/components/src/Loader/Loader.tsx
import React from 'react'; import { styled } from '@storybook/theming'; import { transparentize, opacify } from 'polished'; import { rotate360 } from '../shared/animation'; const LoaderWrapper = styled.div(({ theme }) => ({ borderRadius: '3em', cursor: 'progress', display: 'inline-block', overflow: 'hidden', position: 'absolute', transition: 'all 200ms ease-out', verticalAlign: 'top', top: '50%', left: '50%', marginTop: -16, marginLeft: -16, height: 32, width: 32, zIndex: 4, borderWidth: 2, borderStyle: 'solid', borderColor: transparentize(0.06, theme.appBorderColor), borderTopColor: opacify(0.07, theme.appBorderColor), animation: `${rotate360} 0.7s linear infinite`, mixBlendMode: 'exclusion', })); export function Loader({ ...props }) { return ( <LoaderWrapper aria-label="Content is loading ..." aria-live="polite" role="status" {...props} /> ); }
import React from 'react'; import { styled } from '@storybook/theming'; import { rotate360 } from '../shared/animation'; const LoaderWrapper = styled.div(({ theme }) => ({ borderRadius: '3em', cursor: 'progress', display: 'inline-block', overflow: 'hidden', position: 'absolute', transition: 'all 200ms ease-out', verticalAlign: 'top', top: '50%', left: '50%', marginTop: -16, marginLeft: -16, height: 32, width: 32, zIndex: 4, borderWidth: 2, borderStyle: 'solid', borderColor: 'rgba(0, 0, 0, 0)', borderTopColor: 'rgb(136, 136, 136)', animation: `${rotate360} 0.7s linear infinite`, mixBlendMode: 'exclusion', opacity: 0.7, })); export function Loader({ ...props }) { return ( <LoaderWrapper aria-label="Content is loading ..." aria-live="polite" role="status" {...props} /> ); }
FIX loader being invisible on light background or dark ones
FIX loader being invisible on light background or dark ones
TypeScript
mit
storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook
--- +++ @@ -1,6 +1,5 @@ import React from 'react'; import { styled } from '@storybook/theming'; -import { transparentize, opacify } from 'polished'; import { rotate360 } from '../shared/animation'; const LoaderWrapper = styled.div(({ theme }) => ({ @@ -20,10 +19,11 @@ zIndex: 4, borderWidth: 2, borderStyle: 'solid', - borderColor: transparentize(0.06, theme.appBorderColor), - borderTopColor: opacify(0.07, theme.appBorderColor), + borderColor: 'rgba(0, 0, 0, 0)', + borderTopColor: 'rgb(136, 136, 136)', animation: `${rotate360} 0.7s linear infinite`, mixBlendMode: 'exclusion', + opacity: 0.7, })); export function Loader({ ...props }) {
faa8f06c72d778afef9074757c937f2dba52c581
src/avm2/global.ts
src/avm2/global.ts
/* * Copyright 2014 Mozilla Foundation * * 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. */ var jsGlobal = (function() { return this || (1, eval)('this'); })(); var inBrowser = typeof console != "undefined"; interface JSGlobal { Object: any; String: Function; Number: Function; Boolean: Function; Function: Function; Math: Function; Array: Function; performance: any; print: any; } // declare var print; // declare var console; // declare var performance; // declare var XMLHttpRequest; // declare var document; // declare var getComputedStyle; /** @const */ var release: boolean = false; /** @const */ var debug: boolean = !release; declare function assert(condition: any, ...args); declare var dateNow: () => number; if (!jsGlobal.performance) { jsGlobal.performance = {}; } if (!jsGlobal.performance.now) { jsGlobal.performance.now = dateNow; }
/* * Copyright 2014 Mozilla Foundation * * 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. */ var jsGlobal = (function() { return this || (1, eval)('this'); })(); var inBrowser = typeof console != "undefined"; interface JSGlobal { Object: any; String: Function; Number: Function; Boolean: Function; Function: Function; Math: Function; Array: Function; performance: any; print: any; } // declare var print; // declare var console; // declare var performance; // declare var XMLHttpRequest; // declare var document; // declare var getComputedStyle; /** @const */ var release: boolean = false; /** @const */ var debug: boolean = !release; declare function assert(condition: any, ...args); declare var dateNow: () => number; if (!jsGlobal.performance) { jsGlobal.performance = {}; } if (!jsGlobal.performance.now) { jsGlobal.performance.now = typeof dateNow !== 'undefined' ? dateNow : Date.now; }
Make performance.now shim work in shells lacking dateNow
Make performance.now shim work in shells lacking dateNow
TypeScript
apache-2.0
mozilla/shumway,tschneidereit/shumway,tschneidereit/shumway,yurydelendik/shumway,mbebenita/shumway,yurydelendik/shumway,tschneidereit/shumway,mbebenita/shumway,yurydelendik/shumway,mozilla/shumway,mbebenita/shumway,tschneidereit/shumway,tschneidereit/shumway,yurydelendik/shumway,mbebenita/shumway,mbebenita/shumway,tschneidereit/shumway,mozilla/shumway,mbebenita/shumway,mozilla/shumway,yurydelendik/shumway,yurydelendik/shumway,mbebenita/shumway,tschneidereit/shumway,mozilla/shumway,tschneidereit/shumway,mozilla/shumway,mozilla/shumway,mozilla/shumway,mbebenita/shumway,yurydelendik/shumway,yurydelendik/shumway
--- +++ @@ -48,5 +48,5 @@ } if (!jsGlobal.performance.now) { - jsGlobal.performance.now = dateNow; + jsGlobal.performance.now = typeof dateNow !== 'undefined' ? dateNow : Date.now; }
f0852dbb589b2a99146d360e55a23ee5b942b622
src/clojureDefinition.ts
src/clojureDefinition.ts
'use strict'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import * as vscode from 'vscode'; import { nREPLClient } from './nreplClient'; import { ClojureProvider } from './clojureProvider' export class ClojureDefinitionProvider extends ClojureProvider implements vscode.DefinitionProvider { provideDefinition(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable < vscode.Definition > { return new Promise((resolve, reject) => { let wordRange = document.getWordRangeAtPosition(position); if (!wordRange) { return reject(); } let currentWord: string; currentWord = document.lineAt(position.line).text.slice(wordRange.start.character, wordRange.end.character); let ns = this.getNamespace(document.getText()); let nrepl = this.getNREPL(); nrepl.info(currentWord, ns, (info) => { if (!info.file) { // vscode.window.showInformationMessage(`Can't find definition for ${currentWord}.`); reject(); } let uri = vscode.Uri.parse(info.file); let pos = new vscode.Position(info.line - 1, info.column) let definition = new vscode.Location(uri, pos); console.log(info); resolve(definition); }); }) } }
'use strict'; import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import * as vscode from 'vscode'; import { nREPLClient } from './nreplClient'; import { ClojureProvider } from './clojureProvider' export class ClojureDefinitionProvider extends ClojureProvider implements vscode.DefinitionProvider { provideDefinition(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable < vscode.Definition > { return new Promise((resolve, reject) => { let wordRange = document.getWordRangeAtPosition(position); if (!wordRange) { return reject(); } let currentWord: string; currentWord = document.lineAt(position.line).text.slice(wordRange.start.character, wordRange.end.character); let ns = this.getNamespace(document.getText()); let nrepl = this.getNREPL(); nrepl.info(currentWord, ns, (info) => { if (!info.file) { // vscode.window.showInformationMessage(`Can't find definition for ${currentWord}.`); return reject(); } let uri = vscode.Uri.parse(info.file); let pos = new vscode.Position(info.line - 1, info.column) let definition = new vscode.Location(uri, pos); console.log(info); resolve(definition); }); }) } }
Fix possible bug with missing return
Fix possible bug with missing return
TypeScript
mit
avli/clojureVSCode,avli/clojureVSCode,anyayunli/clojureVSCode,alessandrod/clojureVSCode,fasfsfgs/clojureVSCode
--- +++ @@ -28,7 +28,7 @@ nrepl.info(currentWord, ns, (info) => { if (!info.file) { // vscode.window.showInformationMessage(`Can't find definition for ${currentWord}.`); - reject(); + return reject(); } let uri = vscode.Uri.parse(info.file); let pos = new vscode.Position(info.line - 1, info.column)
9301bbd7fce13eeff4261f28318f1d09fc119d52
web/src/views/Guilds.tsx
web/src/views/Guilds.tsx
import React, { Component } from 'react' import { Link } from 'react-router-dom' import './Guilds.scss' import API from '../api' import Guild from './Guild' import { Guild as GuildT } from '../types' type State = { guilds: GuildT[] | null } export default class Guilds extends Component<{}, State> { state: State = { guilds: null } async componentDidMount() { const guilds = await API.get<GuildT[]>('/api/guilds') this.setState({ guilds }) } render() { const { guilds } = this.state let content if (guilds == null) { content = <p>Loading servers...</p> } else if (guilds.length !== 0) { const guildNodes = guilds.map((guild: GuildT) => ( <li> <Link to={`/guild/${guild.id}`}> <Guild key={guild.id} guild={guild} /> </Link> </li> )) content = ( <> <p>Click on a server below to edit its configuration:</p> <ul className="guild-list">{guildNodes}</ul> </> ) } else { content = <p>Nothing here.</p> } return ( <div id="guilds"> <h2>Servers</h2> {content} </div> ) } }
import React, { Component } from 'react' import { Link } from 'react-router-dom' import './Guilds.scss' import API from '../api' import Guild from './Guild' import { Guild as GuildT } from '../types' type State = { guilds: GuildT[] | null } export default class Guilds extends Component<{}, State> { state: State = { guilds: null } async componentDidMount() { const guilds = await API.get<GuildT[]>('/api/guilds') this.setState({ guilds }) } render() { const { guilds } = this.state let content if (guilds == null) { content = <p>Loading servers...</p> } else if (guilds.length !== 0) { const guildNodes = guilds.map((guild: GuildT) => ( <li key={guild.id}> <Link to={`/guild/${guild.id}`}> <Guild guild={guild} /> </Link> </li> )) content = ( <> <p>Click on a server below to edit its configuration:</p> <ul className="guild-list">{guildNodes}</ul> </> ) } else { content = <p>Nothing here.</p> } return ( <div id="guilds"> <h2>Servers</h2> {content} </div> ) } }
Add key properly on guild listing
Add key properly on guild listing
TypeScript
mit
slice/dogbot,slice/dogbot,sliceofcode/dogbot,slice/dogbot,sliceofcode/dogbot
--- +++ @@ -27,9 +27,9 @@ content = <p>Loading servers...</p> } else if (guilds.length !== 0) { const guildNodes = guilds.map((guild: GuildT) => ( - <li> + <li key={guild.id}> <Link to={`/guild/${guild.id}`}> - <Guild key={guild.id} guild={guild} /> + <Guild guild={guild} /> </Link> </li> ))
39f9ea32ac9abc594ce0c3a89a6813ab857076e0
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 extra slash after node_modules regex for Windows paths
[expo] Remove extra slash after node_modules regex for Windows paths Make the regex to match node_modules paths work on Windows where there are backslashes. (Normally we should make the regex more correct instead of looser but this heuristic is a quick patch for an issue we should fix at the root by moving to a better bundler.)
TypeScript
bsd-3-clause
exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponentjs/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; }
0b30811f14d62c1e6d8acf462d8aa8a0aa6d4c4b
src/main.ts
src/main.ts
// Copyright 2019 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 // // 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 { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.log(err));
// Copyright 2019-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 // // 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 { enableProdMode /*, ApplicationRef*/ } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; //import { enableDebugTools } from '@angular/platform-browser'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) // Uncomment to enable console debug tools, such as ng.profiler.timeChangeDetection() /*.then(moduleRef => { const applicationRef = moduleRef.injector.get(ApplicationRef); const componentRef = applicationRef.components[0]; enableDebugTools(componentRef); })*/ .catch(err => console.log(err));
Add instructions for enabling debugging tools
Add instructions for enabling debugging tools
TypeScript
apache-2.0
google/peoplemath,google/peoplemath,google/peoplemath,google/peoplemath,google/peoplemath
--- +++ @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2019-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. @@ -12,15 +12,22 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { enableProdMode } from '@angular/core'; +import { enableProdMode /*, ApplicationRef*/ } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +//import { enableDebugTools } from '@angular/platform-browser'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.log(err)); +// Uncomment to enable console debug tools, such as ng.profiler.timeChangeDetection() +/*.then(moduleRef => { + const applicationRef = moduleRef.injector.get(ApplicationRef); + const componentRef = applicationRef.components[0]; + enableDebugTools(componentRef); +})*/ +.catch(err => console.log(err));
9c9f56e2319bcd030f46c0934adc850fea00cc65
app/javascript/retrospring/features/questionbox/all.ts
app/javascript/retrospring/features/questionbox/all.ts
import Rails from '@rails/ujs'; import { showErrorNotification, showNotification } from 'utilities/notifications'; import I18n from 'retrospring/i18n'; export function questionboxAllHandler(event: Event): void { const button = event.target as HTMLButtonElement; button.disabled = true; document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').readOnly = true; Rails.ajax({ url: '/ajax/ask', type: 'POST', data: new URLSearchParams({ rcpt: 'followers', question: document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').value, anonymousQuestion: 'false' }).toString(), success: (data) => { if (data.success) { document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').value = ''; window['$']('#modal-ask-followers').modal('hide'); } showNotification(data.message, data.success); }, error: (data, status, xhr) => { console.log(data, status, xhr); showErrorNotification(I18n.translate('frontend.error.message')); }, complete: () => { button.disabled = false; document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').readOnly = false; } }); } export function questionboxAllInputHandler(event: KeyboardEvent): void { if (event.keyCode == 13 && (event.ctrlKey || event.metaKey)) { document.querySelector<HTMLButtonElement>(`button[name=qb-all-ask]`).click(); } }
import { post } from '@rails/request.js'; import { showErrorNotification, showNotification } from 'utilities/notifications'; import I18n from 'retrospring/i18n'; export function questionboxAllHandler(event: Event): void { const button = event.target as HTMLButtonElement; button.disabled = true; document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').readOnly = true; post('/ajax/ask', { body: { rcpt: 'followers', question: document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').value, anonymousQuestion: 'false' }, contentType: 'application/json' }) .then(async response => { const data = await response.json; if (data.success) { document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').value = ''; window['$']('#modal-ask-followers').modal('hide'); } showNotification(data.message, data.success); }) .catch(err => { console.log(err); showErrorNotification(I18n.translate('frontend.error.message')); }) .finally(() => { button.disabled = false; document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').readOnly = false; }); } export function questionboxAllInputHandler(event: KeyboardEvent): void { if (event.keyCode == 13 && (event.ctrlKey || event.metaKey)) { document.querySelector<HTMLButtonElement>(`button[name=qb-all-ask]`).click(); } }
Refactor question asking to use request.js
Refactor question asking 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 { showErrorNotification, showNotification } from 'utilities/notifications'; import I18n from 'retrospring/i18n'; @@ -8,31 +8,32 @@ button.disabled = true; document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').readOnly = true; - Rails.ajax({ - url: '/ajax/ask', - type: 'POST', - data: new URLSearchParams({ + post('/ajax/ask', { + body: { rcpt: 'followers', question: document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').value, - anonymousQuestion: 'false' - }).toString(), - success: (data) => { + anonymousQuestion: 'false' + }, + contentType: 'application/json' + }) + .then(async response => { + const data = await response.json; + if (data.success) { document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').value = ''; window['$']('#modal-ask-followers').modal('hide'); } showNotification(data.message, data.success); - }, - error: (data, status, xhr) => { - console.log(data, status, xhr); + }) + .catch(err => { + console.log(err); showErrorNotification(I18n.translate('frontend.error.message')); - }, - complete: () => { + }) + .finally(() => { button.disabled = false; document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').readOnly = false; - } - }); + }); } export function questionboxAllInputHandler(event: KeyboardEvent): void {
1722a8479cb0c181454563c4e2d2eed8285f39b9
src/environments/environment.ts
src/environments/environment.ts
export const environment = { production: false, APP_NAME_VERSION: 'OpenRadiation app 2.0.0-beta.2', API_KEY: '50adef3bdec466edc25f40c8fedccbce', API_URI: 'https://submit.open-radiation.net/measurements', IN_APP_BROWSER_URI: { base: 'https://request.open-radiation.net', suffix: 'openradiation' } };
export const environment = { production: false, APP_NAME_VERSION: 'OpenRadiation app 2.0.0-beta.2 dev', API_KEY: '50adef3bdec466edc25f40c8fedccbce', API_URI: 'https://submit.open-radiation.net/measurements', IN_APP_BROWSER_URI: { base: 'https://request.open-radiation.net', suffix: 'openradiation' } };
Add distinctive name between beta app and dev app
Add distinctive name between beta app and dev app
TypeScript
apache-2.0
openradiation/openradiation-mobile,openradiation/openradiation-mobile,openradiation/openradiation-mobile,openradiation/openradiation-mobile
--- +++ @@ -1,6 +1,6 @@ export const environment = { production: false, - APP_NAME_VERSION: 'OpenRadiation app 2.0.0-beta.2', + APP_NAME_VERSION: 'OpenRadiation app 2.0.0-beta.2 dev', API_KEY: '50adef3bdec466edc25f40c8fedccbce', API_URI: 'https://submit.open-radiation.net/measurements', IN_APP_BROWSER_URI: {
e22157b4470843882e3d1879306b39dd9a66cd7c
examples/typescript/06_core/hello-world/src/app.ts
examples/typescript/06_core/hello-world/src/app.ts
import { FileDb } from 'jovo-db-filedb'; import { App } from 'jovo-framework'; import { CorePlatform } from 'jovo-platform-core'; import { JovoDebugger } from 'jovo-plugin-debugger'; import { AmazonCredentials, LexSlu } from 'jovo-slu-lex'; const app = new App(); const corePlatform = new CorePlatform(); const credentials: AmazonCredentials = { accessKeyId: process.env.AWS_ACCESS_KEY_ID!, secretAccessKey: process.env.AWS_SECRET_KEY!, region: process.env.AWS_REGION! }; corePlatform.use( new LexSlu({ credentials, botAlias: 'WebTest', botName: 'WebAssistantTest' }) ); app.use(corePlatform, new JovoDebugger(), new FileDb()); app.setHandler({ LAUNCH() { return this.toIntent('HelloWorldIntent'); }, HelloWorldIntent() { this.$corePlatformApp?.$actions.addQuickReplies(['John', 'Jack', 'Max']); this.ask("Hello World! What's your name?", 'Please tell me your name.'); }, MyNameIsIntent() { this.tell('Hey ' + this.$inputs.name.value + ', nice to meet you!'); }, DefaultFallbackIntent() { this.tell('Good Bye!'); } }); export { app };
import { FileDb } from 'jovo-db-filedb'; import { App } from 'jovo-framework'; import { CorePlatform } from 'jovo-platform-core'; import { JovoDebugger } from 'jovo-plugin-debugger'; import { AmazonCredentials, LexSlu } from 'jovo-slu-lex'; const app = new App(); const corePlatform = new CorePlatform(); const credentials: AmazonCredentials = { accessKeyId: process.env.AWS_ACCESS_KEY_ID!, secretAccessKey: process.env.AWS_SECRET_KEY!, region: process.env.AWS_REGION! }; corePlatform.use( new LexSlu({ credentials, botAlias: 'WebTest', botName: 'WebAssistantTest' }) ); app.use(corePlatform, new JovoDebugger(), new FileDb()); app.setHandler({ LAUNCH() { return this.toIntent('HelloWorldIntent'); }, HelloWorldIntent() { this.$corePlatformApp?.$actions.addQuickReplies(['Joe', 'Jane', 'Max']); this.ask("Hello World! What's your name?", 'Please tell me your name.'); }, MyNameIsIntent() { this.tell('Hey ' + this.$inputs.name.value + ', nice to meet you!'); }, DefaultFallbackIntent() { this.tell('Good Bye!'); } }); export { app };
Fix QuickReply value in example
:bug: Fix QuickReply value in example
TypeScript
apache-2.0
jovotech/jovo-framework-nodejs,jovotech/jovo-framework-nodejs
--- +++ @@ -30,7 +30,7 @@ }, HelloWorldIntent() { - this.$corePlatformApp?.$actions.addQuickReplies(['John', 'Jack', 'Max']); + this.$corePlatformApp?.$actions.addQuickReplies(['Joe', 'Jane', 'Max']); this.ask("Hello World! What's your name?", 'Please tell me your name.'); },
ee35f5dc968c699f2b3481cf91041bdf632fbba5
front/src/app/component/page-footer/page-footer.component.spec.ts
front/src/app/component/page-footer/page-footer.component.spec.ts
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { PageFooterComponent } from './page-footer.component'; describe('PageFooterComponent', () => { let component: PageFooterComponent; let fixture: ComponentFixture<PageFooterComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ PageFooterComponent ] }) .compileComponents(); })); beforeEach(() => { }); it('should create', () => { }); });
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { PageFooterComponent } from './page-footer.component'; describe('PageFooterComponent', () => { let pageFooterComponent: PageFooterComponent; let pageFooterFixture: ComponentFixture<PageFooterComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ PageFooterComponent ] }) .compileComponents().then(() => { pageFooterFixture = TestBed.createComponent(PageFooterComponent); pageFooterComponent = pageFooterFixture.componentInstance; }); })); it('should create page footer component', () => { const pageFooter = pageFooterFixture.debugElement.componentInstance; expect(pageFooter).toBeTruthy(); }); it('should contain copyrights text contents', async(() => { const copyrights = pageFooterFixture.debugElement.query(By.css('.page-footer > .copyrights')); const copyrightsText = copyrights.nativeElement.textContent; expect(copyrightsText).toContain("Copyrights"); expect(copyrightsText).toContain("2017"); expect(copyrightsText).toContain("Saka7"); })); });
Add page footer component test
test(front): Add page footer component test
TypeScript
bsd-3-clause
Saka7/word-kombat,Saka7/word-kombat,Saka7/word-kombat,Saka7/word-kombat
--- +++ @@ -1,22 +1,33 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; import { PageFooterComponent } from './page-footer.component'; describe('PageFooterComponent', () => { - let component: PageFooterComponent; - let fixture: ComponentFixture<PageFooterComponent>; + let pageFooterComponent: PageFooterComponent; + let pageFooterFixture: ComponentFixture<PageFooterComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ PageFooterComponent ] }) - .compileComponents(); + .compileComponents().then(() => { + pageFooterFixture = TestBed.createComponent(PageFooterComponent); + pageFooterComponent = pageFooterFixture.componentInstance; + }); })); - beforeEach(() => { + it('should create page footer component', () => { + const pageFooter = pageFooterFixture.debugElement.componentInstance; + expect(pageFooter).toBeTruthy(); }); - it('should create', () => { - }); + it('should contain copyrights text contents', async(() => { + const copyrights = pageFooterFixture.debugElement.query(By.css('.page-footer > .copyrights')); + const copyrightsText = copyrights.nativeElement.textContent; + expect(copyrightsText).toContain("Copyrights"); + expect(copyrightsText).toContain("2017"); + expect(copyrightsText).toContain("Saka7"); + })); });
101945a15be76647885da6d37bd78a9833871151
packages/glimmer-util/lib/assert.ts
packages/glimmer-util/lib/assert.ts
import Logger from './logger'; let alreadyWarned = false; export function debugAssert(test, msg) { // if (!alreadyWarned) { // alreadyWarned = true; // Logger.warn("Don't leave debug assertions on in public builds"); // } if (!test) { throw new Error(msg || "assertion failure"); } } export function prodAssert() {} export default debugAssert;
import Logger from './logger'; // let alreadyWarned = false; export function debugAssert(test, msg) { // if (!alreadyWarned) { // alreadyWarned = true; // Logger.warn("Don't leave debug assertions on in public builds"); // } if (!test) { throw new Error(msg || "assertion failure"); } } export function prodAssert() {} export default debugAssert;
Comment out (now) unused variable
Comment out (now) unused variable
TypeScript
mit
chadhietala/glimmer,glimmerjs/glimmer-vm,chadhietala/glimmer,tildeio/glimmer,tildeio/glimmer,tildeio/glimmer,lbdm44/glimmer-vm,glimmerjs/glimmer-vm,lbdm44/glimmer-vm,glimmerjs/glimmer-vm,chadhietala/glimmer,lbdm44/glimmer-vm,chadhietala/glimmer
--- +++ @@ -1,6 +1,7 @@ import Logger from './logger'; -let alreadyWarned = false; +// let alreadyWarned = false; + export function debugAssert(test, msg) { // if (!alreadyWarned) { // alreadyWarned = true;
d3fe167ba7b7eb37ca180a485bec223d8f86ce80
addon-test-support/index.ts
addon-test-support/index.ts
export { default as a11yAudit } from './audit'; export { default as a11yAuditIf } from './audit-if'; export { setRunOptions, getRunOptions } from './run-options'; export { setEnableA11yAudit, shouldForceAudit } from './should-force-audit'; export { useMiddlewareReporter } from './use-middleware-reporter'; export { setupGlobalA11yHooks, teardownGlobalA11yHooks, DEFAULT_A11Y_TEST_HELPER_NAMES, } from './setup-global-a11y-hooks'; export { setCustomReporter } from './reporter'; export { TEST_SUITE_RESULTS as _TEST_SUITE_RESULTS, middlewareReporter as _middlewareReporter, pushTestResult as _pushTestResult, setupMiddlewareReporter, } from './setup-middleware-reporter'; export { storeResults, printResults } from './logger'; export { setupConsoleLogger } from './setup-console-logger'; export { InvocationStrategy, A11yAuditReporter } from './types';
export { default as a11yAudit } from './audit'; export { default as a11yAuditIf } from './audit-if'; export { setRunOptions, getRunOptions } from './run-options'; export { setEnableA11yAudit, shouldForceAudit } from './should-force-audit'; export { useMiddlewareReporter } from './use-middleware-reporter'; export { setupGlobalA11yHooks, teardownGlobalA11yHooks, DEFAULT_A11Y_TEST_HELPER_NAMES, } from './setup-global-a11y-hooks'; export { setCustomReporter } from './reporter'; export { TEST_SUITE_RESULTS as _TEST_SUITE_RESULTS, middlewareReporter as _middlewareReporter, pushTestResult as _pushTestResult, setupMiddlewareReporter, } from './setup-middleware-reporter'; export { storeResults, printResults } from './logger'; export { setupConsoleLogger } from './setup-console-logger'; export type { InvocationStrategy, A11yAuditReporter } from './types';
Use type-only export for types re-export
Use type-only export for types re-export
TypeScript
mit
ember-a11y/ember-a11y-testing,ember-a11y/ember-a11y-testing,ember-a11y/ember-a11y-testing
--- +++ @@ -18,4 +18,4 @@ export { storeResults, printResults } from './logger'; export { setupConsoleLogger } from './setup-console-logger'; -export { InvocationStrategy, A11yAuditReporter } from './types'; +export type { InvocationStrategy, A11yAuditReporter } from './types';
4a5386e46a7006f3708a9c6c81bb87d673099823
src/dialog/dialog-info/info-options.ts
src/dialog/dialog-info/info-options.ts
/* MIT License Copyright (c) 2017 Temainfo Sistemas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ export interface InfoOptions { title?: string; textOk?: string; }
/* MIT License Copyright (c) 2017 Temainfo Sistemas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ export interface InfoOptions { title?: string; textOk?: string; draggable?: boolean; }
Add property draggable to info dialog
feat(dialog): Add property draggable to info dialog
TypeScript
mit
TemainfoSistemas/truly-ui,TemainfoSistemas/truly-ui,TemainfoSistemas/truly-ui
--- +++ @@ -22,4 +22,5 @@ export interface InfoOptions { title?: string; textOk?: string; + draggable?: boolean; }
3af114db7aad0e17a5fcfed747a0285cc14eb511
source/api/graphql/api.ts
source/api/graphql/api.ts
import { fetch } from "../../api/fetch" export const graphqlAPI = (url: string, query: string) => fetch(`${url}/api/graphql`, { method: "POST", body: JSON.stringify({ query }), }) .then(res => { if (!res.ok) { return res.json() } else { throw new Error("HTTP error\n" + JSON.stringify(res, null, " ")) } }) .then(body => { if (body.errors) { // tslint:disable-next-line:no-console console.log("Received errors from the GraphQL API") // tslint:disable-next-line:no-console console.log(body.errors) } return body })
import { fetch } from "../../api/fetch" export const graphqlAPI = (url: string, query: string) => fetch(`${url}/api/graphql`, { method: "POST", body: JSON.stringify({ query }), }) .then(res => { if (res.ok) { return res.json() } else { throw new Error("HTTP error\n" + JSON.stringify(res, null, " ")) } }) .then(body => { if (body.errors) { // tslint:disable-next-line:no-console console.log("Received errors from the GraphQL API") // tslint:disable-next-line:no-console console.log(body.errors) } return body })
Fix booleab logic in the error handling
Fix booleab logic in the error handling
TypeScript
mit
danger/peril,danger/peril,danger/peril,danger/peril,danger/peril
--- +++ @@ -6,7 +6,7 @@ body: JSON.stringify({ query }), }) .then(res => { - if (!res.ok) { + if (res.ok) { return res.json() } else { throw new Error("HTTP error\n" + JSON.stringify(res, null, " "))
1e5f0390250b2d2069afe6becff7d99d61a8a695
src/components/createTestForm/createTestForm.component.ts
src/components/createTestForm/createTestForm.component.ts
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'llta-create-test-form', templateUrl: './createTestForm.component.html', styleUrls: ['./createTestForm.component.scss'] }) export class CreateTestFormComponent { getNumbersRange(): number[] { return Array(answersQuantity).fill().map((x, i) => i + 1); } onSubmit() { } }
import { Component, OnInit } from '@angular/core'; import { range } from 'lodash.range'; @Component({ selector: 'llta-create-test-form', templateUrl: './createTestForm.component.html', styleUrls: ['./createTestForm.component.scss'] }) export class CreateTestFormComponent { question: string; matching: boolean; answersQuantity: number; answers: string[]; answersTableTitle: string[]; answersLetters: string[]; answersNumbers: string[]; getNumbersRange(): number[] { return range(1, this.answersQuantity + 1); } onSubmit() { } }
Add variables defining, refactor function
Add variables defining, refactor function
TypeScript
mit
ivanna-ostrovets/language-and-literature-admin,ivanna-ostrovets/language-and-literature-admin,ivanna-ostrovets/language-and-literature-admin
--- +++ @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; + +import { range } from 'lodash.range'; @Component({ selector: 'llta-create-test-form', @@ -6,8 +8,16 @@ styleUrls: ['./createTestForm.component.scss'] }) export class CreateTestFormComponent { + question: string; + matching: boolean; + answersQuantity: number; + answers: string[]; + answersTableTitle: string[]; + answersLetters: string[]; + answersNumbers: string[]; + getNumbersRange(): number[] { - return Array(answersQuantity).fill().map((x, i) => i + 1); + return range(1, this.answersQuantity + 1); } onSubmit() {
8cd5087b9dd2e34ef074fd843fff4043ff39421a
src/extension/decorations/flutter_icon_decorations_lsp.ts
src/extension/decorations/flutter_icon_decorations_lsp.ts
import { FlutterOutline } from "../../shared/analysis/lsp/custom_protocol"; import { Logger } from "../../shared/interfaces"; import { fsPath } from "../../shared/utils/fs"; import { IconRangeComputerLsp } from "../../shared/vscode/icon_range_computer"; import { LspAnalyzer } from "../analysis/analyzer_lsp"; import { FlutterIconDecorations } from "./flutter_icon_decorations"; export class FlutterIconDecorationsLsp extends FlutterIconDecorations { private readonly computer: IconRangeComputerLsp; constructor(logger: Logger, private readonly analyzer: LspAnalyzer) { super(logger); this.computer = new IconRangeComputerLsp(logger); this.subscriptions.push(this.analyzer.fileTracker.onFlutterOutline.listen(async (op) => { if (this.activeEditor && fsPath(this.activeEditor.document.uri) === fsPath(op.uri)) { this.update(op.outline); } })); } protected update(outline?: FlutterOutline) { if (!this.activeEditor) return; if (!outline) outline = this.analyzer.fileTracker.getFlutterOutlineFor(this.activeEditor.document.uri); if (!outline) return; const results = this.computer.compute(outline); this.render(results); } }
import * as vs from "vscode"; import { FlutterOutline } from "../../shared/analysis/lsp/custom_protocol"; import { Logger } from "../../shared/interfaces"; import { fsPath } from "../../shared/utils/fs"; import { IconRangeComputerLsp } from "../../shared/vscode/icon_range_computer"; import { LspAnalyzer } from "../analysis/analyzer_lsp"; import { FlutterIconDecorations } from "./flutter_icon_decorations"; export class FlutterIconDecorationsLsp extends FlutterIconDecorations { private readonly computer: IconRangeComputerLsp; constructor(logger: Logger, private readonly analyzer: LspAnalyzer) { super(logger); this.computer = new IconRangeComputerLsp(logger); this.subscriptions.push(this.analyzer.fileTracker.onFlutterOutline.listen(async (op) => { if (this.activeEditor && fsPath(this.activeEditor.document.uri) === fsPath(vs.Uri.parse(op.uri))) { this.update(op.outline); } })); } protected update(outline?: FlutterOutline) { if (!this.activeEditor) return; if (!outline) outline = this.analyzer.fileTracker.getFlutterOutlineFor(this.activeEditor.document.uri); if (!outline) return; const results = this.computer.compute(outline); this.render(results); } }
Fix Flutter icon previews not detecting incoming outlines correctly due to URI in string
Fix Flutter icon previews not detecting incoming outlines correctly due to URI in string Fixes #3081.
TypeScript
mit
Dart-Code/Dart-Code,Dart-Code/Dart-Code,Dart-Code/Dart-Code,Dart-Code/Dart-Code,Dart-Code/Dart-Code
--- +++ @@ -1,3 +1,4 @@ +import * as vs from "vscode"; import { FlutterOutline } from "../../shared/analysis/lsp/custom_protocol"; import { Logger } from "../../shared/interfaces"; import { fsPath } from "../../shared/utils/fs"; @@ -12,7 +13,7 @@ this.computer = new IconRangeComputerLsp(logger); this.subscriptions.push(this.analyzer.fileTracker.onFlutterOutline.listen(async (op) => { - if (this.activeEditor && fsPath(this.activeEditor.document.uri) === fsPath(op.uri)) { + if (this.activeEditor && fsPath(this.activeEditor.document.uri) === fsPath(vs.Uri.parse(op.uri))) { this.update(op.outline); } }));
c62b82a98dd71e96a94e4c997a3dba15b49d2070
pofile.d.ts
pofile.d.ts
declare interface IHeaders { 'Project-Id-Version': string; 'Report-Msgid-Bugs-To': string; 'POT-Creation-Date': string; 'PO-Revision-Date': string; 'Last-Translator': string; 'Language': string; 'Language-Team': string; 'Content-Type': string; 'Content-Transfer-Encoding': string; 'Plural-Forms': string; [name: string]: string; } declare class Item { public msgid: string; public msgctxt?: string; public references: string[]; public msgid_plural?: string; public msgstr: string[]; public comments: string[]; public extractedComments: string[]; public flags: Record<string, boolean | undefined>; private nplurals: number; private obsolete: boolean; public toString(): string; } declare class PO { public comments: string[]; public extractedComments: string[]; public items: Item[]; public headers: Partial<IHeaders> public static parse(data: string): PO; public static parsePluralForms(forms: string): PO; public static load(fileName: string, callback: (err: NodeJS.ErrnoException, po: PO) => void): void; public static Item: Item; public save(fileName: string, callback: (err: NodeJS.ErrnoException) => void): void; public toString(): string; } export = PO
declare interface IHeaders { 'Project-Id-Version': string; 'Report-Msgid-Bugs-To': string; 'POT-Creation-Date': string; 'PO-Revision-Date': string; 'Last-Translator': string; 'Language': string; 'Language-Team': string; 'Content-Type': string; 'Content-Transfer-Encoding': string; 'Plural-Forms': string; [name: string]: string; } declare class Item { public msgid: string; public msgctxt?: string; public references: string[]; public msgid_plural?: string; public msgstr: string[]; public comments: string[]; public extractedComments: string[]; public flags: Record<string, boolean | undefined>; private nplurals: number; private obsolete: boolean; public toString(): string; } declare class PO { public comments: string[]; public extractedComments: string[]; public items: Item[]; public headers: Partial<IHeaders> public static parse(data: string): PO; public static parsePluralForms(forms: string): PO; public static load(fileName: string, callback: (err: NodeJS.ErrnoException, po: PO) => void): void; public static Item: typeof Item; public save(fileName: string, callback: (err: NodeJS.ErrnoException) => void): void; public toString(): string; } export = PO
Revert "Fix type of PO.Item"
Revert "Fix type of PO.Item"
TypeScript
mit
rubenv/pofile
--- +++ @@ -36,7 +36,7 @@ public static parse(data: string): PO; public static parsePluralForms(forms: string): PO; public static load(fileName: string, callback: (err: NodeJS.ErrnoException, po: PO) => void): void; - public static Item: Item; + public static Item: typeof Item; public save(fileName: string, callback: (err: NodeJS.ErrnoException) => void): void; public toString(): string;
17bbed90f19ff2c47f2aa01d95fe20532a158a4a
app/src/ui/lib/avatar.tsx
app/src/ui/lib/avatar.tsx
import * as React from 'react' import { IGitHubUser } from '../../lib/dispatcher' interface IAvatarProps { readonly gitHubUser: IGitHubUser | null readonly title: string | null } const DefaultAvatarURL = 'https://github.com/hubot.png' export class Avatar extends React.Component<IAvatarProps, void> { private getTitle(user: IGitHubUser | null): string { if (user === null) { return this.props.title || 'Unknown User' } return this.props.title || user.email } public render() { const gitHubUser = this.props.gitHubUser const avatarURL = (gitHubUser ? gitHubUser.avatarURL : null) || DefaultAvatarURL const avatarTitle = this.getTitle(gitHubUser) return ( <img className='avatar' title={avatarTitle} src={avatarURL} alt={avatarTitle}/> ) } }
import * as React from 'react' const DefaultAvatarURL = 'https://github.com/hubot.png' /** The minimum properties we need in order to display a user's avatar. */ export interface IAvatarUser { /** The user's email. */ readonly email: string /** The user's avatar URL. */ readonly avatarURL: string } interface IAvatarProps { /** The user whose avatar should be displayed. */ readonly user?: IAvatarUser /** The title of the avatar. Defaults to `email` if provided. */ readonly title?: string } /** A component for displaying a user avatar. */ export class Avatar extends React.Component<IAvatarProps, void> { private getTitle(): string { if (this.props.title) { return this.props.title } if (this.props.user) { return this.props.user.email } return 'Unknown user' } public render() { const url = this.props.user ? this.props.user.avatarURL : DefaultAvatarURL const title = this.getTitle() return ( <img className='avatar' title={title} src={url} alt={title}/> ) } }
Generalize Avatar to only require the properties we need
Generalize Avatar to only require the properties we need
TypeScript
mit
gengjiawen/desktop,shiftkey/desktop,desktop/desktop,artivilla/desktop,BugTesterTest/desktops,j-f1/forked-desktop,shiftkey/desktop,BugTesterTest/desktops,desktop/desktop,kactus-io/kactus,j-f1/forked-desktop,gengjiawen/desktop,j-f1/forked-desktop,BugTesterTest/desktops,say25/desktop,desktop/desktop,shiftkey/desktop,artivilla/desktop,artivilla/desktop,BugTesterTest/desktops,say25/desktop,shiftkey/desktop,hjobrien/desktop,hjobrien/desktop,kactus-io/kactus,hjobrien/desktop,j-f1/forked-desktop,hjobrien/desktop,gengjiawen/desktop,gengjiawen/desktop,kactus-io/kactus,desktop/desktop,say25/desktop,say25/desktop,artivilla/desktop,kactus-io/kactus
--- +++ @@ -1,29 +1,44 @@ import * as React from 'react' -import { IGitHubUser } from '../../lib/dispatcher' - -interface IAvatarProps { - readonly gitHubUser: IGitHubUser | null - readonly title: string | null -} const DefaultAvatarURL = 'https://github.com/hubot.png' +/** The minimum properties we need in order to display a user's avatar. */ +export interface IAvatarUser { + /** The user's email. */ + readonly email: string + + /** The user's avatar URL. */ + readonly avatarURL: string +} + +interface IAvatarProps { + /** The user whose avatar should be displayed. */ + readonly user?: IAvatarUser + + /** The title of the avatar. Defaults to `email` if provided. */ + readonly title?: string +} + +/** A component for displaying a user avatar. */ export class Avatar extends React.Component<IAvatarProps, void> { - private getTitle(user: IGitHubUser | null): string { - if (user === null) { - return this.props.title || 'Unknown User' + private getTitle(): string { + if (this.props.title) { + return this.props.title } - return this.props.title || user.email - } + if (this.props.user) { + return this.props.user.email + } + + return 'Unknown user' + } public render() { - const gitHubUser = this.props.gitHubUser - const avatarURL = (gitHubUser ? gitHubUser.avatarURL : null) || DefaultAvatarURL - const avatarTitle = this.getTitle(gitHubUser) + const url = this.props.user ? this.props.user.avatarURL : DefaultAvatarURL + const title = this.getTitle() return ( - <img className='avatar' title={avatarTitle} src={avatarURL} alt={avatarTitle}/> + <img className='avatar' title={title} src={url} alt={title}/> ) } }
0042f268b9ee8ccb2e1cfe75c32e93e19af7f4a7
src/components/donation/Donation.tsx
src/components/donation/Donation.tsx
import * as React from 'react'; import { formatNumber } from '../shared/utils'; interface Props { total: number; goal: number; } interface State {} export class Donation extends React.Component<Props, State> { render () { // if goal is zero, percent = 100 to avoid divide by zero error const pctDone = this.props.goal && this.props.goal !== 0 ? (this.props.total / this.props.goal) * 100 : 100; const pctDoneStyle = {width: `${pctDone}%`}; if (this.props.goal !== 0 && this.props.total !== 0) { return ( <div className="logo__header__inner layout"> <div className="logo__header__donatebar"> <span style={pctDoneStyle} className="logo__header__donatebar__total"> {`\$${formatNumber(this.props.total)}`} </span> <span className="logo__header__donatebar__goal">{`\$${formatNumber(this.props.goal)}`}</span> </div> <p className="logo__header__donatetext"> <a href="https://secure.actblue.com/donate/5calls-donate">Donate today to keep 5 Calls running</a> </p> </div>); } else { return <span/>; } } }
import * as React from 'react'; import { formatNumber } from '../shared/utils'; interface Props { total: number; goal: number; } interface State {} export class Donation extends React.Component<Props, State> { render () { // if goal is zero, percent = 100 to avoid divide by zero error const pctDone = this.props.goal && this.props.goal !== 0 ? (this.props.total / this.props.goal) * 100 : 100; const pctDoneStyle = {width: `${pctDone}%`}; if (this.props.goal !== 0 && this.props.total !== 0) { return ( <div className="logo__header__inner layout"> <div className="logo__header__donatebar"> <span style={pctDoneStyle} className="logo__header__donatebar__total"> {`\$${formatNumber(this.props.total)}`} </span> {/* <span className="logo__header__donatebar__goal">{`\$${formatNumber(this.props.goal)}`}</span> */} </div> <p className="logo__header__donatetext"> <a href="https://secure.actblue.com/donate/5calls-donate">Donate today to keep 5 Calls running</a> </p> </div>); } else { return <span/>; } } }
Remove the goal for now.
Remove the goal for now.
TypeScript
mit
5calls/react-dev,5calls/5calls,5calls/5calls,5calls/5calls,5calls/5calls,5calls/react-dev,5calls/react-dev
--- +++ @@ -20,7 +20,7 @@ <span style={pctDoneStyle} className="logo__header__donatebar__total"> {`\$${formatNumber(this.props.total)}`} </span> - <span className="logo__header__donatebar__goal">{`\$${formatNumber(this.props.goal)}`}</span> + {/* <span className="logo__header__donatebar__goal">{`\$${formatNumber(this.props.goal)}`}</span> */} </div> <p className="logo__header__donatetext"> <a href="https://secure.actblue.com/donate/5calls-donate">Donate today to keep 5 Calls running</a>
c3033312581fe023a66bf3b60c1b80abf5e4b80d
examples/arduino-uno/multiple-blinks.ts
examples/arduino-uno/multiple-blinks.ts
import { Byte, periodic } from '@amnisio/rivulet'; import { Sources, HIGH, LOW, run, createSinks } from '@amnisio/arduino-uno'; const invert = (value: Byte) => value == LOW ? HIGH : LOW; // Sample application that will blink multiple LEDs attached to the arduino UNO at various cycles. // Requires an LED to be connected at pin D2. // Requires another LED to be connected at pin D3. // The on-board LED is used as a third LED. // The led at pin D2 blinks every 100ms. // The led at pin D3 blinks every 250ms. // The on board LED blinks every 500ms. // That's literally how easy it is to describe asynchronous actions with FRP. const application = (arduino: Sources) => { const sinks = createSinks(); sinks.D2$ = periodic(100).sample(arduino.D2$).map(invert); sinks.D3$ = periodic(250).sample(arduino.D3$).map(invert); sinks.LED$ = periodic(500).sample(arduino.LED$).map(invert); return sinks; }; run(application);
import { Int, periodic } from '@amnisio/rivulet'; import { Sources, HIGH, LOW, run, createSinks } from '@amnisio/arduino-uno'; const invert = (value: Int) => value == LOW ? HIGH : LOW; // Sample application that will blink multiple LEDs attached to the arduino UNO at various cycles. // Requires an LED to be connected at pin D2. // Requires another LED to be connected at pin D3. // The on-board LED is used as a third LED. // The led at pin D2 blinks every 100ms. // The led at pin D3 blinks every 250ms. // The on board LED blinks every 500ms. // That's literally how easy it is to describe asynchronous actions with FRP. const application = (arduino: Sources) => { const sinks = createSinks(); sinks.D2$ = periodic(100).sample(arduino.D2$).map(invert); sinks.D3$ = periodic(250).sample(arduino.D3$).map(invert); sinks.LED$ = periodic(500).sample(arduino.LED$).map(invert); return sinks; }; run(application);
Use Int instead of Byte
Use Int instead of Byte
TypeScript
mit
artfuldev/RIoT
--- +++ @@ -1,7 +1,7 @@ -import { Byte, periodic } from '@amnisio/rivulet'; +import { Int, periodic } from '@amnisio/rivulet'; import { Sources, HIGH, LOW, run, createSinks } from '@amnisio/arduino-uno'; -const invert = (value: Byte) => value == LOW ? HIGH : LOW; +const invert = (value: Int) => value == LOW ? HIGH : LOW; // Sample application that will blink multiple LEDs attached to the arduino UNO at various cycles. // Requires an LED to be connected at pin D2.
841271843d8969197683c10ae75ed7bf6e76f68f
src/desktop/apps/search2/client.tsx
src/desktop/apps/search2/client.tsx
import { buildClientApp } from "reaction/Artsy/Router/client" import { routes } from "reaction/Apps/Search/routes" import { data as sd } from "sharify" import React from "react" import ReactDOM from "react-dom" const mediator = require("desktop/lib/mediator.coffee") buildClientApp({ routes, context: { user: sd.CURRENT_USER, mediator, }, }) .then(({ ClientApp }) => { ReactDOM.hydrate(<ClientApp />, document.getElementById("react-root")) document.getElementById("search-results-skeleton").remove() }) .catch(error => { console.error(error) }) if (module.hot) { module.hot.accept() }
import { buildClientApp } from "reaction/Artsy/Router/client" import { routes } from "reaction/Apps/Search/routes" import { data as sd } from "sharify" import React from "react" import ReactDOM from "react-dom" const mediator = require("desktop/lib/mediator.coffee") buildClientApp({ routes, context: { user: sd.CURRENT_USER, mediator, }, }) .then(({ ClientApp }) => { ReactDOM.hydrate(<ClientApp />, document.getElementById("react-root")) document.getElementById("loading-container").remove() }) .catch(error => { console.error(error) }) if (module.hot) { module.hot.accept() }
Update identifer of loading container
Update identifer of loading container Follow up to https://github.com/artsy/force/pull/3910 The identifier was updated following review feedback, but the client-side callback which removes the loading container still referenced the old value. This commit makes that update.
TypeScript
mit
cavvia/force-1,anandaroop/force,cavvia/force-1,anandaroop/force,joeyAghion/force,oxaudo/force,erikdstock/force,artsy/force,eessex/force,damassi/force,yuki24/force,izakp/force,eessex/force,artsy/force-public,artsy/force-public,damassi/force,yuki24/force,oxaudo/force,oxaudo/force,erikdstock/force,artsy/force,izakp/force,erikdstock/force,joeyAghion/force,joeyAghion/force,joeyAghion/force,izakp/force,eessex/force,artsy/force,izakp/force,eessex/force,yuki24/force,erikdstock/force,damassi/force,anandaroop/force,cavvia/force-1,oxaudo/force,anandaroop/force,yuki24/force,damassi/force,cavvia/force-1,artsy/force
--- +++ @@ -15,7 +15,7 @@ }) .then(({ ClientApp }) => { ReactDOM.hydrate(<ClientApp />, document.getElementById("react-root")) - document.getElementById("search-results-skeleton").remove() + document.getElementById("loading-container").remove() }) .catch(error => { console.error(error)
5882591e288b37f752451ac27682dac075ddc3eb
tests/__tests__/ts-diagnostics.spec.ts
tests/__tests__/ts-diagnostics.spec.ts
import runJest from '../__helpers__/runJest'; describe('TypeScript Diagnostics errors', () => { it('should show the correct error locations in the typescript files', () => { const result = runJest('../ts-diagnostics', ['--no-cache']); expect(result.stderr).toContain( `Hello.ts(2,10): error TS2339: Property 'push' does not exist on type`, ); expect(result.stderr).toContain( `Hello.ts(13,10): error TS2339: Property 'unexcuted' does not exist on type 'Hello`, ); }); });
import runJest from '../__helpers__/runJest'; describe('TypeScript Diagnostics errors', () => { it('should show the correct error locations in the typescript files', () => { const result = runJest('../ts-diagnostics', ['--no-cache']); expect(result.stderr).toContain( `Hello.ts(2,10): error TS2339: Property 'push' does not exist on type`, ); expect(result.stderr).toContain( `Hello.ts(13,10): error TS2339: Property 'unexcuted' does not exist on type 'Hello`, ); }); it('should only show errors for the file which matches the enableTsDiagnostics regex', () => { const result = runJest('../ts-diagnostics-regex', ['--no-cache']); expect(result.stderr).toContain( `__tests__/Hello-should-diagnose.ts(2,12): error TS2339: Property 'push' does not exist on type`, ); expect(result.stderr).toContain( `__tests__/Hello-should-diagnose.ts(13,12): error TS2339: Property 'unexcuted' does not exist on type 'Hello`, ); expect(result.stderr).not.toContain(`Hello-should-NOT-diagnose.ts`); }); });
Add test for the previous change
Add test for the previous change
TypeScript
mit
kulshekhar/ts-jest,kulshekhar/ts-jest
--- +++ @@ -10,4 +10,16 @@ `Hello.ts(13,10): error TS2339: Property 'unexcuted' does not exist on type 'Hello`, ); }); + + it('should only show errors for the file which matches the enableTsDiagnostics regex', () => { + const result = runJest('../ts-diagnostics-regex', ['--no-cache']); + expect(result.stderr).toContain( + `__tests__/Hello-should-diagnose.ts(2,12): error TS2339: Property 'push' does not exist on type`, + ); + expect(result.stderr).toContain( + `__tests__/Hello-should-diagnose.ts(13,12): error TS2339: Property 'unexcuted' does not exist on type 'Hello`, + ); + + expect(result.stderr).not.toContain(`Hello-should-NOT-diagnose.ts`); + }); });
07425d786a6ee1425c55cee28b5f7294477aa62f
DeezerToolBar/content_scripts/actions.ts
DeezerToolBar/content_scripts/actions.ts
"use strict"; browser.runtime.onMessage.addListener(execute); function execute(request, sender, callback) { switch (request.execute) { case 'Play': case "PlayPause": let pp = document.querySelector('.player-controls .svg-icon-play, .player-controls .svg-icon-pause'); pp.parentElement.click(); break; case 'Playlist': let openPlaylist = <HTMLElement>document.querySelector( '.player-options .queuelist' ); if (openPlaylist !== null) openPlaylist.click(); break; case 'Next': case "NextTrack": let n = document.querySelector('.player-controls .svg-icon-next'); n.parentElement.click(); break; case 'Prev': case "PrevTrack": let p = document.querySelector('.player-controls .svg-icon-prev'); p.parentElement.click(); break; case 'Like': case 'Statuses': SetStatuses(request, callback); break; default: document.body.innerText = request.execute; break; } } function SetStatuses(request, callback) { let like = document.querySelector( '.track-actions .svg-icon-love-outline, .queuelist-cover-actions .svg-icon-love-outline' ); var status = like.classList.value.indexOf('is-active') !== -1; if (request.execute === "Like") { like.parentElement.click(); status = !status; } let elt = document.querySelector('.marquee-content'); if (callback !== null) callback({ status, playing: elt.textContent }); else console.debug("Callback is null"); }
"use strict"; browser.runtime.onMessage.addListener(execute); function execute(request, sender, callback) { switch (request.execute) { case 'Play': case "PlayPause": let pp = document.querySelector('.player-controls').childNodes[0]; pp.childNodes[2].childNodes[0].click(); break; case 'Playlist': let openPlaylist = <HTMLElement>document.querySelector( '.player-options .queuelist' ); if (openPlaylist !== null) openPlaylist.click(); break; case 'Next': case "NextTrack": let n = document.querySelector('.player-controls').childNodes[0]; n.childNodes[4].childNodes[0].click(); break; case 'Prev': case "PrevTrack": let p = document.querySelector('.player-controls').childNodes[0]; p.childNodes[0].childNodes[0].click(); break; case 'Like': case 'Statuses': SetStatuses(request, callback); break; default: document.body.innerText = request.execute; break; } } function SetStatuses(request, callback) { let like = document.querySelectorAll('.track-actions').childNodes[0]; var status = like.classList.value.indexOf('is-active') !== -1; if (request.execute === "Like") { like.childNodes[2].click(); status = !status; } let elt = document.querySelector('.marquee-content'); if (callback !== null) callback({ status, playing: elt.textContent }); else console.debug("Callback is null"); }
Update action.ts to adapt current deezer layout.
Update action.ts to adapt current deezer layout. Like status not any more accessible
TypeScript
mit
Chowbi/DeeToolBar,Chowbi/DeeToolBar
--- +++ @@ -7,8 +7,8 @@ switch (request.execute) { case 'Play': case "PlayPause": - let pp = document.querySelector('.player-controls .svg-icon-play, .player-controls .svg-icon-pause'); - pp.parentElement.click(); + let pp = document.querySelector('.player-controls').childNodes[0]; + pp.childNodes[2].childNodes[0].click(); break; case 'Playlist': let openPlaylist = <HTMLElement>document.querySelector( @@ -19,13 +19,13 @@ break; case 'Next': case "NextTrack": - let n = document.querySelector('.player-controls .svg-icon-next'); - n.parentElement.click(); + let n = document.querySelector('.player-controls').childNodes[0]; + n.childNodes[4].childNodes[0].click(); break; case 'Prev': case "PrevTrack": - let p = document.querySelector('.player-controls .svg-icon-prev'); - p.parentElement.click(); + let p = document.querySelector('.player-controls').childNodes[0]; + p.childNodes[0].childNodes[0].click(); break; case 'Like': case 'Statuses': @@ -38,12 +38,10 @@ } function SetStatuses(request, callback) { - let like = document.querySelector( - '.track-actions .svg-icon-love-outline, .queuelist-cover-actions .svg-icon-love-outline' - ); + let like = document.querySelectorAll('.track-actions').childNodes[0]; var status = like.classList.value.indexOf('is-active') !== -1; if (request.execute === "Like") { - like.parentElement.click(); + like.childNodes[2].click(); status = !status; }
f81cd287bd71c6b4bb693d7a6fa523824deeffcf
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, PureComponent, Component} from 'react' class DefaultError extends PureComponent { public render() { return ( <p className="error"> A Chronograf error has occurred. Please report the issue&nbsp; <a href="https://github.com/influxdata/chronograf/issues">here</a>. </p> ) } } export function ErrorHandlingWith( Error: ComponentClass, 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"> A Chronograf error has occurred. Please report the issue&nbsp; <a href="https://github.com/influxdata/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)
Swap default error to be a Component instead of PureComponent
Swap default error to be a Component instead of PureComponent
TypeScript
mit
influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,influxdata/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,li-ang/influxdb,nooproblem/influxdb,li-ang/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,nooproblem/influxdb
--- +++ @@ -3,9 +3,9 @@ tslint:disable max-classes-per-file */ -import React, {ComponentClass, PureComponent, Component} from 'react' +import React, {ComponentClass, Component} from 'react' -class DefaultError extends PureComponent { +class DefaultError extends Component { public render() { return ( <p className="error"> @@ -17,7 +17,7 @@ } export function ErrorHandlingWith( - Error: ComponentClass, + 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>}>(
d0578030e8fce16edc11734dc2a0f9a64b21516e
src/components/type/type.mapper.ts
src/components/type/type.mapper.ts
import { Type } from './type.model'; import { ItemTemplate } from '@core/game_master/gameMaster'; import { Util } from '@util'; import APP_SETTINGS from '@settings/app'; export class TypeMapper { public static Map(rawType: ItemTemplate): Type { let type: Type = new Type(); type.id = rawType.templateId; type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', '')); type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => { return { id: pokemonType.id, attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex] }}); return type; } }
import { Type } from './type.model'; import { ItemTemplate } from '@core/game_master/gameMaster'; import { Util } from '@util'; import APP_SETTINGS from '@settings/app'; export class TypeMapper { public static Map(rawType: ItemTemplate): Type { let type: Type = new Type(); type.id = rawType.templateId; type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', '')); type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => ({ id: pokemonType.id, attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex] })); return type; } }
Add type.json - Code style changes
Add type.json - Code style changes
TypeScript
mit
BrunnerLivio/pokemongo-json-pokedex,vfcp/pokemongo-json-pokedex,BrunnerLivio/pokemongo-data-normalizer,BrunnerLivio/pokemongo-json-pokedex,BrunnerLivio/pokemongo-data-normalizer,vfcp/pokemongo-json-pokedex
--- +++ @@ -10,10 +10,10 @@ type.id = rawType.templateId; type.name = Util.SnakeCase2HumanReadable(rawType.templateId.replace('POKEMON_TYPE_', '')); - type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => { return { + type.damage = APP_SETTINGS.POKEMON_TYPES.map((pokemonType, index) => ({ id: pokemonType.id, attackScalar: rawType.typeEffective.attackScalar[pokemonType.attackScalarIndex] - }}); + })); return type; }
447796daeacbe99c3cfe0cae19fbc658f7ebfaf4
source/platforms/git/_tests/local_dangerfile_example.ts
source/platforms/git/_tests/local_dangerfile_example.ts
// This dangerfile is for running as an integration test on CI import { DangerDSLType } from "../../../dsl/DangerDSL" declare var danger: DangerDSLType declare function markdown(params: string): void const showArray = (array: any[], mapFunc?: (any) => any) => { const defaultMap = (a: any) => a const mapper = mapFunc || defaultMap return `\n - ${array.map(mapper).join("\n - ")}\n` } const git = danger.git const goAsync = async () => { const firstFileDiff = await git.diffForFile(git.modified_files[0]) const firstJSONFile = git.modified_files.find(f => f.endsWith("json")) const jsonDiff = firstJSONFile && (await git.JSONDiffForFile(firstJSONFile)) markdown(` created: ${showArray(git.created_files)} modified: ${showArray(git.modified_files)} deleted: ${showArray(git.deleted_files)} commits: ${git.commits.length} messages: ${showArray(git.commits, c => c.message)} diffForFile keys:${showArray(Object.keys(firstFileDiff))} jsonDiff keys:${showArray(Object.keys(jsonDiff))} `) } goAsync()
// This dangerfile is for running as an integration test on CI import { DangerDSLType } from "../../../dsl/DangerDSL" declare var danger: DangerDSLType declare function markdown(params: string): void const showArray = (array: any[], mapFunc?: (any) => any) => { const defaultMap = (a: any) => a const mapper = mapFunc || defaultMap return `\n - ${array.map(mapper).join("\n - ")}\n` } const git = danger.git const goAsync = async () => { const firstFileDiff = await git.diffForFile(git.modified_files[0]) const firstJSONFile = git.modified_files.find(f => f.endsWith("json")) const jsonDiff = firstJSONFile && (await git.JSONDiffForFile(firstJSONFile)) const jsonDiffKeys = jsonDiff && showArray(Object.keys(jsonDiff)) markdown(` created: ${showArray(git.created_files)} modified: ${showArray(git.modified_files)} deleted: ${showArray(git.deleted_files)} commits: ${git.commits.length} messages: ${showArray(git.commits, c => c.message)} diffForFile keys:${showArray(Object.keys(firstFileDiff))} jsonDiff keys:${jsonDiffKeys || "no JSON files in the diff"} `) } goAsync()
Fix the example dangerfile to not crash if no JSON files are in the PR
Fix the example dangerfile to not crash if no JSON files are in the PR
TypeScript
mit
danger/danger-js,danger/danger-js,danger/danger-js,danger/danger-js
--- +++ @@ -16,6 +16,7 @@ const firstFileDiff = await git.diffForFile(git.modified_files[0]) const firstJSONFile = git.modified_files.find(f => f.endsWith("json")) const jsonDiff = firstJSONFile && (await git.JSONDiffForFile(firstJSONFile)) + const jsonDiffKeys = jsonDiff && showArray(Object.keys(jsonDiff)) markdown(` created: ${showArray(git.created_files)} @@ -24,7 +25,7 @@ commits: ${git.commits.length} messages: ${showArray(git.commits, c => c.message)} diffForFile keys:${showArray(Object.keys(firstFileDiff))} -jsonDiff keys:${showArray(Object.keys(jsonDiff))} +jsonDiff keys:${jsonDiffKeys || "no JSON files in the diff"} `) } goAsync()
dbc0050a9218034e47dae38a72747c4bd270cd32
Presentation.Web/Tests/home.e2e.spec.ts
Presentation.Web/Tests/home.e2e.spec.ts
module Kitos.Tests.e2e.Home { class KitosHomePage { emailInput; constructor() { this.emailInput = element(by.model('email')); } get(): void { browser.get('https://localhost:44300'); } get email(): string { return this.emailInput.getText(); } set email(value: string) { this.emailInput.sendKeys(value); } } describe('home view', () => { var homePage; beforeEach(() => { homePage = new KitosHomePage(); homePage.get(); }); it('should mark invalid email in field', () => { // arrange var emailField = homePage.emailInput; // act homePage.email = 'some invalid email'; // assert expect(emailField.getAttribute('class')).toMatch('ng-invalid'); }); it('should mark valid email in field', () => { // arrange var emailField = homePage.emailInput; // act homePage.email = '[email protected]'; // assert expect(emailField.getAttribute('class')).toMatch('ng-valid'); }); }); }
module Kitos.Tests.e2e.Home { class KitosHomePage { emailInput; constructor() { this.emailInput = element(by.model('email')); } get(): void { browser.get('https://localhost:44300'); } get email(): string { return this.emailInput.getText(); } set email(value: string) { this.emailInput.sendKeys(value); } } describe('home view', () => { jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000; console.log("jasmine timeout: " + jasmine.DEFAULT_TIMEOUT_INTERVAL); var homePage; beforeEach(() => { homePage = new KitosHomePage(); homePage.get(); }); it('should mark invalid email in field', () => { // arrange var emailField = homePage.emailInput; // act homePage.email = 'some invalid email'; // assert expect(emailField.getAttribute('class')).toMatch('ng-invalid'); }); it('should mark valid email in field', () => { // arrange var emailField = homePage.emailInput; // act homePage.email = '[email protected]'; // assert expect(emailField.getAttribute('class')).toMatch('ng-valid'); }); }); }
Set jasmine timeout to 90 seconds.
Set jasmine timeout to 90 seconds.
TypeScript
mpl-2.0
os2kitos/kitos,miracle-as/kitos,os2kitos/kitos,os2kitos/kitos,miracle-as/kitos,miracle-as/kitos,miracle-as/kitos,os2kitos/kitos
--- +++ @@ -20,6 +20,9 @@ } describe('home view', () => { + jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000; + console.log("jasmine timeout: " + jasmine.DEFAULT_TIMEOUT_INTERVAL); + var homePage; beforeEach(() => {
397ff23a3038c1acd339e4ff23963574b037c1a9
console/src/app/core/mongoose-run-status.ts
console/src/app/core/mongoose-run-status.ts
export enum MongooseRunStatus { // NOTE: "All" status is used to match every existing Mongoose Run Record. // It's being used in filter purposes. All = "All", Finished = "Finished", Unavailable = "Unavailable", Running = "Running", }
export enum MongooseRunStatus { // NOTE: "All" status is used to match every existing Mongoose Run Record. // It's being used in filter purposes. All = "All", Undefined = "Undefined", Finished = "Finished", Unavailable = "Unavailable", Running = "Running", }
Add 'undefined' options for Mongose run status.
Add 'undefined' options for Mongose run status.
TypeScript
mit
emc-mongoose/console,emc-mongoose/console,emc-mongoose/console
--- +++ @@ -3,7 +3,7 @@ // NOTE: "All" status is used to match every existing Mongoose Run Record. // It's being used in filter purposes. All = "All", - + Undefined = "Undefined", Finished = "Finished", Unavailable = "Unavailable", Running = "Running",
f054dfed3df3eeb2e89163266fe78cafa4edc810
src/lib/Components/Inbox/Bids/index.tsx
src/lib/Components/Inbox/Bids/index.tsx
import * as React from "react" import * as Relay from "react-relay" import styled from "styled-components/native" import { View } from "react-native" import { LargeHeadline } from "../Typography" import ActiveBid from "./ActiveBid" const Container = styled.View`margin: 20px 0 40px;` class ActiveBids extends React.Component<RelayProps, null> { hasContent() { if (!this.props.me) { return false } return this.props.me.lot_standings.length > 0 } renderRows() { const me = this.props.me || { lot_standings: [] } const bids = me.lot_standings.map(bidData => { return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids } render() { return this.hasContent() ? <Container> <LargeHeadline>Active Bids</LargeHeadline> {this.renderRows()} </Container> : null } } export default Relay.createContainer(ActiveBids, { fragments: { me: () => Relay.QL` fragment on Me { lot_standings(active_positions: true) { active_bid { __id } ${ActiveBid.getFragment("bid")} } } `, }, }) interface RelayProps { me: { lot_standings: Array<{ active_bid: { __id: string } | null } | null> | null } }
import * as React from "react" import * as Relay from "react-relay" import styled from "styled-components/native" import { View } from "react-native" import { LargeHeadline } from "../Typography" import ActiveBid from "./ActiveBid" const Container = styled.View`margin: 20px 0 40px;` class ActiveBids extends React.Component<RelayProps, null> { hasContent() { return this.props.me.lot_standings.length > 0 } renderRows() { const bids = this.props.me.lot_standings.map(bidData => { return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids } render() { return this.hasContent() ? <Container> <LargeHeadline>Active Bids</LargeHeadline> {this.renderRows()} </Container> : null } } export default Relay.createContainer(ActiveBids, { fragments: { me: () => Relay.QL` fragment on Me { lot_standings(active_positions: true) { active_bid { __id } ${ActiveBid.getFragment("bid")} } } `, }, }) interface RelayProps { me: { lot_standings: Array<{ active_bid: { __id: string } | null } | null> | null } }
Remove code that deals with staging details.
[Bids] Remove code that deals with staging details. Guards around the user possibly having been removed after the weekly sync.
TypeScript
mit
artsy/eigen,artsy/emission,artsy/eigen,artsy/eigen,artsy/eigen,artsy/eigen,artsy/emission,artsy/emission,artsy/emission,artsy/eigen,artsy/emission,artsy/emission,artsy/emission,artsy/eigen
--- +++ @@ -10,15 +10,11 @@ class ActiveBids extends React.Component<RelayProps, null> { hasContent() { - if (!this.props.me) { - return false - } return this.props.me.lot_standings.length > 0 } renderRows() { - const me = this.props.me || { lot_standings: [] } - const bids = me.lot_standings.map(bidData => { + const bids = this.props.me.lot_standings.map(bidData => { return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids
647a0d83ce9404ac2cda3a11916aba3b0c408cf0
packages/rev-ui-materialui/src/index.ts
packages/rev-ui-materialui/src/index.ts
import { UI_COMPONENTS } from 'rev-ui/lib/config'; import { MUIListView } from './views/MUIListView'; import { MUIDetailView } from './views/MUIDetailView'; import { MUITextField } from './fields/MUITextField'; import { MUIActionButton } from './actions/MUIActionButton'; export function registerComponents() { UI_COMPONENTS.views.ListView = MUIListView; UI_COMPONENTS.views.DetailView = MUIDetailView; UI_COMPONENTS.actions.PostAction = MUIActionButton; UI_COMPONENTS.actions.SaveAction = MUIActionButton; UI_COMPONENTS.fields.DateField = MUITextField; UI_COMPONENTS.fields.TimeField = MUITextField; UI_COMPONENTS.fields.DateTimeField = MUITextField; UI_COMPONENTS.fields.IntegerField = MUITextField; UI_COMPONENTS.fields.NumberField = MUITextField; UI_COMPONENTS.fields.BooleanField = MUITextField; UI_COMPONENTS.fields.SelectField = MUITextField; UI_COMPONENTS.fields.EmailField = MUITextField; UI_COMPONENTS.fields.URLField = MUITextField; UI_COMPONENTS.fields.PasswordField = MUITextField; UI_COMPONENTS.fields.TextField = MUITextField; }
import { UI_COMPONENTS } from 'rev-ui/lib/config'; import { MUIListView } from './views/MUIListView'; import { MUIDetailView } from './views/MUIDetailView'; import { MUITextField } from './fields/MUITextField'; import { MUIActionButton } from './actions/MUIActionButton'; export function registerComponents() { UI_COMPONENTS.views.ListView = MUIListView; UI_COMPONENTS.views.DetailView = MUIDetailView; UI_COMPONENTS.actions.PostAction = MUIActionButton; UI_COMPONENTS.actions.SaveAction = MUIActionButton; UI_COMPONENTS.actions.RemoveAction = MUIActionButton; UI_COMPONENTS.fields.DateField = MUITextField; UI_COMPONENTS.fields.TimeField = MUITextField; UI_COMPONENTS.fields.DateTimeField = MUITextField; UI_COMPONENTS.fields.IntegerField = MUITextField; UI_COMPONENTS.fields.NumberField = MUITextField; UI_COMPONENTS.fields.BooleanField = MUITextField; UI_COMPONENTS.fields.SelectField = MUITextField; UI_COMPONENTS.fields.EmailField = MUITextField; UI_COMPONENTS.fields.URLField = MUITextField; UI_COMPONENTS.fields.PasswordField = MUITextField; UI_COMPONENTS.fields.TextField = MUITextField; }
Add <RemoveAction /> MUI component
Add <RemoveAction /> MUI component
TypeScript
mit
RevFramework/rev-framework,RevFramework/rev-framework
--- +++ @@ -12,6 +12,7 @@ UI_COMPONENTS.actions.PostAction = MUIActionButton; UI_COMPONENTS.actions.SaveAction = MUIActionButton; + UI_COMPONENTS.actions.RemoveAction = MUIActionButton; UI_COMPONENTS.fields.DateField = MUITextField; UI_COMPONENTS.fields.TimeField = MUITextField;
f9ead9582e75b95710f188a0d71415c7a248f712
src/core/base/value-accessor-provider.ts
src/core/base/value-accessor-provider.ts
/* MIT License Copyright (c) 2017 Temainfo Sistemas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { forwardRef } from '@angular/core'; export function MakeProvider( type: any) { return { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => type), multi: true }; }
/* MIT License Copyright (c) 2017 Temainfo Sistemas Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { forwardRef } from '@angular/core'; export function MakeProvider( type: any): any { return { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => type), multi: true }; }
Fix return of the function MakeProvider broking build.
fix(value-acessor-provider): Fix return of the function MakeProvider broking build.
TypeScript
mit
TemainfoSistemas/truly-ui,TemainfoSistemas/truly-ui,TemainfoSistemas/truly-ui
--- +++ @@ -22,7 +22,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { forwardRef } from '@angular/core'; -export function MakeProvider( type: any) { +export function MakeProvider( type: any): any { return { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => type),
c6cb5040770ca4f93ab88667e874190b19dbd8ed
lib/components/Layout.tsx
lib/components/Layout.tsx
import React from "react"; import Head from "./Head"; import Header from "./Header"; import Footer from "./Footer"; import Cookiescript from "./Cookiescript"; const Layout = ({ title = "drublic - Engineering Management & Software Architecture - Hans Christian Reinl, Cologne", description = `Engineering Management & Software Architecture, Hans Christian Reinl - Working Draft, Node.js, React, CSS, JavaScript & Agile`, image, children, }) => { return ( <> <Head title={`${title} - Engineering Management & Software Architecture - Hans Christian Reinl, Cologne `} description={description} image={image} /> <div dangerouslySetInnerHTML={{ __html: ` <script async src="https://www.googletagmanager.com/gtag/js?id=UA-41497561-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-41497561-1'); </script>`, }} /> <Header /> {children} <Footer /> <Cookiescript /> </> ); }; export default Layout;
import React from "react"; import Head from "./Head"; import Header from "./Header"; import Footer from "./Footer"; import Cookiescript from "./Cookiescript"; const Layout = ({ title = "drublic - Engineering Management & Software Architecture - Hans Christian Reinl, Cologne", description = `Engineering Management & Software Architecture, Hans Christian Reinl - Working Draft, Node.js, React, CSS, JavaScript & Agile`, image = undefined, children, }) => { return ( <> <Head title={`${title} - Engineering Management & Software Architecture - Hans Christian Reinl, Cologne `} description={description} image={image} /> <div dangerouslySetInnerHTML={{ __html: ` <script async src="https://www.googletagmanager.com/gtag/js?id=UA-41497561-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-41497561-1'); </script>`, }} /> <Header /> {children} <Footer /> <Cookiescript /> </> ); }; export default Layout;
Fix default image in layout
Fix default image in layout
TypeScript
mit
drublic/vc,drublic/vc,drublic/vc
--- +++ @@ -7,7 +7,7 @@ const Layout = ({ title = "drublic - Engineering Management & Software Architecture - Hans Christian Reinl, Cologne", description = `Engineering Management & Software Architecture, Hans Christian Reinl - Working Draft, Node.js, React, CSS, JavaScript & Agile`, - image, + image = undefined, children, }) => { return (
748fb92d4a23890717af4375f83a787391dc09f2
angular-typescript-webpack-jasmine/src/modules/tweets/angular/components/tweetSidebar/TweetSidebarComponent.ts
angular-typescript-webpack-jasmine/src/modules/tweets/angular/components/tweetSidebar/TweetSidebarComponent.ts
import {SidebarModel} from "../../../core/models/impl/SidebarModel"; import {SharedModel} from "../../../core/models/impl/SharedModel"; export class TweetSidebarComponent implements ng.IComponentOptions { public template: string = ` <div ng-class="{'sidebar-collapsed': $ctrl.sharedModel.sidebarCollapsed}"> <div> <i ng-click="$ctrl.toggleCollapsed()" class="fa dp-collapse dp-collapse-right" ng-class="{'fa-chevron-left': !$ctrl.sharedModel.sidebarCollapsed, 'fa-chevron-right': $ctrl.sharedModel.sidebarCollapsed}"></i> <div class="collapsed-content"> <h2>Starred tweets</h2> <p>Here we have an overview of our starred tweets</p> <div ng-repeat="tweet in $ctrl.model.tweets" ng-if="tweet.starred"> {{::tweet.user}} has tweeted {{::tweet.content}} </div> </div> </div> </div> `; public controller: any = TweetSidebarController; } export class TweetSidebarController { public static $inject: Array<string> = ["SidebarModel", "SharedModel"]; constructor(public model: SidebarModel, public sharedModel: SharedModel) { } public toggleCollapsed(): void { this.model.toggleCollapsed(); } }
import {SidebarModel} from "../../../core/models/impl/SidebarModel"; import {SharedModel} from "../../../core/models/impl/SharedModel"; export class TweetSidebarComponent implements ng.IComponentOptions { public template: string = ` <div ng-class="{'sidebar-collapsed': $ctrl.sharedModel.sidebarCollapsed}"> <div> <i ng-click="$ctrl.toggleCollapsed()" class="fa dp-collapse dp-collapse-right" ng-class="{'fa-chevron-left': !$ctrl.sharedModel.sidebarCollapsed, 'fa-chevron-right': $ctrl.sharedModel.sidebarCollapsed}"></i> <div class="collapsed-content"> <h2>Starred tweets</h2> <p>Here we have an overview of our starred tweets</p> <div ng-repeat="tweet in $ctrl.model.tweets" ng-if="tweet.starred"> {{::tweet.user}} has tweeted {{::tweet.content}} </div> </div> </div> </div> `; public controller: any = TweetSidebarController; } export class TweetSidebarController { public static $inject: Array<string> = ["SidebarModel", "SharedModel"]; constructor(public model: SidebarModel, public sharedModel: SharedModel) { } public toggleCollapsed(): void { this.model.toggleCollapsed(); } }
Delete useless trailing white spaces
Delete useless trailing white spaces
TypeScript
mit
var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training
--- +++ @@ -5,7 +5,7 @@ <div ng-class="{'sidebar-collapsed': $ctrl.sharedModel.sidebarCollapsed}"> <div> <i ng-click="$ctrl.toggleCollapsed()" class="fa dp-collapse dp-collapse-right" - ng-class="{'fa-chevron-left': !$ctrl.sharedModel.sidebarCollapsed, + ng-class="{'fa-chevron-left': !$ctrl.sharedModel.sidebarCollapsed, 'fa-chevron-right': $ctrl.sharedModel.sidebarCollapsed}"></i> <div class="collapsed-content"> <h2>Starred tweets</h2>
6bd61885e45f54c62be8a45171ffba4154873f1e
app/src/main-process/menu/menu-event.ts
app/src/main-process/menu/menu-event.ts
export type MenuEvent = 'push' | 'pull' | 'select-changes' | 'select-history' | 'add-local-repository' | 'create-branch' | 'show-branches' | 'remove-repository' | 'add-repository' | 'rename-branch' | 'delete-branch' | 'check-for-updates' | 'quit-and-install-update' | 'show-preferences' | 'choose-repository' | 'open-working-directory' | 'update-branch' | 'merge-branch'
export type MenuEvent = 'push' | 'pull' | 'select-changes' | 'select-history' | 'add-local-repository' | 'create-branch' | 'show-branches' | 'remove-repository' | 'add-repository' | 'rename-branch' | 'delete-branch' | 'check-for-updates' | 'quit-and-install-update' | 'show-preferences' | 'choose-repository' | 'open-working-directory' | 'update-branch' | 'merge-branch' | 'show-repository-settings'
Add show repo settings menu event
Add show repo settings menu event
TypeScript
mit
kactus-io/kactus,BugTesterTest/desktops,say25/desktop,kactus-io/kactus,hjobrien/desktop,BugTesterTest/desktops,artivilla/desktop,gengjiawen/desktop,artivilla/desktop,j-f1/forked-desktop,desktop/desktop,kactus-io/kactus,BugTesterTest/desktops,BugTesterTest/desktops,artivilla/desktop,shiftkey/desktop,artivilla/desktop,desktop/desktop,j-f1/forked-desktop,desktop/desktop,shiftkey/desktop,kactus-io/kactus,hjobrien/desktop,gengjiawen/desktop,say25/desktop,gengjiawen/desktop,shiftkey/desktop,gengjiawen/desktop,desktop/desktop,j-f1/forked-desktop,j-f1/forked-desktop,say25/desktop,shiftkey/desktop,say25/desktop,hjobrien/desktop,hjobrien/desktop
--- +++ @@ -16,4 +16,5 @@ 'choose-repository' | 'open-working-directory' | 'update-branch' | - 'merge-branch' + 'merge-branch' | + 'show-repository-settings'
4a94f9148f04d299433a2e72e1633fa0fbb76150
src/vs/languages/php/common/php.contribution.ts
src/vs/languages/php/common/php.contribution.ts
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry'; ModesRegistry.registerCompatMode({ id: 'php', extensions: ['.php', '.phtml', '.ctp'], aliases: ['PHP', 'php'], mimetypes: ['application/x-php'], moduleId: 'vs/languages/php/common/php', ctorName: 'PHPMode' });
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry'; ModesRegistry.registerCompatMode({ id: 'php', extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'], aliases: ['PHP', 'php'], mimetypes: ['application/x-php'], moduleId: 'vs/languages/php/common/php', ctorName: 'PHPMode' });
Add `.php4` and `.php5` as extensions
Languages: Add `.php4` and `.php5` as extensions I am not responsible of this stup*d*t* but unfortunately these extensions are very common…
TypeScript
mit
DustinCampbell/vscode,eklavyamirani/vscode,microlv/vscode,radshit/vscode,0xmohit/vscode,williamcspace/vscode,veeramarni/vscode,DustinCampbell/vscode,ioklo/vscode,gagangupt16/vscode,gagangupt16/vscode,charlespierce/vscode,williamcspace/vscode,veeramarni/vscode,ioklo/vscode,Krzysztof-Cieslak/vscode,landonepps/vscode,sifue/vscode,microsoft/vscode,eklavyamirani/vscode,zyml/vscode,Zalastax/vscode,sifue/vscode,microlv/vscode,jchadwick/vscode,f111fei/vscode,radshit/vscode,bsmr-x-script/vscode,stringham/vscode,Krzysztof-Cieslak/vscode,sifue/vscode,veeramarni/vscode,veeramarni/vscode,matthewshirley/vscode,Microsoft/vscode,gagangupt16/vscode,eamodio/vscode,stringham/vscode,microlv/vscode,landonepps/vscode,zyml/vscode,veeramarni/vscode,eklavyamirani/vscode,0xmohit/vscode,rishii7/vscode,Microsoft/vscode,ioklo/vscode,rishii7/vscode,eamodio/vscode,landonepps/vscode,microlv/vscode,zyml/vscode,gagangupt16/vscode,veeramarni/vscode,eamodio/vscode,KattMingMing/vscode,bsmr-x-script/vscode,cleidigh/vscode,rishii7/vscode,Microsoft/vscode,the-ress/vscode,charlespierce/vscode,joaomoreno/vscode,zyml/vscode,hoovercj/vscode,microlv/vscode,williamcspace/vscode,stringham/vscode,microsoft/vscode,gagangupt16/vscode,hungys/vscode,ioklo/vscode,0xmohit/vscode,stringham/vscode,zyml/vscode,matthewshirley/vscode,mjbvz/vscode,charlespierce/vscode,f111fei/vscode,Krzysztof-Cieslak/vscode,0xmohit/vscode,cleidigh/vscode,KattMingMing/vscode,Krzysztof-Cieslak/vscode,radshit/vscode,bsmr-x-script/vscode,DustinCampbell/vscode,veeramarni/vscode,williamcspace/vscode,0xmohit/vscode,radshit/vscode,Microsoft/vscode,joaomoreno/vscode,jchadwick/vscode,rishii7/vscode,the-ress/vscode,edumunoz/vscode,stringham/vscode,charlespierce/vscode,microsoft/vscode,williamcspace/vscode,matthewshirley/vscode,bsmr-x-script/vscode,eamodio/vscode,gagangupt16/vscode,cleidigh/vscode,hungys/vscode,veeramarni/vscode,0xmohit/vscode,landonepps/vscode,charlespierce/vscode,sifue/vscode,bsmr-x-script/vscode,cleidigh/vscode,ups216/vscode,williamcspace/vscode,matthewshirley/vscode,landonepps/vscode,ioklo/vscode,rishii7/vscode,edumunoz/vscode,f111fei/vscode,hoovercj/vscode,alexandrudima/vscode,microsoft/vscode,gagangupt16/vscode,rishii7/vscode,landonepps/vscode,DustinCampbell/vscode,microsoft/vscode,joaomoreno/vscode,jchadwick/vscode,cleidigh/vscode,mjbvz/vscode,zyml/vscode,0xmohit/vscode,edumunoz/vscode,radshit/vscode,0xmohit/vscode,edumunoz/vscode,zyml/vscode,sifue/vscode,edumunoz/vscode,DustinCampbell/vscode,DustinCampbell/vscode,f111fei/vscode,hashhar/vscode,Microsoft/vscode,williamcspace/vscode,microlv/vscode,microlv/vscode,ups216/vscode,microlv/vscode,eamodio/vscode,bsmr-x-script/vscode,mjbvz/vscode,Microsoft/vscode,hoovercj/vscode,the-ress/vscode,hungys/vscode,williamcspace/vscode,DustinCampbell/vscode,jchadwick/vscode,mjbvz/vscode,the-ress/vscode,hoovercj/vscode,microsoft/vscode,eamodio/vscode,rishii7/vscode,hashhar/vscode,radshit/vscode,charlespierce/vscode,charlespierce/vscode,ups216/vscode,charlespierce/vscode,rishii7/vscode,edumunoz/vscode,hashhar/vscode,ups216/vscode,jchadwick/vscode,edumunoz/vscode,zyml/vscode,eamodio/vscode,Zalastax/vscode,jchadwick/vscode,Microsoft/vscode,KattMingMing/vscode,stringham/vscode,eklavyamirani/vscode,cleidigh/vscode,jchadwick/vscode,williamcspace/vscode,charlespierce/vscode,Krzysztof-Cieslak/vscode,stringham/vscode,mjbvz/vscode,microsoft/vscode,hashhar/vscode,radshit/vscode,gagangupt16/vscode,jchadwick/vscode,jchadwick/vscode,zyml/vscode,charlespierce/vscode,gagangupt16/vscode,f111fei/vscode,f111fei/vscode,veeramarni/vscode,williamcspace/vscode,KattMingMing/vscode,ups216/vscode,hoovercj/vscode,williamcspace/vscode,sifue/vscode,radshit/vscode,cleidigh/vscode,0xmohit/vscode,stringham/vscode,alexandrudima/vscode,eklavyamirani/vscode,sifue/vscode,microlv/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,bsmr-x-script/vscode,williamcspace/vscode,sifue/vscode,ioklo/vscode,landonepps/vscode,sifue/vscode,joaomoreno/vscode,f111fei/vscode,0xmohit/vscode,Krzysztof-Cieslak/vscode,jchadwick/vscode,radshit/vscode,jchadwick/vscode,radshit/vscode,veeramarni/vscode,radshit/vscode,mjbvz/vscode,ups216/vscode,eamodio/vscode,hashhar/vscode,eklavyamirani/vscode,bsmr-x-script/vscode,gagangupt16/vscode,KattMingMing/vscode,rkeithhill/VSCode,microsoft/vscode,landonepps/vscode,landonepps/vscode,matthewshirley/vscode,radshit/vscode,ioklo/vscode,ups216/vscode,charlespierce/vscode,Microsoft/vscode,microsoft/vscode,hashhar/vscode,hungys/vscode,landonepps/vscode,zyml/vscode,veeramarni/vscode,the-ress/vscode,matthewshirley/vscode,joaomoreno/vscode,veeramarni/vscode,ioklo/vscode,the-ress/vscode,hoovercj/vscode,Microsoft/vscode,jchadwick/vscode,bsmr-x-script/vscode,hashhar/vscode,cleidigh/vscode,hungys/vscode,hashhar/vscode,DustinCampbell/vscode,Zalastax/vscode,williamcspace/vscode,eklavyamirani/vscode,cleidigh/vscode,Microsoft/vscode,hashhar/vscode,sifue/vscode,zyml/vscode,hungys/vscode,microlv/vscode,hungys/vscode,hungys/vscode,williamcspace/vscode,matthewshirley/vscode,matthewshirley/vscode,eamodio/vscode,eamodio/vscode,Zalastax/vscode,hashhar/vscode,edumunoz/vscode,Zalastax/vscode,sifue/vscode,Zalastax/vscode,DustinCampbell/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,ioklo/vscode,microsoft/vscode,bsmr-x-script/vscode,0xmohit/vscode,eklavyamirani/vscode,DustinCampbell/vscode,eklavyamirani/vscode,eamodio/vscode,bsmr-x-script/vscode,matthewshirley/vscode,DustinCampbell/vscode,hungys/vscode,Krzysztof-Cieslak/vscode,matthewshirley/vscode,jchadwick/vscode,hoovercj/vscode,eklavyamirani/vscode,joaomoreno/vscode,KattMingMing/vscode,hashhar/vscode,microsoft/vscode,Zalastax/vscode,eamodio/vscode,sifue/vscode,the-ress/vscode,joaomoreno/vscode,f111fei/vscode,eklavyamirani/vscode,williamcspace/vscode,f111fei/vscode,f111fei/vscode,zyml/vscode,hashhar/vscode,ups216/vscode,the-ress/vscode,Microsoft/vscode,f111fei/vscode,eamodio/vscode,hungys/vscode,jchadwick/vscode,gagangupt16/vscode,cleidigh/vscode,cleidigh/vscode,zyml/vscode,microsoft/vscode,ioklo/vscode,bsmr-x-script/vscode,veeramarni/vscode,KattMingMing/vscode,microlv/vscode,gagangupt16/vscode,radshit/vscode,cra0zy/VSCode,rishii7/vscode,KattMingMing/vscode,DustinCampbell/vscode,ups216/vscode,hoovercj/vscode,sifue/vscode,stringham/vscode,the-ress/vscode,Microsoft/vscode,joaomoreno/vscode,mjbvz/vscode,0xmohit/vscode,rishii7/vscode,Microsoft/vscode,hoovercj/vscode,eklavyamirani/vscode,0xmohit/vscode,joaomoreno/vscode,0xmohit/vscode,joaomoreno/vscode,zyml/vscode,Zalastax/vscode,joaomoreno/vscode,ioklo/vscode,Krzysztof-Cieslak/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,edumunoz/vscode,KattMingMing/vscode,matthewshirley/vscode,eklavyamirani/vscode,mjbvz/vscode,gagangupt16/vscode,hashhar/vscode,cleidigh/vscode,mjbvz/vscode,Krzysztof-Cieslak/vscode,gagangupt16/vscode,matthewshirley/vscode,radshit/vscode,charlespierce/vscode,bsmr-x-script/vscode,radshit/vscode,jchadwick/vscode,microsoft/vscode,KattMingMing/vscode,Microsoft/vscode,hoovercj/vscode,the-ress/vscode,veeramarni/vscode,the-ress/vscode,edumunoz/vscode,matthewshirley/vscode,stringham/vscode,DustinCampbell/vscode,joaomoreno/vscode,Zalastax/vscode,ups216/vscode,bsmr-x-script/vscode,hungys/vscode,microsoft/vscode,hungys/vscode,charlespierce/vscode,eamodio/vscode,f111fei/vscode,zyml/vscode,hungys/vscode,hungys/vscode,hungys/vscode,Zalastax/vscode,KattMingMing/vscode,Microsoft/vscode,stringham/vscode,mjbvz/vscode,cleidigh/vscode,bsmr-x-script/vscode,veeramarni/vscode,sifue/vscode,DustinCampbell/vscode,0xmohit/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,f111fei/vscode,joaomoreno/vscode,the-ress/vscode,edumunoz/vscode,landonepps/vscode,ioklo/vscode,williamcspace/vscode,edumunoz/vscode,hoovercj/vscode,hoovercj/vscode,the-ress/vscode,f111fei/vscode,Zalastax/vscode,rishii7/vscode,veeramarni/vscode,KattMingMing/vscode,edumunoz/vscode,hungys/vscode,Zalastax/vscode,matthewshirley/vscode,rishii7/vscode,landonepps/vscode,eamodio/vscode,microlv/vscode,edumunoz/vscode,jchadwick/vscode,hoovercj/vscode,hashhar/vscode,ioklo/vscode,Krzysztof-Cieslak/vscode,Zalastax/vscode,ioklo/vscode,charlespierce/vscode,microlv/vscode,stringham/vscode,stringham/vscode,DustinCampbell/vscode,rishii7/vscode,charlespierce/vscode,rishii7/vscode,gagangupt16/vscode,matthewshirley/vscode,KattMingMing/vscode,mjbvz/vscode,rishii7/vscode,hashhar/vscode,zyml/vscode,mjbvz/vscode,KattMingMing/vscode,KattMingMing/vscode,radshit/vscode,stringham/vscode,alexandrudima/vscode,edumunoz/vscode,Krzysztof-Cieslak/vscode,eklavyamirani/vscode,matthewshirley/vscode,mjbvz/vscode,mjbvz/vscode,Zalastax/vscode,DustinCampbell/vscode,veeramarni/vscode,hashhar/vscode,KattMingMing/vscode,charlespierce/vscode,rishii7/vscode,Microsoft/vscode,hoovercj/vscode,the-ress/vscode,DustinCampbell/vscode,microlv/vscode,edumunoz/vscode,Krzysztof-Cieslak/vscode,gagangupt16/vscode,eklavyamirani/vscode,sifue/vscode,ups216/vscode,ups216/vscode,matthewshirley/vscode,zyml/vscode,jchadwick/vscode,landonepps/vscode,0xmohit/vscode,sifue/vscode,Zalastax/vscode,eklavyamirani/vscode,gagangupt16/vscode,hashhar/vscode,hungys/vscode,charlespierce/vscode,stringham/vscode,f111fei/vscode,bsmr-x-script/vscode,KattMingMing/vscode,microlv/vscode,cleidigh/vscode,landonepps/vscode,microsoft/vscode,mjbvz/vscode,cleidigh/vscode,eamodio/vscode,ups216/vscode,joaomoreno/vscode,williamcspace/vscode,stringham/vscode,landonepps/vscode,ioklo/vscode,alexandrudima/vscode,mjbvz/vscode,joaomoreno/vscode,ioklo/vscode,the-ress/vscode,Microsoft/vscode,ups216/vscode,microlv/vscode,rishii7/vscode,Zalastax/vscode,landonepps/vscode,ups216/vscode,ups216/vscode,ups216/vscode,0xmohit/vscode,the-ress/vscode,mjbvz/vscode,cleidigh/vscode,f111fei/vscode,stringham/vscode,Zalastax/vscode,eklavyamirani/vscode,microlv/vscode,landonepps/vscode,microsoft/vscode,radshit/vscode,cleidigh/vscode,hoovercj/vscode,hoovercj/vscode
--- +++ @@ -8,7 +8,7 @@ ModesRegistry.registerCompatMode({ id: 'php', - extensions: ['.php', '.phtml', '.ctp'], + extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'], aliases: ['PHP', 'php'], mimetypes: ['application/x-php'], moduleId: 'vs/languages/php/common/php',
ef199bb2f2bfa6f1da4e486035c511abfe653136
src/config/configSpec.ts
src/config/configSpec.ts
export type ProjectConfig = | string | { path: string; watch?: boolean; compiler?: string; }; export type MtscConfig = { debug?: boolean; watch?: boolean; compiler?: string; projects: ProjectConfig[]; };
// Tsconfig is only allowed for project tslint settings export type TslintCfg = | boolean // Enable tslint? Will search in project specific folder or global tslint file (will search to tslint.json if not provided) | string // Rules file | TslintCfgObject & { // Will search in project specific folder or else in root dir to tsconfig.json if not provided. NOTE: Must be a file name (not a full path). tsconfig?: string; }; export type TslintCfgObject = { // Default value is true enabled?: boolean; // Default value is false autofix?: boolean; // Will search in project specific folder or else in root dir to tslint.json if not provided. NOTE: Must be a file name (not a full path). rulesFile?: string; }; export type ProjectConfig = | string // Project path (doesn't have to be path/tsconfig.json but is recommended) | { // Project path (doesn't have to be path/tsconfig.json but is recommended) path: string; // Watch this project? Default is true, since that is the whole purpose of creating mtsc watch?: boolean; tslint?: TslintCfg; // Path to the executable tsc compiler?: string; }; // Specific settings win from global settings. Global settings can be seen as default settings for each project. export type MtscConfig = { // Use MTSC Debug for extensive logging of what is happening debug?: boolean; // Default: watch project (default value is true) watch?: boolean; // Default: Enabled | Rulesfile | TslintConfigObject tslint?: boolean | string | TslintCfgObject; // Default: Path to the executable tsc compiler?: string; projects: ProjectConfig[]; };
Add tslint options to config + explaination comments
Add tslint options to config + explaination comments
TypeScript
apache-2.0
guidojo/multipleTypescriptCompilers,guidojo/multipleTypescriptCompilers
--- +++ @@ -1,14 +1,42 @@ +// Tsconfig is only allowed for project tslint settings +export type TslintCfg = + | boolean // Enable tslint? Will search in project specific folder or global tslint file (will search to tslint.json if not provided) + | string // Rules file + | TslintCfgObject & { + // Will search in project specific folder or else in root dir to tsconfig.json if not provided. NOTE: Must be a file name (not a full path). + tsconfig?: string; + }; + +export type TslintCfgObject = { + // Default value is true + enabled?: boolean; + // Default value is false + autofix?: boolean; + // Will search in project specific folder or else in root dir to tslint.json if not provided. NOTE: Must be a file name (not a full path). + rulesFile?: string; +}; + export type ProjectConfig = - | string + | string // Project path (doesn't have to be path/tsconfig.json but is recommended) | { + // Project path (doesn't have to be path/tsconfig.json but is recommended) path: string; + // Watch this project? Default is true, since that is the whole purpose of creating mtsc watch?: boolean; + tslint?: TslintCfg; + // Path to the executable tsc compiler?: string; }; +// Specific settings win from global settings. Global settings can be seen as default settings for each project. export type MtscConfig = { + // Use MTSC Debug for extensive logging of what is happening debug?: boolean; + // Default: watch project (default value is true) watch?: boolean; + // Default: Enabled | Rulesfile | TslintConfigObject + tslint?: boolean | string | TslintCfgObject; + // Default: Path to the executable tsc compiler?: string; projects: ProjectConfig[]; };
31e43ef0a838fb057579b8dbd9f998aa53c1a4b8
modules/viewport/index.ts
modules/viewport/index.ts
import * as React from 'react' import {Dimensions} from 'react-native' type WindowDimensions = {width: number; height: number} type Props = { render: (dimensions: WindowDimensions) => React.Node } type State = { viewport: WindowDimensions } export class Viewport extends React.PureComponent<Props, State> { state = { viewport: Dimensions.get('window'), } componentDidMount() { Dimensions.addEventListener('change', this.handleResizeEvent) } componentWillUnmount() { Dimensions.removeEventListener('change', this.handleResizeEvent) } handleResizeEvent = (event: {window: WindowDimensions}) => { this.setState(() => ({viewport: event.window})) } render() { return this.props.render(this.state.viewport) } }
import * as React from 'react' import {Dimensions} from 'react-native' type WindowDimensions = {width: number; height: number} type Props = { render: (dimensions: WindowDimensions) => React.ReactNode } type State = { viewport: WindowDimensions } export class Viewport extends React.PureComponent<Props, State> { state = { viewport: Dimensions.get('window'), } componentDidMount() { Dimensions.addEventListener('change', this.handleResizeEvent) } componentWillUnmount() { Dimensions.removeEventListener('change', this.handleResizeEvent) } handleResizeEvent = (event: {window: WindowDimensions}) => { this.setState(() => ({viewport: event.window})) } render() { return this.props.render(this.state.viewport) } }
Fix up return type (Node -> ReactNode)
m/viewport: Fix up return type (Node -> ReactNode) Signed-off-by: Kristofer Rye <[email protected]>
TypeScript
agpl-3.0
StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native
--- +++ @@ -4,7 +4,7 @@ type WindowDimensions = {width: number; height: number} type Props = { - render: (dimensions: WindowDimensions) => React.Node + render: (dimensions: WindowDimensions) => React.ReactNode } type State = {
933d9445996926338a901db6226d33950fff3176
src/decorators/root-module.ts
src/decorators/root-module.ts
import * as http from 'http'; import { ListenOptions } from 'net'; import { makeDecorator, Provider, ReflectiveInjector, Injector } from '@ts-stack/di'; import { Router as RestifyRouter } from '@ts-stack/router'; import { PreRequest } from '../services/pre-request'; import { ModuleDecorator } from './module'; import { Router } from '../types/router'; import { BodyParserConfig } from '../types/types'; import { Logger } from '../types/logger'; import { HttpModule, ServerOptions } from '../types/server-options'; import { deepFreeze } from '../utils/deep-freeze'; export const defaultProvidersPerApp: Readonly<Provider[]> = deepFreeze([ Logger, BodyParserConfig, { provide: Router, useClass: RestifyRouter }, PreRequest, { provide: ReflectiveInjector, useExisting: Injector, }, ]); export interface RootModuleDecoratorFactory { (data?: RootModuleDecorator): any; new (data?: RootModuleDecorator): RootModuleDecorator; } export interface RootModuleDecorator extends ModuleDecorator, Partial<ApplicationMetadata> {} export const RootModule = makeDecorator('RootModule', (data: any) => data) as RootModuleDecoratorFactory; export class ApplicationMetadata { httpModule: HttpModule = http; serverName: string = 'Node.js'; serverOptions: ServerOptions = {}; listenOptions: ListenOptions = { host: 'localhost', port: 8080 }; prefixPerApp: string = ''; /** * Providers per the `Application`. */ providersPerApp: Provider[] = []; }
import * as http from 'http'; import { ListenOptions } from 'net'; import { makeDecorator, Provider, ReflectiveInjector, Injector } from '@ts-stack/di'; import { Router as KoaTreeRouter } from '@ts-stack/router'; import { PreRequest } from '../services/pre-request'; import { ModuleDecorator } from './module'; import { Router } from '../types/router'; import { BodyParserConfig } from '../types/types'; import { Logger } from '../types/logger'; import { HttpModule, ServerOptions } from '../types/server-options'; import { deepFreeze } from '../utils/deep-freeze'; export const defaultProvidersPerApp: Readonly<Provider[]> = deepFreeze([ Logger, BodyParserConfig, { provide: Router, useClass: KoaTreeRouter }, PreRequest, { provide: ReflectiveInjector, useExisting: Injector, }, ]); export interface RootModuleDecoratorFactory { (data?: RootModuleDecorator): any; new (data?: RootModuleDecorator): RootModuleDecorator; } export interface RootModuleDecorator extends ModuleDecorator, Partial<ApplicationMetadata> {} export const RootModule = makeDecorator('RootModule', (data: any) => data) as RootModuleDecoratorFactory; export class ApplicationMetadata { httpModule: HttpModule = http; serverName: string = 'Node.js'; serverOptions: ServerOptions = {}; listenOptions: ListenOptions = { host: 'localhost', port: 8080 }; prefixPerApp: string = ''; /** * Providers per the `Application`. */ providersPerApp: Provider[] = []; }
Fix typo in description defaultProvidersPerApp
Fix typo in description defaultProvidersPerApp
TypeScript
mit
restify-ts/core,restify-ts/core,restify-ts/core,restify-ts/core
--- +++ @@ -1,7 +1,7 @@ import * as http from 'http'; import { ListenOptions } from 'net'; import { makeDecorator, Provider, ReflectiveInjector, Injector } from '@ts-stack/di'; -import { Router as RestifyRouter } from '@ts-stack/router'; +import { Router as KoaTreeRouter } from '@ts-stack/router'; import { PreRequest } from '../services/pre-request'; import { ModuleDecorator } from './module'; @@ -14,7 +14,7 @@ export const defaultProvidersPerApp: Readonly<Provider[]> = deepFreeze([ Logger, BodyParserConfig, - { provide: Router, useClass: RestifyRouter }, + { provide: Router, useClass: KoaTreeRouter }, PreRequest, { provide: ReflectiveInjector,
2970cf2aabe2035b8d11494d761b46af61078936
client/app/services/data.service.ts
client/app/services/data.service.ts
import { Injectable } from '@angular/core'; import { Http, Headers, RequestOptions } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; @Injectable() export class DataService { private headers = new Headers({ 'Content-Type': 'application/json', 'charset': 'UTF-8' }); private options = new RequestOptions({ headers: this.headers }); constructor(private http: Http) { } getCats(): Observable<any> { return this.http.get('/api/cats').map(res => res.json()); } countCats(): Observable<any> { return this.http.get('/api/cats/count').map(res => res.json()); } addCat(cat): Observable<any> { return this.http.post('/api/cat', JSON.stringify(cat), this.options); } getCat(cat): Observable<any> { return this.http.get(`/api/cat/${cat._id}`, this.options); } editCat(cat): Observable<any> { return this.http.put(`/api/cat/${cat._id}`, JSON.stringify(cat), this.options); } deleteCat(cat): Observable<any> { return this.http.delete(`/api/cat/${cat._id}`, this.options); } }
import { Injectable } from '@angular/core'; import { Http, Headers, RequestOptions } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; @Injectable() export class DataService { private headers = new Headers({ 'Content-Type': 'application/json', 'charset': 'UTF-8' }); private options = new RequestOptions({ headers: this.headers }); constructor(private http: Http) { } getCats(): Observable<any> { return this.http.get('/api/cats').map(res => res.json()); } countCats(): Observable<any> { return this.http.get('/api/cats/count').map(res => res.json()); } addCat(cat): Observable<any> { return this.http.post('/api/cat', JSON.stringify(cat), this.options); } getCat(cat): Observable<any> { return this.http.get(`/api/cat/${cat._id}`).map(res => res.json()); } editCat(cat): Observable<any> { return this.http.put(`/api/cat/${cat._id}`, JSON.stringify(cat), this.options); } deleteCat(cat): Observable<any> { return this.http.delete(`/api/cat/${cat._id}`, this.options); } }
Fix get cat api on frontend
Fix get cat api on frontend
TypeScript
mit
hasman16/rent-a-ref,alitriki/TO52_Angular4,DavideViolante/Angular2-Express-Mongoose,amirkatzster/Neurimos,amirkatzster/Neurimos,nigel-smk/av-elab,DavideViolante/Angular-Full-Stack,alitriki/TO52_Angular4,DavideViolante/Angular-Full-Stack,amirkatzster/Neurimos,hasman16/rent-a-ref,amirkatzster/Neurimos,DavideViolante/Angular-Full-Stack,DavideViolante/Angular2-Express-Mongoose,nait90/bws-20170603,nait90/bws-20170603,hasman16/rent-a-ref,nait90/bws-20170603,nigel-smk/av-elab,nigel-smk/av-elab,alitriki/TO52_Angular4,DavideViolante/Angular-Full-Stack,DavideViolante/Angular2-Express-Mongoose
--- +++ @@ -25,7 +25,7 @@ } getCat(cat): Observable<any> { - return this.http.get(`/api/cat/${cat._id}`, this.options); + return this.http.get(`/api/cat/${cat._id}`).map(res => res.json()); } editCat(cat): Observable<any> {
7b9111e7faa24635cdc496608fee1c23433e55ae
packages/data-access/src/query-access.ts
packages/data-access/src/query-access.ts
import { DataAccessConfig } from './acl-manager'; import { LuceneQueryAccess } from 'xlucene-evaluator'; /** * Using a DataAccess ACL, limit queries to * specific fields and records * * @todo should be able to translate to a full elasticsearch query */ export class QueryAccess { acl: DataAccessConfig; private _queryAccess: LuceneQueryAccess; constructor(acl: DataAccessConfig) { this.acl = acl; const { excludes = [], includes = [], constraint, prevent_prefix_wildcard } = acl.view; this._queryAccess = new LuceneQueryAccess({ excludes, includes, constraint, prevent_prefix_wildcard, }); } /** * Given xlucene query it should be able to restrict * the query to certian fields and add any constraints. * * If the input query using restricted fields, it will throw. */ restrictQuery(query: string): string { return this._queryAccess.restrict(query); } }
import { SearchParams } from 'elasticsearch'; import { Omit } from '@terascope/utils'; import { LuceneQueryAccess, Translator, TypeConfig } from 'xlucene-evaluator'; import { DataAccessConfig } from './acl-manager'; /** * Using a DataAccess ACL, limit queries to * specific fields and records */ export class QueryAccess { config: DataAccessConfig; private _queryAccess: LuceneQueryAccess; private _typeConfig: TypeConfig|undefined; constructor(config: DataAccessConfig, types?: TypeConfig) { this.config = config; this._typeConfig = types; const { excludes = [], includes = [], constraint, prevent_prefix_wildcard } = this.config.view; this._queryAccess = new LuceneQueryAccess({ excludes, includes, constraint, prevent_prefix_wildcard, }); } /** * Given xlucene query it should be able to restrict * the query to certian fields and add any constraints. * * If the input query using restricted fields, it will throw. */ restrictQuery(query: string, format?: 'xlucene'): string; restrictQuery(query: string, format: 'dsl', params: SearchParamsDefaults): SearchParams; restrictQuery(query: string, format: 'xlucene'|'dsl' = 'xlucene', extra?: object): string|SearchParams { const restricted = this._queryAccess.restrict(query); if (format === 'xlucene') { return restricted; } const body = Translator.toElasticsearchDSL(restricted, this._typeConfig); const _sourceInclude = this.config.view.includes; const _sourceExclude = this.config.view.excludes; return Object.assign({}, { body, _sourceInclude, _sourceExclude }, extra); } } export type SearchParamsDefaults = Partial<Omit<SearchParams, 'body'|'_sourceExclude'|'_sourceInclude'|'_source'>>;
Add support for restricting to full elasticsearch dsl
Add support for restricting to full elasticsearch dsl
TypeScript
apache-2.0
terascope/teraslice,terascope/teraslice,terascope/teraslice,terascope/teraslice
--- +++ @@ -1,24 +1,27 @@ +import { SearchParams } from 'elasticsearch'; +import { Omit } from '@terascope/utils'; +import { LuceneQueryAccess, Translator, TypeConfig } from 'xlucene-evaluator'; import { DataAccessConfig } from './acl-manager'; -import { LuceneQueryAccess } from 'xlucene-evaluator'; /** * Using a DataAccess ACL, limit queries to * specific fields and records - * - * @todo should be able to translate to a full elasticsearch query */ export class QueryAccess { - acl: DataAccessConfig; + config: DataAccessConfig; private _queryAccess: LuceneQueryAccess; + private _typeConfig: TypeConfig|undefined; - constructor(acl: DataAccessConfig) { - this.acl = acl; + constructor(config: DataAccessConfig, types?: TypeConfig) { + this.config = config; + this._typeConfig = types; + const { excludes = [], includes = [], constraint, prevent_prefix_wildcard - } = acl.view; + } = this.config.view; this._queryAccess = new LuceneQueryAccess({ excludes, @@ -34,7 +37,24 @@ * * If the input query using restricted fields, it will throw. */ - restrictQuery(query: string): string { - return this._queryAccess.restrict(query); + restrictQuery(query: string, format?: 'xlucene'): string; + restrictQuery(query: string, format: 'dsl', params: SearchParamsDefaults): SearchParams; + restrictQuery(query: string, format: 'xlucene'|'dsl' = 'xlucene', extra?: object): string|SearchParams { + const restricted = this._queryAccess.restrict(query); + if (format === 'xlucene') { + return restricted; + } + + const body = Translator.toElasticsearchDSL(restricted, this._typeConfig); + const _sourceInclude = this.config.view.includes; + const _sourceExclude = this.config.view.excludes; + + return Object.assign({}, { + body, + _sourceInclude, + _sourceExclude + }, extra); } } + +export type SearchParamsDefaults = Partial<Omit<SearchParams, 'body'|'_sourceExclude'|'_sourceInclude'|'_source'>>;
fe49a94eef3f02e54fe75f5ae99b16088d0028a6
src/app/main/sidebar/sidebar.component.ts
src/app/main/sidebar/sidebar.component.ts
import {Component, OnInit} from '@angular/core'; import {Http, URLSearchParams} from '@angular/http'; @Component({ selector: 'app-sidebar', templateUrl: './sidebar.component.html', styleUrls: ['./sidebar.component.scss'] }) export class SidebarComponent implements OnInit { public links = [ { title: 'FAST Contact Info', link: 'https://www.sheridancollege.ca/academics/faculties/applied-science-and-technology.aspx' }, { title: 'Upcoming Events', link: 'https://www.sheridancollege.ca/news-and-events/events.aspx', badge: 5 } ]; constructor(private http: Http) { } ngOnInit() { } register() { const MLHapi = new URL('https://my.mlh.io/oauth/authorize'); const redirect_uri = new URL('http://localhost:4200/oauth/callback'); const params = new URLSearchParams(); params.append('client_id', '98c90e6fe51d6aa3465723c8f719a78499316c339e135a6a8b39a210b8bf8dc1'); params.append('redirect_uri', redirect_uri.href); params.append('response_type', 'token'); window.location.href = `${MLHapi.href}?${params}`; } }
import {Component, OnInit} from '@angular/core'; import {Http, URLSearchParams} from '@angular/http'; @Component({ selector: 'app-sidebar', templateUrl: './sidebar.component.html', styleUrls: ['./sidebar.component.scss'] }) export class SidebarComponent implements OnInit { public links = [ { title: 'FAST Contact Info', link: 'https://www.sheridancollege.ca/academics/faculties/applied-science-and-technology.aspx' }, { title: 'Upcoming Events', link: 'https://www.sheridancollege.ca/news-and-events/events.aspx', badge: 5 } ]; constructor(private http: Http) { } ngOnInit() { } register() { const MLHapi = new URL('https://my.mlh.io/oauth/authorize'); const redirect_uri = new URL(`${location.hostname}oauth/callback`); const params = new URLSearchParams(); params.append('client_id', '98c90e6fe51d6aa3465723c8f719a78499316c339e135a6a8b39a210b8bf8dc1'); params.append('redirect_uri', redirect_uri.href); params.append('response_type', 'token'); window.location.href = `${MLHapi.href}?${params}`; } }
Make Login Redirect Uri dynamic for prod and dev environments
Make Login Redirect Uri dynamic for prod and dev environments
TypeScript
mit
prabh-62/skills-ontario-2017,prabh-62/skills-ontario-2017,prabh-62/skills-ontario-2017
--- +++ @@ -27,7 +27,7 @@ register() { const MLHapi = new URL('https://my.mlh.io/oauth/authorize'); - const redirect_uri = new URL('http://localhost:4200/oauth/callback'); + const redirect_uri = new URL(`${location.hostname}oauth/callback`); const params = new URLSearchParams(); params.append('client_id', '98c90e6fe51d6aa3465723c8f719a78499316c339e135a6a8b39a210b8bf8dc1'); params.append('redirect_uri', redirect_uri.href);
e711b702bfbc0f080992ca3d452883fe56c65388
types/koa/koa-tests.ts
types/koa/koa-tests.ts
import Koa = require("koa"); declare module 'koa' { export interface Context { db(): void; } } const app = new Koa(); app.context.db = () => {}; app.use(async ctx => { console.log(ctx.db); }); app.use((ctx, next) => { const start: any = new Date(); return next().then(() => { const end: any = new Date(); const ms = end - start; console.log(`${ctx.method} ${ctx.url} - ${ms}ms`); ctx.assert(true, 404, "Yep!"); }); }); // response app.use(ctx => { ctx.body = "Hello World"; ctx.body = ctx.URL.toString(); }); app.listen(3000); const server = app.listen();
import Koa = require("koa"); declare module 'koa' { export interface BaseContext { db(): void; } export interface Context { user: {}; } } const app = new Koa(); app.context.db = () => {}; app.use(async ctx => { console.log(ctx.db); ctx.user = {}; }); app.use((ctx, next) => { const start: any = new Date(); return next().then(() => { const end: any = new Date(); const ms = end - start; console.log(`${ctx.method} ${ctx.url} - ${ms}ms`); ctx.assert(true, 404, "Yep!"); }); }); // response app.use(ctx => { ctx.body = "Hello World"; ctx.body = ctx.URL.toString(); }); app.listen(3000); const server = app.listen();
Add tests for BaseContext as well as Context
Add tests for BaseContext as well as Context
TypeScript
mit
rolandzwaga/DefinitelyTyped,georgemarshall/DefinitelyTyped,one-pieces/DefinitelyTyped,borisyankov/DefinitelyTyped,mcliment/DefinitelyTyped,georgemarshall/DefinitelyTyped,markogresak/DefinitelyTyped,AgentME/DefinitelyTyped,georgemarshall/DefinitelyTyped,AgentME/DefinitelyTyped,rolandzwaga/DefinitelyTyped,magny/DefinitelyTyped,magny/DefinitelyTyped,dsebastien/DefinitelyTyped,georgemarshall/DefinitelyTyped,borisyankov/DefinitelyTyped,AgentME/DefinitelyTyped,dsebastien/DefinitelyTyped,AgentME/DefinitelyTyped
--- +++ @@ -1,8 +1,11 @@ import Koa = require("koa"); declare module 'koa' { + export interface BaseContext { + db(): void; + } export interface Context { - db(): void; + user: {}; } } @@ -12,6 +15,7 @@ app.use(async ctx => { console.log(ctx.db); + ctx.user = {}; }); app.use((ctx, next) => {
01cfbaafcb20abf374997d23a9b8099f448a4ade
polygerrit-ui/app/services/flags/flags.ts
polygerrit-ui/app/services/flags/flags.ts
/** * @license * Copyright (C) 2020 The Android Open Source Project * * 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. */ export interface FlagsService { isEnabled(experimentId: string): boolean; enabledExperiments: string[]; } /** * @desc Experiment ids used in Gerrit. */ export enum KnownExperimentId { PATCHSET_COMMENTS = 'UiFeature__patchset_comments', PATCHSET_CHOICE_FOR_COMMENT_LINKS = 'UiFeature__patchset_choice_for_comment_links', }
/** * @license * Copyright (C) 2020 The Android Open Source Project * * 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. */ export interface FlagsService { isEnabled(experimentId: string): boolean; enabledExperiments: string[]; } /** * @desc Experiment ids used in Gerrit. */ export enum KnownExperimentId { PATCHSET_COMMENTS = 'UiFeature__patchset_comments', PATCHSET_CHOICE_FOR_COMMENT_LINKS = 'UiFeature__patchset_choice_for_comment_links', NEW_CONTEXT_CONTROLS = 'UiFeature__new_context_controls', }
Add experiment ID for new context controls
Add experiment ID for new context controls Change-Id: I18c5560ff6d36f347a8ec9e5117b10ccd7337fa3
TypeScript
apache-2.0
GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit
--- +++ @@ -26,4 +26,5 @@ export enum KnownExperimentId { PATCHSET_COMMENTS = 'UiFeature__patchset_comments', PATCHSET_CHOICE_FOR_COMMENT_LINKS = 'UiFeature__patchset_choice_for_comment_links', + NEW_CONTEXT_CONTROLS = 'UiFeature__new_context_controls', }
59068afcca478b4ca5bb1c29f07b920845fe362e
app/src/cli/main.ts
app/src/cli/main.ts
import * as ChildProcess from 'child_process' import * as Path from 'path' const args = process.argv.slice(2) // At some point we may have other command line options, but for now we assume // the first arg is the path to open. const pathArg = args.length > 0 ? args[0] : '' const repositoryPath = Path.resolve(process.cwd(), pathArg) const url = `x-github-client://openLocalRepo/${encodeURIComponent(repositoryPath)}` const command = __DARWIN__ ? 'open' : 'start' ChildProcess.exec(`${command} ${url}`) process.exit(0)
console.log('hi everyone')
Revert "Invoke the URL protocol"
Revert "Invoke the URL protocol" This reverts commit 4e9980224093f6e1b14d03b889da2d16278f533f.
TypeScript
mit
artivilla/desktop,hjobrien/desktop,artivilla/desktop,gengjiawen/desktop,desktop/desktop,hjobrien/desktop,artivilla/desktop,say25/desktop,say25/desktop,shiftkey/desktop,kactus-io/kactus,shiftkey/desktop,j-f1/forked-desktop,hjobrien/desktop,artivilla/desktop,j-f1/forked-desktop,j-f1/forked-desktop,kactus-io/kactus,hjobrien/desktop,kactus-io/kactus,j-f1/forked-desktop,say25/desktop,shiftkey/desktop,desktop/desktop,desktop/desktop,gengjiawen/desktop,gengjiawen/desktop,kactus-io/kactus,gengjiawen/desktop,shiftkey/desktop,desktop/desktop,say25/desktop
--- +++ @@ -1,15 +1 @@ -import * as ChildProcess from 'child_process' -import * as Path from 'path' - -const args = process.argv.slice(2) - -// At some point we may have other command line options, but for now we assume -// the first arg is the path to open. -const pathArg = args.length > 0 ? args[0] : '' -const repositoryPath = Path.resolve(process.cwd(), pathArg) -const url = `x-github-client://openLocalRepo/${encodeURIComponent(repositoryPath)}` - -const command = __DARWIN__ ? 'open' : 'start' -ChildProcess.exec(`${command} ${url}`) - -process.exit(0) +console.log('hi everyone')
55270ad512d8632dbdff0f54607f6100e47a8a6b
source/ci_source/providers/index.ts
source/ci_source/providers/index.ts
import { BuddyBuild } from "./BuddyBuild" import { Buildkite } from "./Buildkite" import { Circle } from "./Circle" import { Codeship } from "./Codeship" import { DockerCloud } from "./DockerCloud" import { Drone } from "./Drone" import { FakeCI } from "./Fake" import { Jenkins } from "./Jenkins" import { Nevercode } from "./Nevercode" import { Semaphore } from "./Semaphore" import { Surf } from "./Surf" import { Travis } from "./Travis" import { VSTS } from "./VSTS" const providers = [ BuddyBuild, Buildkite, Circle, Codeship, DockerCloud, Drone, FakeCI, Jenkins, Nevercode, Semaphore, Surf, Travis, VSTS, ] // Mainly used for Dangerfile linting const realProviders = [ BuddyBuild, Buildkite, Circle, Codeship, DockerCloud, Drone, Jenkins, Nevercode, Semaphore, Surf, Travis, VSTS, ] export { providers, realProviders }
import { BuddyBuild } from "./BuddyBuild" import { Buildkite } from "./Buildkite" import { Circle } from "./Circle" import { Codeship } from "./Codeship" import { DockerCloud } from "./DockerCloud" import { Drone } from "./Drone" import { FakeCI } from "./Fake" import { Jenkins } from "./Jenkins" import { Nevercode } from "./Nevercode" import { Semaphore } from "./Semaphore" import { Surf } from "./Surf" import { Travis } from "./Travis" import { VSTS } from "./VSTS" const providers = [ Travis, Circle, Semaphore, Nevercode, Jenkins, FakeCI, Surf, DockerCloud, Codeship, Drone, Buildkite, BuddyBuild, VSTS, ] // Mainly used for Dangerfile linting const realProviders = [ Travis, Circle, Semaphore, Nevercode, Jenkins, Surf, DockerCloud, Codeship, Drone, Buildkite, BuddyBuild, VSTS, ] export { providers, realProviders }
Revert "Alphasort ci-source providers for easier additions"
Revert "Alphasort ci-source providers for easier additions" This reverts commit 9bf75701e8268914484f9f409dcda04f41a43558. Sort order was important, actually :-/
TypeScript
mit
danger/danger-js,danger/danger-js,danger/danger-js,danger/danger-js
--- +++ @@ -13,34 +13,34 @@ import { VSTS } from "./VSTS" const providers = [ + Travis, + Circle, + Semaphore, + Nevercode, + Jenkins, + FakeCI, + Surf, + DockerCloud, + Codeship, + Drone, + Buildkite, BuddyBuild, - Buildkite, - Circle, - Codeship, - DockerCloud, - Drone, - FakeCI, - Jenkins, - Nevercode, - Semaphore, - Surf, - Travis, VSTS, ] // Mainly used for Dangerfile linting const realProviders = [ + Travis, + Circle, + Semaphore, + Nevercode, + Jenkins, + Surf, + DockerCloud, + Codeship, + Drone, + Buildkite, BuddyBuild, - Buildkite, - Circle, - Codeship, - DockerCloud, - Drone, - Jenkins, - Nevercode, - Semaphore, - Surf, - Travis, VSTS, ]
331a2515a4e9dc84accbfb34313425d88c7a9139
rules/rewrite/w3c.ts
rules/rewrite/w3c.ts
'use strict'; // XXX import { Url } from 'url'; import { RedirectInfo, ExtendedRedirectInfo } from '../'; // // Entry Point // export function rewrite(url: Url): ExtendedRedirectInfo { const host = '.w3.org'; if (('.' + url.host).endsWith(host)) { if (url.protocol === 'http:') { const reason = 'Prefer https: over http:'; const redirectInfo: RedirectInfo = { protocol: 'https:', }; return { type: 'rewrite', reason: reason, redirectInfo: redirectInfo, }; } } return null; }
'use strict'; // XXX import { Url } from 'url'; import { RedirectInfo, ExtendedRedirectInfo } from '../'; // // dev.w3.org // const REDIRECT_MAP: Map<string, string> = new Map([ ['/csswg/', 'drafts.csswg.org'], ['/fxtf/', 'drafts.fxtf.org'], ['/houdini/', 'drafts.css-houdini.org'], ]); function rewriteDevW3Org(url: Url): ExtendedRedirectInfo { const pathname = url.pathname; for (const pair of REDIRECT_MAP) { const knownPathname = pair[0]; const host = pair[1]; if (pathname.startsWith(knownPathname)) { const newPathname = pathname.substring(knownPathname.length - 1); const reason = 'dev.w3.org has retired'; const redirectInfo: RedirectInfo = { protocol: 'https:', host: host, pathname: newPathname, } return { type: 'rewrite', reason: reason, redirectInfo: redirectInfo, }; } } return null; } // // Entry Point // export function rewrite(url: Url): ExtendedRedirectInfo { if (url.host === 'dev.w3.org') { return rewriteDevW3Org(url); } return null; }
Bring back redirecting dev.w3.org to drafts.csswg.org and so on.
Bring back redirecting dev.w3.org to drafts.csswg.org and so on.
TypeScript
mit
takenspc/ps-url-normalizer
--- +++ @@ -4,17 +4,30 @@ // -// Entry Point +// dev.w3.org // -export function rewrite(url: Url): ExtendedRedirectInfo { - const host = '.w3.org'; +const REDIRECT_MAP: Map<string, string> = new Map([ + ['/csswg/', 'drafts.csswg.org'], + ['/fxtf/', 'drafts.fxtf.org'], + ['/houdini/', 'drafts.css-houdini.org'], +]); - if (('.' + url.host).endsWith(host)) { - if (url.protocol === 'http:') { - const reason = 'Prefer https: over http:'; +function rewriteDevW3Org(url: Url): ExtendedRedirectInfo { + const pathname = url.pathname; + + for (const pair of REDIRECT_MAP) { + const knownPathname = pair[0]; + const host = pair[1]; + + if (pathname.startsWith(knownPathname)) { + const newPathname = pathname.substring(knownPathname.length - 1); + + const reason = 'dev.w3.org has retired'; const redirectInfo: RedirectInfo = { protocol: 'https:', - }; + host: host, + pathname: newPathname, + } return { type: 'rewrite', @@ -26,3 +39,16 @@ return null; } + + +// +// Entry Point +// +export function rewrite(url: Url): ExtendedRedirectInfo { + + if (url.host === 'dev.w3.org') { + return rewriteDevW3Org(url); + } + + return null; +}
23dfb41ea866ebe465e7d66b82f89ddf7f10042d
src/project/ProjectLink.tsx
src/project/ProjectLink.tsx
import { FunctionComponent } from 'react'; import { Link } from '@waldur/core/Link'; interface ProjectLinkProps { row: { project_name: string; project_uuid: string; }; } export const ProjectLink: FunctionComponent<ProjectLinkProps> = ({ row }) => ( <Link state="project" params={{ uuid: row.project_uuid }} label={row.project_name} /> );
import { FunctionComponent } from 'react'; import { Link } from '@waldur/core/Link'; interface ProjectLinkProps { row: { project_name: string; project_uuid: string; }; } export const ProjectLink: FunctionComponent<ProjectLinkProps> = ({ row }) => ( <Link state="project.details" params={{ uuid: row.project_uuid }} label={row.project_name} /> );
Fix project link component: use concrete state instead of abstract.
Fix project link component: use concrete state instead of abstract.
TypeScript
mit
opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport
--- +++ @@ -11,7 +11,7 @@ export const ProjectLink: FunctionComponent<ProjectLinkProps> = ({ row }) => ( <Link - state="project" + state="project.details" params={{ uuid: row.project_uuid }} label={row.project_name} />
a1a6242eb0e4bcb0ae783a572b4406567a91e21b
src/components/HitTable/HitItem.tsx
src/components/HitTable/HitItem.tsx
import * as React from 'react'; import { Hit, Requester } from '../../types'; import { ResourceList } from '@shopify/polaris'; import UnqualifiedCard from './UnqualifiedCard'; import { calculateAllBadges } from '../../utils/badges'; export interface Props { readonly hit: Hit; readonly requester?: Requester; } const HitCard = ({ hit, requester }: Props) => { const { requesterName, reward, title } = hit; const badges = requester ? calculateAllBadges(requester) : []; const itemProps = { attributeOne: title, attributeTwo: requesterName, attributeThree: reward, }; return hit.groupId.startsWith('[Error:groupId]-') ? ( <UnqualifiedCard {...hit} /> ) : ( <ResourceList.Item {...itemProps} badges={badges} /> ); }; export default HitCard;
import * as React from 'react'; import { Hit, Requester } from '../../types'; import { ResourceList } from '@shopify/polaris'; import { calculateAllBadges } from '../../utils/badges'; export interface Props { readonly hit: Hit; readonly requester?: Requester; } const HitCard = ({ hit, requester }: Props) => { const { requesterName, reward, title } = hit; const badges = requester ? calculateAllBadges(requester) : []; const itemProps = { attributeOne: title, attributeTwo: requesterName, attributeThree: reward, badges }; return hit.groupId.startsWith('[Error:groupId]-') ? ( <ResourceList.Item {...itemProps} exceptions={[ { status: 'warning', title: 'You are not qualified.' } ]} /> ) : ( <ResourceList.Item {...itemProps} /> ); }; export default HitCard;
Remove UnqualifiedCard as a conditional render when groupId is invalid
Remove UnqualifiedCard as a conditional render when groupId is invalid
TypeScript
mit
Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine
--- +++ @@ -1,7 +1,6 @@ import * as React from 'react'; import { Hit, Requester } from '../../types'; import { ResourceList } from '@shopify/polaris'; -import UnqualifiedCard from './UnqualifiedCard'; import { calculateAllBadges } from '../../utils/badges'; export interface Props { @@ -17,15 +16,16 @@ attributeOne: title, attributeTwo: requesterName, attributeThree: reward, + badges }; return hit.groupId.startsWith('[Error:groupId]-') ? ( - <UnqualifiedCard {...hit} /> - ) : ( <ResourceList.Item {...itemProps} - badges={badges} + exceptions={[ { status: 'warning', title: 'You are not qualified.' } ]} /> + ) : ( + <ResourceList.Item {...itemProps} /> ); };
374022f12d1d9ee211787e550ef9dd250ce461d4
src/app/user/shared/user.service.spec.ts
src/app/user/shared/user.service.spec.ts
import { inject, TestBed } from '@angular/core/testing'; import { UserService } from './user.service'; import { User } from './user'; import { Observable, of } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { ProgressService } from '../../shared/providers/progress.service'; import { NotificationService } from '../../shared/providers/notification.service'; import { MaterialConfigModule } from '../../routing/material-config.module'; describe('UserService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [MaterialConfigModule], providers: [ NotificationService, ProgressService, UserService, { provide: HttpClient, useValue: new HttpClient(null) } ] }); }); it('should be created', inject([UserService], (service: UserService) => { expect(service).toBeTruthy(); })); it('should return a user named myusername', inject( [UserService, HttpClient], (service: UserService, http: HttpClient) => { const httpSpy = spyOn(http, 'get').and.callFake(function(_url, _options) { return of({ userName: 'myusername', userGroups: ['test-group'] }); }); const authenticatedUserObservable: Observable<User> = service.getUserObservable(); authenticatedUserObservable.subscribe(authenticatedUser => { expect(authenticatedUser.actAs).toBe('myusername'); expect(authenticatedUser.userName).toBe('myusername'); expect(authenticatedUser.userGroups).toEqual(['test-group']); }); } )); });
import { inject, TestBed, async } from '@angular/core/testing'; import { UserService } from './user.service'; import { User } from './user'; import { Observable, of } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { ProgressService } from '../../shared/providers/progress.service'; import { NotificationService } from '../../shared/providers/notification.service'; import { MaterialConfigModule } from '../../routing/material-config.module'; describe('UserService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [MaterialConfigModule], providers: [ NotificationService, ProgressService, UserService, { provide: HttpClient, useValue: new HttpClient(null) } ] }); }); it('should be created', inject([UserService], (service: UserService) => { expect(service).toBeTruthy(); })); it('should return a user named myusername', async( inject([UserService, HttpClient], (service: UserService, http: HttpClient) => { const httpSpy = spyOn(http, 'get').and.callFake(function(_url, _options) { return of({ userName: 'myusername', userGroups: ['test-group'] }); }); const authenticatedUserObservable: Observable<User> = service.getUserObservable(); authenticatedUserObservable.subscribe(authenticatedUser => { expect(authenticatedUser.actAs).toBe('myusername'); expect(authenticatedUser.userName).toBe('myusername'); expect(authenticatedUser.userGroups).toEqual(['test-group']); }); }) )); });
Fix UserService test to use async to properly verify after an observable resolves.
Fix UserService test to use async to properly verify after an observable resolves.
TypeScript
apache-2.0
uw-it-edm/content-services-ui,uw-it-edm/content-services-ui,uw-it-edm/content-services-ui
--- +++ @@ -1,4 +1,4 @@ -import { inject, TestBed } from '@angular/core/testing'; +import { inject, TestBed, async } from '@angular/core/testing'; import { UserService } from './user.service'; import { User } from './user'; @@ -25,9 +25,8 @@ expect(service).toBeTruthy(); })); - it('should return a user named myusername', inject( - [UserService, HttpClient], - (service: UserService, http: HttpClient) => { + it('should return a user named myusername', async( + inject([UserService, HttpClient], (service: UserService, http: HttpClient) => { const httpSpy = spyOn(http, 'get').and.callFake(function(_url, _options) { return of({ userName: 'myusername', @@ -42,6 +41,6 @@ expect(authenticatedUser.userName).toBe('myusername'); expect(authenticatedUser.userGroups).toEqual(['test-group']); }); - } + }) )); });
63fa6895b22c55f4e77b950c35fb66162f3c5c07
src/app/embed/adapters/adapter.properties.ts
src/app/embed/adapters/adapter.properties.ts
import { Observable } from 'rxjs/Observable'; export const PropNames = [ 'audioUrl', 'title', 'subtitle', 'subscribeUrl', 'subscribeTarget', 'artworkUrl', 'feedArtworkUrl', 'episodes' ]; export interface AdapterProperties { audioUrl?: string; duration?: number; title?: string; subtitle?: string; subscribeUrl?: string; subscribeTarget?: string; artworkUrl?: string; feedArtworkUrl?: string; episodes?: Array<AdapterProperties>; index?: number; } export interface DataAdapter { getProperties: (params: Object) => Observable<AdapterProperties>; }
import { Observable } from 'rxjs/Observable'; export const PropNames = [ 'audioUrl', 'duration', 'title', 'subtitle', 'subscribeUrl', 'subscribeTarget', 'artworkUrl', 'feedArtworkUrl', 'episodes' ]; export interface AdapterProperties { audioUrl?: string; duration?: number; title?: string; subtitle?: string; subscribeUrl?: string; subscribeTarget?: string; artworkUrl?: string; feedArtworkUrl?: string; episodes?: Array<AdapterProperties>; index?: number; } export interface DataAdapter { getProperties: (params: Object) => Observable<AdapterProperties>; }
Make sure duration is passed through merge adapter
Make sure duration is passed through merge adapter
TypeScript
mit
PRX/play.prx.org,PRX/play.prx.org,PRX/play.prx.org,PRX/play.prx.org
--- +++ @@ -2,6 +2,7 @@ export const PropNames = [ 'audioUrl', + 'duration', 'title', 'subtitle', 'subscribeUrl',
51879d8fdbc80b8f72c5d0540dda189ae0be3a36
packages/cspell-tools/src/fileWriter.test.ts
packages/cspell-tools/src/fileWriter.test.ts
import { expect } from 'chai'; import * as fileWriter from './fileWriter'; import * as fileReader from './fileReader'; import * as Rx from 'rxjs/Rx'; import * as loremIpsum from 'lorem-ipsum'; import * as path from 'path'; describe('Validate the writer', () => { it('tests writing an Rx.Observable and reading it back.', () => { const text = loremIpsum({ count: 100, format: 'plain'}) + ' éåáí'; const data = text.split(/\b/); const filename = path.join(__dirname, '..', 'temp', 'tests-writing-an-observable.txt'); const obj = Rx.Observable.from(data); const p = fileWriter.writeToFileRxP(filename, obj); return Rx.Observable.from(p) .concatMap(() => fileReader.textFileStreamRx(filename)) .reduce((a, b) => a + b) .toPromise() .then(result => { expect(result).to.equal(text); }); }); });
import { expect } from 'chai'; import * as fileWriter from './fileWriter'; import * as fileReader from './fileReader'; import * as Rx from 'rxjs/Rx'; import * as loremIpsum from 'lorem-ipsum'; import * as path from 'path'; import { mkdirp } from 'fs-promise'; describe('Validate the writer', () => { it('tests writing an Rx.Observable and reading it back.', () => { const text = loremIpsum({ count: 100, format: 'plain'}) + ' éåáí'; const data = text.split(/\b/); const filename = path.join(__dirname, '..', 'temp', 'tests-writing-an-observable.txt'); return Rx.Observable.from(mkdirp(path.dirname(filename))) .flatMap(() => { const obj = Rx.Observable.from(data); return fileWriter.writeToFileRxP(filename, obj); }) .concatMap(() => fileReader.textFileStreamRx(filename)) .reduce((a, b) => a + b) .toPromise() .then(result => { expect(result).to.equal(text); }); }); });
Make sure the temp dir exists.
Make sure the temp dir exists.
TypeScript
mit
Jason3S/cspell,Jason3S/cspell,Jason3S/cspell,Jason3S/cspell,Jason3S/cspell
--- +++ @@ -4,6 +4,7 @@ import * as Rx from 'rxjs/Rx'; import * as loremIpsum from 'lorem-ipsum'; import * as path from 'path'; +import { mkdirp } from 'fs-promise'; describe('Validate the writer', () => { it('tests writing an Rx.Observable and reading it back.', () => { @@ -11,9 +12,11 @@ const data = text.split(/\b/); const filename = path.join(__dirname, '..', 'temp', 'tests-writing-an-observable.txt'); - const obj = Rx.Observable.from(data); - const p = fileWriter.writeToFileRxP(filename, obj); - return Rx.Observable.from(p) + return Rx.Observable.from(mkdirp(path.dirname(filename))) + .flatMap(() => { + const obj = Rx.Observable.from(data); + return fileWriter.writeToFileRxP(filename, obj); + }) .concatMap(() => fileReader.textFileStreamRx(filename)) .reduce((a, b) => a + b) .toPromise()