conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Disable Ribbon if Memex.Link is disabled.\n" }, { "from": "human", "value": "import { injectCSS } from 'src/search-injection/dom'\nimport { setupRibbonUI } from './components'\n\nexport function loader(promiseCreator) {\n let promise\n\n return (...args) => {\...
javascript
chosen
[ { "from": "system", "value": "Set aria-current for first link of nav\n" }, { "from": "human", "value": "function setAriaCurrent() {\n\tvar id = document.getElementById(\"inicio\");\n\tid.textContent = document.title\n}\n\nsetAriaCurrent();\n" }, { "from": "gpt", "value": "function se...
javascript
chosen
[ { "from": "system", "value": "Tidy up handler a bit\n" }, { "from": "human", "value": "import Promise from 'bluebird';\nimport express from 'express';\nimport assert from 'assert';\nimport request from 'superagent'\n\nconst ROTTEN_TOMATOES_API_KEY = process.env.ROTTEN_TOMATOES_API_KEY;\nassert(R...
javascript
chosen
[ { "from": "system", "value": "Fix deopt with regex matches field load optimizing to undefined.\n\nLooping over a large array is fast if you minimize the work done on the\nloop. In the app I tested there were 3000+ modules, 23 initializers, and\n13 instance initializers. It is best to save the require work t...
javascript
chosen
[ { "from": "system", "value": ":new: Use ES6 Map as Database\n" }, { "from": "human", "value": "\n\n\"use strict\";\nvar\n OS = require('os'),\n Net = require('net'),\n CPP = require('childprocess-promise');\nclass Main{\n constructor(Port){\n this.Port = Port;\n this.Server = null;\n ...
javascript
chosen
[ { "from": "system", "value": "Remove reference to non-existent file\n" }, { "from": "human", "value": "var chai = require('chai');\nvar expect = chai.expect;\nvar jsdom = require('mocha-jsdom');\n\nvar helpers = require('../spec-helpers');\n\n\ndescribe('DrawerTabsView', function() {\n jsdom();...
javascript
chosen
[ { "from": "system", "value": "Fix in creating session error message\n" }, { "from": "human", "value": "define(['jquery', 'controllers/analystController', 'Ladda'], function ($, analystController, Ladda) {\n\n function sessionView() {\n\n\n $(function () {\n $('#generate').on('click', fu...
javascript
chosen
[ { "from": "system", "value": "Make get shuttles api route more secure by encapsulating array in data key\n\nThis is better as per this article: https://www.owasp.org/index.php/AJAX_Security_Cheat_Sheet#Always_return_JSON_with_an_Object_on_the_outside\n" }, { "from": "human", "value": "const expr...
javascript
chosen
[ { "from": "system", "value": "Normalize class names before prefixing\n" }, { "from": "human", "value": "import Ember from 'ember';\n\nconst FONT_SIZE_PATTERN = /font-size/;\n\nexport default Ember.Helper.helper(function ([prefix, ...classNames]) {\n return classNames.reduce(function(string, nam...
javascript
chosen
[ { "from": "system", "value": "Access denied post will no longer show up when logged in\n" }, { "from": "human", "value": "Router.configure({\n layoutTemplate: 'layout',\n loadingTemplate: 'loading',\n notFoundTemplate: 'notFound',\n waitOn: function() { return Meteor.subscribe('posts'); }\n}...
javascript
chosen
[ { "from": "system", "value": "Fix config check to work with ngCloakAuth\n" }, { "from": "human", "value": "'use strict';\n\n// Declare app level module which depends on filters, and services\nangular.module('myApp',\n ['myApp.config', 'myApp.filters', 'myApp.services', 'myApp.directives', '...
javascript
chosen
[ { "from": "system", "value": "Append HTML in demo app - much more fun to watch :)\n" }, { "from": "human", "value": "(function () {\n var indicator = document.createElement(\"h1\");\n indicator.innerHTML = \"Press a key on your keyboard.\";\n document.body.appendChild(indicator);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Add synchronization of note position after dragdrop between tabs\n" }, { "from": "human", "value": "define([\n 'backbone',\n 'models/noteModel',\n 'underscore',\n 'jquery',\n 'text!templates/noteTemplate.html',\n 'jquery.extensions'\n], function (B...
javascript
chosen
[ { "from": "system", "value": "Reduce work for verifying transaction completion\n" }, { "from": "human", "value": "/* eslint-env browser */\n\nconst isFunction = require('lodash/isFunction');\nconst isObject = require('lodash/isObject');\nconst isString = require('lodash/isString');\n\nconst { de...
javascript
chosen
[ { "from": "system", "value": "Add horizontal margin to the app.\n" }, { "from": "human", "value": "export class AppTemplate {\n static update(render) {\n /* eslint-disable indent */\n return render`\n <header></header>\n\n <div class=\"flex flex-wrap-s flex...
javascript
chosen
[ { "from": "system", "value": "[fix] Check for lack of host header.\n" }, { "from": "human", "value": "var union = require('union'),\n ecstatic = require('ecstatic');\n\nvar port = process.env.PORT || 8080;\n\n//\n// ### redirect(res)\n// World's simplest redirect function\n//\nfunction red...
javascript
chosen
[ { "from": "system", "value": "Allow a user’s widget data to be null on the settings page.\n" }, { "from": "human", "value": "import React from 'react'\nimport PropTypes from 'prop-types'\nimport WidgetSettings from './WidgetSettingsContainer'\nimport SettingsChildWrapper from '../SettingsChildWr...
javascript
chosen
[ { "from": "system", "value": "Test why aria-current is not read: remove accesskey\n" }, { "from": "human", "value": "function setAriaCurrent() {\n\tvar title = document.title;\n\tif title== \"Comunidad hispanohablante de NVDA\" {\n\t\tvar id = \"inicio\"\n\t}\n\tdocument.getElementById(id).setAt...
javascript
chosen
[ { "from": "system", "value": "Change `assign` to not use a for-in loop\n\nApparently, v8’s JIT engineers require that we, as JavaScript developers\nperform this very simple transformation, since they do not seem capable\nof performing it themselves.\n" }, { "from": "human", "value": "import keys...
javascript
chosen
[ { "from": "system", "value": "Throw new error in order to test nightmare js setup\n" }, { "from": "human", "value": "if(!window.jQuery) window.$ = window.Zepto = require('zepto-browserify').$;\n\nrequire('./components/polyfills.js')();\n\nlet warn = (msg) => {\n if (!window || !window.console...
javascript
chosen
[ { "from": "system", "value": "Use proper target for button\n" }, { "from": "human", "value": "$(function(){\n $( \"input[type='submit']\" ).click(function() {\n $(\"form[data-remote]\").on(\"ajax:success\", function(e, data, status, xhr) {\n $('.flash-notice').show(300);\n $(\":inp...
javascript
chosen
[ { "from": "system", "value": "Fix bug with guarding for MixPanel in demo env\n" }, { "from": "human", "value": "(function() {\n // Define filter operations\n window.shared || (window.shared = {});\n var Env = window.shared.Env;\n\n window.shared.MixpanelUtils = {\n isMixpanelEnabled: func...
javascript
chosen
[ { "from": "system", "value": "Remove references to controllers from project page routing\n" }, { "from": "human", "value": "function routerConfig ($stateProvider, $urlRouterProvider) {\n 'ngInject';\n $stateProvider\n .state('home', {\n url: '/',\n templateUrl: 'app/main/main.html...
javascript
chosen
[ { "from": "system", "value": "Update Acceptance test, fix import to app login\n" }, { "from": "human", "value": "/* eslint-env mocha */\n/* eslint-disable func-names, prefer-arrow-callback */\n\nimport { createUser, removeUser } from './helpers.js'\n\ndescribe('APP - Log In', () => {\n beforeEa...
javascript
chosen
[ { "from": "system", "value": "Fix CSS loaders for ssr\n" }, { "from": "human", "value": "var webpack = require('webpack');\n\nmodule.exports = {\n entry: './entry',\n externals: {\n // Add global variables you would like to import\n 'react': 'React',\n 'react-router': 'ReactRouter',\n...
javascript
chosen
[ { "from": "system", "value": "Remove extraneous references to modal.\n" }, { "from": "human", "value": "PANDA.views.DatasetsResults = Backbone.View.extend({\n template: PANDA.templates.datasets_results,\n pager_template: PANDA.templates.pager,\n\n initialize: function(options) {\n ...
javascript
chosen
[ { "from": "system", "value": "Increase default max image size to 3 MB.\nThis should allow uploads from most phones with their default settings.\n" }, { "from": "human", "value": "// Disable auto discover for all elements:\n//Dropzone.autoDiscover = false;\nvar submissionDropzone;\n\nDropzone.opt...
javascript
chosen
[ { "from": "system", "value": "Use info growl for game rating growl.\nIt fits better with the component.\n" }, { "from": "human", "value": "angular.module( 'App.Game.RatingGrowl' ).service( 'Game_RatingGrowl', function( App, Api, Growls )\n{\n\tthis.show = function( game )\n\t{\n\t\t// Don't show...
javascript
chosen
[ { "from": "system", "value": "Put back accidentally removed `campaign`.\n" }, { "from": "human", "value": "/**\n * Login page\n */\n'use strict';\nvar $ = require('jquery');\n\nvar passwordForms = require('js/passwordForms');\n\nvar activateToggleBox = function () {\n var el = $(this);\n\n ...
javascript
chosen
[ { "from": "system", "value": "Use last hour to avoid empty interval\n" }, { "from": "human", "value": "// Delete these three lines once you have your environment variables set\n// The environment-configured 'keen' variable is set in layout.erb\n\nKeen.ready(function(){\n\n // ------------------...
javascript
chosen
[ { "from": "system", "value": "Make showWait() available to other scripts." }, { "from": "human", "value": "(function() {\n var selector = \"run_link\";\n var waiting_id = null;\n var counting_id = null;\n var timer_dom = 'counter';\n var wait_dom = 'please_wait';\n var wait_secs = 20;\n v...
javascript
chosen
[ { "from": "system", "value": "Add modal class to body when a modal view is shown\n" }, { "from": "human", "value": "define([\"backbone\", \"utils\"], function(B, $u) {\n return B.View.extend({\n initialize: function(options) {\n if (options.url)\n this.templat...
javascript
chosen
[ { "from": "system", "value": "Check all the todos and not just one\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport { addTodo } from './common.js';\n\n\ndescribe('App', function() {\n beforeEach(function() {\n addTodo('buy cheddar');\n addTodo('buy chorizo');\n ...
javascript
chosen
[ { "from": "system", "value": "Improve styling of error boundary <pre> output\n\nThe previous style was overflowing the screen, making some of the\ndetails disappear from the screenshot. Making the font smaller and\nbreaking more aggressively should help.\n" }, { "from": "human", "value": "// Thi...
javascript
chosen
[ { "from": "system", "value": "Rename cookie keys to be consistent with naming\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * @module code-project/handler/select-messaging-platform\n */\n\n/**\n * Stores the messaging platform information\n * @param {Request} request - Hapi Request\n...
javascript
chosen
[ { "from": "system", "value": "Change the property name of mediaoption\n" }, { "from": "human", "value": "/*\n * Copyright 2015 Samsung Electronics Co., Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the Licen...
javascript
chosen
[ { "from": "system", "value": "Set margin 0 for divider\n" }, { "from": "human", "value": "import MJMLColumnElement from './decorators/MJMLColumnElement'\nimport React, { Component } from 'react'\nimport _ from 'lodash'\n\n/**\n * Displays a customizable divider\n */\n@MJMLColumnElement({\n tagN...
javascript
chosen
[ { "from": "system", "value": " Add some comments in dockerfile\n" }, { "from": "human", "value": "'use strict';\n\n// Development specific configuration\n// ==================================\nmodule.exports = {\n // MongoDB connection options\n mongo: {\n uri: process.env.MONGOLAB_URI || '...
javascript
chosen
[ { "from": "system", "value": "Doc: Standardize Jsdoc style in Defiant.Plugin\n" }, { "from": "human", "value": "'use strict';\n\n/**\n * Base Plugin class that all subsequent Plugins should be based on.\n * @class\n * @memberOf Defiant\n */\nclass Plugin {\n /**\n * @constructor\n * @param ...
javascript
chosen
[ { "from": "system", "value": "Fix part day events spanning two days being displayed on two rows\n" }, { "from": "human", "value": "import { differenceInCalendarDays, startOfDay, endOfDay, min, max } from 'proton-shared/lib/date-fns-utc';\n\nexport const splitDayEventsInInterval = ({ events = [],...
javascript
chosen
[ { "from": "system", "value": "Make correct reference to engines in the `engines` directory\n\nThe engines files were being loaded in by `Path.join('./', <file>)\nIt seems that depending on where this function is being called\nthe path reference of `'./'` would point elsewhere instead of the\n`engines` direc...
javascript
chosen
[ { "from": "system", "value": "Return copy of notes sorted\n" }, { "from": "human", "value": "import Marked from 'marked'\n\nexport const orderedNotes = state => {\n return state.notes.sort((a, b) => {\n var aOrder = state.notesOrder[a['.key']]\n var bOrder = state.notesOrder[b['.key']]\n ...
javascript
chosen
[ { "from": "system", "value": "Move authentication block inside network layer setup\n" }, { "from": "human", "value": "/*\n Bootstrap components and api on DOM Load\n*/\n\n/* global Turbolinks document */\nimport Relay from 'react-relay';\nimport {\n mountComponents,\n unmountComponents,\n} fr...
javascript
chosen
[ { "from": "system", "value": "Remove the typeahead and only use bloodhound\n" }, { "from": "human", "value": "$(function() {\n var speakersBH = new Bloodhound({\n datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),\n queryTokenizer: Bloodhound.tokenizers.whitespace,\n ...
javascript
chosen
[ { "from": "system", "value": "Use arrow function in test\n" }, { "from": "human", "value": "'use strict';\n\nconst fs = require('fs');\n\nfunction read(filename) {\n return fs.readFileSync(filename, {'encoding': 'utf8'});\n}\n\nexports.cname = {\n 'build': function(test) {\n const actual = ...
javascript
chosen
[ { "from": "system", "value": "Remove a now useless test\n" }, { "from": "human", "value": "var merge = require('./merge');\nvar isPlainObject = require('./isPlainObject');\n\nvar hash = JSON.stringify;\n\nfunction applyTransforms(transforms, declarations, transformCache, result) {\n var prope...
javascript
chosen
[ { "from": "system", "value": "Add a method for fetching a node, and collections list (artifacts).\n" }, { "from": "human", "value": "// Define DrupalAjaxRequest\nvar DrupalAjaxRequest = (function () {\n var fetch = function(feed_id, callback) {\n Zepto.ajax(\n {\n url: Kiosk....
javascript
chosen
[ { "from": "system", "value": "Remove warning section from input\n" }, { "from": "human", "value": "import { expect } from 'chai';\nimport intercept from 'intercept-stdout';\nimport { IO, resolveValue, triggerWarnings } from '../src/input';\nimport { String as Text } from '../src/types';\nimport ...
javascript
chosen
[ { "from": "system", "value": "Fix path to packaged sinon test dependency\n" }, { "from": "human", "value": "module.exports = function (config) {\n config.set({\n browsers: [ 'PhantomJS' ],\n plugins: [\n 'karma-mocha',\n 'karma-coverage',\n 'karm...
javascript
chosen
[ { "from": "system", "value": "Add destructuring comment to home container\n" }, { "from": "human", "value": "import React, {Component, PropTypes} from 'react';\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport {fetchHome} from '../actions/homeActions';\n\nc...
javascript
chosen
[ { "from": "system", "value": "Fix Card Opened Webhook can not be disabled.\n\nThanks to mvanvoorden and xet7 !\n\nCloses #2932,\ncloses #2889,\ncloses #2666\n" }, { "from": "human", "value": "Meteor.startup(() => {\n if (process.env.CARD_OPENED_WEBHOOK_ENABLED) {\n Meteor.settings.public.CAR...
javascript
chosen
[ { "from": "system", "value": "Fix for high level registration test.\n\n* Exported single components now have compiled render function,\n not a template property.\n" }, { "from": "human", "value": "import Vue from 'vue'\nimport {\n default as VueMdl,\n MdlCheckbox,\n MdlBadge,\n components,\...
javascript
chosen
[ { "from": "system", "value": "Tweak the pattern to exclude WP.com templates from self-hosted packages.\n" }, { "from": "human", "value": "module.exports = {\n\tpackage: {\n\t\tfiles: [\n\t\t\t{\n\t\t\t\tcwd: '<%= paths.source %>',\n\t\t\t\tsrc: [\n\t\t\t\t\t'**',\n\t\t\t\t\t'!<%= paths.js %>/sou...
javascript
chosen
[ { "from": "system", "value": "Delete unused code related to electron binary location detection.\n" }, { "from": "human", "value": "const os = require('os');\nconst pathModule = require('path');\nconst Application = require('spectron').Application;\nconst electron = require('electron');\n\nconst ...
javascript
chosen
[ { "from": "system", "value": "Add hidden method to err page\n" }, { "from": "human", "value": "'use strict';\n\nconst template = require('../../views/pages/ErrorPage.hbs');\n\nclass ErrorPage {\n\tconstructor() {\n\t\tthis.container = document.createElement('div');\n\t\tthis.container.classList....
javascript
chosen
[ { "from": "system", "value": "Change custom markup to asynchronous testing\n" }, { "from": "human", "value": "'use strict';\n\nvar _ = require('lodash');\nvar fs = require('fs');\nvar utility = require('../utility');\n\ndescribe('custom markup', function() {\n before(function() {\n ...
javascript
chosen
[ { "from": "system", "value": "Test jetzt erfolgreich: Funktion testLineDifference existiert und scheint auch die richtig Rechenoperation durchzuführen, aber das wird jetzt noch genauer untersucht\n" }, { "from": "human", "value": "function getRibbon(links) {\n\t\n\tfor(var i=0;i<links.length;i++...
javascript
chosen
[ { "from": "system", "value": "FIX themesUrl - use 2.4\n" }, { "from": "human", "value": "/**\n * @type {string}\n */\nexport const themesUrl = 'https://geomapfish-demo-dc.camptocamp.com/sbrunner24/themes?version=2&background=background';\n\n\n/**\n * @type {string}\n */\nexport const projection ...
javascript
chosen
[ { "from": "system", "value": "Correct export to named import, rather then default\n" }, { "from": "human", "value": "export default from './WindowScroller'\nexport WindowScroller from './WindowScroller'\nexport IS_SCROLLING_TIMEOUT from './utils/onScroll'\n" }, { "from": "gpt", "valu...
javascript
chosen
[ { "from": "system", "value": "Add utility method to set config properties\n" }, { "from": "human", "value": "'use strict';\n\nconst _sinon = require('sinon');\nconst _clone = require('clone');\n\n/**\n * Helper class that helps construct mock config objects.\n */\nclass ConfigMockBuilder {\n ...
javascript
chosen
[ { "from": "system", "value": "Add JS to demo event bubbling for JULIA CASTRO\n" }, { "from": "human", "value": "$(document).ready(function() {\n // This is called after the document has loaded in its entirety\n // This guarantees that any elements we bind to will exist on the page\n // when w...
javascript
chosen
[ { "from": "system", "value": "Add react-dom to routerless renderer\n" }, { "from": "human", "value": "<% if (router) {%><%- imports(\n { 'react': ['React']\n , 'react-dom': ['ReactDOM']\n , './components/$paramName': [name]\n , 'react-router': [false, ['Router', 'Route']] }) %>\n\n<% if (app...
javascript
chosen
[ { "from": "system", "value": "Add a test for ready event\n" }, { "from": "human", "value": "var assert = require('assert');\nvar expect = require('chai').expect;\n\nvar Doorman = require('../');\n\ndescribe('Doorman', function () {\n it('should expose a constructor', function () {\n assert(t...
javascript
chosen
[ { "from": "system", "value": "Fix generated pages not showing publication on load\n" }, { "from": "human", "value": "$(function () {\n\tvar base = '/';\n\tvar initialTitle = document.title;\n\n\t$(Z).on('Z:publicationchange', function (ev, publication) {\n\t\tdocument.title = [publication.title,...
javascript
chosen
[ { "from": "system", "value": "Update base player class to accept options as a second parameter to its constructor\n" }, { "from": "human", "value": "import {EventEmitter} from 'events'\n\nexport default class Player extends EventEmitter {\n\n\tconstructor(game) {\n\t\tsuper();\n\t\tthis.game = g...
javascript
chosen
[ { "from": "system", "value": "Add gulp serve no build task\n" }, { "from": "human", "value": "/* ************************************ */\n/* Server */\n/* ************************************ */\n'use strict';\n\nvar path = require('path');\nvar gulp = require('gulp...
javascript
chosen
[ { "from": "system", "value": "Send to server as json\n" }, { "from": "human", "value": "var App = window.App || {};\n\nApp.Create = (function ($, w) {\n\n 'use strict';\n\n function Create ($el, options) {\n\n this.options = $.extend({}, Create.defaults, options);\n\n $($el)....
javascript
chosen
[ { "from": "system", "value": "Support program directives (like \"use strict\").\n" }, { "from": "human", "value": "exports.Program = (node, generator) => {\n // Program nodes should not have their own mapping.\n node.body.forEach(bodyNode => {\n generator.generate(bodyNode);\n });\n};\n\ne...
javascript
chosen
[ { "from": "system", "value": "Add development mode error logging\n\nRemove debug console.log()\n" }, { "from": "human", "value": "/* eslint no-process-exit:0 */\nimport fsp from 'fs-promise';\nimport _ from 'lodash';\nimport * as issueHandler from './issue-handler';\nimport {findProjectKey} from...
javascript
chosen
[ { "from": "system", "value": "Support for the new launcher_profiles.json format\n\nLauncher 2.0.1003 changed the launcher_profiles.json format slightly" }, { "from": "human", "value": "const mineflayer = require('mineflayer')\nconst path = require('path')\n\nif (process.argv.length !== 5) {\n c...
javascript
chosen
[ { "from": "system", "value": "Fix duplicate `g` creation on `resetG`\n" }, { "from": "human", "value": "// remove all children of the main `g` element\n// prepare for re-drawing (e.g. during resize) with margins\nexport default ({\n g,\n margin\n}) => {\n g.selectAll('*').remove()\n g.append...
javascript
chosen
[ { "from": "system", "value": "Change ALRT to new loader format" }, { "from": "human", "value": "define(function() {\n\n 'use strict';\n \n return function(resource) {\n if (resource.data.length < 12) {\n console.error('ALRT resource: expected length 12, got ' + resource.data.length);\...
javascript
chosen
[ { "from": "system", "value": "Adjust coverage reporting to focus on source code\n" }, { "from": "human", "value": "module.exports = {\n roots: [\"<rootDir>/test\"],\n modulePaths: [\"<rootDir>/src\", \"<rootDir>/node_modules\"],\n transform: {\n \"^.+\\\\.tsx?$\": \"ts-jest\",\n },\n col...
javascript
chosen
[ { "from": "system", "value": "Add changes to the js file\n" }, { "from": "human", "value": "// window.checkAdLoad = function(){\n// var checkAdLoadfunction = function(){\n// var msg = \"Ad unit is not present\";\n// if($(\"._teraAdContainer\")){\n// console.log(\"Ad unit is prese...
javascript
chosen
[ { "from": "system", "value": "Make the item creation operation its own method. It was getting a bit convoluted as an inline callback\n" }, { "from": "human", "value": "jsio('from common.javascript import Class')\njsio('import tasks.panels.Panel')\njsio('import ui.Button')\n\nexports = Class(task...
javascript
chosen
[ { "from": "system", "value": "Change hardcoded request path to location host\n" }, { "from": "human", "value": "import axios from 'axios'\nconst API_BASE = 'http://127.0.0.1:8888';\n\nexport default {\n get: (url) => {\n return axios.get(`${API_BASE}${url}`)\n },\n \n post(url, body) {\n ...
javascript
chosen
[ { "from": "system", "value": "Correct bug to initialize mogodbUri\n" }, { "from": "human", "value": "var mongo = require('mongodb');\nvar mongoUri = process.env.MONGOLAB_URI ||process.env.MONGOHQ_URL ||'mongodb://localhost/mydb';\n\nif (process.env.VCAP_SERVICES) {\n var env = JSON.parse(proce...
javascript
chosen
[ { "from": "system", "value": "Add test for components with dependencies\n" }, { "from": "human", "value": "function defaultTestHooksGetter() {\n return {\n before: global.before,\n beforeEach: global.beforeEach,\n afterEach: global.afterEach,\n after: global.afterEach\n };\n}\n\nmo...
javascript
chosen
[ { "from": "system", "value": "Fix crash when a user role has no locale string\n" }, { "from": "human", "value": "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useTranslator } from '@u-wave/react-translate';\nimport upperCaseFirst from '../../utils/upperCaseFirst';\nim...
javascript
chosen
[ { "from": "system", "value": "Add checks against invalid search input\n" }, { "from": "human", "value": "var minimatch = require('minimatch');\nvar is = require('annois');\nvar fp = require('annofp');\nvar zip = require('annozip');\n\n\nmodule.exports = function(model, query, cb) {\n if(!is.o...
javascript
chosen
[ { "from": "system", "value": "Support custom column width, offset, push and pull\n" }, { "from": "human", "value": "import { FormioComponents } from '../Components';\nexport class ColumnComponent extends FormioComponents {\n get className() {\n return 'col col-sm-' + this.component.colWidth;...
javascript
chosen
[ { "from": "system", "value": "Set suitable font-size to slide pages\n" }, { "from": "human", "value": "// @flow\nimport { PureComponent } from 'react'\nimport Measure from 'react-measure'\nimport type { Children } from 'react'\n\ntype Props = {\n className: string,\n children?: Children,\n}\n\...
javascript
chosen
[ { "from": "system", "value": "Add update to periods schema and methods\n" }, { "from": "human", "value": "/**\n * mSupply Mobile\n * Sustainable Solutions (NZ) Ltd. 2019\n */\n\nimport Realm from 'realm';\n\nexport class Period extends Realm.Object {}\n\nexport default Period;\n\nPeriod.schema =...
javascript
chosen
[ { "from": "system", "value": "Use HTTP_HOST env variable as default host address\n" }, { "from": "human", "value": "'use strict';\n\nconst { publicFolder } = require('unleash-frontend');\n\nconst isDev = () => process.env.NODE_ENV === 'development';\nconst THIRTY_DAYS = 30 * 24 * 60 * 60 * 1000;...
javascript
chosen
[ { "from": "system", "value": "Use an interval rather than a timeout to add the line number links\n" }, { "from": "human", "value": "$(function () {\n var highlight = null;\n var match = /#line\\-(\\d+)/g.exec(window.location.hash);\n if (match) {\n highlight = parseInt(match[1], ...
javascript
chosen
[ { "from": "system", "value": "Fix a typo as Zepto provides no method 'click' but only 'bind'.\n" }, { "from": "human", "value": "\n( function( exports )\n{\n \n var HelpCtrl = exports.HelpCtrl = function( $handle, $help, $interface )\n {\n this.$handle = $handle;\n this...
javascript
chosen
[ { "from": "system", "value": "Set exit code while process exits gracefully\n\ncf. https://nodejs.org/api/process.html#process_process_exit_code\n" }, { "from": "human", "value": "'use strict';\n\nconst { Issuer } = require('..');\n\nconst {\n ISSUER = 'https://guarded-cliffs-8635.herokuapp.com'...
javascript
chosen
[ { "from": "system", "value": "Use the new api for stringifying the box\n" }, { "from": "human", "value": "// Dependencies\nvar Box = require(\"../lib\");\n\n// Create a simple box\nvar b1 = new Box(\"20x10\");\nconsole.log(b1.toString());\n\n// Set custom marks\nvar b2 = new Box({\n w: 10\n ...
javascript
chosen
[ { "from": "system", "value": "Use whole words for date strings\n" }, { "from": "human", "value": "import moment from 'moment';\n\nmoment.updateLocale('en', {\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'secs',\n m: 'a minute',\n mm: '%d mins',\n h: 'an hour',\n...
javascript
chosen
[ { "from": "system", "value": "Update test for UI tweaks\n" }, { "from": "human", "value": "describe(\"Inspector\", function () {\n var inspector, element, entity = iD.Entity({type: 'node', id: \"n12345\", tags: {}});\n\n beforeEach(function () {\n inspector = iD.Inspector();\n ...
javascript
chosen
[ { "from": "system", "value": "Add max width to images\n" }, { "from": "human", "value": "module.exports = {\n siteMetadata: {\n name: `Iiro Jäppinen`,\n siteTitle: 'iiro.fi',\n siteUrl: `https://iiro.fi/`\n },\n plugins: [\n {\n resolve: 'gatsby-so...
javascript
chosen
[ { "from": "system", "value": "Add UMD pattern for exposing module\n\nExpose module using UMD for better interoperability with AMD/CommonJS\nenvironments.\n" }, { "from": "human", "value": "/*!\n * uQuery - A minimal URL parameter parsing library.\n * v0.1.2\n * (c) 2015 Aaron Harvey - aaron.h...
javascript
chosen
[ { "from": "system", "value": "Enable an user agent detection for HTML5 date.\n" }, { "from": "human", "value": "/**\n * @class CM_FormField_Date\n * @extends CM_FormField_Abstract\n */\nvar CM_FormField_Date = CM_FormField_Abstract.extend({\n _class: 'CM_FormField_Date',\n\n ready: function() ...
javascript
chosen
[ { "from": "system", "value": "Fix Gulp task not closing\n" }, { "from": "human", "value": "'use strict';\n\nconst { promisify } = require('util');\n\nconst { watch, series, parallel } = require('gulp');\n\nconst FILES = require('../files');\n\n// Returns a watch task\n// E.g. with `tasks` `{ FOR...
javascript
chosen
[ { "from": "system", "value": "Test recipe name rendering in each recipe entry\n" }, { "from": "human", "value": "const expect = require('chai').expect;\nconst React = require('react');\n// const TestUtils = require('react-addons-test-utils'); // Alternately could use the DOM API\n\nimport Recipe...
javascript
chosen
[ { "from": "system", "value": "[SYN5-432] Fix that one last locator\n" }, { "from": "human", "value": "export default {\n url: 'https://localhost:8080/#/instances',\n elements: {\n syncanoLogo: {\n selector: '.logo-white'\n },\n menuAccount: {\n selector: 'div[data-e2e=\"acco...
javascript
chosen
[ { "from": "system", "value": "Add PPLA and PPLA2 as locality\n" }, { "from": "human", "value": "var through2 = require('through2');\n\nfunction featureCodeToLayer(featureCode) {\n switch (featureCode) {\n case 'ADM1':\n return 'region';\n case 'ADM2':\n return 'count...
javascript
chosen
[ { "from": "system", "value": "Comment the main compiler script\n" }, { "from": "human", "value": "#!/usr/bin/env node\n\nconst argv = require('yargs')\n .usage('$0 [-a] [-o] [-i] filename')\n .boolean(['a', 'o', 'i'])\n .describe('a', 'show abstract syntax tree after parsing then stop')\n .d...
javascript
chosen
[ { "from": "system", "value": "Add filter to normalize images.\n" }, { "from": "human", "value": "(function() {\n\n angular.module('pokedex.filters', [])\n .filter('imageify', function() {\n return function(input) {\n return \"img/pokemons/\" + input.toLowerCase() + \".jpg\";\n ...
javascript
chosen
[ { "from": "system", "value": "Fix fromEmisions filtering for completion cutoff\n" }, { "from": "human", "value": "import React from 'react'\nimport ObservableView from './view'\nimport { isEmissionsArr } from '../../utils/isEmissionsArr'\n\nconst selectValue = obj => obj.x\n\nfunction fromEmissi...
javascript
chosen