code
stringlengths 122
4.99k
| label
int64 0
14
|
---|---|
diff --git a/src/font/bitmaptext.js b/src/font/bitmaptext.js var stringHeight = measureTextHeight(this);
var textMetrics = ret || this.getBounds();
- var strings = typeof text !== "undefined" ? ("" + (text)).split("\n") : this._text;
+ var strings = typeof text === "string" ? ("" + (text)).split("\n") : text;
textMetrics.height = textMetrics.width = 0;
| 1 |
diff --git a/edit.js b/edit.js @@ -2164,7 +2164,7 @@ const _makeExplosionMesh = () => {
};
let explosionMeshes = [];
-const pxMeshes = [];
+let pxMeshes = [];
const _applyVelocity = (position, velocity, timeDiff) => {
position.add(localVector4.copy(velocity).multiplyScalar(timeDiff));
@@ -2612,6 +2612,9 @@ function animate(timestamp, frame) {
pxMesh.angularVelocity = new THREE.Vector3((-1+Math.random()*2)*Math.PI*2*0.01, (-1+Math.random()*2)*Math.PI*2*0.01, (-1+Math.random()*2)*Math.PI*2*0.01);
pxMesh.collisionIndex = -1;
pxMesh.isBuildMesh = true;
+ const startTime = Date.now();
+ const endTime = startTime + 3000;
+ pxMesh.update = () => Date.now() < endTime;
currentChunkMesh.add(pxMesh);
pxMeshes.push(pxMesh);
}
@@ -2641,16 +2644,19 @@ function animate(timestamp, frame) {
}
}
};
- switch (selectedWeapon) {
- case 'rifle': {
- _hit()
-
+ const _explode = (position, quaternion) => {
const explosionMesh = _makeExplosionMesh();
- explosionMesh.position.copy(assaultRifleMesh.position)
- .add(localVector3.set(0, 0.09, -0.7).applyQuaternion(assaultRifleMesh.quaternion));
- explosionMesh.quaternion.copy(assaultRifleMesh.quaternion);
+ explosionMesh.position.copy(position);
+ explosionMesh.quaternion.copy(quaternion);
scene.add(explosionMesh);
explosionMeshes.push(explosionMesh);
+ };
+ switch (selectedWeapon) {
+ case 'rifle': {
+ _hit()
+ localVector2.copy(assaultRifleMesh.position)
+ .add(localVector3.set(0, 0.09, -0.7).applyQuaternion(assaultRifleMesh.quaternion))
+ _explode(localVector2, assaultRifleMesh.quaternion);
break;
}
case 'grenade': {
@@ -2667,19 +2673,21 @@ function animate(timestamp, frame) {
pxMesh.angularVelocity = new THREE.Vector3((-1+Math.random()*2)*Math.PI*2*0.01, (-1+Math.random()*2)*Math.PI*2*0.01, (-1+Math.random()*2)*Math.PI*2*0.01);
pxMesh.collisionIndex = -1;
pxMesh.isBuildMesh = true;
+ const startTime = Date.now();
+ const endTime = startTime + 3000;
+ pxMesh.update = () => {
+ if (Date.now() < endTime) {
+ return true;
+ } else {
+ pxMesh.getWorldPosition(localVector2);
+ pxMesh.getWorldQuaternion(localQuaternion2);
+ // localQuaternion2.set(0, 0, 0, 1);
+ _explode(localVector2, localQuaternion2);
+ return false;
+ }
+ };
currentChunkMesh.add(pxMesh);
pxMeshes.push(pxMesh);
-
- console.log('throw grenade', pxMesh);
-
- /* _hit()
-
- const explosionMesh = _makeExplosionMesh();
- explosionMesh.position.copy(assaultRifleMesh.position)
- .add(localVector3.set(0, 0.09, -0.7).applyQuaternion(assaultRifleMesh.quaternion));
- explosionMesh.quaternion.copy(assaultRifleMesh.quaternion);
- scene.add(explosionMesh);
- explosionMeshes.push(explosionMesh); */
}
break;
}
@@ -3334,8 +3342,8 @@ function animate(timestamp, frame) {
wireframeMaterial.uniforms.uSelectId.value.set(0, 0, 0);
} */
- for (let i = 0; i < pxMeshes.length; i++) {
- const pxMesh = pxMeshes[i];
+ pxMeshes = pxMeshes.filter(pxMesh => {
+ if (pxMesh.update()) {
if (!pxMesh.velocity.equals(zeroVector)) {
localVector.copy(pxMesh.position)
.applyMatrix4(pxMesh.parent.matrixWorld);
@@ -3343,7 +3351,12 @@ function animate(timestamp, frame) {
} else {
pxMesh.collisionIndex = -1;
}
+ return true;
+ } else {
+ pxMesh.parent.remove(pxMesh);
+ return false;
}
+ });
physicsRaycaster.readRaycast();
for (let i = 0; i < pxMeshes.length; i++) {
const pxMesh = pxMeshes[i];
| 0 |
diff --git a/src/models/application.js b/src/models/application.js @@ -91,9 +91,9 @@ Application.create = function(api, name, instanceType, region, orgaIdOrName, git
"instanceType": instanceType.type,
"instanceVersion": instanceType.version,
"instanceVariant": instanceType.variant.id,
- "maxFlavor": "S",
+ "maxFlavor": instanceType.defaultFlavor.name,
"maxInstances": 1,
- "minFlavor": "S",
+ "minFlavor": instanceType.defaultFlavor.name,
"minInstances": 1,
"name": name,
"zone": region
| 4 |
diff --git a/src/inner-slider.js b/src/inner-slider.js @@ -107,9 +107,20 @@ export class InnerSlider extends React.Component {
}
componentWillReceiveProps = (nextProps) => {
let spec = {listRef: this.list, trackRef: this.track, ...nextProps, ...this.state}
- let setTrackStyle
- if (this.state.animating) setTrackStyle = false
- else setTrackStyle = true
+ let setTrackStyle = false
+ for (let key of Object.keys(this.props)) {
+ if (!nextProps.hasOwnProperty(key)) {
+ setTrackStyle = true
+ break
+ }
+ if (typeof nextProps[key] === 'object' || typeof nextProps[key] === 'function') {
+ continue
+ }
+ if (nextProps[key] !== this.props[key]) {
+ setTrackStyle = true
+ break
+ }
+ }
this.updateState(spec, setTrackStyle, () => {
if (this.state.currentSlide >= React.Children.count(nextProps.children)) {
this.changeSlide({
| 1 |
diff --git a/bin/cli.js b/bin/cli.js @@ -494,6 +494,10 @@ if (command === 'create') {
command.stdout.pipe(process.stdout);
command.stderr.pipe(process.stderr);
} else if (command === 'deploy' || command === 'deploy-update') {
+ let dockerImageName, dockerDefaultImageName;
+ let dockerDefaultImageVersionTag = 'v1.0.0';
+ let nextVersionTag;
+
let appPath = arg1 || '.';
let absoluteAppPath = path.resolve(appPath);
let pkg = parsePackageFile(appPath);
@@ -532,7 +536,7 @@ if (command === 'create') {
};
let setImageVersionTag = function (imageName, versionTag) {
- if (versionTag.indexOf(':') != 0) {
+ if (versionTag.indexOf(':') !== 0) {
versionTag = ':' + versionTag;
}
return imageName.replace(/(\/[^\/:]*)(:[^:]*)?$/g, `$1${versionTag}`);
@@ -578,7 +582,7 @@ if (command === 'create') {
};
let performDeployment = function (dockerConfig, versionTag, username, password) {
- let dockerLoginCommand = `docker login -u ${username} -p ${password}`;
+ let dockerLoginCommand = `docker login -u "${username}" -p "${password}"`;
let fullVersionTag;
if (versionTag) {
@@ -592,7 +596,6 @@ if (command === 'create') {
}
try {
saveSocketClusterK8sConfigFile(socketClusterK8sConfig);
-
execSync(`docker build -t ${dockerConfig.imageName} .`, {stdio: 'inherit'});
execSync(`${dockerLoginCommand}; docker push ${dockerConfig.imageName}`, {stdio: 'inherit'});
@@ -670,6 +673,7 @@ if (command === 'create') {
};
let handleDockerVersionTagAndPushToDockerImageRepo = function (versionTag) {
+ socketClusterK8sConfig.docker.imageName = setImageVersionTag(socketClusterK8sConfig.docker.imageName, nextVersionTag);
let dockerConfig = socketClusterK8sConfig.docker;
if (dockerConfig.auth) {
@@ -692,16 +696,14 @@ if (command === 'create') {
let pushToDockerImageRepo = function () {
let versionTagString = parseVersionTag(socketClusterK8sConfig.docker.imageName).replace(/^:/, '');
- let nextVersionTag;
if (versionTagString) {
if (isUpdate) {
nextVersionTag = incrementVersion(versionTagString);
- socketClusterK8sConfig.docker.imageName = setImageVersionTag(socketClusterK8sConfig.docker.imageName, nextVersionTag);
} else {
nextVersionTag = versionTagString;
}
} else {
- nextVersionTag = '""';
+ nextVersionTag = dockerDefaultImageVersionTag;
}
promptInput(`Enter the Docker version tag for this deployment (Default: ${nextVersionTag}):`, handleDockerVersionTagAndPushToDockerImageRepo);
@@ -710,8 +712,6 @@ if (command === 'create') {
if (socketClusterK8sConfig.docker && socketClusterK8sConfig.docker.imageRepo) {
pushToDockerImageRepo();
} else {
- let dockerImageName, dockerDefaultImageName, dockerDefaultImageVersionTag;
-
let saveSocketClusterK8sConfigs = function () {
socketClusterK8sConfig.docker = {
imageRepo: 'https://index.docker.io/v1/',
@@ -729,17 +729,18 @@ if (command === 'create') {
};
let handleDockerImageName = function (imageName) {
- if (imageName) {
- dockerImageName = imageName;
- } else {
- dockerImageName = setImageVersionTag(dockerDefaultImageName, dockerDefaultImageVersionTag);
+ let slashes = (imageName || dockerDefaultImageName).match(/\//g) || [];
+ if (slashes.length !== 1) {
+ failedToDeploy(
+ new Error('Invalid Docker image name; it must be in the format organizationName/projectName')
+ );
}
+ dockerImageName = setImageVersionTag(dockerDefaultImageName, dockerDefaultImageVersionTag);
saveSocketClusterK8sConfigs();
};
let promptDockerImageName = function () {
dockerDefaultImageName = `${dockerUsername}/${appName}`;
- dockerDefaultImageVersionTag = 'v1.0.0';
promptInput(`Enter the Docker image name without the version tag (Or press enter for default: ${dockerDefaultImageName}):`, handleDockerImageName);
};
| 9 |
diff --git a/tools/make/lib/notes/Makefile b/tools/make/lib/notes/Makefile @@ -24,6 +24,7 @@ notes:
$(QUIET) $(FIND_NOTES) $(FIND_NOTES_FLAGS) $(KEYWORDS) $(FIND_NOTES_DIR) \
--exclude-dir "$(NODE_MODULES)/*" \
--exclude-dir "$(BUILD_DIR)/*" \
+ --exclude-dir "$(DIST_DIR)/*" \
--exclude-dir "$(REPORTS_DIR)/*" \
--exclude-dir "$(DEPS_TMP_DIR)/*" \
--exclude-dir "$(DEPS_BUILD_DIR)/*" \
| 8 |
diff --git a/activities/Calligra.activity/js/player.js b/activities/Calligra.activity/js/player.js @@ -13,7 +13,8 @@ var Player = {
return {
size: -1,
zoom: -1,
- current: { start: -1, track: -1, tracks: [] }
+ current: { start: -1, track: -1, tracks: [] },
+ mode: ''
}
},
methods: {
@@ -38,15 +39,20 @@ var Player = {
initEvent: function() {
// Register click/touch on letter event
var vm = this;
- var clickEvent = "click";
+ var clickEvent = "mousemove";
var touchScreen = ("ontouchstart" in document.documentElement);
if (touchScreen) {
clickEvent = "touchend";
}
var letter = document.getElementById("letter");
letter.addEventListener(clickEvent, function(e) {
+ if (vm.mode != 'input') {
+ return;
+ }
var x = Math.floor((e.clientX-letter.getBoundingClientRect().left)/vm.zoom);
var y = Math.floor((e.clientY-letter.getBoundingClientRect().top)/vm.zoom);
+ vm.current.tracks.push({x: x, y: y});
+ vm.draw();
});
},
@@ -60,6 +66,20 @@ var Player = {
imageObj.onload = function() {
// Draw letter
context.drawImage(imageObj, 0, 0, vm.size, vm.size);
+
+ // Draw current position
+ if (vm.mode == 'input' && vm.current.tracks.length) {
+ context.beginPath();
+ context.strokeStyle = app.color.stroke;
+ context.lineWidth = 10;
+ context.lineCap = "round";
+ context.lineJoin = "round";
+ context.moveTo(vm.zoom*vm.current.tracks[0].x, vm.zoom*vm.current.tracks[0].y);
+ for (var i = 1 ; i < vm.current.tracks.length ; i++) {
+ context.lineTo(vm.zoom*vm.current.tracks[i].x, vm.zoom*vm.current.tracks[i].y);
+ }
+ context.stroke();
+ }
};
imageObj.src = vm.item.image;
},
@@ -77,6 +97,7 @@ var Player = {
mounted: function() {
var vm = this;
var timeout = 70;
+ vm.mode = 'show';
var step = function() {
// Draw a segment of path
var line = vm.current.tracks[vm.current.start][vm.current.track];
@@ -89,6 +110,7 @@ var Player = {
context.strokeStyle = app.color.stroke;
context.lineWidth = 10;
context.lineCap = "round";
+ context.lineJoin = "round";
context.moveTo(vm.zoom*line.x0, vm.zoom*line.y0);
context.lineTo(vm.zoom*line.x1, vm.zoom*line.y1);
context.stroke();
@@ -98,6 +120,18 @@ var Player = {
vm.current.track = 0;
if (vm.current.start < vm.current.tracks.length) {
setTimeout(step, timeout);
+ } else {
+ setTimeout(function() {
+ vm.mode = 'input';
+ vm.current.start = 0;
+ vm.current.track = 0;
+ vm.current.tracks = [];
+ if (vm.item.starts && vm.item.starts.length) {
+ vm.current.tracks.push({x: vm.item.starts[0].x, y: vm.item.starts[0].y});
+ vm.current.tracks.push({x: vm.item.starts[0].x, y: vm.item.starts[0].y});
+ }
+ vm.draw();
+ }, 500);
}
} else {
setTimeout(step, timeout);
| 6 |
diff --git a/lib/taiko.js b/lib/taiko.js @@ -812,7 +812,8 @@ async function scrollTo(selector) {
const scroll = async (e, px, scrollPage, scrollElement, direction) => {
e = e || 100;
if (Number.isInteger(e)) {
- await runtimeHandler.runtimeEvaluate(`(${scrollPage}).apply(null, ${JSON.stringify([e])})`);
+ const res = await runtimeHandler.runtimeEvaluate(`(${scrollPage}).apply(null, ${JSON.stringify([e])})`);
+ if(res.result.subtype == 'error') throw new Error(res.result.description);
return { description: `Scrolled ${direction} the page by ${e} pixels` };
}
@@ -821,7 +822,8 @@ const scroll = async (e, px, scrollPage, scrollElement, direction) => {
//TODO: Allow user to set options for scroll
const options = setNavigationOptions({});
await doActionAwaitingNavigation(options, async () => {
- await runtimeHandler.runtimeCallFunctionOn(scrollElement,null,{nodeId:nodeId,arg:px});
+ const res = await runtimeHandler.runtimeCallFunctionOn(scrollElement,null,{nodeId:nodeId,arg:px});
+ if(res.result.subtype == 'error') throw new Error(res.result.description);
});
return { description: `Scrolled ${direction} ` + description(e, true) + ` by ${px} pixels` };
};
| 9 |
diff --git a/admin-base/core/src/main/java/com/peregrine/admin/resource/AdminResourceHandlerService.java b/admin-base/core/src/main/java/com/peregrine/admin/resource/AdminResourceHandlerService.java @@ -1028,7 +1028,7 @@ public class AdminResourceHandlerService
// If found we copy this over into our newly created node
if (component.startsWith(SLASH)) {
logger.warn("Component: '{}' started with a slash which is not valid -> ignored", component);
- } else {
+ } else if (isNotBlank(variation) || properties.isEmpty()) {
copyPropertiesFromComponentVariation(newNode, variation);
}
@@ -1131,18 +1131,19 @@ public class AdminResourceHandlerService
if (value instanceof String) {
node.setProperty(key, (String) value);
} else if (value instanceof List) {
- final List list = (List) value;
- // Get sub node
+ final Node child;
if (node.hasNode(key)) {
- applyChildProperties(node.getNode(key), list);
+ child = node.getNode(key);
} else {
- applyChildProperties(node, list);
+ child = node.addNode(key);
}
+
+ applyChildrenProperties(child, (List) value);
}
}
}
- private void applyChildProperties(@NotNull Node parent, @NotNull List childProperties) throws RepositoryException, ManagementException {
+ private void applyChildrenProperties(@NotNull Node parent, @NotNull List childProperties) throws RepositoryException, ManagementException {
// Loop over Array
int counter = 0;
for (final Object item : childProperties) {
@@ -1151,6 +1152,7 @@ public class AdminResourceHandlerService
} else {
logger.warn("Array item: '{}' is not an Object and so ignored", item);
}
+
counter++;
}
}
@@ -1171,29 +1173,28 @@ public class AdminResourceHandlerService
// No name or matching path name (auto generated IDs) -> use position to find target
final Node target = getNodeAtPosition(parent, position);
- if (target != null) {
- logger.trace("Found Target by position: '{}'", target.getPath());
- // Check if component matches
- final Object sourceComponent = properties.get(COMPONENT);
- final Object targetComponent = target.getProperty(COMPONENT).getString();
- if (sourceComponent == null || !sourceComponent.equals(targetComponent)) {
- logger.warn("Source Component: '{}' does not match target: '{}'", sourceComponent, targetComponent);
- } else {
- applyProperties(target, properties);
- }
- } else {
+ if (isNull(target)) {
final String path = getPropsFromMap(properties, PATH, EMPTY);
final Node sourceNode = findSourceByPath(parent, path.split(SLASH));
- if (sourceNode != null) {
- Node newNode = addNewNode(parent);
- if (sourceNode.hasProperty(SLING_RESOURCE_TYPE)) {
+ final Node newNode = addNewNode(parent);
+ if (nonNull(sourceNode) && sourceNode.hasProperty(SLING_RESOURCE_TYPE)) {
String componentName = sourceNode.getProperty(SLING_RESOURCE_TYPE).getString();
newNode.setProperty(SLING_RESOURCE_TYPE, componentName);
logger.trace("Copy Props from Component Variation, component name: '{}'", componentName);
copyPropertiesFromComponentVariation(newNode, APPS_ROOT + SLASH + componentName, null);
}
+
logger.trace("Apply Properties to node: '{}', props: '{}'", newNode, properties);
applyProperties(newNode, properties);
+ } else {
+ logger.trace("Found Target by position: '{}'", target.getPath());
+ // Check if component matches
+ final Object sourceComponent = properties.get(COMPONENT);
+ final Object targetComponent = target.getProperty(COMPONENT).getString();
+ if (nonNull(sourceComponent) && sourceComponent.equals(targetComponent)) {
+ applyProperties(target, properties);
+ } else {
+ logger.warn("Source Component: '{}' does not match target: '{}'", sourceComponent, targetComponent);
}
}
}
| 11 |
diff --git a/test/jasmine/tests/polar_test.js b/test/jasmine/tests/polar_test.js @@ -1149,10 +1149,6 @@ describe('Test polar interactions:', function() {
describe('dragmode === false', function() {
it('should not respond to drag interactions on plot area when dragmode === false', function(done) {
var fig = Lib.extendDeep({}, require('@mocks/polar_scatter.json'));
-
- // to avoid dragging on hover labels
- fig.layout.hovermode = false;
-
// adjust margins so that middle of plot area is at 300x300
// with its middle at [200,200]
fig.layout.width = 400;
@@ -1243,10 +1239,6 @@ describe('Test polar interactions:', function() {
it('should not respond to drag interactions on radial drag area when dragmode === false', function(done) {
var fig = Lib.extendDeep({}, require('@mocks/polar_scatter.json'));
-
- // to avoid dragging on hover labels
- fig.layout.hovermode = false;
-
// adjust margins so that middle of plot area is at 300x300
// with its middle at [200,200]
fig.layout.width = 400;
@@ -1328,8 +1320,6 @@ describe('Test polar interactions:', function() {
it('should not respond to drag interactions on inner radial drag area when dragmode === false', function(done) {
var fig = Lib.extendDeep({}, require('@mocks/polar_scatter.json'));
fig.layout.polar.hole = 0.2;
- // to avoid dragging on hover labels
- fig.layout.hovermode = false;
// adjust margins so that middle of plot area is at 300x300
// with its middle at [200,200]
fig.layout.width = 400;
@@ -1372,10 +1362,6 @@ describe('Test polar interactions:', function() {
it('should not respond to drag interactions on angular drag area when dragmode === false', function(done) {
var fig = Lib.extendDeep({}, require('@mocks/polar_scatter.json'));
-
- // to avoid dragging on hover labels
- fig.layout.hovermode = false;
-
// adjust margins so that middle of plot area is at 300x300
// with its middle at [200,200]
fig.layout.width = 400;
| 2 |
diff --git a/includes/Modules/Idea_Hub.php b/includes/Modules/Idea_Hub.php @@ -504,11 +504,6 @@ final class Idea_Hub extends Module
'googlesitekit-idea-hub-notice',
array(
'src' => $base_url . 'js/googlesitekit-idea-hub-notice.js',
- 'dependencies' => array(
- 'googlesitekit-vendor',
- 'googlesitekit-api',
- 'googlesitekit-data',
- ),
'load_contexts' => array( Asset::CONTEXT_ADMIN_POST_EDITOR ),
)
),
| 2 |
diff --git a/token-metadata/0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D/metadata.json b/token-metadata/0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D/metadata.json "symbol": "RENBTC",
"address": "0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D",
"decimals": 8,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/avatars/avatars.js b/avatars/avatars.js @@ -361,6 +361,7 @@ const loadPromise = (async () => {
swordSideIdle: animations.find(a => a.name === 'sword_idle_side.fbx'),
swordSideIdleStatic: animations.find(a => a.name === 'sword_idle_side_static.fbx'),
swordSideSlash: animations.find(a => a.name === 'sword_side_slash.fbx'),
+ swordSideSlashStep: animations.find(a => a.name === 'sword_side_slash_step.fbx'),
swordTopDownSlash: animations.find(a => a.name === 'sword_topdown_slash.fbx'),
swordUndraw: animations.find(a => a.name === 'sword_undraw.fbx'),
};
| 0 |
diff --git a/.storybook/config.js b/.storybook/config.js import { addDecorator, configure } from '@storybook/react';
// init UI using a Decorator
-//import BootstrapDecorator from './decorators/BootstrapDecorator'
-//addDecorator(BootstrapDecorator)
+import BootstrapDecorator from './decorators/BootstrapDecorator'
+addDecorator(BootstrapDecorator)
// Uncomment to activate material UI instead
-import MaterialUIDecorator from './decorators/MaterialUIDecorator'
-addDecorator(MaterialUIDecorator)
+// import MaterialUIDecorator from './decorators/MaterialUIDecorator'
+// addDecorator(MaterialUIDecorator)
/*
| 13 |
diff --git a/unlock-app/src/components/content/KeyChainContent.js b/unlock-app/src/components/content/KeyChainContent.js @@ -8,31 +8,9 @@ import DeveloperOverlay from '../developer/DeveloperOverlay'
import Layout from '../interface/Layout'
import Account from '../interface/Account'
import { pageTitle } from '../../constants'
-import LogIn from '../interface/LogIn'
-import SignUp from '../interface/SignUp'
-import FinishSignup from '../interface/FinishSignup'
+import LogInSignUp from '../interface/LogInSignUp'
-export class KeyChainContent extends React.Component {
- constructor(props) {
- super(props)
- this.state = {
- // TODO: Add method to toggle signup and pass it to subcomponents, so that
- // we can switch back and forth between views for logging in and signing
- // up.
- signup: true,
- }
- }
-
- toggleSignup = () => {
- this.setState(prevState => ({
- ...prevState,
- signup: !prevState.signup,
- }))
- }
-
- render() {
- const { account, network, router } = this.props
- const { signup } = this.state
+export const KeyChainContent = ({ account, network, router }) => {
const { hash } = router.location
const emailAddress = hash.slice(1) // trim off leading '#'
@@ -48,26 +26,15 @@ export class KeyChainContent extends React.Component {
<DeveloperOverlay />
</BrowserOnly>
)}
- {!account && !signup && (
- <BrowserOnly>
- <LogIn toggleSignup={this.toggleSignup} />
- </BrowserOnly>
- )}
- {!account && signup && !emailAddress && (
- <BrowserOnly>
- <SignUp toggleSignup={this.toggleSignup} />
- </BrowserOnly>
- )}
- {!account && signup && emailAddress && (
- <BrowserOnly>
- <FinishSignup emailAddress={emailAddress} />
- </BrowserOnly>
+ {!account && (
+ // Default to sign up form. User can toggle to login. If email
+ // address is truthy, do the signup flow.
+ <LogInSignUp signup emailAddress={emailAddress} />
)}
</Layout>
</GlobalErrorConsumer>
)
}
-}
KeyChainContent.propTypes = {
account: UnlockPropTypes.account,
| 5 |
diff --git a/package.json b/package.json "postcss-import-url": "^5.1.0",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.7.0",
- "prettier": "npm:wp-prettier@^2.2.1-beta-1",
+ "prettier": "npm:[email protected]",
"puppeteer": "^10.4.0",
"puppeteer-core": "^3.3.0",
"rimraf": "^3.0.2",
| 2 |
diff --git a/src/v2-routes/v2-info.js b/src/v2-routes/v2-info.js const express = require("express")
const v2 = express.Router()
+const asyncHandle = require("express-async-handler")
// Returns company info
-v2.get("/", (req, res, next) => {
- global.db.collection("info").find({},{"_id": 0 }).toArray((err, doc) => {
- if (err) {
- return next(err)
- }
- res.json(doc[0])
- })
-})
+v2.get("/", asyncHandle(async (req, res) => {
+ const data = await global.db
+ .collection("info")
+ .find({},{"_id": 0 })
+ .toArray()
+ res.json(data[0])
+}))
module.exports = v2
| 3 |
diff --git a/node_common/managers/search/update.js b/node_common/managers/search/update.js @@ -102,8 +102,6 @@ const cleanFile = ({
};
const indexObject = async (objects, cleanObject, index) => {
- console.log("index object");
- console.log(objects);
try {
if (Array.isArray(objects)) {
let body = [];
@@ -111,11 +109,9 @@ const indexObject = async (objects, cleanObject, index) => {
body.push({ index: { _index: index, _id: object.id } });
body.push(cleanObject(object));
}
- console.log(body);
const result = await searchClient.bulk({
body,
});
- console.log(result);
} else {
let object = objects;
const result = await searchClient.index({
@@ -123,7 +119,6 @@ const indexObject = async (objects, cleanObject, index) => {
index: index,
body: cleanObject(object),
});
- console.log(result);
}
} catch (e) {
Logging.error(e);
@@ -143,8 +138,6 @@ export const indexFile = async (files) => {
};
const updateObject = async (objects, cleanObject, index) => {
- console.log("update object");
- console.log(objects);
try {
if (Array.isArray(objects)) {
let body = [];
@@ -155,7 +148,6 @@ const updateObject = async (objects, cleanObject, index) => {
const result = await searchClient.bulk({
body,
});
- console.log(result);
} else {
let object = objects;
const result = await searchClient.update({
@@ -165,7 +157,6 @@ const updateObject = async (objects, cleanObject, index) => {
doc: cleanObject(object),
},
});
- console.log(result);
}
} catch (e) {
Logging.error(e);
@@ -185,8 +176,6 @@ export const updateFile = async (files) => {
};
const deleteObject = async (objects, index) => {
- console.log("delete object");
- console.log(objects);
try {
if (Array.isArray(objects)) {
let body = [];
@@ -196,7 +185,6 @@ const deleteObject = async (objects, index) => {
const result = await searchClient.bulk({
body,
});
- console.log(result);
} else {
let object = objects;
let result = await searchClient.delete({
| 2 |
diff --git a/src/commands/link.js b/src/commands/link.js const Command = require('../base')
const { flags } = require('@oclif/command')
const renderShortDesc = require('../utils/renderShortDescription')
-const inquirer = require('inquirer')
const path = require('path')
const chalk = require('chalk')
-const getRepoData = require('../utils/getRepoData')
const linkPrompt = require('../utils/link/link-by-prompt')
-const isEmpty = require('lodash.isempty')
+
class LinkCommand extends Command {
async run() {
await this.authenticate()
const { flags } = this.parse(LinkCommand)
const siteId = this.site.get('siteId')
-
- if (siteId && !flags.force) {
- let siteInaccessible = false
+ // const hasFlags = !isEmpty(flags)
let site
try {
site = await this.netlify.getSite({ siteId })
} catch (e) {
- if (!e.ok) {
- siteInaccessible = true
+ // silent api error
}
+
+ // Site id is incorrect
+ if (siteId && !site) {
+ console.log(`No site "${siteId}" found in your netlify account.`)
+ console.log(`Please double check your siteID and which account you are logged into via \`netlify status\`.`)
+ return this.exit()
}
- if (!siteInaccessible) {
- this.log(`Site already linked to ${site.name}`)
- this.log(`Link: ${site.admin_url}`)
+
+ // If already linked to site. exit and prompt for unlink
+ if (site) {
+ this.log(`Site already linked to "${site.name}"`)
+ this.log(`Admin url: ${site.admin_url}`)
this.log()
- this.log(`To unlink this site, run: \`netlify unlink\``)
+ this.log(`To unlink this site, run: ${chalk.cyanBright('netlify unlink')}`)
return this.exit()
}
- }
if (flags.id) {
- let site
try {
site = await this.netlify.getSite({ site_id: flags.id })
} catch (e) {
if (e.status === 404) {
this.error(new Error(`Site id ${flags.id} not found`))
+ } else {
+ this.error(e)
}
- else this.error(e)
}
this.site.set('siteId', site.id)
this.log(`Linked to ${site.name} in ${path.relative(path.join(process.cwd(), '..'), this.site.path)}`)
@@ -56,8 +58,11 @@ class LinkCommand extends Command {
filter: 'all'
})
} catch (e) {
- if (e.status === 404) this.error(new Error(`${flags.name} not found`))
- else this.error(e)
+ if (e.status === 404) {
+ this.error(new Error(`${flags.name} not found`))
+ } else {
+ this.error(e)
+ }
}
if (results.length === 0) {
@@ -69,15 +74,17 @@ class LinkCommand extends Command {
return this.exit()
}
- await linkPrompt(this)
+ site = await linkPrompt(this)
+ return site
}
}
LinkCommand.description = `${renderShortDesc('Link a local repo or project folder to an existing site on Netlify')}`
LinkCommand.examples = [
- '$ netlify init --id 123-123-123-123',
- '$ netlify init --name my-site-name'
+ 'netlify link',
+ 'netlify link --id 123-123-123-123',
+ 'netlify link --name my-site-name'
]
LinkCommand.flags = {
@@ -86,9 +93,6 @@ LinkCommand.flags = {
}),
name: flags.string({
description: 'Name of site to link to'
- }),
- force: flags.boolean({
- description: 'Force link a folder to a site, even if the folder is already linked'
})
}
| 3 |
diff --git a/js/lbank2.js b/js/lbank2.js @@ -1004,11 +1004,11 @@ module.exports = class lbank2 extends Exchange {
parseOrderStatus (status) {
const statuses = {
- '-1': 'cancelled', // cancelled
+ '-1': 'canceled', // canceled
'0': 'open', // not traded
'1': 'open', // partial deal
'2': 'closed', // complete deal
- '3': 'closed', // filled partially and cancelled
+ '3': 'closed', // filled partially and canceled
'4': 'closed', // disposal processing
};
return this.safeString (statuses, status, status);
@@ -1309,7 +1309,7 @@ module.exports = class lbank2 extends Exchange {
* @param {dict} params extra parameters specific to the lbank2 api endpoint
* @returns {[dict]} a list of [order structures]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure
*/
- // default query is for cancelled and completely filled orders
+ // default query is for canceled and completely filled orders
// does not return open orders unless specified explicitly
if (symbol === undefined) {
throw new ArgumentsRequired (this.id + ' fetchOrders() requires a symbol argument');
@@ -1323,7 +1323,7 @@ module.exports = class lbank2 extends Exchange {
'symbol': market['id'],
'current_page': 1,
'page_length': limit,
- // 'status' -1: Cancelled, 0: Unfilled, 1: Partially filled, 2: Completely filled, 3: Partially filled and cancelled, 4: Cancellation is being processed
+ // 'status' -1: Canceled, 0: Unfilled, 1: Partially filled, 2: Completely filled, 3: Partially filled and canceled, 4: Cancellation is being processed
};
const response = await this.privatePostSupplementOrdersInfoHistory (this.extend (request, params));
//
@@ -1665,7 +1665,7 @@ module.exports = class lbank2 extends Exchange {
'1': 'pending',
'2': 'ok',
'3': 'failed',
- '4': 'cancelled',
+ '4': 'canceled',
'5': 'transfer', // Transfer
};
return this.safeString (statuses, status, status);
@@ -1674,7 +1674,7 @@ module.exports = class lbank2 extends Exchange {
parseWithdrawalStatus (status) {
const statuses = {
'1': 'pending',
- '2': 'cancelled',
+ '2': 'canceled',
'3': 'failed',
'4': 'ok',
};
@@ -2098,7 +2098,7 @@ module.exports = class lbank2 extends Exchange {
'10102': 'Too little to withdraw',
'10103': 'Exceed daily limitation of withdraw',
'10104': 'Cancel was rejected',
- '10105': 'Request has been cancelled',
+ '10105': 'Request has been canceled',
'10106': 'None trade time',
'10107': 'Start price exception',
'10108': 'can not create order',
@@ -2136,7 +2136,7 @@ module.exports = class lbank2 extends Exchange {
'10023': InvalidOrder, // 'Market Order is not supported yet',
'10024': PermissionDenied, // 'User cannot trade on this pair',
'10025': InvalidOrder, // 'Order has been filled',
- '10026': InvalidOrder, // 'Order has been cancelled',
+ '10026': InvalidOrder, // 'Order has been canceled',
'10027': InvalidOrder, // 'Order is cancelling',
'10028': BadRequest, // 'Wrong query time',
'10029': BadRequest, // 'from is not in the query time',
@@ -2149,7 +2149,7 @@ module.exports = class lbank2 extends Exchange {
'10102': InsufficientFunds, // 'Too little to withdraw',
'10103': ExchangeError, // 'Exceed daily limitation of withdraw',
'10104': ExchangeError, // 'Cancel was rejected',
- '10105': ExchangeError, // 'Request has been cancelled',
+ '10105': ExchangeError, // 'Request has been canceled',
'10106': BadRequest, // 'None trade time',
'10107': BadRequest, // 'Start price exception',
'10108': ExchangeError, // 'can not create order',
| 1 |
diff --git a/test/jasmine/tests/axes_test.js b/test/jasmine/tests/axes_test.js @@ -7953,3 +7953,41 @@ describe('more matching axes tests', function() {
.then(done, done.fail);
});
});
+
+describe('shift tests', function() {
+ var gd;
+
+ beforeEach(function() {
+ gd = createGraphDiv();
+ });
+
+ function checkLine(selector, position) {
+ var path = d3Select(gd).select(selector)
+ var pos = (path.split('d="M')[1]).split(',')[0];
+ expect(Number(pos)).toBeCloseTo(position, 2);
+ };
+
+ afterEach(destroyGraphDiv);
+
+ it('should set y-axis shifts correctly on first draw when shift=true', function() {
+ var fig = require('@mocks/zz-mult-yaxes-simple.json');
+ Plotly.newPlot(gd, fig).then(function() {
+ checkLine('path.xy3-y.crisp', 550)
+ checkLine('path.xy4-y.crisp', 691)
+ expect(gd._fullLayout.yaxis3._shift).toBeCloseTo(97, 2)
+ expect(gd._fullLayout.yaxis4._shift).toBeCloseTo(243, 2)
+ });
+ });
+
+ it('should set y-axis shifts correctly on first draw when shift=<numeric>', function() {
+
+ var fig = require('@mocks/zz-mult-yaxes-manual-shift.json');
+ Plotly.newPlot(gd, fig).then(function() {
+ checkLine('path.xy3-y.crisp', 97)
+ checkLine('path.xy4-y.crisp', 616)
+ expect(gd._fullLayout.yaxis3._shift).toBeCloseTo(-100, 2)
+ expect(gd._fullLayout.yaxis4._shift).toBeCloseTo(100, 2)
+ });
+ });
+
+});
| 0 |
diff --git a/content/articles/spring-webflux/index.md b/content/articles/spring-webflux/index.md @@ -202,7 +202,7 @@ public interface StudentService {
Flux<Student> findAll(); // Returns all students
- Mono<Student> update(Student student); // Updates and returns the updated student
+ Mono<Student> update(Student student, int id); // Updates and returns the updated student
Mono<Void> delete(int id); // Delete the student
@@ -238,8 +238,8 @@ public class StudentServiceImpl implements StudentService {
}
// Saves a student into the database
@Override
- public Mono<Student> update(Student student) {
- return repository.findById(student.getId()) // tries to get a student with the specified id
+ public Mono<Student> update(Student student, int id) {
+ return repository.findById(id) // tries to get a student with the specified id
.doOnError(IllegalStateException::new)
.map(studentMap -> {
studentMap.setName(student.getName());
@@ -290,7 +290,7 @@ public class StudentController {
}
// Updates the student with the provided id
@PutMapping("/{id}")
- public Mono<Student> updateStudent(@RequestBody Student student) {
+ public Mono<Student> updateStudent(@RequestBody Student student, @PathVariable("id") int id) {
return service.update(student);
}
// Deletes the student with the provided id
| 1 |
diff --git a/lib/ag-solo/html/index.html b/lib/ag-solo/html/index.html <!doctype html>
<html lang="en">
+
<head>
<meta charset="utf-8" />
<title>SwingSet Solo REPL Demo</title>
padding: 0;
margin: 0;
}
+
h1 {
text-align: center;
margin-top: 40px;
}
+
.container {
display: grid;
grid-template-columns: 40px 520px auto 40px;
grid-template-rows: 40px auto;
}
+
.left {
grid-column: 2;
grid-row: 2;
}
+
.right {
grid-column: 3;
grid-row: 2;
display: flex;
flex-direction: column;
}
+
+ .gallery {
+ border: 3px solid black;
+ background: repeating-linear-gradient(-45deg, grey, grey 5px, white 5px, white 10px);
+ height: 500px;
+ width: 500px;
+ line-height: 0;
+ }
+
+ .pixel {
+ height: 50px;
+ width: 50px;
+ display: inline-block;
+ transition: background-color 2s;
+ }
+
+ .updated {
+ animation-name: spin;
+ animation-duration: 2000ms;
+ animation-iteration-count: 1;
+ }
+
+ @keyframes spin {
+ from {
+ transform: rotate(0deg);
+ }
+
+ to {
+ transform: rotate(360deg);
+ }
+ }
+
#history {
overflow-y: scroll;
overflow-x: hidden;
width: 100%;
}
+
#history>.history-line {
background: #DBFAF9;
border-top: 2pt;
}
</style>
</head>
+
<body>
<noscript>
You need to enable JavaScript to run this app.</noscript>
@@ -66,4 +105,5 @@ You need to enable JavaScript to run this app.</noscript>
</address>
<script src="./main.js"></script>
</body>
+
</html>
\ No newline at end of file
| 5 |
diff --git a/docs/src/pages/demos/tooltips/PositionedTooltips.js b/docs/src/pages/demos/tooltips/PositionedTooltips.js @@ -28,64 +28,44 @@ class PositionedTooltips extends React.Component {
<div className={classes.root}>
<Grid container justify="center">
<Grid item>
- <Tooltip
- id="tooltip-top-start"
- className={classes.fab}
- title="Add"
- placement="top-start"
- >
+ <Tooltip id="tooltip-top-start" title="Add" placement="top-start">
<Button>top-start</Button>
</Tooltip>
- <Tooltip id="tooltip-top" className={classes.fab} title="Add" placement="top">
+ <Tooltip id="tooltip-top" title="Add" placement="top">
<Button>top</Button>
</Tooltip>
- <Tooltip id="tooltip-top-end" className={classes.fab} title="Add" placement="top-end">
+ <Tooltip id="tooltip-top-end" title="Add" placement="top-end">
<Button>top-end</Button>
</Tooltip>
</Grid>
</Grid>
<Grid container justify="center">
<Grid item xs={6}>
- <Tooltip
- id="tooltip-left-start"
- className={classes.fab}
- title="Add"
- placement="left-start"
- >
+ <Tooltip id="tooltip-left-start" title="Add" placement="left-start">
<Button>left-start</Button>
</Tooltip>
<br />
- <Tooltip id="tooltip-left" className={classes.fab} title="Add" placement="left">
+ <Tooltip id="tooltip-left" title="Add" placement="left">
<Button>left</Button>
</Tooltip>
<br />
- <Tooltip id="tooltip-left-end" className={classes.fab} title="Add" placement="left-end">
+ <Tooltip id="tooltip-left-end" title="Add" placement="left-end">
<Button>left-end</Button>
</Tooltip>
</Grid>
<Grid item container xs={6} align="flex-end" direction="column" spacing={0}>
<Grid item>
- <Tooltip
- id="tooltip-right-start"
- className={classes.fab}
- title="Add"
- placement="right-start"
- >
+ <Tooltip id="tooltip-right-start" title="Add" placement="right-start">
<Button>right-start</Button>
</Tooltip>
</Grid>
<Grid item>
- <Tooltip id="tooltip-right" className={classes.fab} title="Add" placement="right">
+ <Tooltip id="tooltip-right" title="Add" placement="right">
<Button>right</Button>
</Tooltip>
</Grid>
<Grid item>
- <Tooltip
- id="tooltip-right-end"
- className={classes.fab}
- title="Add"
- placement="right-end"
- >
+ <Tooltip id="tooltip-right-end" title="Add" placement="right-end">
<Button>right-end</Button>
</Tooltip>
</Grid>
@@ -93,23 +73,13 @@ class PositionedTooltips extends React.Component {
</Grid>
<Grid container justify="center">
<Grid item>
- <Tooltip
- id="tooltip-bottom-start"
- className={classes.fab}
- title="Add"
- placement="bottom-start"
- >
+ <Tooltip id="tooltip-bottom-start" title="Add" placement="bottom-start">
<Button>bottom-start</Button>
</Tooltip>
- <Tooltip id="tooltip-bottom" className={classes.fab} title="Add" placement="bottom">
+ <Tooltip id="tooltip-bottom" title="Add" placement="bottom">
<Button>bottom</Button>
</Tooltip>
- <Tooltip
- id="tooltip-bottom-end"
- className={classes.fab}
- title="Add"
- placement="bottom-end"
- >
+ <Tooltip id="tooltip-bottom-end" title="Add" placement="bottom-end">
<Button>bottom-end</Button>
</Tooltip>
</Grid>
| 2 |
diff --git a/metaversefile-api.js b/metaversefile-api.js @@ -16,7 +16,7 @@ import Avatar from './avatars/avatars.js';
import {rigManager} from './rig.js';
import {world} from './world.js';
import {glowMaterial} from './shaders.js';
-import * as ui from './vr-ui.js';
+// import * as ui from './vr-ui.js';
import {ShadertoyLoader} from './shadertoy.js';
import cameraManager from './camera-manager.js';
import {GIFLoader} from './GIFLoader.js';
@@ -623,9 +623,9 @@ metaversefile.setApi({
useAbis() {
return abis;
},
- useUi() {
+ /* useUi() {
return ui;
- },
+ }, */
useActivate(fn) {
const app = currentAppRender;
if (app) {
| 2 |
diff --git a/assets/js/modules/analytics/datastore/setup-flow.test.js b/assets/js/modules/analytics/datastore/setup-flow.test.js @@ -116,12 +116,6 @@ describe( 'modules/analytics setup-flow', () => {
describe( 'selectors', () => {
describe( 'getSetupFlowMode', () => {
- it( 'returns "legacy" if the feature flag ga4setup is disabled ', async () => {
- enabledFeatures.delete( 'ga4setup' );
-
- expect( registry.select( MODULES_ANALYTICS ).getSetupFlowMode() ).toBe( SETUP_FLOW_MODE_LEGACY );
- } );
-
it( 'should return "legacy" if isAdminAPIWorking() returns false', () => {
registry.dispatch( MODULES_ANALYTICS_4 ).receiveError(
new Error( 'foo' ), 'getProperties', [ 'foo', 'bar' ],
| 2 |
diff --git a/src/components/mapexplorer.js b/src/components/mapexplorer.js @@ -175,9 +175,14 @@ function MapExplorer({
},
{}
);
- currentMapData[currentMap.name].Total = states.find(
+ currentMapData[currentMap.name].Total = {};
+ const stateData = states.find(
(state) => currentMap.name === state.state
);
+ dataTypes.forEach((dtype) => {
+ currentMapData[currentMap.name].Total[dtype] =
+ parseInt(stateData[dtype !== 'deceased' ? dtype : 'deaths']) || 0;
+ });
}
}
return [statistic, currentMapData];
| 1 |
diff --git a/app/components/file-viewer/audio-player.jsx b/app/components/file-viewer/audio-player.jsx @@ -81,7 +81,14 @@ class AudioPlayer extends React.Component {
}
renderProgressMarker() {
- return (<ProgressIndicator progressPosition={this.state.progressPosition} progressRange={[0, this.state.trackDuration]} naturalWidth={100} naturalHeight={100} />);
+ return (
+ <ProgressIndicator
+ progressPosition={this.state.progressPosition}
+ progressRange={[0, this.state.trackDuration]}
+ naturalWidth={100}
+ naturalHeight={100}
+ />
+ );
}
render() {
@@ -92,7 +99,15 @@ class AudioPlayer extends React.Component {
<div>
{this.renderProgressMarker()}
<div className="audio-image-component">
- <ImageViewer src={imageSrc} type={this.imageTypeString()} format={this.imageFormatString()} frame={this.props.frame} onLoad={this.props.onLoad} onFocus={this.props.onFocus} onBlur={this.props.onBlur} />
+ <ImageViewer
+ src={imageSrc}
+ type={this.imageTypeString()}
+ format={this.imageFormatString()}
+ frame={this.props.frame}
+ onLoad={this.props.onLoad}
+ onFocus={this.props.onFocus}
+ onBlur={this.props.onBlur}
+ />
</div>
</div>
);
@@ -104,9 +119,15 @@ class AudioPlayer extends React.Component {
</div>
<div className="audio-player-component">
<audio
- className="subject" controls={true} ref={(element) => {
- this.player = element;
- }} src={this.audioSrc()} type={this.audioTypeString()} preload="auto" onCanPlay={this.onAudioLoad.bind(this)} onEnded={this.endAudio} onTimeUpdate={this.updateProgress.bind(this)}
+ className="subject"
+ controls={true}
+ ref={(element) => { this.player = element; }}
+ src={this.audioSrc()}
+ type={this.audioTypeString()}
+ preload="auto"
+ onCanPlay={this.onAudioLoad.bind(this)}
+ onEnded={this.endAudio}
+ onTimeUpdate={this.updateProgress.bind(this)}
>
Your browser does not support the audio format. Please upgrade your browser.
</audio>
| 1 |
diff --git a/token-metadata/0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9/metadata.json b/token-metadata/0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9/metadata.json "symbol": "SXP",
"address": "0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/plugins/block_storage/app/controllers/block_storage/volumes_controller.rb b/plugins/block_storage/app/controllers/block_storage/volumes_controller.rb @@ -109,7 +109,12 @@ module BlockStorage
end
def reset_status
- volume = services.block_storage.find_volume(params[:id])
+ # there is a bug in cinder permissions check.
+ # The API does not allow volume admin to change
+ # the state. For now we switch to cloud admin.
+ # TODO: switch back to service.block_storage once
+ # the API is fixed
+ volume = cloud_admin.block_storage.find_volume(params[:id])
if volume.reset_status(params[:status])
audit_logger.info(current_user, 'has reset volume', volume.id)
| 11 |
Subsets and Splits