code
stringlengths 122
4.99k
| label
int64 0
14
|
---|---|
diff --git a/lib/HotModuleReplacementPlugin.js b/lib/HotModuleReplacementPlugin.js @@ -153,7 +153,7 @@ module.exports = class HotModuleReplacementPlugin {
const buf = [source];
buf.push("");
buf.push("// __webpack_hash__");
- buf.push(`${this.requireFn}.h = () => hotCurrentHash`);
+ buf.push(this.requireFn + ".h = function() { return hotCurrentHash; };");
return this.asString(buf);
});
| 1 |
diff --git a/samples/csharp_dotnetcore/14.nlp-with-dispatch/NlpDispatch/NlpDispatchBot.cs b/samples/csharp_dotnetcore/14.nlp-with-dispatch/NlpDispatch/NlpDispatchBot.cs @@ -79,39 +79,39 @@ public NlpDispatchBot(BotServices services)
/// There are no dialogs used, since it's "single turn" processing, meaning a single
/// request and response, with no stateful conversation.
/// </summary>
- /// <param name="context">A <see cref="ITurnContext"/> containing all the data needed
+ /// <param name="turnContext">A <see cref="ITurnContext"/> containing all the data needed
/// for processing this conversation turn. </param>
/// <param name="cancellationToken">(Optional) A <see cref="CancellationToken"/> that can be used by other objects
/// or threads to receive notice of cancellation.</param>
/// <returns>A <see cref="Task"/> that represents the work queued to execute.</returns>
- public async Task OnTurnAsync(ITurnContext context, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken))
{
- if (context.Activity.Type == ActivityTypes.Message && !context.Responded)
+ if (turnContext.Activity.Type == ActivityTypes.Message && !turnContext.Responded)
{
// Get the intent recognition result
- var recognizerResult = await _services.LuisServices[DispatchKey].RecognizeAsync(context, cancellationToken);
+ var recognizerResult = await _services.LuisServices[DispatchKey].RecognizeAsync(turnContext, cancellationToken);
var topIntent = recognizerResult?.GetTopScoringIntent();
if (topIntent == null)
{
- await context.SendActivityAsync("Unable to get the top intent.");
+ await turnContext.SendActivityAsync("Unable to get the top intent.");
}
else
{
- await DispatchToTopIntentAsync(context, topIntent, cancellationToken);
+ await DispatchToTopIntentAsync(turnContext, topIntent, cancellationToken);
}
}
- else if (context.Activity.Type == ActivityTypes.ConversationUpdate)
+ else if (turnContext.Activity.Type == ActivityTypes.ConversationUpdate)
{
// Send a welcome message to the user and tell them what actions they may perform to use this bot
- if (context.Activity.MembersAdded != null)
+ if (turnContext.Activity.MembersAdded != null)
{
- await SendWelcomeMessageAsync(context, cancellationToken);
+ await SendWelcomeMessageAsync(turnContext, cancellationToken);
}
}
else
{
- await context.SendActivityAsync($"{context.Activity.Type} event detected", cancellationToken: cancellationToken);
+ await turnContext.SendActivityAsync($"{turnContext.Activity.Type} event detected", cancellationToken: cancellationToken);
}
}
| 10 |
diff --git a/public/app/js/cbus-ui.js b/public/app/js/cbus-ui.js @@ -695,9 +695,9 @@ cbus.broadcast.listen("episode_completed_status_change", function(e) {
// move to the first point
ctx.lineTo(0, CANVAS_BASELINE - (streamDataSkipped[0] / 500 * canvas.height));
- for (i = 1; i < streamDataSkipped.length - 2; i++) {
- var xc = (i * columnWidth + (i + 1) * columnWidth) / 2;
- var yc = (CANVAS_BASELINE - (streamDataSkipped[i] / 500 * canvas.height) + CANVAS_BASELINE - (streamDataSkipped[i + 1] / 500 * canvas.height)) / 2;
+ for (let i = 1, l = streamDataSkipped.length - 2; i < l; i++) {
+ let xc = (i * columnWidth + (i + 1) * columnWidth) / 2;
+ let yc = (CANVAS_BASELINE - (streamDataSkipped[i] / 500 * canvas.height) + CANVAS_BASELINE - (streamDataSkipped[i + 1] / 500 * canvas.height)) / 2;
ctx.quadraticCurveTo(i * columnWidth, CANVAS_BASELINE - (streamDataSkipped[i] / 500 * canvas.height), xc, yc);
}
// curve through the last two points
| 7 |
diff --git a/token-metadata/0x3A9FfF453d50D4Ac52A6890647b823379ba36B9E/metadata.json b/token-metadata/0x3A9FfF453d50D4Ac52A6890647b823379ba36B9E/metadata.json "symbol": "SHUF",
"address": "0x3A9FfF453d50D4Ac52A6890647b823379ba36B9E",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/magda-storage-api/src/createApiRouter.ts b/magda-storage-api/src/createApiRouter.ts -import { ApiError } from "@google-cloud/common";
import express from "express";
import { OutgoingHttpHeaders } from "http";
import ObjectStoreClient from "./ObjectStoreClient";
@@ -49,8 +48,7 @@ export default function createApiRouter(options: ApiRouterOptions) {
}
});
} catch (err) {
- if (err instanceof ApiError) {
- if (err.code === 404) {
+ if (err.code === "NotFound") {
res.status(404).send(
"No such object with fileId " +
fileId +
@@ -58,7 +56,6 @@ export default function createApiRouter(options: ApiRouterOptions) {
bucket
);
}
- }
res.status(500).send("Unknown error");
}
| 9 |
diff --git a/pages/base-adresse-nationale.js b/pages/base-adresse-nationale.js @@ -69,21 +69,17 @@ function BaseAdresseNationale({address}) {
}, [address, initialHash])
useEffect(() => {
- if (!initialHash && address) {
- if (address?.positions?.length > 1) {
- const coordinates = []
- address.positions.forEach(p => {
- coordinates.push(p.position.coordinates)
+ let bbox = address?.displayBBox
+
+ if (!initialHash && address?.positions?.length > 1) {
+ const coordinates = address.positions.map(p => {
+ return p.position.coordinates
})
- const llb = new maplibregl.LngLatBounds(coordinates)
- setBBox(llb)
- } else {
- setBBox(address.displayBBox)
- }
- } else {
- setBBox(null)
+ bbox = new maplibregl.LngLatBounds(coordinates).toArray()
}
+
+ setBBox(bbox)
}, [initialHash, address])
return (
| 7 |
diff --git a/ui/build/build.types.js b/ui/build/build.types.js @@ -90,7 +90,7 @@ function convertTypeVal (type, def) {
function getTypeVal (def) {
return Array.isArray(def.type)
- ? def.type.map(type => convertTypeVal(type, def)).join(' | ')
+ ? def.tsType || def.type.map(type => convertTypeVal(type, def)).join(' | ')
: convertTypeVal(def.type, def)
}
| 1 |
diff --git a/site/how.xml b/site/how.xml @@ -174,7 +174,7 @@ limitations under the License.
James Governor discusses how messaging in the cloud, specifically with RabbitMQ, is changing the way applications are architected. The slides on
that page (by Matt Biddulph) are definitely worth a look.
</li>
- <li><a href="http://railsdog.com/blog/2009/12/generating-pdfs-on-ec2-with-ruby/">Generating Thousands of PDFs on EC2 with Ruby</a><br/>
+ <li><a href="http://seancribbs.com/tech/2009/12/23/generating-thousands-of-pdfs-on-ec2-with-ruby/">Generating Thousands of PDFs on EC2 with Ruby</a><br/>
Describes how it is possible to leverage the cloud and RabbitMQ to scale-out a massive PDF generation task.
</li>
<li><a href="http://notes.variogr.am/post/67710296/replacing-amazon-sqs-with-something-faster-and-cheaper">Replacing Amazon SQS with something faster and cheaper</a><br/>
| 14 |
diff --git a/src/renderWrapper.js b/src/renderWrapper.js @@ -41,7 +41,7 @@ class ErrorBoundary extends React.Component {
fontSize: 'small',
},
},
- `Error when rendering component=${component}, variant${variant}\n\n${error.stack}`,
+ `Error when rendering component "${component}", variant "${variant}"\n\n${error.stack}`,
);
}
| 7 |
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml @@ -56,8 +56,12 @@ jobs:
# Define the type of virtual host machine on which to run the job:
runs-on: ${{ matrix.OS }}
- # Define the build matrix...
+ # Define the build matrix strategy...
strategy:
+ # Specify whether to cancel all in-progress jobs if any matrix job fails:
+ fail-fast: true
+
+ # Define the build matrix:
matrix:
# Define the list of build tasks:
BUILD_TASK: ['test-npm-install', 'test', 'benchmark', 'examples', 'test-coverage']
| 12 |
diff --git a/contribs/gmf/src/controllers/desktop.scss b/contribs/gmf/src/controllers/desktop.scss @@ -769,6 +769,13 @@ hr.ngeo-filter-separator-rules {
border-color: $color;
}
+// handle long text in dropdown
+ngeo-filter {
+ .dropdown-menu li > a {
+ white-space: normal;
+ }
+}
+
/**
* Ngeo Rule component
*/
@@ -782,6 +789,10 @@ ngeo-rule {
.dropdown > .dropdown-toggle {
text-align: left;
+ // handle long text in button
+ overflow: hidden;
+ text-overflow: ellipsis;
+ padding-right: 1rem;
&::after {
right: $app-margin;
top: 50%;
| 9 |
diff --git a/src/views/components/mod/mod_log/index.tsx b/src/views/components/mod/mod_log/index.tsx @@ -41,10 +41,11 @@ class ModLog extends React.Component {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var logs = JSON.parse(xmlhttp.responseText);
if (Object.keys(logs).length == 0) {
- pages -= numIncrement;
+ page -= numIncrement;
this.setState({ logPage: page });
- }
+ } else {
this.setState({ logs: logs });
+ }
// console.log(logs);
}
};
| 1 |
diff --git a/tests/test_ProxiedContracts.py b/tests/test_ProxiedContracts.py @@ -7,6 +7,7 @@ from tests.contract_interfaces.extern_state_fee_token_interface import ExternSta
from tests.contract_interfaces.havven_escrow_interface import PublicHavvenEscrowInterface
from tests.contract_interfaces.court_interface import FakeCourtInterface
+
class TestProxiedDestructibleExternStateToken(__import__('tests').test_DestructibleExternStateToken.TestDestructibleExternStateToken):
@classmethod
def setUpClass(cls):
@@ -32,8 +33,8 @@ class TestProxiedFeeCollection(__import__('tests').test_FeeCollection.TestFeeCol
def setUpClass(cls):
cls.havven_proxy, cls.proxied_havven, cls.nomin_proxy, cls.proxied_nomin, cls.havven_contract, cls.nomin_contract, cls.fake_court_contract = cls.deployContracts()
- cls.havven = PublicHavvenInterface(cls.proxied_havven, "ProxiedPublicHavven")
- cls.nomin = PublicNominInterface(cls.proxied_nomin, "ProxiedPublicNomin")
+ cls.havven = PublicHavvenInterface(cls.proxied_havven, "ProxiedHavven")
+ cls.nomin = PublicNominInterface(cls.proxied_nomin, "ProxiedNomin")
fast_forward(weeks=102)
@@ -52,9 +53,8 @@ class TestProxiedHavven(__import__('tests').test_Havven.TestHavven):
cls.havven_contract, cls.nomin_contract, cls.court_contract, \
cls.escrow_contract, cls.construction_block, cls.havven_event_dict = cls.deployContracts()
- cls.havven = PublicHavvenInterface(cls.proxied_havven, "ProxiedPublicHavven")
-
- cls.nomin = PublicNominInterface(cls.proxied_nomin, "ProxiedPublicNomin")
+ cls.havven = PublicHavvenInterface(cls.proxied_havven, "ProxiedHavven")
+ cls.nomin = PublicNominInterface(cls.proxied_nomin, "ProxiedNomin")
cls.initial_time = cls.havven.lastFeePeriodStartTime()
cls.time_fast_forwarded = 0
@@ -72,6 +72,7 @@ class TestProxiedHavvenEscrow(__import__('tests').test_HavvenEscrow.TestHavvenEs
cls.nomin = PublicNominInterface(cls.proxied_nomin, "ProxiedNomin")
cls.escrow = PublicHavvenEscrowInterface(cls.escrow_contract, "HavvenEscrow")
+
class TestProxiedIssuance(__import__('tests').test_Issuance.TestIssuance):
@classmethod
def setUpClass(cls):
| 7 |
diff --git a/src/generators/constrain.less b/src/generators/constrain.less .define-constrains(@variants) {
.generate-utility-variants('constrain'; @variants; {
max-width: extract(@__variant-value, 2);
- flex-basis: extract(@__variant-value, 2);
});
}
.define-constrains(@variants);
.generate-responsive-utility-variants('constrain'; @variants; @screens; {
max-width: extract(@__variant-value, 2);
- flex-basis: extract(@__variant-value, 2);
});
}
| 2 |
diff --git a/html/utilities/validation/isValidMonetary.js b/html/utilities/validation/isValidMonetary.js const isValidMonetary = (value) => {
const expression = /(^\$?(\d+|\d{1,3}(,\d{3})*)(\.\d+)?$)|^$/;
return expression.test(value);
-}
+};
export { isValidMonetary as default };
\ No newline at end of file
| 3 |
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb @@ -149,6 +149,12 @@ describe User do
@organization.destroy
end
+ def create_role(user)
+ # NOTE: It's hard to test the real Groups API call here, it needs a Rails server up and running
+ # Instead, we test the main step that this function does internally (creating a role)
+ user.in_database["CREATE ROLE \"#{user.database_username}_#{unique_name('role')}\""].all
+ end
+
it 'cannot be admin and viewer at the same time' do
user = ::User.new
user.organization = @organization
@@ -160,26 +166,22 @@ describe User do
it 'should not be able to create groups without admin rights' do
user = FactoryGirl.create(:valid_user, organization: @organization)
-
- # NOTE: It's hard to test the real Groups API call here, it needs a Rails server up and running
- # Instead, we test the main step that this function does internally (creating a role)
- expect { user.in_database.fetch("CREATE ROLE #{unique_name('role')}").all }.to raise_error
+ expect { create_role(user) }.to raise_error
end
it 'should be able to create groups with admin rights' do
user = FactoryGirl.create(:valid_user, organization: @organization, org_admin: true)
-
- expect { user.in_database.fetch("CREATE ROLE #{unique_name('role')}").all }.to_not raise_error
+ expect { create_role(user) }.to_not raise_error
end
it 'should revoke admin rights on demotion' do
user = FactoryGirl.create(:valid_user, organization: @organization, org_admin: true)
- expect { user.in_database.fetch("CREATE ROLE #{unique_name('role')}").all }.to_not raise_error
+ expect { create_role(user) }.to_not raise_error
user.org_admin = false
user.save
- expect { user.in_database.fetch("CREATE ROLE #{unique_name('role')}").all }.to raise_error
+ expect { create_role(user) }.to raise_error
end
end
| 7 |
diff --git a/.travis.yml b/.travis.yml @@ -3,14 +3,16 @@ node_js:
- '10'
cache:
directories:
- - "$HOME/.cache/yarn"
- - ".cache"
-dist: trusty
+ - node_modules
+ yarn: true
+dist: xenial
os:
- linux
script:
- yarn test
before_deploy: rm -rf node_modules
+before_install:
+ - npm install -g yarn
deploy:
provider: heroku
api_key:
| 7 |
diff --git a/src/store/actions/performNextAction.js b/src/store/actions/performNextAction.js @@ -30,8 +30,12 @@ async function withInterval (func) {
async function hasSwapExpired ({ getters }, { network, walletId, order }) {
const fromClient = getters.client(network, walletId, order.from)
+ try {
const latestBlock = await fromClient.chain.getBlockByNumber(await fromClient.chain.getBlockHeight())
return latestBlock.timestamp > order.swapExpiration
+ } catch (e) {
+ console.warn(e)
+ }
}
async function createSecret ({ getters, dispatch }, { order, network, walletId }) {
| 1 |
diff --git a/userscript.user.js b/userscript.user.js @@ -72848,7 +72848,7 @@ var $$IMU_EXPORT$$;
if (domain_nosub === "userapi.com") {
// https://sun6-14.userapi.com/impg/c200620/v200620345/27c83/89QyoQ7VCt8.jpg?size=200x0&quality=90&sign=e60754261191285d162c2466eddcc1a8
// https://sun6-14.userapi.com/c200620/v200620345/27c83/89QyoQ7VCt8.jpg
- newsrc = src.replace(/(:\/\/[^/]+\/+)impg\/+(.*?)(?:[?#].*)?$/, "$1$2");
+ newsrc = src.replace(/(:\/\/[^/]+\/+)imp[gf]\/+(.*?)(?:[?#].*)?$/, "$1$2");
if (newsrc !== src)
return newsrc;
}
@@ -106870,8 +106870,12 @@ var $$IMU_EXPORT$$;
domain_processed_cb();
if (!data) {
- // this is most likely to happen for null_if_no_change (source = undefined)
+ if (typeof source === "undefined" && !settings.gallery_download_unchanged) {
+ console_warn("Not downloading unchanged image", our_source);
+ } else {
console_error("Unable to download", source, our_source);
+ }
+
return cb();
} else {
add_file(data, function(progobj) {}, cb);
| 7 |
diff --git a/src/apps.json b/src/apps.json "js": {
"particleJS": ""
},
- "script": "/particles(?:\\min)?\\.js",
+ "script": "/particles(?:\\.min)?\\.js",
"html": "<div id=\"particles\\-js\">",
"website": "https://vincentgarreau.com/particles.js/"
},
| 1 |
diff --git a/sources/osgShader/CompilerVertex.js b/sources/osgShader/CompilerVertex.js @@ -170,9 +170,9 @@ var CompilerVertex = {
return boneMatrix;
},
- getTarget: function(name, i) {
- var type = name.indexOf('Tangent') !== -1 ? 'vec4' : 'vec3';
- return this.getOrCreateAttribute(type, name + '_' + i);
+ getTarget: function(inputName, i) {
+ var type = inputName.indexOf('Tangent') !== -1 ? 'vec4' : 'vec3';
+ return this.getOrCreateAttribute(type, inputName + '_' + i);
},
morphTangentApproximation: function(inputVertex, outputVertex) {
@@ -203,10 +203,30 @@ var CompilerVertex = {
return outputVertex;
},
+ getTargetWeights: function(inputName) {
+ var targetWeights = this.getOrCreateUniform('vec4', 'uTargetWeights');
+ if (inputName.indexOf('Normal') === -1 && inputName.indexOf('Tangent') === -1) {
+ return targetWeights;
+ }
+
+ var nWeights = this.getVariable('nTargetWeights');
+ if (nWeights) return nWeights;
+
+ nWeights = this.createVariable('vec4', 'nTargetWeights');
+
+ // normalize weights to avoid negative weight for base normal/tangent
+ this.getNode('InlineCode')
+ .code('%output = %wts / max(1.0, %wts[0] + %wts[1] + %wts[2] + %wts[3]);')
+ .inputs({ wts: targetWeights })
+ .outputs({ output: nWeights });
+
+ return nWeights;
+ },
+
morphTransformVec3: function(inputVertex, outputVertex) {
var inputs = {
vertex: inputVertex,
- weights: this.getOrCreateUniform('vec4', 'uTargetWeights')
+ weights: this.getTargetWeights(inputVertex.getVariable())
};
var numTargets = this._morphAttribute.getNumTargets();
| 7 |
diff --git a/resources/views/laravel-medialibrary/v7/downloading-media/downloading-multiple-files.md b/resources/views/laravel-medialibrary/v7/downloading-media/downloading-multiple-files.md @@ -6,7 +6,7 @@ You might want to let users be able to download multiple files at once. Traditio
The medialibrary is able to zip stream multiple files on the fly. So you don't need to create a zip archive on your server.
-The provided `ZipStreamResponse` class that allows you to respond with a stream. Files will be zipped on the fly and you can even include files from multiple filesystems.
+The provided `MediaStream` class that allows you to respond with a stream. Files will be zipped on the fly and you can even include files from multiple filesystems.
Here's an example on how it can be used:
@@ -20,7 +20,7 @@ class DownloadMediaController
// Download the files associated with the media in a streamed way.
// No prob if your files are very large.
- return ZipStreamResponse::create('my-files.zip')->addMedia($downloads);
+ return MediaStream::create('my-files.zip')->addMedia($downloads);
}
}
```
| 10 |
diff --git a/src/data/icons.yaml b/src/data/icons.yaml viewBox: 0 0 64 64
description: Used to illustrate the direction an action can be taken or where the user will
be taken after the action is taken.
+- name: chevron-down-circle
+ viewBox: 0 0 64 64
+ description: ...
- name: chevron-down-circle-filled
viewBox: 0 0 64 64
description: ...
viewBox: 0 0 64 64
description: Used to illustrate the direction an action can be taken or where the user will
be taken after the action is taken.
+- name: chevron-left-circle
+ viewBox: 0 0 64 64
+ description: ...
- name: chevron-right
viewBox: 0 0 64 64
description: Used to illustrate the direction an action can be taken or where the user will
be taken after the action is taken.
+- name: chevron-right-circle
+ viewBox: 0 0 64 64
+ description: ...
- name: chevron-up
viewBox: 0 0 64 64
description: Used to illustrate the direction an action can be taken or where the user will
be taken after the action is taken.
+- name: chevron-up-circle
+ viewBox: 0 0 64 64
+ description: ...
- name: clock
viewBox: 0 0 64 64
description: The clock icon should be used to indicate when something is time sensitive.
| 3 |
diff --git a/tests/e2e/plugins/reset.php b/tests/e2e/plugins/reset.php @@ -12,4 +12,17 @@ use Google\Site_Kit\Core\Util\Reset;
register_activation_hook( __FILE__, static function () {
( new Reset( new Context( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ) )->all();
+
+ /**
+ * Remove anything left behind.
+ * @link https://github.com/google/site-kit-wp/issues/351
+ */
+ global $wpdb;
+
+ $wpdb->query(
+ "DELETE FROM $wpdb->options WHERE option_name LIKE '%googlesitekit%'"
+ );
+ $wpdb->query(
+ "DELETE FROM $wpdb->usermeta WHERE meta_key LIKE '%googlesitekit%'"
+ );
} );
| 3 |
diff --git a/test/www/jxcore/bv_tests/testThaliMobileNative.js b/test/www/jxcore/bv_tests/testThaliMobileNative.js @@ -343,6 +343,7 @@ function shiftData (t, sock, exchangeData) {
}
});
sock.on('close', function () {
+ t.equal(receivedData, exchangeData, 'got the same data back');
resolve();
});
| 0 |
diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js @@ -470,38 +470,38 @@ function getPaymentMethodMenuWidth(isSmallScreenWidth) {
* @returns {Array} The RGB components of the RGBA color converted to RGB.
*/
function convertRGBAToRGB(foregroundRGB, backgroundRGB, opacity) {
- const [foregroundR, foregroundG, foregroundB] = foregroundRGB;
- const [backgroundR, backgroundG, backgroundB] = backgroundRGB;
+ const [foregroundRed, foregroundGreen, foregroundBlue] = foregroundRGB;
+ const [backgroundRed, backgroundGreen, backgroundBlue] = backgroundRGB;
return [
- ((1 - opacity) * backgroundR) + (opacity * foregroundR),
- ((1 - opacity) * backgroundG) + (opacity * foregroundG),
- ((1 - opacity) * backgroundB) + (opacity * foregroundB),
+ ((1 - opacity) * backgroundRed) + (opacity * foregroundRed),
+ ((1 - opacity) * backgroundGreen) + (opacity * foregroundGreen),
+ ((1 - opacity) * backgroundBlue) + (opacity * foregroundBlue),
];
}
/**
* Denormalizes the three components of a color in RGB notation.
*
- * @param {number} r The first normalized component of a color in RGB notation.
- * @param {number} g The second normalized component of a color in RGB notation.
- * @param {number} b The third normalized component of a color in RGB notation.
+ * @param {number} red The first normalized component of a color in RGB notation.
+ * @param {number} green The second normalized component of a color in RGB notation.
+ * @param {number} blue The third normalized component of a color in RGB notation.
* @returns {Array} An array with the three denormalized components of a color in RGB notation.
*/
-function denormalizeRGB(r, g, b) {
- return [Math.floor(r * 255), Math.floor(g * 255), Math.floor(b * 255)];
+function denormalizeRGB(red, green, blue) {
+ return [Math.floor(red * 255), Math.floor(green * 255), Math.floor(blue * 255)];
}
/**
* Normalizes the three components of a color in RGB notation.
*
- * @param {number} r The first denormalized component of a color in RGB notation.
- * @param {number} g The second denormalized component of a color in RGB notation.
- * @param {number} b The third denormalized component of a color in RGB notation.
+ * @param {number} red The first denormalized component of a color in RGB notation.
+ * @param {number} green The second denormalized component of a color in RGB notation.
+ * @param {number} blue The third denormalized component of a color in RGB notation.
* @returns {Array} An array with the three normalized components of a color in RGB notation.
*/
-function normalizeRGB(r, g, b) {
- return [r / 255, g / 255, b / 255];
+function normalizeRGB(red, green, blue) {
+ return [red / 255, green / 255, blue / 255];
}
/**
@@ -513,13 +513,13 @@ function normalizeRGB(r, g, b) {
function getThemeBackgroundColor() {
const backdropOpacity = variables.modalFullscreenBackdropOpacity;
- const [backgroundR, backgroundG, backgroundB] = hexadecimalToRGBComponents(themeColors.appBG);
- const [backdropR, backdropG, backdropB] = hexadecimalToRGBComponents(themeColors.modalBackdrop);
- const normalizedBackdropRGB = normalizeRGB(backdropR, backdropG, backdropB);
+ const [backgroundRed, backgroundGreen, backgroundBlue] = hexadecimalToRGBComponents(themeColors.appBG);
+ const [backdropRed, backdropGreen, backdropBlue] = hexadecimalToRGBComponents(themeColors.modalBackdrop);
+ const normalizedBackdropRGB = normalizeRGB(backdropRed, backdropGreen, backdropBlue);
const normalizedBackgroundRGB = normalizeRGB(
- backgroundR,
- backgroundG,
- backgroundB,
+ backgroundRed,
+ backgroundGreen,
+ backgroundBlue,
);
const themeRGBNormalized = convertRGBAToRGB(
normalizedBackdropRGB,
| 10 |
diff --git a/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/pagebrowser/template.vue b/admin-base/ui.apps/src/main/content/jcr_root/apps/admin/components/pagebrowser/template.vue type: "checkbox",
label: "Open in new window?",
model: "newWindow",
- default: true
+ default: false
}
]
},
| 12 |
diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -10,6 +10,74 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master
where X.Y.Z is the semver of most recent plotly.js release.
+## [1.42.0] -- 2018-10-29
+
+### Added
+- Add `parcats` (aka parallel categories) trace type [#2963, #3072]
+- Add new gl3d tick and title auto-rotation algorithm that limits text
+ overlaps [#3084, #3104, #3131]
+- Add support for reversed-range axes on gl3d subplots [#3141]
+- Add modebar layout style attributes: `orientation`, `bgcolor`, `color`
+ and `activecolor` [#3068, #3091]
+- Add `title`, `titleposition` and `titlefont` attributes to `pie` traces [#2987]
+- Add `hoverlabel.split` attribute to `ohlc` and `candlestick` traces to split
+ hover labels into multiple pieces [#2959]
+- Add support for `line.shape` values 'hv', 'vh', 'hvh' and 'vhv'
+ in `scattergl` traces [#3087]
+- Add handler for `PlotlyConfig.MathJaxConfig: 'local'` to override our default
+ MathJax behavior which modifies the global MathJax config on load [#2994]
+- Add support for graph div as first argument for `Plotly.makeTemplate`
+ and `Plotly.validateTemplate` [#3111, #3118]
+- Implement trace, node and link hoverinfo for `sankey` traces [#3096, #3150]
+- Implement per-sector textfont settings in `pie` traces [#3130]
+
+## Changed
+- Use new Plotly logo in "Produced with Plotly" modebar button [#3068]
+- Improve `histogram` autobin algorithm: allow partial bin specification,
+ deprecate `autobin(x|y)` attributes, force stacked/grouped histograms to match size
+ and have compatible `start` value [#3044]
+- Count distinct values for category and date axis auto-type, which
+ improves the detection of "NaN" string values in numerical data [#3070]
+- Improve bar and pie textfont color inheritance [#3130]
+- Improve `splom` first-render, axis range relayout and marker restyle
+ performance [#3057, #3161]
+- Make `splom` `xaxes` and `yaxes` list always have same length as the trace
+ `dimensions` regardless of their partial visiblities [#3057]
+- Improve axis `overlaying` documentation [#3082]
+
+### Fixed
+- Fix `gl3d` subplots on tablets [#3088]
+- Fix responsive behavior under flexbox and grid CSS [#3056, #3090, #3122]
+- Fix relayout calls turning back `autosize` on [#3120]
+- Fix MathJax rendering (for recent versions of MathJax) [#2994]
+- Fix `scattergl` update on graphs with fractional computed dimensions [#3132]
+- Fix `scattergl` symbols in MS Edge [#2750]
+- Fix `scattergl` selections on overlaying axes [#3067]
+- Fix `scattergl` `tozero` fills with bad values [#3087, #3168]
+- Fix `scattergl` fill layer ordering [#3087]
+- Fix `scattergl` lines on reversed-range axes [#3078]
+- Fix axis auto-type routine for boolean data [#3070]
+- Fix `splom` axis placement when the diagonal is missing [#3057]
+- Fix line `restyle` calls on `parcoords` traces [#3178]
+- Fix `parcoods` rendering after `hovermode` relayout calls [#3123]
+- Fix WebGL warnings for `scatter3d` traces with blank text items [#3171, #3177]
+- Fix WebGL warnings for `scatter3d` trace with empty lines [#3174]
+- Fix rendering of `scatter3d` lines for certain scene angles [#3163]
+- Fix handling of large pad values in `sankey` traces [#3143]
+- Fix `scatterpolargl` to `scatterpolar` toggling [#3098]
+- Fix `scatterpolargl` axis-autorange padding [#3098]
+- Fix `bar` text position for traces with set `base` [#3156]
+- Fix `bar` support for typed arrays for `width` and `offset` attributes [#3169]
+- Fix aggregate transforms with bad group values [#3093]
+- Fix transforms operating on auto-invisible traces [#3139]
+- Fix templating for polar and carpet axes [#3092, #3095]
+- Ignore invalid trace indices in restyle and update [#3114]
+- Fix grid style `relayout` calls on graph with large `splom` traces [#3067]
+- Fix logging on some old browsers [#3137]
+- Remove erroneous warning `WARN: unrecognized full object value` when
+ relayouting array containers [#3053]
+
+
## [1.41.3] -- 2018-09-25
### Fixed
| 3 |
diff --git a/src/App/components/StoryMaster/NuxJoinCard/index.js b/src/App/components/StoryMaster/NuxJoinCard/index.js @@ -36,15 +36,20 @@ class NuxJoinCard extends Component {
componentWillMount = () => {
const { user: { frequencies } } = this.props;
const usersFrequencies = Object.keys(frequencies);
+ let featuredArr = this.state.featured.slice();
// show the unjoined featured frequencies first
featured.map((freq, i) => {
if (includes(usersFrequencies, freq.id)) {
- this.state.featured.push(freq);
+ featuredArr.push(freq);
} else {
- this.state.featured.unshift(freq);
+ featuredArr.unshift(freq);
}
});
+
+ this.setState({
+ featured: featuredArr,
+ });
};
render() {
@@ -61,7 +66,8 @@ class NuxJoinCard extends Component {
</Description>
<Hscroll>
- {this.state.featured.map((freq, i) => {
+ {this.state.featured.length > 0 &&
+ this.state.featured.map((freq, i) => {
let freqIdString = `"${freq.id}"`;
return (
<FreqCard key={i}>
| 1 |
diff --git a/src/formio.form.js b/src/formio.form.js @@ -238,10 +238,19 @@ export class FormioForm extends FormioComponents {
}
keyboardCatchableElement(element) {
+ if (element.nodeName === 'TEXTAREA') {
+ return false;
+ }
+
+ if (element.nodeName === 'INPUT') {
return [
- 'INPUT',
- 'TEXTAREA'
- ].indexOf(element.nodeName) === -1;
+ 'text',
+ 'email',
+ 'password'
+ ].indexOf(element.type) === -1;
+ }
+
+ return true;
}
executeShortcuts(event) {
| 7 |
diff --git a/src/api/message.js b/src/api/message.js @@ -34,6 +34,12 @@ const SEND_MESSAGE_OPTIONS = {
__typename: 'Message',
sender: {
...ownProps.currentUser,
+ contextPermissions: {
+ isOwner: false,
+ isModerator: false,
+ reputation: 0,
+ __typename: 'ContextPermissions',
+ },
__typename: 'User',
},
timestamp: +new Date(),
| 1 |
diff --git a/src/js/utils/modal.js b/src/js/utils/modal.js @@ -128,12 +128,17 @@ function createModalOverlay() {
* @param {HTMLElement} targetElement The element the opening will expose
* @param {SVGElement} openingElement The svg mask for the opening
*/
-function positionModalOpening(targetElement, openingElement) {
+function positionModalOpening(targetElement, openingElement, modalOverlayOpeningPadding) {
if (targetElement.getBoundingClientRect && openingElement instanceof SVGElement) {
const { x, y, width, height, left, top } = targetElement.getBoundingClientRect();
// getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top
- _setAttributes(openingElement, { x: x || left, y: y || top, width, height });
+ _setAttributes(openingElement, {
+ x: (x || left) - modalOverlayOpeningPadding,
+ y: (y || top) - modalOverlayOpeningPadding,
+ width: (width + (modalOverlayOpeningPadding * 2)),
+ height: (height + (modalOverlayOpeningPadding * 2))
+ });
}
}
| 0 |
diff --git a/.github/VISION.md b/.github/VISION.md @@ -124,6 +124,17 @@ Thanks for your support!
***TL-BR***: This list is most likely not even complete.
You don't need to be a genius in math to figure out that this is a massive amount of work.
+If I would create neo.mjs just for myself, there would be no Docs app, no Real World 1 or 2 app.
+I already put in a massive amount of time to enable you to use neo.mjs as well and I don't expect anyone to say thank
+you for doing this (although it is nice to hear :)).
+I would even be willing to continue this project on my own, but I would run bankrupt rather sooner than later without
+funding. So, assuming you know how the romantic idea of Open Source works, let me repeat the first part again:
+
+To speed up the current development there are two options:
+1. Help promoting neo.mjs or jump in as a contributor (see <a href="../CONTRIBUTING.md">Contributing</a>)
+2. Jump in as a sponsor to ensure I can spend more time on the neo.mjs coding side (see <a href="../BACKERS.md">Sponsors & Backers</a>)
+
+Best regards, Tobias
Copyright (c) 2015 - today, Tobias Uhlig & Rich Waters
\ No newline at end of file
| 12 |
diff --git a/js/whitebit.js b/js/whitebit.js // ---------------------------------------------------------------------------
const Exchange = require ('./base/Exchange');
-const { ExchangeNotAvailable, ExchangeError, DDoSProtection, BadSymbol, InvalidOrder, ArgumentsRequired } = require ('./base/errors');
+const { ExchangeNotAvailable, ExchangeError, DDoSProtection, BadSymbol, InvalidOrder, ArgumentsRequired, AuthenticationError, OrderNotFound, PermissionDenied, InsufficientFunds } = require ('./base/errors');
// ---------------------------------------------------------------------------
module.exports = class whitebit extends Exchange {
@@ -176,11 +176,19 @@ module.exports = class whitebit extends Exchange {
},
'exceptions': {
'exact': {
+ 'Unauthorized request.': AuthenticationError,
+ 'The order id field is required.': InvalidOrder, // {"code":0,"message":"Validation failed","errors":{"orderId":["The order id field is required."]}}
+ 'This action is unauthorized.': PermissionDenied, // {"code":0,"message":"This action is unauthorized."}
+ 'This API Key is not authorized to perform this action.': PermissionDenied,
+ 'Not enough balance': InsufficientFunds, // {"code":0,"message":"Validation failed","errors":{"amount":["Not enough balance"]}}
+ 'Amount must be greater than 0': InvalidOrder, // {"code":0,"message":"Validation failed","errors":{"amount":["Amount must be greater than 0"]}}
+ 'The market format is invalid.': BadSymbol, // {"code":0,"message":"Validation failed","errors":{"market":["The market format is invalid."]}}
+ 'Market is not available': BadSymbol, // {"success":false,"message":{"market":["Market is not available"]},"result":[]}
'503': ExchangeNotAvailable, // {"response":null,"status":503,"errors":{"message":[""]},"notification":null,"warning":null,"_token":null},
- '422': InvalidOrder, // {"response":null,"status":422,"errors":{"orderId":["Finished order id 1295772653 not found on your account"]},"notification":null,"warning":"Finished order id 1295772653 not found on your account","_token":null}
+ '422': OrderNotFound, // {"response":null,"status":422,"errors":{"orderId":["Finished order id 1295772653 not found on your account"]},"notification":null,"warning":"Finished order id 1295772653 not found on your account","_token":null}
},
'broad': {
- 'Market is not available': BadSymbol, // {"success":false,"message":{"market":["Market is not available"]},"result":[]}
+ 'Finished order id not found on your account': OrderNotFound, // {"response":null,"status":422,"errors":{"orderId":["Finished order id 435453454535 not found on your account"]},"notification":null,"warning":"Finished order id 435453454535 not found on your account","_token":null}
},
},
});
@@ -1162,13 +1170,26 @@ module.exports = class whitebit extends Exchange {
throw new ExchangeError (this.id + ' ' + code.toString () + ' endpoint not found');
}
if (response !== undefined) {
+ // For cases where we have a meaningful status
+ // {"response":null,"status":422,"errors":{"orderId":["Finished order id 435453454535 not found on your account"]},"notification":null,"warning":"Finished order id 435453454535 not found on your account","_token":null}
const status = this.safeValue (response, 'status');
- if ((status !== undefined && status !== '200')) {
+ // For these cases where we have a generic code variable error key
+ // {"code":0,"message":"Validation failed","errors":{"amount":["Amount must be greater than 0"]}}
+ const code = this.safeValue (response, 'code');
+ const hasErrorStatus = status !== undefined && status !== '200';
+ if (hasErrorStatus || code) {
const feedback = this.id + ' ' + body;
- const status = this.safeString (response, 'status');
- if (typeof status === 'string') {
+ if (hasErrorStatus) {
this.throwExactlyMatchedException (this.exceptions['exact'], status, feedback);
}
+ const errorObject = this.safeValue (response, 'errors');
+ if (errorObject !== undefined) {
+ const errorKey = Object.keys (errorObject)[0];
+ const errorMessageArray = this.safeValue (errorObject, errorKey, []);
+ const errorMessage = errorMessageArray.length > 0 ? errorMessageArray[0] : body;
+ this.throwExactlyMatchedException (this.exceptions['exact'], errorMessage, feedback);
+ this.throwBroadlyMatchedException (this.exceptions['broad'], errorMessage, feedback);
+ }
this.throwBroadlyMatchedException (this.exceptions['broad'], body, feedback);
throw new ExchangeError (feedback);
}
| 9 |
diff --git a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js @@ -459,7 +459,6 @@ module.exports = function(RED) {
if(!opts || typeof opts !== "object") {
return; //nothing to change, simply return
}
- // const originalBrokerURL = node.brokerurl;
//apply property changes (only if the property exists in the opts object)
setIfHasProperty(opts, node, "url", init);
@@ -468,7 +467,6 @@ module.exports = function(RED) {
setIfHasProperty(opts, node, "clientid", init);
setIfHasProperty(opts, node, "autoConnect", init);
setIfHasProperty(opts, node, "usetls", init);
- // setIfHasProperty(opts, node, "usews", init);
setIfHasProperty(opts, node, "verifyservercert", init);
setIfHasProperty(opts, node, "compatmode", init);
setIfHasProperty(opts, node, "protocolVersion", init);
@@ -567,9 +565,6 @@ module.exports = function(RED) {
if (typeof node.usetls === 'undefined') {
node.usetls = false;
}
- // if (typeof node.usews === 'undefined') {
- // node.usews = false;
- // }
if (typeof node.verifyservercert === 'undefined') {
node.verifyservercert = false;
}
| 2 |
diff --git a/src/style/themes/base/base-theme.config.js b/src/style/themes/base/base-theme.config.js @@ -32,20 +32,6 @@ export default (palette) => {
size: '14px'
},
- field: {
- text: {
- size: {
- primary: '14px',
- secondary: '16px'
- }
- },
- padding: {
- primary: '9px 1px',
- secondary: '9px 4px',
- tertiary: '9px 6px'
- }
- },
-
disabled: {
border: palette.slateTint(80),
disabled: blackWithOpacity(0.55),
| 13 |
diff --git a/tests/functional/aws-node-sdk/test/object/100-continue.js b/tests/functional/aws-node-sdk/test/object/100-continue.js @@ -78,7 +78,7 @@ class ContinueRequestHandler {
assert.strictEqual(req.socket.bytesWritten, expected);
return cb();
});
- //req.on('error', err => cb(err));
+ req.on('error', err => cb(err));
}
}
| 13 |
diff --git a/assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidget/LegacyDashboardAllTraffic.js b/assets/js/modules/analytics/components/dashboard/DashboardAllTrafficWidget/LegacyDashboardAllTraffic.js @@ -30,7 +30,6 @@ import DashboardModuleHeader from '../../../../../components/dashboard/Dashboard
import DashboardAllTrafficWidget from '.';
import { Cell } from '../../../../../material-components';
import { getWidgetComponentProps } from '../../../../../googlesitekit/widgets/util';
-import ReportError from '../../../../../components/ReportError';
function LegacyDashboardAllTraffic() {
const widgetComponentProps = getWidgetComponentProps( 'legacy-all-traffic-widget' );
@@ -44,7 +43,7 @@ function LegacyDashboardAllTraffic() {
</Cell>
<Cell size={ 12 }>
<Layout className="googlesitekit-pagespeed-widget">
- <DashboardAllTrafficWidget { ...widgetComponentProps } WidgetReportError={ ReportError } />
+ <DashboardAllTrafficWidget { ...widgetComponentProps } />
</Layout>
</Cell>
</Fragment>
| 2 |
diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx @@ -114,7 +114,7 @@ const Editor = createClass({
let editorPageCount = 2; // start counting from page 2
- const lineNumbers = _.reduce(this.props.brew.text.split('\n'), (r, line, lineNumber)=>{
+ _.forEach(this.props.brew.text.split('\n'), (line, lineNumber)=>{
if(this.props.renderer == 'legacy') {
if(line.includes('\\page')) {
const testElement = Object.assign(document.createElement('div'), {
@@ -125,7 +125,6 @@ const Editor = createClass({
testElement.style.top = `${parseInt(testElement.style.top) - 12.5}px`;
testElement.style.left = 'unset';
editorPageCount = editorPageCount + 1;
- r.push(lineNumber);
}
}
@@ -139,12 +138,9 @@ const Editor = createClass({
testElement.style.top = `${parseInt(testElement.style.top) - 12.5}px`;
testElement.style.left = 'unset';
editorPageCount = editorPageCount + 1;
- r.push(lineNumber);
}
}
- return r;
- }, []);
- return lineNumbers;
+ }, [])
}
},
| 14 |
diff --git a/packages/@uppy/core/src/_common.scss b/packages/@uppy/core/src/_common.scss Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
line-height: 1;
-webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
}
.uppy-Root *, .uppy-Root *:before, .uppy-Root *:after {
max-height: 100%;
fill: currentColor; /* no !important */
display: inline-block;
- // vertical-align: text-top;
overflow: hidden;
- // width: 1em;
- // height: 1em;
}
.UppyIcon--svg-baseline {
position: relative;
}
-// Buttons
-
-.UppyButton--circular {
- @include reset-button;
- box-shadow: 1px 2px 4px 0px rgba($color-black, 0.2);
- border-radius: 50%;
- cursor: pointer;
- transition: all 0.3s;
-}
-
-.UppyButton--blue {
- color: $color-white;
- background-color: $color-cornflower-blue;
-
- &:hover,
- &:focus {
- background-color: darken($color-cornflower-blue, 10%);
- }
-}
-
-.UppyButton--red {
- color: $color-white;
- background-color: $color-red;
-
- &:hover,
- &:focus {
- background-color: darken($color-red, 10%);
- }
-}
-
-.UppyButton--sizeM {
- width: 60px;
- height: 60px;
-}
-
-.UppyButton--sizeS {
- width: 45px;
- height: 45px;
-}
-
// Utilities
.uppy-u-reset {
| 2 |
diff --git a/articles/software-testing-part2/index.md b/articles/software-testing-part2/index.md @@ -72,7 +72,7 @@ Then, we create a first test that fulfills our first condition.
from factorial import find_factorial
-def test_find_factorial():
+def test_find_factorial_of_zero():
num = 0
assert find_factorial(num) == 1
```
| 10 |
diff --git a/packages/react-filerobot-image-editor/src/utils/cloudimageQueryToDesignState.js b/packages/react-filerobot-image-editor/src/utils/cloudimageQueryToDesignState.js @@ -173,8 +173,10 @@ const cloudimageQueryToDesignState = (
? {
[WATERMARK_ANNOTATION_ID]: {
...watermark,
+ x: (crop.x || 0) + (watermark.x || 0),
+ y: (crop.y || 0) + (watermark.y || 0),
id: WATERMARK_ANNOTATION_ID,
- name: watermark?.text ? TOOLS_IDS.TEXT : TOOLS_IDS.IMAGE,
+ name: watermark.text ? TOOLS_IDS.TEXT : TOOLS_IDS.IMAGE,
...(watermark.text
? {
width: watermark.text.length * watermark.fontSize,
| 7 |
diff --git a/includes/Core/Authentication/Clients/OAuth_Client.php b/includes/Core/Authentication/Clients/OAuth_Client.php @@ -208,6 +208,21 @@ final class OAuth_Client {
$this->google_client->setScopes( $this->get_required_scopes() );
$this->google_client->prepareScopes();
+ // This is called when the client refreshes the access token on-the-fly.
+ $this->google_client->setTokenCallback(
+ function( $cache_key, $access_token ) {
+ // All we can do here is assume an hour as it usually is.
+ $this->set_access_token( $access_token, HOUR_IN_SECONDS );
+ }
+ );
+
+ // This is called when refreshing the access token on-the-fly fails.
+ $this->google_client->setTokenExceptionCallback(
+ function( Exception $e ) {
+ $this->handle_fetch_token_exception( $e );
+ }
+ );
+
$profile = $this->profile->get();
if ( ! empty( $profile['email'] ) ) {
$this->google_client->setLoginHint( $profile['email'] );
@@ -229,21 +244,6 @@ final class OAuth_Client {
)
);
- // This is called when the client refreshes the access token on-the-fly.
- $this->google_client->setTokenCallback(
- function( $cache_key, $access_token ) {
- // All we can do here is assume an hour as it usually is.
- $this->set_access_token( $access_token, HOUR_IN_SECONDS );
- }
- );
-
- // This is called when refreshing the access token on-the-fly fails.
- $this->google_client->setTokenExceptionCallback(
- function( Exception $e ) {
- $this->handle_fetch_token_exception( $e );
- }
- );
-
return $this->google_client;
}
| 12 |
diff --git a/ui/src/screens/SearchScreen/SearchScreen.jsx b/ui/src/screens/SearchScreen/SearchScreen.jsx @@ -131,7 +131,7 @@ class SearchScreen extends React.Component {
icon: 'person'
}
];
- this.state = {facets: facets, toggle: false};
+ this.state = {facets: facets, hideFacets: false};
this.updateQuery = this.updateQuery.bind(this);
this.getMoreResults = this.getMoreResults.bind(this);
@@ -178,15 +178,15 @@ class SearchScreen extends React.Component {
}
toggleFacets() {
- this.setState({toggle: !this.state.toggle});
+ this.setState({hideFacets: !this.state.hideFacets});
}
render() {
const {query, result, intl} = this.props;
- const {toggle} = this.state;
+ const {hideFacets} = this.state;
const title = query.getString('q') || intl.formatMessage(messages.page_title);
- const toggleClass = toggle ? 'show' : 'hide';
- const plusMinusIcon = toggle ? 'minus' : 'plus';
+ const hideFacetsClass = hideFacets ? 'show' : 'hide';
+ const plusMinusIcon = hideFacets ? 'minus' : 'plus';
return (
<Screen query={query} updateQuery={this.updateQuery} title={title}>
@@ -215,7 +215,7 @@ class SearchScreen extends React.Component {
<FormattedMessage id="search.screen.filters" defaultMessage="Filters"/>
</span>
</div>
- <div className={toggleClass}>
+ <div className={hideFacetsClass}>
<SearchFacets query={query}
result={result}
updateQuery={this.updateQuery}
| 10 |
diff --git a/character-controller.js b/character-controller.js @@ -58,7 +58,20 @@ class PlayerHand extends THREE.Object3D {
this.enabled = false;
}
}
-class Player extends THREE.Object3D {
+class PlayerBase extends THREE.Object3D {
+ constructor() {
+ super();
+
+ this.leftHand = new PlayerHand();
+ this.rightHand = new PlayerHand();
+ this.hands = [
+ this.leftHand,
+ this.rightHand,
+ ];
+ this.avatar = null;
+ }
+}
+class StatePlayer extends PlayerBase {
constructor({
playerId = makeId(5),
playersArray = new Z.Doc().getArray(playersMapName),
@@ -81,15 +94,7 @@ class Player extends THREE.Object3D {
app.parent && app.parent.remove(app);
});
- this.leftHand = new PlayerHand();
- this.rightHand = new PlayerHand();
- this.hands = [
- this.leftHand,
- this.rightHand,
- ];
-
this.avatarEpoch = 0;
- this.avatar = null;
this.syncAvatarCancelFn = null;
this.unbindFns = [];
| 0 |
diff --git a/articles/api-auth/tutorials/implicit-grant.md b/articles/api-auth/tutorials/implicit-grant.md @@ -41,7 +41,7 @@ Where:
Auth0 returns profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID tokens or access tokens, they must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims) to avoid possible collisions with standard OIDC claims. For example, if you choose the namespace `https://foo.com/` and you want to add a custom claim named `myclaim`, you would name the claim `https://foo.com/myclaim`, instead of `myclaim`. You can [add namespaced claims using Rules](#optional-customize-the-tokens).
:::
-* `response_type`: Indicates the type of credentials returned in the response. For this flow you can either use `token`, to get only an `access_token`, `id_token` to get only an `id_token`, or `id_token token` to get both an `id_token` and an `access_token`.
+* `response_type`: Indicates the type of credentials returned in the response. For this flow you can either use `token`, to get only an `access_token`, `id_token` to get only an `id_token` (if you don't plan on accessing an API), or `id_token token` to get both an `id_token` and an `access_token`.
* `client_id`: Your application's Client ID. You can find this value at your [Client's Settings](${manage_url}/#/clients/${account.clientId}/settings).
@@ -126,17 +126,17 @@ For details on how to implement this, refer to [Silent Authentication](/api-auth
## Keep reading
-<i class="notification-icon icon-budicon-345"></i> [Implicit Grant overview](/api-auth/grant/implicit)<br/>
-<i class="notification-icon icon-budicon-345"></i> [How to protect your SPA against replay attacks](/api-auth/tutorials/nonce)<br/>
-<i class="notification-icon icon-budicon-345"></i> [Silent authentication for SPAs](/api-auth/tutorials/silent-authentication)<br/>
-<i class="notification-icon icon-budicon-345"></i> [How to configure an API in Auth0](/apis)<br/>
-<i class="notification-icon icon-budicon-345"></i> [Why you should always use access tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis)<br/>
-<i class="notification-icon icon-budicon-345"></i> [Single Page App Quickstarts](/quickstart/spa)<br/>
-<i class="notification-icon icon-budicon-345"></i> [ID Token](/tokens/id-token)<br/>
-<i class="notification-icon icon-budicon-345"></i> [Access Token](/tokens/access-token)<br/>
-<i class="notification-icon icon-budicon-345"></i> [Client Authentication for Client-side Web Apps](/client-auth/client-side-web)<br/>
-<i class="notification-icon icon-budicon-345"></i> [Authentication API: GET /authorize](/api/authentication#implicit-grant)<br/>
-<i class="notification-icon icon-budicon-345"></i> [The OAuth 2.0 protocol](/protocols/oauth2)<br/>
-<i class="notification-icon icon-budicon-345"></i> [The OpenID Connect protocol](/protocols/oidc)<br/>
-<i class="notification-icon icon-budicon-345"></i> [Tokens used by Auth0](/tokens)<br/>
-<i class="notification-icon icon-budicon-345"></i> [RFC 6749: The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749)
+- [Implicit Grant overview](/api-auth/grant/implicit)<br/>
+- [How to protect your SPA against replay attacks](/api-auth/tutorials/nonce)<br/>
+- [Silent authentication for SPAs](/api-auth/tutorials/silent-authentication)<br/>
+- [How to configure an API in Auth0](/apis)<br/>
+- [Why you should always use access tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis)<br/>
+- [Single Page App Quickstarts](/quickstart/spa)<br/>
+- [ID Token](/tokens/id-token)<br/>
+- [Access Token](/tokens/access-token)<br/>
+- [Client Authentication for Client-side Web Apps](/client-auth/client-side-web)<br/>
+- [Authentication API: GET /authorize](/api/authentication#implicit-grant)<br/>
+- [The OAuth 2.0 protocol](/protocols/oauth2)<br/>
+- [The OpenID Connect protocol](/protocols/oidc)<br/>
+- [Tokens used by Auth0](/tokens)<br/>
+- [RFC 6749: The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749)
| 0 |
diff --git a/codegens/libcurl/test/unit/convert.test.js b/codegens/libcurl/test/unit/convert.test.js @@ -36,13 +36,15 @@ function runSnippet (codeSnippet, collection, done) {
return callback(stderr);
}
- return exec('./executableFile', function (err, stdout, stderr) {
+ exec('./executableFile', function (err, stdout, stderr) {
if (err) {
return callback(err);
}
if (stderr) {
return callback(stderr);
}
+ // this because libcurl's stdout returns a 200(response code) at the end of response body
+ stdout = stdout.substring(0, stdout.length - 3);
try {
stdout = JSON.parse(stdout);
}
@@ -96,7 +98,9 @@ function runSnippet (codeSnippet, collection, done) {
'content-length',
'accept',
'total-route-time',
- 'cookie'
+ 'cookie',
+ 'cache-control',
+ 'postman-token'
];
if (result[0]) {
@@ -128,7 +132,7 @@ function runSnippet (codeSnippet, collection, done) {
});
}
-describe('curl convert function', function () {
+describe('libcurl convert function', function () {
describe('convert for different request types', function () {
mainCollection.item.forEach(function (item) {
| 1 |
diff --git a/test/www/jxcore/bv_tests/testThaliMobileNative.js b/test/www/jxcore/bv_tests/testThaliMobileNative.js @@ -339,10 +339,10 @@ function shiftData (t, sock, exchangeData) {
sock.on('data', function (chunk) {
receivedData += chunk.toString();
if (receivedData === exchangeData) {
- sock.end();
+ sock.destroy();
}
});
- sock.on('end', function () {
+ sock.on('close', function () {
resolve();
});
| 14 |
diff --git a/package-lock.json b/package-lock.json "pick-by-alias": "^1.2.0",
"raf": "^3.4.1",
"regl-scatter2d": "^3.1.9"
+ },
+ "dependencies": {
+ "@plotly/point-cluster": {
+ "version": "3.1.9",
+ "resolved": "https://registry.npmjs.org/@plotly/point-cluster/-/point-cluster-3.1.9.tgz",
+ "integrity": "sha512-MwaI6g9scKf68Orpr1pHZ597pYx9uP8UEFXLPbsCmuw3a84obwz6pnMXGc90VhgDNeNiLEdlmuK7CPo+5PIxXw==",
+ "requires": {
+ "array-bounds": "^1.0.1",
+ "binary-search-bounds": "^2.0.4",
+ "clamp": "^1.0.1",
+ "defined": "^1.0.0",
+ "dtype": "^2.0.0",
+ "flatten-vertex-data": "^1.0.2",
+ "is-obj": "^1.0.1",
+ "math-log2": "^1.0.1",
+ "parse-rect": "^1.2.0",
+ "pick-by-alias": "^1.2.0"
+ }
+ },
+ "regl-scatter2d": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/regl-scatter2d/-/regl-scatter2d-3.2.1.tgz",
+ "integrity": "sha512-qxUCK5kXuoVZin2gPLXkgkBfRr3XLobVgEfn5N0fiprsb/ncTCtSNVBqP0EJgNb115R+FXte9LKA9YrFx7uBnA==",
+ "requires": {
+ "@plotly/point-cluster": "^3.1.9",
+ "array-range": "^1.0.1",
+ "array-rearrange": "^2.2.2",
+ "clamp": "^1.0.1",
+ "color-id": "^1.1.0",
+ "color-normalize": "^1.5.0",
+ "color-rgba": "^2.1.1",
+ "flatten-vertex-data": "^1.0.2",
+ "glslify": "^7.0.0",
+ "image-palette": "^2.1.0",
+ "is-iexplorer": "^1.0.0",
+ "object-assign": "^4.1.1",
+ "parse-rect": "^1.2.0",
+ "pick-by-alias": "^1.2.0",
+ "to-float32": "^1.0.1",
+ "update-diff": "^1.1.0"
+ }
+ }
}
},
"remove-trailing-separator": {
| 3 |
diff --git a/waitlist/test/test_views.py b/waitlist/test/test_views.py from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
+from unittest.mock import patch
from books.models import Book, BookCopy, Library
from waitlist.models import WaitlistItem
@@ -16,17 +17,25 @@ class WaitlistViewSetTest(TestCase):
self.library = Library.objects.create(name="My library", slug="myslug")
self.book = Book.objects.create(author="Author", title="the title", subtitle="The subtitle",
publication_date=timezone.now())
- self.copy = BookCopy.objects.create(book=self.book, library=self.library, borrow_date=timezone.now())
-
self.base_url = "/api/libraries/" + self.library.slug + \
"/books/" + str(self.book.id) + \
"/waitlist/"
- def test_add_book_to_waitlist_should_return_201_code(self):
+ def test_should_return_201_response_when_create_item_is_successful(self):
+
+ with patch.object(WaitlistItem, 'create_item', return_value=None) as create_mock:
response = self.client.post(self.base_url)
+
self.assertEqual(response.status_code, 201)
- def test_add_book_to_waitlist_should_return_created_item(self):
+ def test_should_return_response_with_waitlist_item_when_create_item_is_successful(self):
+ created_item = WaitlistItem(
+ book=self.book,
+ library=self.library,
+ user=self.user,
+ added_date=timezone.now())
+
+ with patch.object(WaitlistItem, 'create_item', return_value=created_item):
response = self.client.post(self.base_url)
waitlist_item = response.data['waitlist_item']
@@ -35,32 +44,9 @@ class WaitlistViewSetTest(TestCase):
self.assertEqual(waitlist_item['library']['slug'], self.library.slug)
self.assertEqual(waitlist_item['book'], self.book.id)
- def test_add_book_to_waitlist_should_create_an_waitlist_item(self):
- self.assertEqual(self.user.waitlist_items.count(), 0)
- initialCount = WaitlistItem.objects.all().count()
-
- response = self.client.post(self.base_url)
-
- finalCount = WaitlistItem.objects.all().count()
- self.assertEqual(self.user.waitlist_items.count(), 1)
- self.assertEqual(initialCount + 1, finalCount)
-
- def test_should_not_add_book_to_waitlist_if_there_are_copies_available(self):
- initialCount = WaitlistItem.objects.all().count()
- BookCopy.objects.create(book=self.book, library=self.library)
+ def test_should_return_404_response_when_create_item_raises_value_error(self):
+ with patch.object(WaitlistItem, 'create_item', side_effect=ValueError):
response = self.client.post(self.base_url)
self.assertEqual(response.status_code, 404)
- finalCount = WaitlistItem.objects.all().count()
- self.assertEqual(initialCount, finalCount)
-
- def test_should_add_book_to_waitlist_if_there_are_no_copies_available(self):
- initialCount = WaitlistItem.objects.all().count()
-
- response = self.client.post(self.base_url)
-
- self.assertEqual(response.status_code, 201)
- finalCount = WaitlistItem.objects.all().count()
- self.assertEqual(initialCount + 1, finalCount)
-
| 7 |
diff --git a/polyfills/TypedArray/prototype/at/tests.js b/polyfills/TypedArray/prototype/at/tests.js /* global proclaim, Int8Array */
// use "Int8Array" as a proxy for all "TypedArray" subclasses
-if ('Int8Array' in self) {
+
it('is a function', function () {
proclaim.isFunction(Int8Array.prototype.at);
});
@@ -60,4 +60,3 @@ if ('Int8Array' in self) {
});
}
});
-}
| 2 |
diff --git a/publish/src/commands/deploy/check-aggregator-prices.js b/publish/src/commands/deploy/check-aggregator-prices.js 'use strict';
-const Web3 = require('web3');
+const ethers = require('ethers');
const axios = require('axios');
const { gray, yellow, red, cyan } = require('chalk');
@@ -11,7 +11,7 @@ module.exports = async ({ network, useOvm, providerUrl, synths, oldExrates, stan
const output = [];
const { etherscanUrl } = loadConnections({ network });
- const web3 = new Web3(new Web3.providers.HttpProvider(providerUrl));
+ const provider = new ethers.providers.JsonRpcProvider(providerUrl);
const feeds = standaloneFeeds.concat(synths);
@@ -20,7 +20,7 @@ module.exports = async ({ network, useOvm, providerUrl, synths, oldExrates, stan
for (const { name, asset, feed, inverted } of feeds) {
const currencyKey = name || asset; // either name of synth or asset for standalone
if (feed) {
- if (!web3.utils.isAddress(feed)) {
+ if (!ethers.utils.isAddress(feed)) {
throw Error(
`Invalid aggregator address for ${currencyKey}: ${feed}. (If mixed case, make sure it is valid checksum)`
);
@@ -47,14 +47,14 @@ module.exports = async ({ network, useOvm, providerUrl, synths, oldExrates, stan
}
}
- const liveAggregator = new web3.eth.Contract(abi, feed);
+ const liveAggregator = new ethers.Contract(feed, abi, provider);
const [
aggAnswerRaw,
exRatesAnswerRaw,
{ frozenAtUpperLimit, frozenAtLowerLimit },
] = await Promise.all([
- liveAggregator.methods.latestAnswer().call(),
+ liveAggregator.latestAnswer(),
oldExrates.methods.rateForCurrency(toBytes32(currencyKey)).call(),
oldExrates.methods.inversePricing(toBytes32(currencyKey)).call(),
]);
@@ -68,7 +68,7 @@ module.exports = async ({ network, useOvm, providerUrl, synths, oldExrates, stan
answer = frozenAtUpperLimit ? inverted.upperLimit : Math.min(answer, inverted.upperLimit);
}
- const existing = web3.utils.fromWei(exRatesAnswerRaw);
+ const existing = ethers.utils.formatUnits(exRatesAnswerRaw);
if (answer === existing) {
output.push(
| 2 |
diff --git a/src/views/Details/NFTAssetDetails.vue b/src/views/Details/NFTAssetDetails.vue @@ -192,7 +192,8 @@ export default {
showFullscreen: false,
activeTab: 'overview',
nftAsset: null,
- accountId: ''
+ accountId: '',
+ prevRoute: null
}
},
components: {
@@ -203,6 +204,11 @@ export default {
NavBar,
Star
},
+ beforeRouteEnter(to, from, next) {
+ next((vm) => {
+ vm.prevRoute = from
+ })
+ },
computed: {
...mapGetters(['accountsData']),
...mapState(['activeNetwork']),
@@ -237,7 +243,7 @@ export default {
async created() {
const nftAsset = await JSON.parse(localStorage.getItem('nftAsset'))
- if (nftAsset) {
+ if (nftAsset && this.prevRoute.path === '/wallet/nfts/send') {
this.nftAsset = nftAsset
this.accountId = nftAsset.accountId
return
| 3 |
diff --git a/metaverse_modules/ki/index.js b/metaverse_modules/ki/index.js @@ -12,7 +12,9 @@ const identityQuaternion = new THREE.Quaternion();
let kiGlbApp = null;
const loadPromise = (async () => {
- kiGlbApp = await metaversefile.load(baseUrl + 'ki.glb');
+ kiGlbApp = await metaversefile.createAppAsync({
+ start_url: baseUrl + 'ki.glb',
+ });
})();
const color1 = new THREE.Color(0x59C173);
| 4 |
diff --git a/edit.html b/edit.html <i class="fal fa-cube"></i>
<div class=label>Shapes [7]</div>
</a>
- <a id=weapon-8 class="weapon" weapon="light">
+ <a id=weapon-8 class="weapon" weapon="inventory">
+ <i class="fal fa-backpack"></i>
+ <div class=label>Inventory [8]</div>
+ </a>
+ <a id=weapon-9 class="weapon" weapon="light">
<i class="fal fa-bolt"></i>
- <div class=label>Light [8]</div>
+ <div class=label>Light [9]</div>
</a>
- <a id=weapon-9 class="weapon" weapon="pencil">
+ <a id=weapon-10 class="weapon" weapon="pencil">
<i class="fal fa-pencil"></i>
- <div class=label>Pencil [9]</div>
+ <div class=label>Pencil [10]</div>
</a>
- <a id=weapon-10 class="weapon" weapon="paintbrush">
+ <a id=weapon-11 class="weapon" weapon="paintbrush">
<i class="fal fa-brush"></i>
- <div class=label>Paintbrush [10]</div>
- </a>
- <a id=weapon-11 class="weapon" weapon="select">
- <i class="fal fa-mouse-pointer"></i>
- <div class=label>Select [TAB]</div>
+ <div class=label>Paintbrush [11]</div>
</a>
<a id=weapon-12 class="weapon" weapon="physics">
<i class="fal fa-raygun"></i>
- <div class=label>Physics</div>
+ <div class=label>Physics [12]</div>
+ </a>
+ <a id=weapon-13 class="weapon" weapon="select">
+ <i class="fal fa-mouse-pointer"></i>
+ <div class=label>Select [TAB]</div>
</a>
</div>
</div>
| 0 |
diff --git a/src/lib/traceTypes.js b/src/lib/traceTypes.js @@ -12,10 +12,10 @@ export const chartCategory = _ => {
value: 'CHARTS_3D',
label: _('3D charts'),
},
- FINANCIAL: {
- value: 'FINANCIAL',
- label: _('Finance'),
- },
+ // FINANCIAL: {
+ // value: 'FINANCIAL',
+ // label: _('Finance'),
+ // },
DISTRIBUTIONS: {
value: 'DISTRIBUTIONS',
label: _('Distributions'),
@@ -42,7 +42,7 @@ export const categoryLayout = _ => [
chartCategory(_).DISTRIBUTIONS,
chartCategory(_).SPECIALIZED,
chartCategory(_).MAPS,
- chartCategory(_).FINANCIAL,
+ // chartCategory(_).FINANCIAL,
];
export const traceTypes = _ => [
@@ -146,16 +146,6 @@ export const traceTypes = _ => [
label: _('Atlas Map'),
category: chartCategory(_).MAPS,
},
- {
- value: 'candlestick',
- label: _('Candlestick'),
- category: chartCategory(_).FINANCIAL,
- },
- {
- value: 'ohlc',
- label: _('OHLC'),
- category: chartCategory(_).FINANCIAL,
- },
// {
// value: 'parcoords',
// label: _('Parallel Coordinates'),
@@ -181,6 +171,16 @@ export const traceTypes = _ => [
label: _('Ternary Scatter'),
category: chartCategory(_).SPECIALIZED,
},
+ {
+ value: 'candlestick',
+ label: _('Candlestick'),
+ category: chartCategory(_).SPECIALIZED,
+ },
+ {
+ value: 'ohlc',
+ label: _('OHLC'),
+ category: chartCategory(_).SPECIALIZED,
+ },
// {
// value: 'pointcloud',
// label: _('Point Cloud'),
| 5 |
diff --git a/lib/assets/core/test/spec/cartodb3/editor/layers/layer-content-view/analyses/analyses-form-models/filter-by-node-column.spec.js b/lib/assets/core/test/spec/cartodb3/editor/layers/layer-content-view/analyses/analyses-form-models/filter-by-node-column.spec.js @@ -147,39 +147,5 @@ describe('editor/layers/layer-content-views/analyses/analysis-form-models/filter
filter_column: null
});
});
-
- describe('filter_column', function () {
- it('validator is correct', function () {
- this.model.set('column', 'cartodb_id');
-
- expect(this.model.schema.column).toBeDefined();
-
- this.model.set('filter_column', 'numero_de_finca');
-
- expect(this.model.schema.filter_column).toBeDefined();
- expect(this.model.schema.filter_column.validators).toBeDefined();
- expect(this.model.schema.filter_column.validators[0]).toEqual('required');
- expect(this.model.schema.filter_column.validators[1]).toEqual(jasmine.any(Function));
- });
- });
-
- describe('._validateFilterColumn', function () {
- it('should validate column types match', function () {
- var formValues = {
- column: 'cartodb_id',
- filter_column: 'numero_de_finca'
- };
-
- spyOn(this.model._columnOptions, 'findColumn').and.returnValue({
- type: 'number'
- });
- spyOn(this.model._filterColumnOptions, 'findColumn').and.returnValue({
- type: 'string'
- });
-
- expect(JSON.stringify(this.model._validateFilterColumn('numero_de_finca', formValues)))
- .toBe('{"message":"editor.layers.analysis-form.should-match"}');
- });
- });
});
});
| 2 |
diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js @@ -198,9 +198,10 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
, 'deliverAt' : deliverAt // The time at which the microbolus should be delivered
};
- var basaliob;
- if (iob_data.basaliob) { basaliob = iob_data.basaliob; }
- else { basaliob = iob_data.iob - iob_data.bolussnooze; }
+ var basaliob = iob_data.basaliob;
+ //if (iob_data.basaliob) { basaliob = iob_data.basaliob; }
+ //else { basaliob = iob_data.iob - iob_data.bolussnooze; }
+ var bolusiob = iob - basaliob;
// generate predicted future BGs based on IOB, COB, and current absorption rate
@@ -432,7 +433,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
var lowtempimpact = (currenttemp.rate - basal) * ((30-minutes_running)/60) * sens;
var adjEventualBG = eventualBG + lowtempimpact;
// don't return early if microBolusAllowed etc.
- if ( adjEventualBG < min_bg && ! (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || iob_data.bolussnooze > 0))) {
+ if ( adjEventualBG < min_bg && ! (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || bolusiob > 0))) {
rT.reason += "letting low temp of " + currenttemp.rate + " run.";
return rT;
}
@@ -441,7 +442,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
// if eventual BG is above min but BG is falling faster than expected Delta
if (minDelta < expectedDelta) {
// if in SMB mode, don't cancel SMB zero temp
- if (! (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || iob_data.bolussnooze > 0))) {
+ if (! (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || bolusiob > 0))) {
if (glucose_status.delta < minDelta) {
rT.reason += "Eventual BG " + convert_bg(eventualBG, profile) + " > " + convert_bg(min_bg, profile) + " but Delta " + tick + " < Exp. Delta " + expectedDelta;
} else {
@@ -465,7 +466,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
}
// if in SMB mode, don't cancel SMB zero temp
- if (! (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || iob_data.bolussnooze > 0))) {
+ if (! (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || bolusiob > 0))) {
rT.reason += convert_bg(eventualBG, profile)+"-"+convert_bg(snoozeBG, profile)+" in range: no temp required";
if (currenttemp.duration > 15 && (round_basal(basal, profile) === round_basal(currenttemp.rate, profile))) {
rT.reason += ", temp " + currenttemp.rate + " ~ req " + basal + "U/hr";
@@ -518,9 +519,9 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
var lastBolusAge = round(( new Date().getTime() - iob_data.lastBolusTime ) / 60000,1);
//console.error(lastBolusAge);
//console.error(profile.temptargetSet, target_bg, rT.COB);
- // only allow microboluses with COB or low temp targets, or within DIA/2 hours of a bolus
+ // only allow microboluses with COB or low temp targets, or within DIA hours of a bolus
// only microbolus if insulinReq represents 20m or more of basal
- if (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || iob_data.bolussnooze > 0)) { // && insulinReq > profile.current_basal/3) {
+ if (microBolusAllowed && ((profile.temptargetSet && target_bg < 100) || rT.COB || bolusiob > 0)) { // && insulinReq > profile.current_basal/3) {
// never bolus more than 30m worth of basal
maxBolus = profile.current_basal/2;
// bolus 1/3 the insulinReq, up to maxBolus
| 11 |
diff --git a/lib/node_modules/@stdlib/blas/ddot/lib/main.js b/lib/node_modules/@stdlib/blas/ddot/lib/main.js @@ -86,10 +86,10 @@ function ddot( x, y ) {
};
x = array( x, opts );
y = array( y, opts );
- if ( x.ndims !== 1 ) {
+ if ( x.shape.length !== 1 ) {
throw new TypeError( 'invalid argument. First argument must be either an array-like object or ndarray which can be cast to a 1-dimensional ndarray. Value: `' + x + '`.' );
}
- if ( y.ndims !== 1 ) {
+ if ( y.shape.length !== 1 ) {
throw new TypeError( 'invalid argument. Second argument must be either an array-like object or ndarray which can be cast to a 1-dimensional ndarray. Value: `' + y + '`.' );
}
}
| 4 |
diff --git a/public/javascripts/SVLabel/src/SVLabel/task/TaskContainer.js b/public/javascripts/SVLabel/src/SVLabel/task/TaskContainer.js @@ -434,14 +434,6 @@ function TaskContainer (navigationModel, neighborhoodModel, streetViewService, s
* - If the street you just audited connects to any of those, pick the highest priority one
* - O/w jump to the highest priority street
*
- *
- * If the neighborhood is not 100% complete (across all users)
- * - If the street you just audited connects to any
- * streets that no one has audited, then pick one, otherwise jump.
- * Else
- * - If the street you just audited connects to any streets
- * that you have not personally audited, pick any one of those at random. Otherwise, jump.
- *
* @param finishedTask The task that has been finished.
* @returns {*} Next task
*/
| 3 |
diff --git a/extensions/projection/README.md b/extensions/projection/README.md @@ -90,8 +90,8 @@ If the transform is defined in an item's properties it is used as the default tr
| Field Name | Type | Description |
| ---------- | -------- | -------------------------------------------- |
-| proj:shape | [number] | See item description. |
-| proj:transorm | [number] | See item description. |
+| proj:shape | \[number] | See item description. |
+| proj:transorm | \[number] | See item description. |
## Centroid Object
| 1 |
diff --git a/generators/client/templates/angular/webpack/_webpack.common.js b/generators/client/templates/angular/webpack/_webpack.common.js @@ -122,8 +122,7 @@ module.exports = function (options) {
{ from: './src/main/webapp/favicon.ico', to: 'favicon.ico' },
{ from: './src/main/webapp/manifest.webapp', to: 'manifest.webapp' },
// { from: './src/main/webapp/sw.js', to: 'sw.js' },
- { from: './src/main/webapp/robots.txt', to: 'robots.txt' }<% if (enableTranslation) { %>,
- { from: './src/main/webapp/i18n', to: 'i18n' }<% } %>
+ { from: './src/main/webapp/robots.txt', to: 'robots.txt' }
]),
new webpack.ProvidePlugin({
$: "jquery",
| 2 |
diff --git a/builds/jazz-build-module/sls-app/sbr.groovy b/builds/jazz-build-module/sls-app/sbr.groovy @@ -7,10 +7,10 @@ import org.json.*
echo "sbr.groovy is being loaded"
-def steps
+def output
-def initialize(steps,aWhitelistValidator) {
- this.steps = steps
+def initialize(output,aWhitelistValidator) {
+ this.output = output
sbrContent = readFile("./sls-app/serverless-build-rules.yml")
whitelistValidator = aWhitelistValidator
}
@@ -37,7 +37,7 @@ def Map<String, Object> processServerless(Map<String, Object> origAppYmlFile,
Map<String, SBR_Rule> rules = convertRuleForestIntoLinearMap(rulesYmlFile)
Map<String, SBR_Rule> resolvedRules = rulePostProcessor(rules)
- Transformer transformer = new Transformer(steps, config, context, resolvedRules) // Encapsulating the config, context and rules into the class so that they do not have to be passed as an arguments with every call of recursive function
+ Transformer transformer = new Transformer(output, config, context, resolvedRules) // Encapsulating the config, context and rules into the class so that they do not have to be passed as an arguments with every call of recursive function
Map<String, Object> transformedYmlTreelet = transformer.transform(origAppYmlFile);
Map<String, SBR_Rule> path2MandatoryRuleMap = resolvedRules.inject([:]){acc, item -> if(item.value instanceof SBR_Rule && item.value.isMandatory) acc.put(item.key, item.value); return acc}
@@ -63,17 +63,17 @@ def Map<String, String> allRules(Map<String, Object> origAppYmlFile,
/* This class encapsulates config, context and rules so that they don't have to be carried over with every call of recursive function */
class Transformer {
- // steps is added here only to facilitate echo for easy debugging
- def steps;
+ // output is added here only to facilitate echo for easy debugging
+ def output;
private def config;
private Map<String, String> context;
private Map<String, SBR_Rule> path2RulesMap;
private Map<String, SBR_Rule> templatedPath2RulesMap;
private Map<String, SBR_Rule> path2MandatoryRuleMap;
- public Transformer(steps, aConfig, aContext, aPath2RulesMap) {
- steps = steps
- steps.echo("In Transformer Constructor! Test for Echo")
+ public Transformer(output, aConfig, aContext, aPath2RulesMap) {
+ output = output
+ output.echo("In Transformer Constructor! Test for Echo")
config = aConfig;
context = aContext;
path2RulesMap = aPath2RulesMap;
| 10 |
diff --git a/lib/tasks/connectors_api.rake b/lib/tasks/connectors_api.rake @@ -51,7 +51,7 @@ namespace :cartodb do
puts "Organization not found: #{args.org}" if org.blank?
if provider.present? && org.present?
org_config = Carto::ConnectorConfiguration.where(
- connector_provider_id: provider.id, organization_id: user.organization.id
+ connector_provider_id: provider.id, organization_id: org.id
).first
provider_config = Carto::ConnectorConfiguration.default(provider)
yield provider, org, org_config, provider_config
| 1 |
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md @@ -8,11 +8,9 @@ Some of the tests require databases to run locally. The easiest way to run these
### Making a new release
To make a release, you first need to ensure that the released version will either be a semver minor or patch release so that automatic updates are working for our users. Following that, the process is simple:
- - Update `CHANGELOG.md` so that the unreleased section gets its version number.
- - Update the version number in `package.json` and `package-lock.json`.
- - Commit the new version, e.g. `VERSION=$(node -e "console.log(require('./package.json').version)") && git commit -m $VERSION`.
- - Tag the new version, e.g. `VERSION=$(node -e "console.log(require('./package.json').version)") && git tag -a v$VERSION -m v$VERSION`.
- - Push the commit with the tag to GitHub, e.g. `git push --tags origin master`.
+ - Update `CHANGELOG.md` so that the unreleased section gets its version number. Commit this change.
+ - Run `npm version patch`, `npm version minor`, or `npm version major`, depending on which part of the version number has to be bumped.
+ - Push the commit and the tag created by `npm version` to GitHub, e.g. `git push --tags origin master`.
### Pushing Artifacts to NPM
Once the released is properly commited and tagged, you can release the artifact to NPM in the following way.
| 4 |
diff --git a/source/server.js b/source/server.js @@ -266,8 +266,9 @@ app.get('/serverdata.js', (req, res) => {
const text = `ungit.config = ${JSON.stringify(config)};\n` +
`ungit.userHash = "${hash}";\n` +
`ungit.version = "${config.ungitDevVersion}";\n` +
- `ungit.platform = "${os.platform()}"\n` +
- `ungit.pluginApiVersion = "${require('../package.json').ungitPluginApiVersion}"\n`;
+ `ungit.platform = "${os.platform()}";\n` +
+ `ungit.pluginApiVersion = "${require('../package.json').ungitPluginApiVersion}";\n`;
+ res.set('Content-Type', 'text/javascript');
res.send(text);
});
});
| 12 |
diff --git a/base/tile_events/RopeEvent.ts b/base/tile_events/RopeEvent.ts @@ -9,7 +9,7 @@ import { event_types, TileEvent } from "./TileEvent";
* over a rope.
*/
export class RopeEvent extends TileEvent {
- private static readonly SWING_SIZE = 3;
+ private static readonly SWING_SIZE = 2;
/** Whether the char will be walking over the rope. */
private _walk_over_rope: boolean;
@@ -108,12 +108,15 @@ export class RopeEvent extends TileEvent {
const swing_tween = this.game.add.tween(swing_object).to({
y: half_height
}, 300, Phaser.Easing.Quadratic.InOut, true, 0, -1, true);
+ const position_ratio_formula = (relative_pos : number) => {
+ return 4 * relative_pos * (-relative_pos + 1);
+ };
swing_tween.onUpdateCallback(() => {
this.data.hero.sprite.x = this.data.hero.sprite.body.x;
const relative_pos = (this.data.hero.sprite.x - this.origin_interactable_object.x)/this.origin_interactable_object.rope_width;
- const position_ratio = 0.5 - Math.cos(degree360 * relative_pos) / 2;
- this.data.hero.sprite.y += swing_object.y * position_ratio;
+ const position_ratio = position_ratio_formula(relative_pos);
+ this.data.hero.sprite.y += swing_object.y * position_ratio
const rope_fragments_group = this.origin_interactable_object.rope_fragments_group;
for (let i = 0; i < rope_fragments_group.children.length; ++i) {
@@ -123,7 +126,7 @@ export class RopeEvent extends TileEvent {
const distance_ratio = 1 - hero_frag_dist / this.origin_interactable_object.rope_width;
const relative_frag_pos = (rope_frag_x - this.origin_interactable_object.x)/this.origin_interactable_object.rope_width;
- const position_penalty = 0.5 - Math.cos(degree360 * relative_frag_pos) / 2;
+ const position_penalty = position_ratio_formula(relative_frag_pos);
rope_frag.y += swing_object.y * distance_ratio * position_ratio * position_penalty;
}
| 7 |
diff --git a/lod.js b/lod.js @@ -398,6 +398,32 @@ const sortTasks = (tasks, worldPosition) => {
});
return taskDistances.map(taskDistance => taskDistance.task);
}; */
+
+class DataRequest {
+ constructor(node) {
+ this.node = node;
+
+ this.abortController = new AbortController();
+ this.signal = this.abortController.signal;
+
+ this.loadPromise = makePromise();
+ }
+ cancel() {
+ // console.log('cancel data request');
+ this.abortController.abort(abortError);
+ }
+ waitForLoad() {
+ return this.loadPromise;
+ }
+ waitUntil(p) {
+ p.then(result => {
+ this.loadPromise.accept(result);
+ }).catch(err => {
+ this.loadPromise.reject(err);
+ });
+ }
+}
+
const TrackerTaskTypes = {
ADD: 1,
REMOVE: 2,
| 0 |
diff --git a/src/apps.json b/src/apps.json "icon": "jQuery.svg",
"implies": "jQuery",
"js": {
- "jQuery.migrateVersion": "([\\d.]+)\\;version:\\1"
+ "jQuery.migrateVersion": "([\\d.]+)\\;version:\\1",
+ "jQuery.migrateWarnings": "",
+ "jqueryMigrate": ""
},
- "script": "jquery[.-]migrate(?:-([\\d.]))?(?:\\.min)?\\.js(?:\\?ver=([\\d.]+))?\\;version:\\1?\\1:\\2",
+ "script": "jquery[.-]migrate(?:-([\\d.]+))?(?:\\.min)?\\.js(?:\\?ver=([\\d.]+))?\\;version:\\1?\\1:\\2",
"website": "https://github.com/jquery/jquery-migrate"
},
"jQuery Mobile": {
| 7 |
diff --git a/tests/test_Owned.py b/tests/test_Owned.py @@ -36,32 +36,48 @@ class TestOwned(unittest.TestCase):
cls.owned_event_map = generate_topic_event_map(compiled['Owned']['abi'])
- def test_owner_is_master(self):
+ def test_constructor(self):
self.assertEqual(self.owned.owner(), MASTER)
+ self.assertEqual(self.owned.nominatedOwner(), ZERO_ADDRESS)
def test_change_owner(self):
old_owner = self.owned.owner()
new_owner = DUMMY
+ self.assertNotEqual(old_owner, new_owner)
+ # Only the owner may nominate a new owner.
self.assertReverts(self.owned.nominateOwner, new_owner, old_owner)
+
+ # Nominate new owner and ensure event emitted properly.
nominated_tx = self.owned.nominateOwner(old_owner, new_owner)
event_data = get_event_data_from_log(self.owned_event_map, nominated_tx.logs[0])
self.assertEqual(event_data['event'], "OwnerNominated")
self.assertEqual(event_data['args']['newOwner'], new_owner)
+ # Ensure owner unchanged, nominated owner was set properly.
self.assertEqual(self.owned.owner(), old_owner)
self.assertEqual(self.owned.nominatedOwner(), new_owner)
+
+ # Ensure only the nominated owner can accept the ownership.
+ self.assertReverts(self.owned.acceptOwnership, old_owner)
+ # But the nominee gains no other privileges.
self.assertReverts(self.owned.nominateOwner, new_owner, old_owner)
+
+ # Accept ownership and ensure event emitted properly.
accepted_tx = self.owned.acceptOwnership(new_owner)
event_data = get_event_data_from_log(self.owned_event_map, accepted_tx.logs[0])
self.assertEqual(event_data['event'], "OwnerChanged")
self.assertEqual(event_data['args']['oldOwner'], old_owner)
self.assertEqual(event_data['args']['newOwner'], new_owner)
+ # Ensure owner changed, nominated owner reset to zero.
self.assertEqual(self.owned.nominatedOwner(), ZERO_ADDRESS)
self.assertEqual(self.owned.owner(), new_owner)
+
+ # The old owner may no longer nominate a new owner.
self.assertReverts(self.owned.nominateOwner, old_owner, new_owner)
+ # Go backwards.
self.owned.nominateOwner(new_owner, old_owner)
self.owned.acceptOwnership(old_owner)
self.assertEqual(self.owned.owner(), old_owner)
| 7 |
diff --git a/packages/gallery/src/components/item/pure.js b/packages/gallery/src/components/item/pure.js @@ -5,7 +5,6 @@ import { GALLERY_CONSTS, utils, isSEOMode } from 'pro-gallery-lib';
function getSlideAnimationStyles({ idx, activeIndex, options, container }) {
const { isRTL, slideAnimation } = options;
const baseStyles = {
- position: 'absolute',
display: 'block',
};
switch (slideAnimation) {
| 2 |
diff --git a/packages/app/src/components/Layout/RawLayout.tsx b/packages/app/src/components/Layout/RawLayout.tsx -import React, { ReactNode } from 'react';
+import React, { ReactNode, useEffect, useState } from 'react';
-import { useTheme } from 'next-themes';
import Head from 'next/head';
import { useGrowiTheme } from '~/stores/context';
+import { Themes, useNextThemes } from '~/stores/use-next-themes';
import { ThemeProvider } from '../Theme/utils/ThemeProvider';
@@ -22,7 +22,14 @@ export const RawLayout = ({ children, title, className }: Props): JSX.Element =>
const { data: growiTheme } = useGrowiTheme();
// get color scheme from next-themes
- const { resolvedTheme: colorScheme } = useTheme();
+ const { resolvedTheme } = useNextThemes();
+
+ const [colorScheme, setColorScheme] = useState<Themes|undefined>(undefined);
+
+ // set colorScheme in CSR
+ useEffect(() => {
+ setColorScheme(resolvedTheme as Themes);
+ }, [resolvedTheme]);
return (
<>
| 12 |
diff --git a/src/modules/auto-updater/implementation/ot-auto-updater.js b/src/modules/auto-updater/implementation/ot-auto-updater.js @@ -240,13 +240,14 @@ class OTAutoUpdater {
const command = `cd ${destination} && npm ci --omit=dev --ignore-scripts`;
const child = exec(command);
-
+ let rejected = false;
child.stdout.on('data', (data) => {
this.logger.trace(`AutoUpdater - npm ci - ${data.replace(/\r?\n|\r/g, '')}`);
});
- let rejected = false;
+
child.stderr.on('data', (data) => {
- if (data.includes('npm ERROR')) {
+ if (data.includes(' error ')) {
+ this.logger.trace(`Error message: ${data}`);
// npm passes warnings as errors, only reject if "error" is included
const errorData = data.replace(/\r?\n|\r/g, '');
this.logger.error(
@@ -259,8 +260,10 @@ class OTAutoUpdater {
}
});
child.stdout.on('end', () => {
+ if (!rejected) {
this.logger.debug(`AutoUpdater - Dependencies installed successfully`);
resolve();
+ }
});
});
}
| 3 |
diff --git a/src/common/integrations/GoogleDrive.js b/src/common/integrations/GoogleDrive.js @@ -186,7 +186,7 @@ class GoogleDrive {
.setVisible(true);
})
.catch(e => {
- if (error.status && error.status === 401) {
+ if (e.status && e.status === 401) {
this.signOut();
}
| 3 |
diff --git a/core/worker/.gitlab-ci.yml b/core/worker/.gitlab-ci.yml @@ -37,14 +37,14 @@ build:
- echo ${HKUBE_CI_TOKEN} | docker login -u yehiyam --password-stdin registry.gitlab.com
- export PRIVATE_REGISTRY=registry.gitlab.com/greenapes/hkube/registry
- npm run build
-.deploy:
+deploy:
stage: deploy
only:
- triggers
script:
- VERSION=$(git describe --abbrev=0 --tags);VERSION=${VERSION%.*}
- MESSAGE="Triggered by ${CI_PROJECT_NAME:-Unknown}. $(git log -1 --pretty=%B)"
- - curl -X POST -H "PRIVATE-TOKEN:MXgU_4aWxXLfzWQPHv9M" -F tag_name="${VERSION}.$(date +%s)" -F release_description="Version ${VERSION} $(date)" -F message="${MESSAGE}" -F ref=master http://gitlab.rms/gitlab/api/v3/projects/47/repository/tags
+ - curl -X POST -F "token=4c7785e026e9ce1cb8914b0add0ed2" -F "ref=master" "https://gitlab.com/api/v4/projects/4650308/trigger/pipeline"
cache:
paths:
| 0 |
diff --git a/app/src/renderer/components/PageDelegate.vue b/app/src/renderer/components/PageDelegate.vue @@ -80,7 +80,7 @@ export default {
// reduce unallocated atoms by assigned atoms
this.fields.candidates.forEach(f => (value -= f.atoms))
- return value > 0 ? value : 0
+ return value
},
unallocatedAtomsPercent () {
return Math.round(this.unallocatedAtoms / this.user.atoms * 100 * 100) / 100 + '%'
@@ -140,10 +140,6 @@ export default {
this.$store.commit('notifyWarn', { title: 'Unallocated Atoms',
body: 'You haven\'t allocated any atoms yet.' })
return
- } else if (this.unallocatedAtoms > 0) {
- this.$store.commit('notifyWarn', { title: 'Unallocated Atoms',
- body: `You haven't allocated all of your atoms yet. (${this.unallocatedAtoms} left)` })
- return
} else if (this.unallocatedAtoms < 0) {
this.$store.commit('notifyWarn', { title: 'Too Many Allocated Atoms',
body: `You've allocated ${this.unallocatedAtoms * -1} more atoms than you have.`})
| 11 |
diff --git a/package.json b/package.json "name": "find-and-replace",
"main": "./lib/find",
"description": "Find and replace within buffers and across the project.",
- "version": "0.207.3",
+ "version": "0.207.4",
"license": "MIT",
"activationCommands": {
"atom-workspace": [
| 6 |
diff --git a/test/jasmine/tests/hover_label_test.js b/test/jasmine/tests/hover_label_test.js @@ -4798,11 +4798,6 @@ describe('hovermode: (x|y)unified', function() {
}
})
.then(function(gd) {
- _hover(gd, { xpx: 25, ypx: 250 });
- assertLabel({title: 'Jan 1, 2017', items: [
- 'scatter : 1'
- ]});
-
_hover(gd, { xpx: 50, ypx: 250 });
assertLabel({title: 'Feb 1, 2017', items: [
'scatter : 2'
@@ -4875,6 +4870,135 @@ describe('hovermode: (x|y)unified', function() {
.then(done, done.fail);
});
+ it('case of M1 period bars overlaid on M3 period bars', function(done) {
+ Plotly.newPlot(gd, {
+ data: [
+ {
+ type: 'bar',
+ name: 'M3',
+ xperiod: 'M3',
+ x: [
+ '2017-04',
+ '2017-07',
+ '2017-10',
+ '2018-01'
+ ],
+ y: [10, 5, 10, 5]
+ },
+ {
+ type: 'bar',
+ name: 'M1',
+ xperiod: 'M1',
+ x: [
+ '2017-01',
+ '2017-02',
+ '2017-03',
+ '2017-04',
+ '2017-05',
+ '2017-06',
+ '2017-07',
+ '2017-08',
+ '2017-09',
+ '2017-10',
+ '2017-11',
+ '2017-12'
+ ],
+ y: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+ }
+ ],
+ layout: {
+ barmode: 'overlay',
+ hovermode: 'x unified',
+ showlegend: false,
+ width: 500,
+ height: 500,
+ margin: {
+ t: 50,
+ b: 50,
+ l: 50,
+ r: 50
+ }
+ }
+ })
+ .then(function(gd) {
+ _hover(gd, { xpx: 25, ypx: 250 });
+ assertLabel({title: 'Jan 1, 2017', items: [
+ 'M1 : 1'
+ ]});
+
+ _hover(gd, { xpx: 50, ypx: 250 });
+ assertLabel({title: 'Feb 1, 2017', items: [
+ 'M1 : 2'
+ ]});
+
+ _hover(gd, { xpx: 75, ypx: 250 });
+ assertLabel({title: 'Mar 1, 2017', items: [
+ 'M1 : 3',
+ 'M1 : (Feb 1, 2017, 2)'
+ ]});
+
+ _hover(gd, { xpx: 100, ypx: 250 });
+ assertLabel({title: 'Apr 1, 2017', items: [
+ 'M3 : 10',
+ 'M1 : 4'
+ ]});
+
+ _hover(gd, { xpx: 125, ypx: 250 });
+ assertLabel({title: 'May 1, 2017', items: [
+ 'M3 : (Apr 1, 2017, 10)',
+ 'M1 : 5'
+ ]});
+
+ _hover(gd, { xpx: 150, ypx: 250 });
+ assertLabel({title: 'Jun 1, 2017', items: [
+ 'M3 : (Apr 1, 2017, 10)',
+ 'M1 : 6'
+ ]});
+
+ _hover(gd, { xpx: 175, ypx: 250 });
+ assertLabel({title: 'Jul 1, 2017', items: [
+ 'M3 : 5',
+ 'M1 : 7'
+ ]});
+
+ _hover(gd, { xpx: 200, ypx: 250 });
+ assertLabel({title: 'Aug 1, 2017', items: [
+ 'M3 : (Jul 1, 2017, 5)',
+ 'M1 : 8'
+ ]});
+
+ _hover(gd, { xpx: 225, ypx: 250 });
+ assertLabel({title: 'Sep 1, 2017', items: [
+ 'M3 : (Jul 1, 2017, 5)',
+ 'M1 : 9'
+ ]});
+
+ _hover(gd, { xpx: 250, ypx: 250 });
+ assertLabel({title: 'Oct 1, 2017', items: [
+ 'M3 : 10',
+ 'M1 : 10'
+ ]});
+
+ _hover(gd, { xpx: 275, ypx: 250 });
+ assertLabel({title: 'Nov 1, 2017', items: [
+ 'M3 : (Oct 1, 2017, 10)',
+ 'M1 : 11'
+ ]});
+
+ _hover(gd, { xpx: 300, ypx: 250 });
+ assertLabel({title: 'Dec 1, 2017', items: [
+ 'M3 : (Oct 1, 2017, 10)',
+ 'M1 : 12'
+ ]});
+
+ _hover(gd, { xpx: 350, ypx: 250 });
+ assertLabel({title: 'Jan 1, 2018', items: [
+ 'M3 : 5'
+ ]});
+ })
+ .then(done, done.fail);
+ });
+
it('should have the same traceorder as the legend', function(done) {
var mock = require('@mocks/stacked_area.json');
var mockCopy = Lib.extendDeep({}, mock);
| 0 |
diff --git a/token-metadata/0x995dE3D961b40Ec6CDee0009059D48768ccbdD48/metadata.json b/token-metadata/0x995dE3D961b40Ec6CDee0009059D48768ccbdD48/metadata.json "symbol": "UFC",
"address": "0x995dE3D961b40Ec6CDee0009059D48768ccbdD48",
"decimals": 8,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/protocols/delegate-manager/test/DelegateManager.js b/protocols/delegate-manager/test/DelegateManager.js @@ -21,8 +21,7 @@ contract('DelegateManager Integration Tests', async accounts => {
let indexer
let delegateFactory
let delegateManager
- let delegateAddress1
- let delegateAddress2
+ let delegateAddress
async function setupTokenAmounts() {
await stakeToken.mint(owner, STARTING_BALANCE)
@@ -43,7 +42,7 @@ contract('DelegateManager Integration Tests', async accounts => {
swap = await Swap.new()
delegateFactory = await DelegateFactory.new(swap.address)
- delegateManager = await DelegateManager.new(delegateFactory.address)
+ delegateManager = await DelegateManager.new(delegateFactory.address, tradeWallet_1)
indexer = await Indexer.new(stakeToken.address, delegateFactory.address)
await indexer.createIndex(WETH_TOKEN.address, DAI_TOKEN.address)
@@ -54,39 +53,9 @@ contract('DelegateManager Integration Tests', async accounts => {
let val = await delegateManager.factory.call()
equal(val, delegateFactory.address, 'factory was not properly set')
})
- })
-
- describe('Test createDelegate', async () => {
- it('Test creating delegates', async () => {
- let trx = await delegateManager.createDelegate(tradeWallet_1)
- emitted(trx, 'DelegateCreated', e => {
- delegateAddress1 = e.delegate
- return e.owner === owner
- })
- })
-
- it('Test creating another delegate', async () => {
- let trx = await delegateManager.createDelegate(tradeWallet_2)
- emitted(trx, 'DelegateCreated', e => {
- delegateAddress2 = e.delegate
- return e.owner === owner
- })
- })
-
- it('Test retrieval of delegates', async () => {
- //retrieve the list
- let val = await delegateManager.getOwnerAddressToDelegates.call(owner)
- equal(val.length, 2, 'there are too many items in the returned list')
- equal(
- val[0],
- delegateAddress1,
- 'there was an issue creating the delegate'
- )
- equal(
- val[1],
- delegateAddress2,
- 'there was an issue creating the delegate'
- )
+ it('Test delegate address', async () => {
+ delegateAddress = await delegateManager.delegate.call()
+ //TODO: ensure it's not empty
})
})
@@ -98,11 +67,11 @@ contract('DelegateManager Integration Tests', async accounts => {
WETH_TOKEN.address,
DAI_TOKEN.address,
INTENT_AMOUNT,
- padAddressToLocator(delegateAddress1),
+ padAddressToLocator(delegateAddress),
]
//give manager admin access
- let delegate = await Delegate.at(delegateAddress1)
+ let delegate = await Delegate.at(delegateAddress)
await delegate.addAdmin(delegateManager.address)
//give allowance to the delegateManager to pull staking amount
@@ -118,7 +87,6 @@ contract('DelegateManager Integration Tests', async accounts => {
await passes(
delegateManager.setRuleAndIntent(
- delegateAddress1,
rule,
intent,
indexer.address
@@ -150,7 +118,6 @@ contract('DelegateManager Integration Tests', async accounts => {
equal(scoreBefore.toNumber(), INTENT_AMOUNT, 'intent score is incorrect')
await passes(delegateManager.unsetRuleAndIntent(
- delegateAddress1,
WETH_TOKEN.address,
DAI_TOKEN.address,
indexer.address
| 3 |
diff --git a/includes/Modules/Search_Console.php b/includes/Modules/Search_Console.php @@ -19,7 +19,6 @@ use Google\Site_Kit\Core\Modules\Module_With_Screen;
use Google\Site_Kit\Core\Modules\Module_With_Screen_Trait;
use Google\Site_Kit\Core\Modules\Module_With_Scopes;
use Google\Site_Kit\Core\Modules\Module_With_Scopes_Trait;
-use Google\Site_Kit\Core\Authentication\Owner_ID;
use Google\Site_Kit\Core\Authentication\Clients\Google_Site_Kit_Client;
use Google\Site_Kit\Core\Modules\Module_With_Settings;
use Google\Site_Kit\Core\Modules\Module_With_Settings_Trait;
| 2 |
diff --git a/addon/components/base/bs-form.js b/addon/components/base/bs-form.js @@ -260,7 +260,11 @@ export default Component.extend({
assert('You cannot use the form element\'s default onChange action for form elements if not using a model or setting the value directly on a form element. You must add your own onChange action to the form element in this case!',
isPresent(model) && isPresent(property)
);
+ if (typeof model.set === 'function') {
+ model.set(property, value);
+ } else {
set(model, property, value);
}
}
+ }
});
| 4 |
diff --git a/sirepo/job_supervisor.py b/sirepo/job_supervisor.py @@ -111,8 +111,10 @@ class _ComputeJob(PKDict):
job.PENDING: _cancel_queued,
job.RUNNING: _cancel_running,
})
+ self.status = job.CANCELED
return await d[self.status](self, req)
if self.computeJobHash != req.content.computeJobHash:
+ self.status = job.CANCELED
return await _cancel_queued(self, req)
async def _receive_api_runSimulation(self, req):
| 12 |
diff --git a/debian/rules b/debian/rules @@ -9,9 +9,7 @@ include /usr/share/cdbs/1/class/ant.mk
#include /usr/share/cdbs/1/rules/dpatch.mk
#include /usr/share/cdbs/1/rules/simple-patchsys.mk
-JAVA_HOME_DIRS := /usr/lib/jvm/default-java \
- /usr/lib/jvm/adoptopenjdk-8-jdk-hotspot \
- /usr/lib/jvm/java-8-openjdk-arm64
+JAVA_HOME := /usr/lib/jvm/adoptopenjdk-8-jdk-hotspot
DEB_ANT_BUILD_TARGET := jar
| 14 |
diff --git a/js/app.js b/js/app.js @@ -263,6 +263,15 @@ var App = function() {
this.stop();
process.exit(0);
});
+
+ /* We also need to listen to SIGTERM signals so we stop everything when we are asked to stop by the OS.
+ */
+ process.on("SIGTERM", () => {
+ console.log("[SIGTERM] Received. Shutting down server...");
+ setTimeout(() => { process.exit(0); }, 3000); // Force quit after 3 seconds
+ this.stop();
+ process.exit(0);
+ });
};
module.exports = new App();
| 9 |
diff --git a/views/about.pug b/views/about.pug @@ -97,7 +97,7 @@ block content
p.
In May 2018, we created #[a(href='https://opencollective.com/getbootstrapcdn', rel='noopener', target='_blank') an organization on Open Collective].
- We use the collective for any money we make from advertisements (CarbonAds) or affiliate commissions (#[a(href='/books/') Books] and #[a(href='/jobs/') Jobs]).
+ We use the collective for any money we make from advertisements (CarbonAds) and affiliate commissions (#[a(href='/themes/') Themes], #[a(href='/books/') Books] and #[a(href='/jobs/') Jobs]).
This allows us to do the following:
ul
| 0 |
diff --git a/pages/claim.js b/pages/claim.js @@ -16,7 +16,11 @@ const ALLOWED_CONTEXT = ['claim', 'access']
const Claim = ({ router: { query }, t }) => {
let { context, email, code } = query
- context = ALLOWED_CONTEXT.includes(context) && context
+ context =
+ ALLOWED_CONTEXT.includes(context) &&
+ (code && code.length === 7 && context === 'access' // ignore access context with 7 digit codes for memberships
+ ? undefined
+ : context)
email = email && maybeDecode(email)
email = email && isEmail(email) ? email : ''
code = code && sanitizeVoucherCode(code)
| 8 |
diff --git a/src/traces/carpet/axis_attributes.js b/src/traces/carpet/axis_attributes.js var extendFlat = require('../../lib/extend').extendFlat;
var fontAttrs = require('../../plots/font_attributes');
var colorAttrs = require('../../components/color/attributes');
+var axesAttrs = require('../../plots/cartesian/layout_attributes')
module.exports = {
color: {
@@ -265,31 +266,7 @@ module.exports = {
'*%H~%M~%S.%2f* would display *09~15~23.46*'
].join(' ')
},
- tickformatstops: {
- _isLinkedToArray: 'tickformatstop',
-
- dtickrange: {
- valType: 'info_array',
- role: 'info',
- items: [
- {valType: 'any'},
- {valType: 'any'}
- ],
- description: [
- 'range [*min*, *max*], where *min*, *max* - dtick values',
- 'which describe some zoom level, it is possible to omit *min*',
- 'or *max* value by passing *null*'
- ].join(' ')
- },
- value: {
- valType: 'string',
- dflt: '',
- role: 'style',
- description: [
- 'string - dtickformat for described zoom level, the same as *tickformat*'
- ].join(' ')
- }
- },
+ tickformatstops: axesAttrs.tickformatstops,
categoryorder: {
valType: 'enumerated',
values: [
| 2 |
diff --git a/src/userscript.ts b/src/userscript.ts @@ -87050,7 +87050,12 @@ var $$IMU_EXPORT$$;
if (domain === "imgs.ototoy.jp") {
// https://imgs.ototoy.jp/imgs/jacket/0036/00121822.1375675376.146_320.jpg
// https://imgs.ototoy.jp/imgs/jacket/0036/00121822.1375675376.146orig.jpg
- return src.replace(/(\/imgs\/+jacket\/+[0-9]+\/+[0-9]+\.[0-9]+\.[0-9]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1orig$2");
+ // thanks to tathastu871 on github: https://github.com/qsniyg/maxurl/issues/1088
+ // https://imgs.ototoy.jp/feature/image.php/2022101901/tobira.jpg?width=721
+ // https://imgs.ototoy.jp/feature/image.php/2022101901/tobira.jpg?width=999999 -- 7370x4913
+ return src
+ .replace(/(\/imgs\/+jacket\/+[0-9]+\/+[0-9]+\.[0-9]+\.[0-9]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1orig$2")
+ .replace(/(\/image\.php\/+[0-9]+\/+[^/?#]+)(?:[?#].*)?$/, "$1?width=999999");
}
if (domain === "gl.weburg.net") {
| 7 |
diff --git a/bin/endtoend-build b/bin/endtoend-build @@ -20,3 +20,4 @@ rm ./test/endtoend/package-lock.json
cp ./test/endtoend/node_modules/uppy/dist/uppy.min.css ./test/endtoend/dist
cp ./test/endtoend/src/index.html ./test/endtoend/dist
browserify ./test/endtoend/src/main.js -o ./test/endtoend/dist/bundle.js -t babelify
+rm -rf ./test/endtoend/node_modules
| 2 |
diff --git a/spec/e2e/text-editing.spec.js b/spec/e2e/text-editing.spec.js @@ -5,8 +5,6 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;
var helpers = require('./helpers');
var driver = require('selenium-webdriver');
-var blockTypes = ["text"]; // jshint ignore:line
-
var pressShift = function() {
return helpers.browser.actions()
.sendKeys(driver.Key.SHIFT)
@@ -38,6 +36,11 @@ var pressBackSpace = function() {
.sendKeys(driver.Key.BACK_SPACE)
.perform();
};
+var pressDown = function() {
+ return helpers.browser.actions()
+ .sendKeys(driver.Key.ARROW_DOWN)
+ .perform();
+};
var enterText = function(text) {
return helpers.browser.actions()
@@ -410,4 +413,76 @@ describe('List block', function() {
});
});
});
+
+ describe('Pressing Backspace', function() {
+
+ it('should delete a character', function(done) {
+ helpers.focusOnListBlock().then(pressRight).then(pressBackSpace)
+ .then(function() {
+ return getBlockData(1);
+ }).then(function(data) {
+ expect(data.data.listItems[0].content).toBe("<b>w</b>o");
+ done();
+ });
+ });
+
+ it('should delete the block when caret is at the start of the block and there is a block above', function(done) {
+ helpers.focusOnTextBlock(1)
+ .then(pressRight).then(pressRight).then(pressRight).then(pressRight)
+ .then(pressEnter)
+ .then(function() {
+ helpers.createBlock('list', function() {
+ helpers.hasBlockCount(4)
+ .then(pressBackSpace)
+ .then(function() {
+ return helpers.hasBlockCount(4);
+ })
+ .then(pressBackSpace)
+ .then(function() {
+ return helpers.hasBlockCount(3);
+ }).then(done);
+ });
+ });
+ });
+
+ it('should transpose the block content when caret is at the start of the block and there is a block above', function(done) {
+ helpers.focusOnTextBlock(1)
+ .then(pressRight).then(pressRight).then(pressRight).then(pressRight)
+ .then(pressEnter)
+ .then( function() {
+ helpers.createBlock('list', function() {
+ helpers.hasBlockCount(4)
+ .then( function() {
+ return enterText("Five");
+ })
+ .then(pressLeft)
+ .then(pressLeft)
+ .then(pressLeft)
+ .then(pressLeft)
+ .then(pressBackSpace)
+ .then(pressBackSpace)
+ .then(function() {
+ return getBlockData(2);
+ })
+ .then(function(data) {
+ expect(data.data.text).toBe("<p>F<b>ou</b>rFive</p>");
+ done();
+ });
+ });
+ });
+ });
+
+ it('should transpose the list content from the deleted list item', function(done) {
+ helpers.focusOnListBlock()
+ .then(pressRight).then(pressRight).then(pressRight).then(pressRight)
+ .then(pressBackSpace)
+ .then(function() {
+ return getBlockData(1);
+ })
+ .then(function(data) {
+ expect(data.data.listItems[0].content).toBe("T<b>w</b>oT<b>hre</b>e");
+ done();
+ });
+ });
+ });
});
| 7 |
diff --git a/src/algorithms/utils/jest-extensions/toBeCloseToArraySnapshot.ts b/src/algorithms/utils/jest-extensions/toBeCloseToArraySnapshot.ts @@ -89,7 +89,7 @@ export default function toBeCloseToArraySnapshot(this: Context, received: number
message: () => `expected: ${expected}\n received: ${received}`,
actual: serialize(received),
count: state.count,
- expected: expected !== undefined ? serialize(expected) : undefined,
+ expected: expected ? serialize(expected) : undefined,
key: state.key,
pass: false,
}
| 1 |
diff --git a/js/kiri-driver-cam.js b/js/kiri-driver-cam.js @@ -921,7 +921,7 @@ var gs_kiri_cam = exports;
widgetCount = widgetArray.length,
widget = widgetArray[widgetIndex];
- if (widgetIndex >= widgetCount || !widget) return;
+ if (widgetIndex >= widgetCount || !widget || !widget.getCamBounds) return;
var slices = widget.slices,
bounds = widget.getCamBounds(settings),
@@ -1370,6 +1370,8 @@ var gs_kiri_cam = exports;
* @returns {Array} gcode lines
*/
function printExport(print, online) {
+ if (!widget) return;
+
var i,
time = 0,
lines = 0,
| 9 |
diff --git a/js/core/bis_bidsutils.js b/js/core/bis_bidsutils.js @@ -357,9 +357,10 @@ let dicom2BIDS = async function (opts) {
* Call this function after image files have been altered in some way, e.g. by a user changing where files are in the file tree.
*
* @param {Array} changedFiles - Names of files that have already been moved. Each entry is an object with a field 'old' that has the old name of the image and 'new' with the changed name. These should be the full paths for the files.
+ * @param {String} taskName - Name of the new task entered by the user.
* @param {String} baseDirectory - Name of the base directory of the study.
*/
-let syncSupportingFiles = (changedFiles, baseDirectory) => {
+let syncSupportingFiles = (changedFiles, taskName, baseDirectory) => {
return new Promise((resolve, reject) => {
//dicom params file is in source so trim base directory to there
@@ -392,21 +393,15 @@ let syncSupportingFiles = (changedFiles, baseDirectory) => {
let newSupportingFileList = [];
for (let supportingFile of supportingFiles) {
- //file extension could be in two parts, e.g. like '.nii.gz'
- let fileExtension = bis_genericio.getBaseName(supportingFile).split('.');
- if (fileExtension.length > 2) { fileExtension = fileExtension.slice(1).join('.'); }
- else { fileExtension = fileExtension[1]; }
-
- //construct the full name of the destination using the new location of the image
- let newFilename = bis_genericio.getBaseName(file.new).split('.')[0];
+ let newFilename = replaceTaskName(supportingFile, taskName);
let newFilepath = file.new.split('/');
newFilepath = newFilepath.slice(0, newFilepath.length - 1);
- newFilepath.push(newFilename + '.' + fileExtension);
+ newFilepath.push(newFilename);
newFilepath = newFilepath.join('/');
//file.old will hold the old location of the image, so trim off the file extension and add the extension of the supporting file to get its location
let splitOldPath = file.old.split('/');
- splitOldPath[splitOldPath.length - 1] = splitOldPath[splitOldPath.length - 1].split('.')[0] + '.' + fileExtension;
+ splitOldPath[splitOldPath.length - 1] = bis_genericio.getBaseName(supportingFile);
let oldFilepath = splitOldPath.join('/');
console.log('old location', oldFilepath, 'new location', newFilepath);
@@ -436,9 +431,6 @@ let syncSupportingFiles = (changedFiles, baseDirectory) => {
}
}
- console.log('new supporting file list', compiledSupportingFileList);
- console.log('new settings', settings);
-
let writeSettingsFileFn = writeSettingsFile(settingsFilename, settings);
movePromiseArray.push(writeSettingsFileFn);
@@ -451,6 +443,17 @@ let syncSupportingFiles = (changedFiles, baseDirectory) => {
});
+ function replaceTaskName(filename, taskname) {
+ let basename = bis_genericio.getBaseName(filename);
+ let splitbase = basename.split('_');
+
+ //task name could be at index 1 or 2 according to BIDS specification
+ //https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html
+ if (splitbase[1].includes('task')) { splitbase[1] = 'task-' + taskname; }
+ else if (splitbase[2].includes('task')) { splitbase[2] = 'task-' + taskname; }
+
+ return splitbase.join('_');
+ }
};
@@ -466,7 +469,6 @@ let writeSettingsFile = (filename, settings) => {
settings = JSON.stringify(settings, null, 2);
}
- console.log('settings', settings);
bis_genericio.write(filename, settings, false)
.then( () => { resolve(); })
.catch( () => { reject(); });
| 1 |
diff --git a/test/test.js b/test/test.js @@ -156,6 +156,31 @@ module.exports = function (redom) {
onunmount: true
});
});
+ t.test('component lifecycle events inside node element', function (t) {
+ t.plan(1);
+ var eventsFired = {};
+ function Item() {
+ this.el = el('p');
+ this.onmount = function () {
+ eventsFired.onmount = true;
+ };
+ this.onremount = function () {
+ eventsFired.onremount = true;
+ };
+ this.onunmount = function () {
+ eventsFired.onunmount = true;
+ };
+ }
+ var item = el("wrapper", new Item());
+ mount(document.body, item);
+ mount(document.body, item);
+ unmount(document.body, item);
+ t.deepEqual(eventsFired, {
+ onmount: true,
+ onremount: true,
+ onunmount: true
+ });
+ });
t.test('setChildren', function (t) {
t.plan(2);
var h1 = el.extend('h1');
@@ -348,14 +373,14 @@ module.exports = function (redom) {
};
var test = new Test();
setChildren(document.body, []);
- mount(document.body, test);
- mount(document.body, test);
- t.equals(document.body.outerHTML, '<body><test></test></body>');
- unmount(document.body, test.el);
- mount(document.body, test.el);
- mount(document.body, test.el);
- unmount(document.body, test);
- t.equals(document.body.outerHTML, '<body></body>');
+ mount(document.body, test); // ONMOUNT pass - 1
+ mount(document.body, test); // ONREMOUNT pass - 2
+ t.equals(document.body.outerHTML, '<body><test></test></body>'); // pass - 3
+ unmount(document.body, test.el); // ONUNMOUNT - 4
+ mount(document.body, test.el); // ONMOUNT - 5
+ mount(document.body, test.el); // ONREMOUNT - 6
+ unmount(document.body, test); // ONUNMOUNT - 7
+ t.equals(document.body.outerHTML, '<body></body>'); // pass - 8
});
t.test('special cases', function (t) {
t.plan(1);
@@ -527,22 +552,22 @@ module.exports = function (redom) {
t.plan(1);
var logs = [];
- var nApexes = 30;
- var nLeaves = 20;
- var nBranches = 10;
+ var nApexes = 3;
+ var nLeaves = 2;
+ var nBranches = 1;
function Base(name, content) {
- var el = html('', content);
+ var _el = html('', content);
function onmount() {
- logs.push(name + ' mounted: ' + (typeof el.getBoundingClientRect()));
+ logs.push(name + ' mounted: ' + (typeof _el.getBoundingClientRect()));
}
function onunmount() {
- logs.push(name + ' unmounting: ' + (typeof el.getBoundingClientRect()));
+ logs.push(name + ' unmount: ' + (typeof _el.getBoundingClientRect()));
}
- return { el, onmount, onunmount };
+ return { el: _el, onmount, onunmount };
}
function Apex() {
@@ -581,48 +606,25 @@ module.exports = function (redom) {
expectedLog.push('Tree mounted: object');
for (let i = 0; i < nBranches; i++) {
expectedLog.push('Branch mounted: object');
- }
- for (let j = 0; j < nBranches * nLeaves; j++) {
+ for (let j = 0; j < nLeaves; j++) {
expectedLog.push('Leaf mounted: object');
- }
- for (let k = 0; k < nBranches * nLeaves * nApexes; k++) {
+ for (let k = 0; k < nApexes; k++) {
expectedLog.push('Apex mounted: object');
}
+ }
+ }
+
// onunmount -- unmounting
- expectedLog.push('Tree unmounting: object');
for (let i = 0; i < nBranches; i++) {
- expectedLog.push('Branch unmounting: object');
- }
- for (let j = 0; j < nBranches * nLeaves; j++) {
- expectedLog.push('Leaf unmounting: object');
- }
- for (let k = 0; k < nBranches * nLeaves * nApexes; k++) {
- expectedLog.push('Apex unmounting: object');
- }
-
- // // DOM logical ordering
- // expectedLog.push('Tree mounted: object');
- // for (let i = 0; i < nBranches; i++) {
- // expectedLog.push('Branch mounted: object');
- // for (let j = 0; j < nBranches * nLeaves; j++) {
- // expectedLog.push('Leaf mounted: object');
- // for (let k = 0; k < nBranches * nLeaves * nApexes; k++) {
- // expectedLog.push('Apex mounted: object');
- // }
- // }
- // }
- // // (reversed when unmounting)
- // // onunmount -- unmounting
- // for (let i = 0; i < nBranches; i++) {
- // for (let j = 0; j < nBranches * nLeaves; j++) {
- // for (let k = 0; k < nBranches * nLeaves * nApexes; k++) {
- // expectedLog.push('Apex unmount: object');
- // }
- // expectedLog.push('Leaf unmount: object');
- // }
- // expectedLog.push('Branch unmount: object');
- // }
- // expectedLog.push('Tree unmount: object');
+ for (let j = 0; j < nLeaves; j++) {
+ for (let k = 0; k < nApexes; k++) {
+ expectedLog.push('Apex unmount: object');
+ }
+ expectedLog.push('Leaf unmount: object');
+ }
+ expectedLog.push('Branch unmount: object');
+ }
+ expectedLog.push('Tree unmount: object');
var tree = Tree();
mount(document.body, tree);
| 0 |
diff --git a/apps.json b/apps.json "icon": "app.png",
"version":"0.01",
"description": "A simple vertical watch face with the date.",
+ "type":"clock",
"tags": "clock, clock-face, face",
"storage": [
{"name":"verticalface.app.js","url":"app.js"},
| 11 |
diff --git a/test/integration-test.js b/test/integration-test.js @@ -1551,8 +1551,8 @@ vows.describe('integration tests')
'a{font-family:Helvetica,Arial}'
],
'keeps quoting for generic families' : [
- '.block{font-family:"cursive","default","emoji","fangsong","fantasy","inherit","initial","math","monospace",font-family: "sans-serif","serif","system-ui","ui-monospace","ui-rounded","ui-sans-serif","ui-serif","unset"}',
- '.block{font-family:"cursive","default","emoji","fangsong","fantasy","inherit","initial","math","monospace",font-family: "sans-serif","serif","system-ui","ui-monospace","ui-rounded","ui-sans-serif","ui-serif","unset"}'
+ '.block{font-family:"cursive","default","emoji","fangsong","fantasy","inherit","initial","math","monospace","sans-serif","serif","system-ui","ui-monospace","ui-rounded","ui-sans-serif","ui-serif","unset"}',
+ '.block{font-family:"cursive","default","emoji","fangsong","fantasy","inherit","initial","math","monospace","sans-serif","serif","system-ui","ui-monospace","ui-rounded","ui-sans-serif","ui-serif","unset"}'
],
'do not remove font family double quotation if space inside': [
'a{font-family:"Courier New"}',
| 1 |
diff --git a/edit.js b/edit.js @@ -2475,11 +2475,10 @@ document.getElementById('inventory-drop-zone').addEventListener('drop', async e
jsonItem.getAsString(resolve);
});
const j = JSON.parse(s);
- let {name, dataHash, id, iconHash, contractAddress} = j;
+ let {name, dataHash, id, iconHash} = j;
if (!dataHash) {
const p = pe.children.find(p => p.id === id);
dataHash = await p.getHash();
- contractAddress = p.contractAddress;
}
const inventory = loginManager.getInventory();
@@ -2487,7 +2486,6 @@ document.getElementById('inventory-drop-zone').addEventListener('drop', async e
name,
hash: dataHash,
iconHash,
- contractAddress,
});
await loginManager.setInventory(inventory);
}
@@ -2534,7 +2532,6 @@ window.addEventListener('avatarchange', e => {
name: p.name,
dataHash: p.hash,
iconHash: null,
- contractAddress: null,
});
});
(async () => {
@@ -2576,14 +2573,13 @@ const _changeInventory = inventory => {
const is = inventorySubtabContent.querySelectorAll('.item');
is.forEach((itemEl, i) => {
const item = inventory[i];
- const {name, hash, iconHash, contractAddress} = item;
+ const {name, hash, iconHash} = item;
itemEl.addEventListener('dragstart', e => {
_startPackageDrag(e, {
name,
dataHash: hash,
iconHash,
- contractAddress,
});
});
@@ -2633,12 +2629,8 @@ const _makePackageHtml = p => `
</div>
</div>
`;
-const _addPackageFromHash = async (dataHash, contractAddress, matrix) => {
- if (!contractAddress) {
- debugger;
- }
+const _addPackageFromHash = async (dataHash, matrix) => {
const p = await XRPackage.download(dataHash);
- p.contractAddress = contractAddress;
if (matrix) {
p.setMatrix(matrix);
}
@@ -2655,14 +2647,14 @@ const _startPackageDrag = (e, j) => {
});
};
const _bindPackage = (pE, pJ) => {
- const {name, dataHash, contractAddress} = pJ;
+ const {name, dataHash} = pJ;
const iconHash = pJ.icons.find(i => i.type === 'image/gif').hash;
pE.addEventListener('dragstart', e => {
- _startPackageDrag(e, {name, dataHash, iconHash, contractAddress});
+ _startPackageDrag(e, {name, dataHash, iconHash});
});
const addButton = pE.querySelector('.add-button');
addButton.addEventListener('click', () => {
- _addPackageFromHash(dataHash, contractAddress);
+ _addPackageFromHash(dataHash);
});
const wearButton = pE.querySelector('.wear-button');
wearButton.addEventListener('click', () => {
@@ -2712,7 +2704,7 @@ pe.domElement.addEventListener('drop', async e => {
jsonItem.getAsString(resolve);
});
const j = JSON.parse(s);
- const {type, dataHash, contractAddress} = j;
+ const {type, dataHash} = j;
if (dataHash) {
_updateRaycasterFromMouseEvent(raycaster, e);
localMatrix.compose(
@@ -2722,7 +2714,7 @@ pe.domElement.addEventListener('drop', async e => {
new THREE.Vector3(1, 1, 1)
)
- await _addPackageFromHash(dataHash, contractAddress, localMatrix);
+ await _addPackageFromHash(dataHash, localMatrix);
}
}
});
@@ -3159,15 +3151,12 @@ const _handleUrl = async u => {
if (q.p) { // package
const metadata = await fetch(packagesEndpoint + '/' + q.p)
.then(res => res.json())
- const {dataHash, contractAddress} = metadata;
+ const {dataHash} = metadata;
const arrayBuffer = await fetch(`${apiHost}/${dataHash}.wbn`)
.then(res => res.arrayBuffer());
const p = new XRPackage(new Uint8Array(arrayBuffer));
- if (contractAddress) {
- p.contractAddress = contractAddress;
- }
await p.waitForLoad();
await pe.add(p);
} else if (q.i) { // index
| 2 |
diff --git a/magda-web-client/src/UI/Notification.js b/magda-web-client/src/UI/Notification.js @@ -10,9 +10,18 @@ function Notification(props) {
let content = props.conent;
if (!content) content = {};
+ if (content instanceof Error) {
+ type = "error";
+ content = {
+ title: "Error:",
+ detail: content.message
+ };
+ }
+
let { title, detail } = props.content;
if (!title) title = "";
if (!detail) detail = "";
+ if (!detail && title) detail = title;
return (
<div className="notification-box">
| 7 |
diff --git a/js/views/Map.js b/js/views/Map.js @@ -120,7 +120,8 @@ function labelz(txt, min, max) {
//var maxZoom = 100; // for 2d orthographic view
-var perspective = 55;
+// https://gamedev.stackexchange.com/questions/53601/why-is-90-horz-60-vert-the-default-fps-field-of-view
+var perspective = 60;
// XXX This is not the best for performance. Would be better
// to use the scale.rgb methods. For ordinal, we would need
@@ -136,6 +137,17 @@ var toColor = (column, scale) => {
return colors;
};
+function twoDInitialDistance(width, height, centroids, mins) {
+ // compute distance from z = 0 if data fills screen in x
+ // or y dimension, and take the larger distance (so all data
+ // fits on screen).
+ var maxdx = (centroids[0] - mins[0]) /
+ Math.tan((perspective * width / height / 2) / 180 * Math.PI),
+ maxdy = (centroids[1] - mins[1]) /
+ Math.tan((perspective / 2) / 180 * Math.PI);
+ return Math.max(maxdx, maxdy);
+}
+
var loaded;
var loader = new Promise(resolve => loaded = resolve);
@@ -145,7 +157,6 @@ function points(el, props) {
axes = [],
labels = [],
mouse = new THREE.Vector2(),
- twoD,
size;
var sprite = new THREE.TextureLoader().load(disc);
@@ -173,7 +184,7 @@ function points(el, props) {
});
var resolution = new THREE.Vector2(width, height);
-
+ // We reset camera near & far params in init(), after inspecting the data.
var camera = new THREE.PerspectiveCamera(perspective, width / height, 2, 4000);
var controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
@@ -287,10 +298,11 @@ function points(el, props) {
}
function init(props) {
- // XXX We should be scaling the data to a size that works
- // with webgl. Currently the render will fail if the data domain
- // is inappropriate for webgl.
- twoD = props.data.columns.length === 2;
+ var twoD = props.data.columns.length === 2;
+ var mins = props.data.columns.map(_.minnull),
+ maxs = props.data.columns.map(_.maxnull),
+ centroids = maxs.map((max, i) => (max + mins[i]) / 2);
+
var min = _.minnull(props.data.columns.map(_.minnull)),
max = _.maxnull(props.data.columns.map(_.maxnull));
@@ -308,10 +320,21 @@ function points(el, props) {
(label, fn) => fn(label, min, max, twoD));
labels.forEach(l => scene.add(l));
- var c = (max + min) / 2;
+ // Compute max distance, initial distance, min distance, frustrum near,
+ // frustrum far.
+ // Initial distance should put all data on screen. Max distance
+ // should be a bit more, possibly putting the axes on screen.
+ // Frustrum far should be max distance, or slightly more.
+ // Min distance should allow, say, 50x zoom. Near frustrum should
+ // support min distance, so should be the same, or slightly smaller
+ // so it doesn't clip at max zoom.
+ var initialDistance;
if (twoD) {
- controls.maxDistance = 2 * (max - min);
- controls.minDistance = .10 * (max - min);
+ initialDistance = twoDInitialDistance(width, height, centroids, mins);
+ controls.maxDistance = initialDistance * 1.1;
+ controls.minDistance = controls.maxDistance / 50;
+ camera.far = controls.maxDistance * 1.05; // add 5% buffer behind data
+ camera.near = controls.minDistance * 0.9;
} else {
controls.maxDistance = 2 * (max - min);
controls.minDistance = .25 * (max - min);
@@ -320,17 +343,19 @@ function points(el, props) {
setView(props.data.view);
} else {
if (twoD) {
- camera.position.z = c + (max - min);
- camera.position.y = c;
- camera.position.x = c;
+ camera.position.x = centroids[0];
+ camera.position.y = centroids[1];
+ camera.position.z = initialDistance;
} else {
camera.position.z = min + 2 * (max - min);
camera.position.y = max + (max - min);
camera.position.x = max + (max - min);
}
- controls.target = new THREE.Vector3(c, c, twoD ? 0 : c);
+ controls.target = new THREE.Vector3(centroids[0], centroids[1],
+ twoD ? 0 : centroids[2]);
}
+ camera.updateProjectionMatrix();
controls.enableRotate = !twoD;
controls.update();
| 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.