code
stringlengths 122
4.99k
| label
int64 0
14
|
---|---|
diff --git a/python/ccxtpro/base/fast_client.py b/python/ccxtpro/base/fast_client.py __author__ = 'Carlo Revelli'
+import ccxt
from ccxtpro.base.aiohttp_client import AiohttpClient
import asyncio
import collections
@@ -34,20 +35,19 @@ class FastClient(AiohttpClient):
if self.switcher is None or self.switcher.done():
self.switcher = asyncio.ensure_future(switcher())
- def exception_wrapper(set_exception):
- def inner(exception):
- set_exception(exception)
- self.on_error(exception)
- return inner
+ def network_error(exception):
+ self.on_error(ccxt.NetworkError(exception))
connection = self.connection._conn
if connection.closed:
# connection got terminated after the connection was made and before the receive loop ran
self.on_close(1006)
return
- queue = connection.protocol._payload_parser.queue
+ protocol = connection.protocol
+ queue = protocol._payload_parser.queue
queue.feed_data = feed_data
- queue.set_exception = exception_wrapper(queue.set_exception)
+ queue.set_exception = network_error
+ protocol.connection_lost = network_error
def resolve(self, result, message_hash=None):
super(FastClient, self).resolve(result, message_hash)
| 9 |
diff --git a/webaverse.js b/webaverse.js @@ -239,6 +239,7 @@ export default class Webaverse extends EventTarget {
rigManager.localRig.undecapitate();
// rigManager.localRig.aux.undecapitate();
}
+ avatarScene.add(world.lights);
renderer.render(avatarScene, camera);
if (decapitated) {
rigManager.localRig.undecapitate();
| 0 |
diff --git a/publish/releases.json b/publish/releases.json "major": 2,
"minor": 46
},
- "sources": ["Exchanger", "Synthetix"],
- "sips": [138, 139, 140]
+ "sources": ["DebtCache", "Exchanger", "Synthetix"],
+ "sips": [138, 139, 140, 145, 150, 151]
},
{
"name": "Alnitak (Optimism)",
"minor": 46
},
"ovm": true,
- "sources": ["Exchanger", "MintableSynthetix"],
- "sips": [138, 139, 140]
+ "sources": ["DebtCache", "Exchanger", "Synthetix"],
+ "sips": [138, 139, 140, 145, 150]
}
]
| 3 |
diff --git a/src/common.js b/src/common.js @@ -56,9 +56,13 @@ export function freeze(value) {
export function shallowCopy(value) {
if (Array.isArray(value)) return value.slice()
- if (value.__proto__ === undefined)
- return Object.assign(Object.create(null), value)
- return Object.assign({}, value)
+ const target = value.__proto__ === undefined ? Object.create(null) : {}
+ for (let key in value) {
+ if (has(value, key)) {
+ target[key] = value[key]
+ }
+ }
+ return target
}
export function each(value, cb) {
| 14 |
diff --git a/server/game/cards/11.4-MoD/SerMarkMullendore.js b/server/game/cards/11.4-MoD/SerMarkMullendore.js @@ -11,7 +11,6 @@ class SerMarkMullendore extends DrawCard {
this.game.addMessage('{0} uses {1} to reveal the top card of their deck as {2}', this.controller, this, this.topCard);
- if(this.topCard.getType() === 'character') {
if(!this.controller.canPutIntoPlay(this.topCard)) {
this.game.addMessage('{0} is unable to put {1} into play for {2}', this.controller, this.topCard, this);
return;
@@ -27,7 +26,6 @@ class SerMarkMullendore extends DrawCard {
}
});
}
- }
});
}
| 11 |
diff --git a/.slackbot.yml b/.slackbot.yml # List of Slack usernames (not GitHub) for the Cesium Concierge Slackbot to send release reminders for.
releaseSchedule:
- - eli, 1/3/2022
- - peter, 2/1/2022
+ - ggetz, 2/1/2022
- eli, 3/1/2022
- sam.suhag, 4/1/2022
- - eli, 5/2/2022
- - peter, 6/1/2022
- - eli, 7/1/2022
- - sam.suhag, 8/1/2022
+ - ggetz, 5/2/2022
+ - eli, 6/1/2022
+ - sam.suhag, 7/1/2022
+ - ggetz, 8/1/2022
- eli, 9/1/2022
- - peter, 10/3/2022
- - eli, 11/1/2022
- - sam.suhag, 12/1/2022
+ - sam.suhag, 10/3/2022
+ - ggetz, 11/1/2022
| 3 |
diff --git a/package.json b/package.json },
"dependencies": {
"@material-ui/core": "^3.1.0",
- "@reactioncommerce/components": "0.57.0",
+ "@reactioncommerce/components": "0.60.0",
"@reactioncommerce/components-context": "^1.1.0",
"@segment/snippet": "^4.3.1",
"apollo-cache-inmemory": "^1.1.11",
| 3 |
diff --git a/apps/smtswch/README.md b/apps/smtswch/README.md @@ -20,6 +20,7 @@ This app allows you to remotely control devices (or anything else you like!) wit
First, you'll need a device that supports BLE.
Install EspruinoHub following the directions at [https://github.com/espruino/EspruinoHub](https://github.com/espruino/EspruinoHub)
+
Install [Node-RED](https://nodered.org/docs/getting-started)
## Example Node-RED flow
| 7 |
diff --git a/readme.md b/readme.md @@ -720,6 +720,29 @@ export default ({ url }) =>
</div>
```
+The router instance should be only used inside the client side of your app though. In order to prevent any error regarding this subject, when rendering the Router on the server side, use the imperatively prefetch method in the `componentDidMount()` lifecycle method.
+
+```jsx
+import React from 'react'
+import Router from 'next/router'
+
+export default class MyLink extends React.Component {
+ componentDidMount() {
+ Router.prefetch('/dynamic')
+ }
+
+ render() {
+ return (
+ <div>
+ <a onClick={() => setTimeout(() => url.pushTo('/dynamic'), 100)}>
+ A route transition will happen after 100ms
+ </a>
+ </div>
+ )
+ }
+}
+```
+
### Custom server and routing
<p><details>
| 7 |
diff --git a/components/combobox/combobox.jsx b/components/combobox/combobox.jsx @@ -1216,7 +1216,7 @@ class Combobox extends React.Component {
className={classNames('slds-form-element', props.classNameContainer)}
>
<Label
- assistiveText={this.props.assistiveText.label}
+ assistiveText={this.props.assistiveText}
htmlFor={this.getId()}
label={labels.label}
required={labels.labelRequired}
| 1 |
diff --git a/PostBanDeletedPosts.user.js b/PostBanDeletedPosts.user.js // @description When user posts on SO Meta regarding a post ban, fetch and display deleted posts (must be mod) and provide easy way to copy the results into a comment
// @homepage https://github.com/samliew/SO-mod-userscripts
// @author @samliew
-// @version 2.3.1
+// @version 2.3.2
//
// @include https://meta.stackoverflow.com/questions/*
//
if(!hasDeletedComment) {
if(comment.length <= 600) {
- addComment(pid, comment);
- location.reload(true);
+ addComment(pid, comment).then(() => location.reload());
}
else {
const spl = comment.split(' [11]');
- addComment(pid, spl[0] + '...');
-
- setTimeout(() => {
- addComment(pid, '... [11]' + spl[1]);
- location.reload(true);
- }, 500);
+ addComment(pid, spl[0] + '...').then(() => {
+ addComment(pid, '... [11]' + spl[1]).then(() => location.reload());
+ });
}
}
});
| 4 |
diff --git a/src/scss/components/_layout.scss b/src/scss/components/_layout.scss @@ -72,7 +72,7 @@ body,
}
.docs-o-Grid--three-col {
- grid-template-columns: repeat(auto-fit, minmax(310px, 425px));
+ grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
}
.docs-o-Grid--home-page {
| 3 |
diff --git a/_references.md b/_references.md [Avocado Lab]: /docs/tutorials/AvocadoLab/
[DIYbiosphere]: /projects/diybiosphere/
[DIYbio.org]: /networks/diybio.org/
-
+[Genspace]: /labs/genspace/
+[Biotech Without Borders]: /labs/biotechwithoutborders/
+[BwoB]: /labs/biotechwithoutborders/
[slack]: https://diybiosphere.slack.com/ "DIYbiosphere Slack"
[gitter]: https://gitter.im/DIYbiosphere/sphere?utm_source=share-link&utm_medium=link&utm_campaign=share-link "DIYbiosphere Gitter chat room"
| 0 |
diff --git a/src/lib/analytics/analytics.js b/src/lib/analytics/analytics.js @@ -9,6 +9,7 @@ import * as Sentry from '@sentry/browser'
// import API from '../../lib/API/api'
import Config from '../../config/config'
import logger, { ExceptionCategory } from '../../lib/logger/pino-logger'
+import { isMobileReactNative } from '../../lib/utils/platform'
export const CLICK_BTN_GETINVITED = 'CLICK_BTN_GETINVITED'
export const CLICK_BTN_RECOVER_WALLET = 'CLICK_BTN_RECOVER_WALLET'
@@ -308,10 +309,11 @@ const patchLogger = () => {
const debounceFireEvent = debounce(fireEvent, 500, { leading: true })
logger.error = (...args) => {
+ const isRunningTests = env === 'test'
+ const proxyToLogger = () => logError(...args)
const { Unexpected, Network, Human } = ExceptionCategory
const [logContext, logMessage, eMsg = '', errorObj, extra = {}] = args
let { dialogShown, category = Unexpected, ...context } = extra
- let errorToPassIntoLog = errorObj
let categoryToPassIntoLog = category
if (
@@ -321,14 +323,6 @@ const patchLogger = () => {
categoryToPassIntoLog = Network
}
- let savedErrorMessage
- if (errorObj instanceof Error) {
- savedErrorMessage = errorObj.message
- errorToPassIntoLog.message = `${logMessage}: ${errorObj.message}`
- } else {
- errorToPassIntoLog = new Error(logMessage)
- }
-
if (isString(logMessage) && !logMessage.includes('axios')) {
const logPayload = {
unique: `${eMsg} ${logMessage} (${logContext.from})`,
@@ -349,9 +343,16 @@ const patchLogger = () => {
debounceFireEvent(ERROR_LOG, logPayload)
}
- if (env === 'test') {
- logError(...args)
- return
+ let savedErrorMessage
+
+ if (!isRunningTests) {
+ let errorToPassIntoLog = errorObj
+
+ if (errorObj instanceof Error) {
+ savedErrorMessage = errorObj.message
+ errorToPassIntoLog.message = `${logMessage}: ${errorObj.message}`
+ } else {
+ errorToPassIntoLog = new Error(logMessage)
}
reportToSentry(
@@ -369,6 +370,12 @@ const patchLogger = () => {
level: categoryToPassIntoLog === Human ? 'info' : undefined,
},
)
+ }
+
+ if (isRunningTests || isMobileReactNative) {
+ proxyToLogger()
+ return
+ }
Sentry.flush().finally(() => {
// if savedErrorMessage not empty that means errorObj
@@ -378,7 +385,7 @@ const patchLogger = () => {
errorObj.message = savedErrorMessage
}
- logError(...args)
+ proxyToLogger()
})
}
}
| 2 |
diff --git a/src/menu.js b/src/menu.js @@ -135,7 +135,9 @@ D.installMenu = function Menu(mx) {
}
return !1;
};
- $m = $('<div class=menu>').prependTo('body').empty()
+ $m = $('div[class=menu]');
+ $m.length || ($m = $('<div class=menu>').prependTo('body'));
+ $m.empty()
.addClass('menu')
.append(arg.map(render));
$m.find('>.m-sub>.m-opener').addClass('m-top');
| 14 |
diff --git a/package.json b/package.json "test:web": "npm run link && react-app-rewired test",
"test:native": "npm run test:ios && npm run test:android",
"test:ios": "npm run animation:assets && ENVFILE=.env.test detox build -c ios.sim.debug && detox test -c ios.sim.debug",
- "test:android": "npm run animation:assets && ENVFILE=.env.test detox build -c android.emu.release && detox test -c android.emu.release",
+ "test:android": "npm run animation:assets && ENVFILE=.env.test detox build -c android.emu.debug && detox test -c android.emu.debug",
"coverage": "react-app-rewired test --coverage",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
"bundlesize:check": "bundlesize",
| 0 |
diff --git a/packages/react-router/docs/api/hooks.md b/packages/react-router/docs/api/hooks.md @@ -44,7 +44,11 @@ This could be really useful e.g. in a situation where you would like to trigger
```jsx
import React from "react"
import ReactDOM from "react-dom"
-import { BrowserRouter as Router, Switch, useLocation } from "react-router"
+import {
+ BrowserRouter as Router,
+ Switch,
+ useLocation
+} from "react-router"
function usePageViews() {
let location = useLocation()
@@ -75,7 +79,12 @@ ReactDOM.render(
```jsx
import React from "react"
import ReactDOM from "react-dom"
-import { BrowserRouter as Router, Switch, Route, useParams } from "react-router"
+import {
+ BrowserRouter as Router,
+ Switch,
+ Route,
+ useParams
+} from "react-router"
function BlogPost() {
let { slug } = useParams()
| 3 |
diff --git a/storybook-utilities/getStorybookInstance.js b/storybook-utilities/getStorybookInstance.js @@ -2,14 +2,22 @@ const getStorybookInstance = () => {
const storybookUrl = window.location.href;
let storybookInstance;
- if (storybookUrl.includes('6006') || storybookUrl.includes('react.sparkdesignsystem')) {
+ if (
+ storybookUrl.includes('6006')
+ || storybookUrl.includes('react.sparkdesignsystem')
+ || storybookUrl.includes('spark-sb-react')
+ ) {
storybookInstance = 'react';
} else if (
- storybookUrl.includes('8006') || storybookUrl.includes('angular.sparkdesignsystem')
+ storybookUrl.includes('8006')
+ || storybookUrl.includes('angular.sparkdesignsystem')
+ || storybookUrl.includes('spark-sb-angular')
) {
storybookInstance = 'angular';
} else if (
- storybookUrl.includes('7006') || storybookUrl.includes('html.sparkdesignsystem')
+ storybookUrl.includes('7006')
+ || storybookUrl.includes('html.sparkdesignsystem')
+ || storybookUrl.includes('spark-sb-html')
) {
storybookInstance = 'html';
} else {
| 3 |
diff --git a/includes/Modules/Analytics/Advanced_Tracking/AMP_Config_Injector.php b/includes/Modules/Analytics/Advanced_Tracking/AMP_Config_Injector.php @@ -40,6 +40,8 @@ final class AMP_Config_Injector {
foreach ( $events as $event ) {
$event_config = $event->get_config();
+ $amp_trigger_key = md5( "{$event_config['action']}::{$event_config['on']}::{$event_config['selector']}" );
+
$amp_trigger = array();
if ( 'DOMContentLoaded' === $event_config['on'] ) {
$amp_trigger['on'] = 'visible';
@@ -56,7 +58,7 @@ final class AMP_Config_Injector {
}
}
- $gtag_amp_opt['triggers'][ $event_config['selector'] ] = $amp_trigger;
+ $gtag_amp_opt['triggers'][ $amp_trigger_key ] = $amp_trigger;
}
return $gtag_amp_opt;
| 4 |
diff --git a/src/metrics.js b/src/metrics.js @@ -54,17 +54,13 @@ function featureFulfilled(name) {
sendFeatureMetric(`atom_${name}_fulfilled`);
}
-function track(event, props = {}) {
+function track(event, properties = {}) {
const e = {
event,
userId: '0',
- user_id: distinctID(),
- sent_at: Math.floor(new Date().getTime() / 1000),
- source: 'vscode',
+ properties
};
- for (const k in props) { e[k] = props[k]; }
-
Logger.debug('segment:', e);
if (process.env.NODE_ENV !== 'test') { ANALYTICS.track(e); }
@@ -72,9 +68,12 @@ function track(event, props = {}) {
function trackHealth(value) {
track('kited_health', {
- value,
+ user_id: distinctID(),
+ sent_at: Math.floor(new Date().getTime() / 1000),
+ source: 'vscode',
os_name: getOsName(),
plugin_version: kitePkg.version,
+ value,
});
}
| 5 |
diff --git a/src/components/ChangeLogComponent/ChangeLogComponent.styles.js b/src/components/ChangeLogComponent/ChangeLogComponent.styles.js @@ -10,7 +10,9 @@ export const Markdown: ComponentType<*> =
className: `markdown ${className}`,
...props
}))`
+ @media only screen and (min-width: 800px) {
max-width: 85%;
+ }
`;
const calcColour = ({color}) => {
@@ -48,9 +50,6 @@ export const Container: ComponentType<*> =
@media only screen and (min-width: 800px) {
grid-template-columns: repeat(3, 1fr);
}
- // @media only screen and (min-width: 1100px) {
- // grid-template-columns: repeat(4, 1fr);
- // }
`;
@@ -76,7 +75,6 @@ export const MainContent: ComponentType<*> =
&.no-border {
border-top: unset;
margin-top: 1rem;
- // max-width: 50em;
}
`;
@@ -97,3 +95,20 @@ export const SideContent: ComponentType<*> =
}
`;
+
+export const MonthlyGroup: ComponentType<*> =
+ styled
+ .article`
+ margin-top: 30px;
+ border-top: 1px solid #e1e1e1;
+
+ &:first-of-type {
+ border-top: none;
+ }
+ `
+
+export const MonthlyHeader: ComponentType<*> =
+ styled
+ .header`
+ margin-top: 30px;
+ `;
| 7 |
diff --git a/layouts/partials/helpers/warning.html b/layouts/partials/helpers/warning.html {{- if eq .Site.Params.debug true }}
- <div class="row w-100 justify-content-center mx-0">
+ <div class="row w-100 justify-content-center mx-0 mt-3">
<div class="alert alert-danger text-center">
{{ .message }}
</div>
| 0 |
diff --git a/tests/node/tests/operations.mjs b/tests/node/tests/operations.mjs @@ -588,7 +588,7 @@ Password: 034148`;
const result = await chef.generatePGPKeyPair("Back To the Drawing Board", {
keyType: "ECC-256",
});
- assert.strictEqual(result.toString().length, 2560);
+ assert.strictEqual(result.toString().substr(0, 37), "-----BEGIN PGP PRIVATE KEY BLOCK-----");
}),
it("Generate UUID", () => {
| 7 |
diff --git a/token-metadata/0xDf801468a808a32656D2eD2D2d80B72A129739f4/metadata.json b/token-metadata/0xDf801468a808a32656D2eD2D2d80B72A129739f4/metadata.json "symbol": "CUBE",
"address": "0xDf801468a808a32656D2eD2D2d80B72A129739f4",
"decimals": 8,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/_data/conferences.yml b/_data/conferences.yml date: August 3-7, 2019
place: Anchorage, Alaska, USA
sub: DM
+
+ - title: 3DV
+ year: 2019
+ id: 3dv19
+ link: http://3dv19.gel.ulaval.ca/
+ deadline: '2019-06-10 23:59:59'
+ timezone: America/New_York
+ date: September 16-19, 2019
+ place: Quebec City, Canada
+ sub: CV
| 3 |
diff --git a/components/App.js b/components/App.js @@ -54,7 +54,7 @@ export const updateProps = (newProps) => {
appState[k] = newProps[k];
}
}
- if (appState.pointerLock || appState.isXR) {
+ if (appState.pointerLock || appState.isXR || !appState.selectedWeapon) {
appContainer.style.display = 'none';
appContainer.innerHTML = '';
setBindings(null, onclickBindings);
| 1 |
diff --git a/articles/_includes/_new_app.md b/articles/_includes/_new_app.md @@ -7,8 +7,8 @@ When you signed up for Auth0, a new application was created for you, or you coul
Your will need some details about that application to communicate with Auth0. You can get these details from the [Application Settings](${manage_url}/#/applications/${account.clientId}/settings) section in the Auth0 dashboard.
You need the following information:
-* **Client ID** : $(account.clientId)
-* **Domain** : $(account.domain)
+* **Client ID**
+* **Domain**
::: note
If you download the sample from the top of this page while being logged in, these details are filled out for you. If not, refer to the Github's repository's README.MD for instructions on how to properly configure it.
| 2 |
diff --git a/spark/components/alerts/vanilla/alerts.stories.js b/spark/components/alerts/vanilla/alerts.stories.js @@ -7,7 +7,7 @@ export default {
export const info = () => {
useEffect(() => {
alerts();
- }, []);
+ });
return `
<div
@@ -21,7 +21,7 @@ export const info = () => {
viewBox="0 0 64 64" aria-hidden="true" >
<use xlink:href="#bell"></use>
</svg>
- <p class="sprk-c-Alert__text"> This is important information.</p>
+ <p class="sprk-c-Alert__text"> This is an informational alert.</p>
</div>
<button class="sprk-c-Alert__icon sprk-c-Alert__icon--dismiss"
type="button"
@@ -34,7 +34,70 @@ export const info = () => {
`;
};
-export const success = () =>
- '<div class="sprk-c-Alert sprk-c-Alert--success" role="alert" data-sprk-alert="container" data-id="alert-success-1" data-analytics="object.action.event" ><div class="sprk-c-Alert__content"> <svg class="sprk-c-Alert__icon sprk-c-Icon sprk-c-Icon--l sprk-c-Icon--stroke-current-color" viewBox="0 0 512 512" aria-hidden="true" > <use xlink:href="#check-mark"></use> </svg><p class="sprk-c-Alert__text"> This is a success message.</p></div><button class="sprk-c-Alert__icon sprk-c-Alert__icon--dismiss" type="button" title="Dismiss" data-sprk-alert="dismiss" > <svg class="sprk-c-Icon sprk-c-Icon--stroke-current-color" viewBox="0 0 64 64" aria-hidden="true" > <use xlink:href="#close"></use> </svg> </button></div>';
-export const fail = () =>
- '<div class="sprk-c-Alert sprk-c-Alert--fail" role="alert" data-sprk-alert="container" data-id="alert-fail-1" data-analytics="object.action.event" ><div class="sprk-c-Alert__content"> <svg class="sprk-c-Alert__icon sprk-c-Icon sprk-c-Icon--l sprk-c-Icon--stroke-current-color" viewBox="0 0 576 512" aria-hidden="true" > <use xlink:href="#exclamation"></use> </svg><p class="sprk-c-Alert__text"> This is a failure message to alert that something was not successful.</p></div><button class="sprk-c-Alert__icon sprk-c-Alert__icon--dismiss" type="button" title="Dismiss" data-sprk-alert="dismiss" > <svg class="sprk-c-Icon sprk-c-Icon--stroke-current-color" viewBox="0 0 64 64" aria-hidden="true" > <use xlink:href="#close"></use> </svg> </button></div>';
+export const success = () => {
+ useEffect(() => {
+ alerts();
+ });
+
+ return `
+ <div
+ class="sprk-c-Alert sprk-c-Alert--success"
+ role="alert"
+ data-sprk-alert="container"
+ data-id="alert-success-1"
+ data-analytics="object.action.event"
+ >
+ <div class="sprk-c-Alert__content">
+ <svg class="sprk-c-Alert__icon sprk-c-Icon sprk-c-Icon--l sprk-c-Icon--stroke-current-color" viewBox="0 0 512 512" aria-hidden="true" >
+ <use xlink:href="#check-mark"></use>
+ </svg>
+ <p class="sprk-c-Alert__text">
+ This is a success alert.
+ </p>
+ </div>
+ <button
+ class="sprk-c-Alert__icon sprk-c-Alert__icon--dismiss"
+ type="button"
+ title="Dismiss"
+ data-sprk-alert="dismiss"
+ >
+ <svg class="sprk-c-Icon sprk-c-Icon--stroke-current-color" viewBox="0 0 64 64" aria-hidden="true" >
+ <use xlink:href="#close"></use>
+ </svg>
+ </button>
+ </div>
+ `
+}
+
+export const fail = () => {
+ useEffect(() => {
+ alerts();
+ });
+
+ return `
+ <div
+ class="sprk-c-Alert sprk-c-Alert--fail"
+ role="alert"
+ data-sprk-alert="container"
+ data-id="alert-fail-1"
+ data-analytics="object.action.event"
+ >
+ <div class="sprk-c-Alert__content">
+ <svg class="sprk-c-Alert__icon sprk-c-Icon sprk-c-Icon--l sprk-c-Icon--stroke-current-color" viewBox="0 0 576 512" aria-hidden="true" >
+ <use xlink:href="#exclamation"></use>
+ </svg>
+ <p class="sprk-c-Alert__text"> This is a failure alert.</p>
+ </div>
+ <button
+ class="sprk-c-Alert__icon sprk-c-Alert__icon--dismiss"
+ type="button"
+ title="Dismiss"
+ data-sprk-alert="dismiss"
+ >
+ <svg class="sprk-c-Icon sprk-c-Icon--stroke-current-color" viewBox="0 0 64 64" aria-hidden="true" >
+ <use xlink:href="#close"></use>
+ </svg>
+ </button>
+ </div>
+ `
+}
| 3 |
diff --git a/src/views/communityMembers/components/communityMembers.js b/src/views/communityMembers/components/communityMembers.js @@ -187,7 +187,7 @@ class CommunityMembers extends React.Component<Props, State> {
onClick={this.viewModerators}
active={filter && filter.isModerator ? true : false}
>
- Mods
+ Team
</Filter>
<Filter
onClick={this.viewBlocked}
| 10 |
diff --git a/best-practices.md b/best-practices.md @@ -312,9 +312,9 @@ actual role requirements.
| snow-ice | Best Practice | Points to a file that indicates whether a pixel is assessed as being snow/ice or not. |
| land-water | Best Practice | Points to a file that indicates whether a pixel is assessed as being land or water. |
| water-mask | Best Practice | Points to a file that indicates whether a pixel is assessed as being water (e.g. flooding map). |
-| reflectance, temperature, saturation, cloud, cloud-shadow | [EO Extension](extensions/eo/README.md#best-practices) | See the [table](extensions/eo/README.md#best-practices) in EO for more information. |
-| incidence-angle, azimuth, sun-azimuth, sun-elevation, terrain-shadow, terrain-occlusion, terrain-illumination | [View Extension](extensions/view/README.md#best-practices) | See the [table](extensions/view/README.md#best-practices) in View for more information. |
-| local-incidence-angle, noise-power, amplitude, magnitude, sigma0, beta0, gamma0, date-offset, covmat, prd | [SAR Extension](extensions/sar/README.md#best-practices) | See the [table](extensions/sar/README.md#best-practices) in SAR for more information. |
+| reflectance, temperature, saturation, cloud, cloud-shadow | [EO Extension](extensions/eo/README.md#best-practices) | See the [table](extensions/eo/README.md#best-practices) in EO for more information, and the definitive list of roles related to EO. |
+| incidence-angle, azimuth, sun-azimuth, sun-elevation, terrain-shadow, terrain-occlusion, terrain-illumination | [View Extension](extensions/view/README.md#best-practices) | See the [table](extensions/view/README.md#best-practices) in View for more information, and the definitive list of roles related to viewing angles. |
+| local-incidence-angle, noise-power, amplitude, magnitude, sigma0, beta0, gamma0, date-offset, covmat, prd | [SAR Extension](extensions/sar/README.md#best-practices) | See the [table](extensions/sar/README.md#best-practices) in SAR for more information. , and the definitive list of roles related to SAR. |
Some of the particular asset roles also have some best practices:
| 0 |
diff --git a/edit.js b/edit.js @@ -364,6 +364,15 @@ scene.add(floorMesh); */
geometryManager.geometryWorker.addGeometryPhysics(geometryManager.physics, mesh);
}
+ {
+ const mesh = await runtime.loadFile({
+ name: 'index.js',
+ url: 'https://avaer.github.io/mirror/index.js',
+ });
+ mesh.run();
+ scene.add(mesh);
+ }
+
{
const u = 'assets/parkour.glb';
const res = await fetch('./' + u);
| 0 |
diff --git a/components/SpainMap.jsx b/components/SpainMap.jsx @@ -53,18 +53,6 @@ const SpainMap = ({ data, reportFound }) => {
}
}
- const updatePosition = ({ left, top }, node) => {
- const html = document.querySelector('html')
- if (html.getAttribute('scheme')) {
- const d = document.documentElement
- left = Math.min(d.clientWidth - node.clientWidth, left)
- top = Math.min(d.clientHeight - node.clientHeight, top)
- left = Math.max(0, left * 0.5)
- top = Math.max(0, top * 0.25)
- }
- return { top, left }
- }
-
const tooltipText = ({
ccaa,
dosisAdministradas,
@@ -141,7 +129,7 @@ const SpainMap = ({ data, reportFound }) => {
))}
</g>
</svg>
- {hasMounted && <ReactTooltip id='toolitpMap' overridePosition={({ left, top }, _currentEvent, _currentTarget, node) => updatePosition({ left, top }, node)}>{content}</ReactTooltip>}
+ {hasMounted && <ReactTooltip id='toolitpMap'>{content}</ReactTooltip>}
</div>
</>
)
| 13 |
diff --git a/src/components/Form.js b/src/components/Form.js @@ -62,13 +62,12 @@ class Form extends React.Component {
this.touchedInputs = {};
this.getValues = this.getValues.bind(this);
- this.getErrorText = this.getErrorText.bind(this);
this.setTouchedInput = this.setTouchedInput.bind(this);
this.validate = this.validate.bind(this);
- this.onSubmit = this.onSubmit.bind(this);
+ this.submit = this.submit.bind(this);
}
- onSubmit() {
+ submit() {
// Return early if the form is already submitting to avoid duplicate submission
if (this.props.formState.isSubmitting) {
return;
@@ -92,23 +91,12 @@ class Form extends React.Component {
getValues() {
const values = {};
- _.each(_.keys(this.inputRefs), (key) => {
- values[key] = this.inputRefs[key].value;
+ _.each(_.keys(this.inputRefs), (inputID) => {
+ values[inputID] = this.inputRefs[inputID].value;
});
return values;
}
- getErrorText(inputID) {
- if (_.isEmpty(this.state.errors[inputID])) {
- return '';
- }
-
- const translatedErrors = _.map(this.state.errors[inputID], translationKey => (
- this.props.translate(translationKey)
- ));
- return _.join(translatedErrors, ' ');
- }
-
setTouchedInput(inputID) {
this.touchedInputs = {
...this.touchedInputs,
@@ -154,7 +142,7 @@ class Form extends React.Component {
return React.cloneElement(child, {
ref: node => this.inputRefs[inputID] = node,
defaultValue: this.props.draftValues[inputID] || child.props.defaultValue,
- errorText: this.getErrorText(inputID),
+ errorText: this.state.errors[inputID] || '',
onBlur: (key) => {
this.setTouchedInput(key);
this.validate(this.getValues());
@@ -188,7 +176,7 @@ class Form extends React.Component {
isAlertVisible={_.size(this.state.errors) > 0 || Boolean(this.props.formState.serverErrorMessage)}
isLoading={this.props.formState.isSubmitting}
message={this.props.formState.serverErrorMessage}
- onSubmit={this.onSubmit}
+ onSubmit={this.submit}
onFixTheErrorsLinkPressed={() => {
this.inputRefs[_.first(_.keys(this.state.errors))].focus();
}}
| 10 |
diff --git a/app/models/label/LabelValidationTable.scala b/app/models/label/LabelValidationTable.scala @@ -124,8 +124,7 @@ object LabelValidationTable {
_label <- labelsWithoutDeleted if _label.labelId === _validation.labelId
_mission <- MissionTable.auditMissions if _label.missionId === _mission.missionId
_user <- users if _user.username =!= "anonymous" && _user.userId === _mission.userId // User who placed the label
- _validationUser <- users if _validationUser.username =!= "anonymous" && _validationUser.userId === _validation.userId // User who did the validation
- _userRole <- userRoles if _validationUser.userId === _userRole.userId
+ _userRole <- userRoles if _user.userId === _userRole.userId
_role <- roleTable if _userRole.roleId === _role.roleId
} yield (_user.userId, _role.role, _validation.labelId, _validation.validationResult)
| 1 |
diff --git a/README.md b/README.md @@ -101,7 +101,7 @@ and go to [http://localhost:4200](http://localhost:4200).
Installing the library is as easy as:
```bash
-ember install [email protected]
+ember install ember-simple-auth
```
### Upgrading from a pre-3.0 release?
| 6 |
diff --git a/character-controller.js b/character-controller.js @@ -369,6 +369,74 @@ class Player extends THREE.Object3D {
setMicMediaStream(mediaStream, options) {
this.avatar.setMicrophoneMediaStream(mediaStream, options);
}
+ new() {
+ const self = this;
+ this.state.transact(function tx() {
+ const actions = self.getActionsState();
+ while (actions.length > 0) {
+ actions.delete(actions.length - 1);
+ }
+
+ const avatar = self.getAvatarState();
+ avatar.delete('instanceId');
+
+ const apps = self.getAppsState();
+ const appsJson = apps.toJSON();
+ while (apps.length > 0) {
+ apps.delete(apps.length - 1);
+ }
+ for (const instanceId of appsJson) {
+ const appMap = self.state.get(self.prefix + '.' + instanceId);
+ const appJson = appMap.toJSON();
+ for (const k in appJson) {
+ appMap.delete(k);
+ }
+ }
+ });
+ }
+ save() {
+ const actions = this.getActionsState();
+ const avatar = this.getAvatarState();
+ const apps = this.getAppsState();
+ return JSON.stringify({
+ // actions: actions.toJSON(),
+ avatar: avatar.toJSON(),
+ apps: Array.from(apps).map(instanceId => {
+ return this.state.getMap(this.prefix + '.' + instanceId).toJSON();
+ }),
+ });
+ }
+ load(s) {
+ const j = JSON.parse(s);
+ // console.log('load', j);
+ const self = this;
+ this.state.transact(function tx() {
+ const actions = self.getActionsState();
+ while (actions.length > 0) {
+ actions.delete(actions.length - 1);
+ }
+
+ const avatar = self.getAvatarState();
+ if (j?.avatar?.instanceId) {
+ avatar.set('instanceId', j.avatar.instanceId);
+ }
+
+ const apps = self.getAppsState();
+ if (Array.isArray(j?.apps)) {
+ for (const app of j.apps) {
+ const {
+ instanceId,
+ } = app;
+ const appMap = self.state.get(self.prefix + '.' + instanceId);
+ for (const k in app) {
+ const v = app[k];
+ appMap.set(k, v);
+ }
+ apps.push([instanceId]);
+ }
+ }
+ });
+ }
update(timestamp, timeDiff) {
if (this.avatar) {
const renderer = getRenderer();
| 0 |
diff --git a/packages/magda-web/src/Search.js b/packages/magda-web/src/Search.js @@ -68,6 +68,8 @@ class Search extends Component {
if(this.props.location.query.q && this.props.location.query.q.length > 0){
this.doSearch();
this.debouncedGetPublisherFacets();
+ this.getActiveOptions('publisher');
+ this.getActiveOptions('format');
}
}
@@ -82,7 +84,7 @@ class Search extends Component {
}, (err)=>{console.warn(err)});
}
- getActiveOptions(id, searchFreeText){
+ getActiveOptions(id){
let query = this.props.location.query[id];
let key = `active${id[0].toUpperCase() + id.slice(1)}Options`;
if(!defined(query) || query.length === 0){
@@ -95,7 +97,7 @@ class Search extends Component {
}
let tempList = [];
query.forEach(item=>{
- let url = this.getSearchQuery(id, item, searchFreeText);
+ let url = this.getSearchQuery(id, item);
// search locally first
if(defined(this.props.options) && this.props.options.length > 0){
let option = find(this.props.options, o=>o.value === item);
@@ -143,10 +145,11 @@ class Search extends Component {
}, (err)=>{console.warn(err)});
}
- getSearchQuery(facetId, _facetSearchWord, searchFreeText){
+ getSearchQuery(facetId, _facetSearchWord){
// bypass natual language process filtering by using freetext as general query
+ let keyword = encodeURI(this.props.location.query.q);
let facetSearchWord = encodeURI(_facetSearchWord);
- return `http://magda-search-api.terria.io/facets/${facetId}/options/search?generalQuery=${searchFreeText}&facetQuery=${facetSearchWord}`;
+ return `http://magda-search-api.terria.io/facets/${facetId}/options/search?generalQuery=${keyword}&facetQuery=${facetSearchWord}`;
}
doSearch(){
@@ -182,14 +185,8 @@ class Search extends Component {
filterTemporalOptions: data.facets[1].options,
filterFormatOptions: data.facets[2].options
});
-
- this.getActiveOptions('publisher', data.query.freeText);
- this.getActiveOptions('format', data.query.freeText);
-
// this.parseQuery(data.query);
}, (err)=>{console.warn(err)});
-
-
}
// parseQuery(query){
@@ -213,6 +210,8 @@ class Search extends Component {
pathname: this.props.location.pathname,
query: Object.assign(this.props.location.query, query)
});
+ this.getActiveOptions('publisher');
+ this.getActiveOptions('format');
// uncomment this when facet search is activated
this.debouncedSearch();
}
| 4 |
diff --git a/src/store.js b/src/store.js @@ -43,13 +43,12 @@ if (process.env.IS_BROWSER) {
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
enhancer = composeEnhancers(
applyMiddleware(...middleware),
- persistState(['app', 'favorites', 'editor', 'bookmarks', 'user'], {
+ persistState(['app', 'favorites', 'editor', 'bookmarks'], {
slicer: () => state => ({
- app: pick(state.app, ['locale', 'sidebarIsVisible', 'layout']),
- user: pick(state.user, ['following']),
+ app: pick(state.app, ['locale']),
bookmarks: state.bookmarks,
favorites: state.favorites,
- editor: state.editor,
+ editor: pick(state.editor, ['draftPosts']),
}),
}),
);
| 2 |
diff --git a/src/libs/Permissions.js b/src/libs/Permissions.js @@ -32,7 +32,7 @@ function canUseIOU(betas) {
* @returns {Boolean}
*/
function canUsePayWithExpensify(betas) {
- return _.contains(betas, CONST.BETAS.PAY_WITH_EXPENSIFY) || canUseAllBetas();
+ return _.contains(betas, CONST.BETAS.PAY_WITH_EXPENSIFY) || canUseAllBetas(betas);
}
/**
@@ -40,7 +40,7 @@ function canUsePayWithExpensify(betas) {
* @returns {Boolean}
*/
function canUseFreePlan(betas) {
- return _.contains(betas, CONST.BETAS.FREE_PLAN) || canUseAllBetas();
+ return _.contains(betas, CONST.BETAS.FREE_PLAN) || canUseAllBetas(betas);
}
/**
@@ -48,7 +48,7 @@ function canUseFreePlan(betas) {
* @returns {Boolean}
*/
function canUseDefaultRooms(betas) {
- return _.contains(betas, CONST.BETAS.DEFAULT_ROOMS) || canUseAllBetas();
+ return _.contains(betas, CONST.BETAS.DEFAULT_ROOMS) || canUseAllBetas(betas);
}
export default {
| 11 |
diff --git a/src/encoded/schemas/file.json b/src/encoded/schemas/file.json "raw signal",
"read-depth normalized signal",
"reads",
+ "redacted alignments",
+ "redacted unfiltered alignments",
"reference variants",
"relative replication signal",
"replicated peaks",
"alignments": "alignment",
"unfiltered alignments": "alignment",
+ "redacted alignments": "alignment",
+ "redacted unfiltered alignments": "alignment",
"transcriptome alignments": "alignment",
"spike-in alignments": "alignment",
"maternal haplotype mapping": "alignment",
| 0 |
diff --git a/runtime.js b/runtime.js @@ -308,6 +308,17 @@ const _loadVrm = async (file, {files = null, parentUrl = null, instanceId = null
o.frustumCulled = false;
}
});
+ o.run = () => {
+ // elide expensive bone updates; this should not be called if wearing the avatar
+ o.traverse(o => {
+ if (o.skeleton) {
+ o.skeleton.update = (update => function() {
+ update.apply(this, arguments);
+ o.skeleton.update = () => {};
+ })(o.skeleton.update);
+ }
+ });
+ };
o.geometry = {
boundingBox: new THREE.Box3().setFromObject(o),
};
| 0 |
diff --git a/src/components/webView/iframe.web.js b/src/components/webView/iframe.web.js @@ -23,6 +23,7 @@ export const createIframe = (src, title, backToWallet = false, backToRoute = 'Ho
//this is for our external pages like privacy policy, etc.. they dont require iframeresizer to work ok on ios <13
return (
<iframe
+ allowFullScreen
title={title}
seamless
frameBorder="0"
| 0 |
diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js @@ -978,7 +978,9 @@ var Utils = {
};
var Utils = this;
- var html = "";
+ var html = "<div style='padding: 5px;'>" +
+ files.length +
+ " file(s) found</div>\n";
files.forEach(function(file, i) {
if (typeof file.contents !== "undefined") {
html += formatFile(file, i);
| 0 |
diff --git a/lib/core/config.js b/lib/core/config.js @@ -359,8 +359,6 @@ Config.prototype.loadEmbarkConfigFile = function() {
this.buildDir = this.embarkConfig.buildDir;
this.configDir = this.embarkConfig.config;
-
-
};
Config.prototype.loadPipelineConfigFile = function() {
| 2 |
diff --git a/src/core/evaluator.js b/src/core/evaluator.js @@ -44,6 +44,7 @@ import {
isStream,
Name,
Ref,
+ RefSet,
} from "./primitives.js";
import {
ErrorFont,
@@ -237,9 +238,9 @@ class PartialEvaluator {
return false;
}
- var processed = Object.create(null);
+ const processed = new RefSet();
if (resources.objId) {
- processed[resources.objId] = true;
+ processed.put(resources.objId);
}
var nodes = [resources],
@@ -252,7 +253,7 @@ class PartialEvaluator {
for (const key of graphicStates.getKeys()) {
let graphicState = graphicStates.getRaw(key);
if (graphicState instanceof Ref) {
- if (processed[graphicState.toString()]) {
+ if (processed.has(graphicState)) {
continue; // The ExtGState has already been processed.
}
try {
@@ -262,7 +263,7 @@ class PartialEvaluator {
throw ex;
}
// Avoid parsing a corrupt ExtGState more than once.
- processed[graphicState.toString()] = true;
+ processed.put(graphicState);
info(`hasBlendModes - ignoring ExtGState: "${ex}".`);
continue;
@@ -272,7 +273,7 @@ class PartialEvaluator {
continue;
}
if (graphicState.objId) {
- processed[graphicState.objId] = true;
+ processed.put(graphicState.objId);
}
const bm = graphicState.get("BM");
@@ -299,7 +300,7 @@ class PartialEvaluator {
for (const key of xObjects.getKeys()) {
var xObject = xObjects.getRaw(key);
if (xObject instanceof Ref) {
- if (processed[xObject.toString()]) {
+ if (processed.has(xObject)) {
// The XObject has already been processed, and by avoiding a
// redundant `xref.fetch` we can *significantly* reduce the load
// time for badly generated PDF files (fixes issue6961.pdf).
@@ -312,7 +313,7 @@ class PartialEvaluator {
throw ex;
}
// Avoid parsing a corrupt XObject more than once.
- processed[xObject.toString()] = true;
+ processed.put(xObject);
info(`hasBlendModes - ignoring XObject: "${ex}".`);
continue;
@@ -322,20 +323,20 @@ class PartialEvaluator {
continue;
}
if (xObject.dict.objId) {
- processed[xObject.dict.objId] = true;
+ processed.put(xObject.dict.objId);
}
var xResources = xObject.dict.get("Resources");
if (!(xResources instanceof Dict)) {
continue;
}
// Checking objId to detect an infinite loop.
- if (xResources.objId && processed[xResources.objId]) {
+ if (xResources.objId && processed.has(xResources.objId)) {
continue;
}
nodes.push(xResources);
if (xResources.objId) {
- processed[xResources.objId] = true;
+ processed.put(xResources.objId);
}
}
}
| 4 |
diff --git a/articles/tutorials/adding-scopes-for-an-external-idp.md b/articles/tutorials/adding-scopes-for-an-external-idp.md @@ -19,7 +19,7 @@ For example, if you click the Google connection, you can select the required sco
## 2. Pass Scopes to Authorize endpoint
-You can also pass the scopes you wish to request as a comma-separated list in the `connection_scope` parameter when calling the `/authorize` endpoint. For example, if you want to request the `https://www.googleapis.com/auth/contacts.readonly` and `https://www.googleapis.com/auth/analytics` scopes from Google, you can pass these along with the `connection` parameter to ensure the user logs in with their Google account:
+You can also pass the scopes you wish to request as a comma-separated list in the `connection_scope` parameter when calling the ['/authorize` endpoint](/api/authentication#login). For example, if you want to request the `https://www.googleapis.com/auth/contacts.readonly` and `https://www.googleapis.com/auth/analytics` scopes from Google, you can pass these along with the `connection` parameter to ensure the user logs in with their Google account:
```text
https://${account.namespace}/authorize
| 0 |
diff --git a/app/stylesheets/builtin-pages/library.less b/app/stylesheets/builtin-pages/library.less background: #fafafa;
border-bottom: 1px solid #ddd;
+ .container {
+ position: relative;
+ }
+
+ .mode-toggle {
+ position: absolute;
+ right: 0;
+ bottom: 15px;
+
+ .mode {
+ font-size: .7rem;
+ line-height: 18px;
+ letter-spacing: .4px;
+ text-transform: uppercase;
+ color: @color-text--muted;
+
+ &:focus {
+ outline: 0;
+ box-shadow: none;
+ }
+
+ &.active {
+ &:extend(.btn.primary);
+ }
+ }
+ }
+
.info-container {
&:extend(.flex);
padding: 20px 0;
color: @color-text;
font-weight: 500;
}
+
+ .revisions-indicator {
+ display: inline-block;
+ background: @blue;
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ margin-left: 2px;
+ vertical-align: top;
+ margin-top: 6.5px;
+ }
}
}
}
\ No newline at end of file
| 12 |
diff --git a/src/__experimental__/components/checkbox/checkbox.style.js b/src/__experimental__/components/checkbox/checkbox.style.js @@ -9,7 +9,7 @@ import LabelStyle from '../label/label.style';
import checkBoxClassicStyle from './checkbox-classic.style';
import ValidationIconStyle from '../../../components/validations/validation-icon.style';
-const svgBorderColor = ({
+const validationBorderColor = ({
theme,
hasError,
hasWarning,
@@ -42,7 +42,7 @@ const CheckboxStyle = styled.div`
svg {
background-color: ${theme.colors.white};
- border: ${svgBorderColor};
+ border: ${validationBorderColor};
}
${HiddenCheckableInputStyle},
@@ -70,6 +70,18 @@ const CheckboxStyle = styled.div`
${LabelStyle} {
padding: 0 6px;
width: auto;
+
+ ${({ hasError }) => hasError && !disabled && css`
+ color: ${theme.colors.error};
+ `}
+
+ ${({ hasWarning }) => hasWarning && !disabled && css`
+ color: ${theme.colors.warning};
+ `}
+
+ ${({ hasInfo }) => hasInfo && !disabled && css`
+ color: ${theme.colors.info};
+ `}
}
${FieldHelpStyle} {
@@ -182,29 +194,10 @@ CheckboxStyle.propTypes = {
size: PropTypes.string
};
-const groupSvgBorder = ({
- theme,
- hasError,
- hasWarning,
- hasInfo
-}) => {
- let color = theme.colors.border;
-
- if (hasError) {
- color = theme.colors.error;
- } else if (hasWarning) {
- color = theme.colors.warning;
- } else if (hasInfo) {
- color = theme.colors.info;
- }
-
- return `1px solid ${color}`;
-};
-
const StyledCheckboxGroup = styled.div`
& ${StyledCheckableInputSvgWrapper} {
svg {
- border: ${groupSvgBorder};
+ border: ${validationBorderColor};
}
}
| 12 |
diff --git a/closure/goog/html/safeurl.js b/closure/goog/html/safeurl.js @@ -377,13 +377,19 @@ goog.html.SafeUrl.fromSmsUrl = function(smsUrl) {
/**
* Validates SMS URL `body` parameter, which is optional and should appear at
- * most once and should be percentage-encoded if present.
+ * most once and should be percent-encoded if present. Rejects many malformed
+ * bodies, but may spuriously reject some URLs and does not reject all malformed
+ * sms: URLs.
*
* @param {string} smsUrl A sms URL.
* @return {boolean} Whether SMS URL has a valid `body` parameter if it exists.
* @private
*/
goog.html.SafeUrl.isSmsUrlBodyValid_ = function(smsUrl) {
+ var hash = smsUrl.indexOf('#');
+ if (hash > 0) {
+ smsUrl = smsUrl.substring(0, hash);
+ }
var bodyParams = smsUrl.match(/[?&]body=/gi);
// "body" param is optional
if (!bodyParams) {
@@ -394,16 +400,16 @@ goog.html.SafeUrl.isSmsUrlBodyValid_ = function(smsUrl) {
return false;
}
// Get the encoded `body` parameter value.
- var bodyValue = smsUrl.match(/[?&]body=([^&]+)/)[1];
+ var bodyValue = smsUrl.match(/[?&]body=([^&]*)/)[1];
if (!bodyValue) {
return true;
}
try {
- return goog.string.urlEncode(bodyValue) === bodyValue ||
- goog.string.urlDecode(bodyValue) !== bodyValue;
+ decodeURIComponent(bodyValue);
} catch (error) {
return false;
}
+ return /^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(bodyValue);
};
| 1 |
diff --git a/package.json b/package.json "dependencies": {
"debug": "^4.1.1",
"zigbee-herdsman": "0.12.83",
- "zigbee-herdsman-converters": "12.0.76",
+ "zigbee-herdsman-converters": "12.0.77",
"@iobroker/adapter-core": "^1.0.3"
},
"description": "Zigbee devices",
| 3 |
diff --git a/packages/app/src/components/Navbar/GrowiSubNavigationSwitcher.jsx b/packages/app/src/components/Navbar/GrowiSubNavigationSwitcher.jsx -import React, { useState, useEffect, useCallback } from 'react';
-// import PropTypes from 'prop-types';
+import React, {
+ useMemo, useState, useRef, useEffect, useCallback,
+} from 'react';
import StickyEvents from 'sticky-events';
import { debounce } from 'throttle-debounce';
+
import loggerFactory from '~/utils/logger';
+import { useSidebarCollapsed } from '~/stores/ui';
import GrowiSubNavigation from './GrowiSubNavigation';
@@ -21,19 +24,25 @@ const logger = loggerFactory('growi:cli:GrowiSubNavigationSticky');
*/
const GrowiSubNavigationSwitcher = (props) => {
+ const { data: isSidebarCollapsed } = useSidebarCollapsed();
+
const [isVisible, setVisible] = useState(false);
+ const [width, setWidth] = useState(null);
+
+ const fixedContainerRef = useRef();
+ const stickyEvents = useMemo(() => new StickyEvents({ stickySelector: '#grw-subnav-sticky-trigger' }), []);
const resetWidth = useCallback(() => {
- const elem = document.getElementById('grw-subnav-fixed-container');
+ const instance = fixedContainerRef.current;
- if (elem == null || elem.parentNode == null) {
+ if (instance == null || instance.parentNode == null) {
return;
}
// get parent width
- const { clientWidth: width } = elem.parentNode;
+ const { clientWidth } = instance.parentNode;
// update style
- elem.style.width = `${width}px`;
+ setWidth(clientWidth);
}, []);
// setup effect by resizing event
@@ -57,7 +66,6 @@ const GrowiSubNavigationSwitcher = (props) => {
useEffect(() => {
// sticky
// See: https://github.com/ryanwalters/sticky-events
- const stickyEvents = new StickyEvents({ stickySelector: '#grw-subnav-sticky-trigger' });
const { stickySelector } = stickyEvents;
const elem = document.querySelector(stickySelector);
elem.addEventListener(StickyEvents.CHANGE, stickyChangeHandler);
@@ -66,16 +74,28 @@ const GrowiSubNavigationSwitcher = (props) => {
return () => {
elem.removeEventListener(StickyEvents.CHANGE, stickyChangeHandler);
};
- }, [stickyChangeHandler]);
+ }, [stickyChangeHandler, stickyEvents]);
+
+ // update width when sidebar collapsing changed
+ useEffect(() => {
+ if (isSidebarCollapsed != null) {
+ setTimeout(resetWidth, 300);
+ }
+ }, [isSidebarCollapsed, resetWidth]);
- // update width
+ // initialize
useEffect(() => {
resetWidth();
+ setTimeout(() => {
+ stickyEvents.state.values((sticky) => {
+ setVisible(sticky.isSticky);
});
+ }, 100);
+ }, [resetWidth, stickyEvents]);
return (
<div className={`grw-subnav-switcher ${isVisible ? '' : 'grw-subnav-switcher-hidden'}`}>
- <div id="grw-subnav-fixed-container" className="grw-subnav-fixed-container position-fixed">
+ <div id="grw-subnav-fixed-container" className="grw-subnav-fixed-container position-fixed" ref={fixedContainerRef} style={{ width }}>
<GrowiSubNavigation isCompactMode />
</div>
</div>
| 7 |
diff --git a/packages/style/ve-table.less b/packages/style/ve-table.less padding: 10px;
// hack content fill td height
//height: 1px;
- height: inherit;
+ //height: inherit;
+ display: table-cell;
+ height: 100%;
}
}
| 1 |
diff --git a/package.json b/package.json "Dustin Belliston (https://github.com/dwbelliston)",
"kobanyan (https://github.com/kobanyan)"
],
+ "engines": {
+ "node": ">=8.12.0"
+ },
"dependencies": {
"@hapi/boom": "^7.4.2",
"@hapi/cryptiles": "^4.2.0",
| 0 |
diff --git a/src/components/FindWallet/WalletTable.tsx b/src/components/FindWallet/WalletTable.tsx @@ -341,6 +341,7 @@ const FeatureLabel = styled.div<{ hasFeature: boolean }>`
width: 200px;
p {
margin-bottom: 0;
+ flex:none;
color: ${(props) => props.hasFeature ? props.theme.colors.text : props.theme.colors.secondary};
text-decoration: ${(props) => props.hasFeature ? "none" : "line-through"};
}
| 5 |
diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js @@ -49,24 +49,19 @@ let allPolicies = [];
Onyx.connect({
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
- callback: (policies) => {
- allPolicies = policies;
- },
+ callback: policies => allPolicies = policies,
});
/**
- * When we reconnect the app, we don't want to fetch workspaces created optimistically while offline since they don't exist yet in the back-end.
- * If we fetched them then they'd return as empty objects which would clear out the optimistic policy values initially created locally.
- * Once the re-queued call to CreateWorkspace returns, the full contents of the workspace excluded here should be correctly saved into Onyx.
- *
* @param {Array} policies
* @return {Array<String>} array of policy ids
*/
-function getPolicyIDListExcludingWorkspacesCreatedOffline(policies) {
- const policiesExcludingWorkspacesCreatedOffline = _.reject(policies,
- policy => lodashGet(policy, 'pendingAction', null) === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD
- && lodashGet(policy, 'type', null) === CONST.POLICY.TYPE.FREE);
- return _.compact(_.pluck(policiesExcludingWorkspacesCreatedOffline, 'id'));
+function getNonOptimisticPolicyIDs(policies) {
+ return _.chain(policies)
+ .reject(policy => lodashGet(policy, 'pendingAction', null) === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD)
+ .pluck('id')
+ .compact()
+ .value();
}
/**
@@ -122,7 +117,7 @@ function openApp() {
waitForCollectionCallback: true,
callback: (policies) => {
Onyx.disconnect(connectionID);
- API.read('OpenApp', {policyIDList: getPolicyIDListExcludingWorkspacesCreatedOffline(policies)}, {
+ API.read('OpenApp', {policyIDList: getNonOptimisticPolicyIDs(policies)}, {
optimisticData: [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
@@ -153,7 +148,7 @@ function openApp() {
* Refreshes data when the app reconnects
*/
function reconnectApp() {
- API.write('ReconnectApp', {policyIDList: getPolicyIDListExcludingWorkspacesCreatedOffline(allPolicies)}, {
+ API.write('ReconnectApp', {policyIDList: getNonOptimisticPolicyIDs(allPolicies)}, {
optimisticData: [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.IS_LOADING_REPORT_DATA,
| 10 |
diff --git a/protocols/index/contracts/Index.sol b/protocols/index/contracts/Index.sol @@ -99,11 +99,10 @@ contract Index is Ownable {
/**
* @notice Unset a Locator
* @param _identifier address
- * @return bool return true on success
*/
function unsetLocator(
address _identifier
- ) external onlyOwner returns (bool) {
+ ) external onlyOwner {
// Ensure the entry exists.
require(hasEntry(_identifier), "ENTRY_DOES_NOT_EXIST");
@@ -136,8 +135,8 @@ contract Index is Ownable {
/**
* @notice Get a Range of Locators
* @dev _start value of 0x0 starts at the head
- * @param _start address The identifier to start
- * @param _count uint256 The number to return
+ * @param _start address Identifier to start with
+ * @param _count uint256 Number of locators to return
* @return result bytes32[]
*/
function getLocators(
@@ -174,10 +173,7 @@ contract Index is Ownable {
function hasEntry(
address _identifier
) internal view returns (bool) {
- if (_entries[_identifier].locator != bytes32(0)) {
- return true;
- }
- return false;
+ return _entries[_identifier].locator != bytes32(0);
}
/**
| 1 |
diff --git a/catalog-spec/json-schema/catalog.json b/catalog-spec/json-schema/catalog.json "type": "array",
"uniqueItems": true,
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "title": "Reference to a JSON Schema",
+ "type": "string",
+ "format": "uri"
+ },
+ {
+ "title": "Reference to a core extension",
+ "type": "string",
+ "enum": [
+ "checksum",
+ "single-file-stac",
+ "tiled-assets"
+ ]
+ }
+ ]
}
},
"id": {
| 3 |
diff --git a/www/pluginInit.js b/www/pluginInit.js @@ -63,16 +63,23 @@ function pluginInit() {
var viewportTagContent = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no';
- // Detect if iOS device
- if (/(iPhone|iPod|iPad)/i.test(window.navigator.userAgent)) {
- // Get iOS major version
- var iosVersion = parseInt((window.navigator.userAgent).match(/OS (\d+)_(\d+)_?(\d+)? like Mac OS X/i)[1]);
- // Detect if device is running >iOS 11
- // iOS 11's UIWebView and WKWebView changes the viewport behaviour to render viewport without the status bar. Need to override with "viewport-fit: cover" to include the status bar.
- if (iosVersion >= 11) {
+ //
+ // Detect support for CSS env() variable
+ //
+ var envTestDiv = '<div id="envTest" style="margin-top:-99px;margin-top:env(safe-area-inset-top);position:absolute;z-index:-1;"></div>';
+
+ document.body.insertAdjacentHTML('afterbegin', envTestDiv);
+
+ var testElement = document.getElementById('envTest');
+ var computedStyles = window.getComputedStyle(testElement);
+ var testResult = computedStyles.getPropertyValue('margin-top');
+
+ document.body.removeChild(testElement);
+
+ // if browser supports env(), returns a pixel value as string, even if 0px
+ if (testResult != '-99px') {
viewportTagContent += ', viewport-fit=cover';
}
- }
// Update viewport tag attribute
viewportTag.setAttribute('content', viewportTagContent);
| 14 |
diff --git a/includes/Modules/Analytics.php b/includes/Modules/Analytics.php @@ -1276,7 +1276,7 @@ final class Analytics extends Module
if ( $this->context->is_amp() ) {
?>
- <meta id="__gaOptOutExtension">
+ <script type="text/plain" id="__gaOptOutExtension"></script>
<?php
return;
}
| 14 |
diff --git a/assets/svg/device-size-desktop-icon.svg b/assets/svg/device-size-desktop-icon.svg -<svg name="google-sitekit-device-size-desktop" width="23" height="17" viewBox="0 0 23 17" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path fillRule="evenodd" clipRule="evenodd" d="M19.2369 14C20.3369 14 21.2269 13.1 21.2269 12L21.2369 2C21.2369 0.9 20.3369 0 19.2369 0H3.23694C2.13694 0 1.23694 0.9 1.23694 2V12C1.23694 13.1 2.13694 14 3.23694 14H19.2369ZM3.23694 2H19.2369V12H3.23694V2ZM0.236938 15H22.2369V17H0.236938V15Z" />
+<svg name="google-sitekit-device-size-desktop" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/>
+ <path d="M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6z"/>
</svg>
| 14 |
diff --git a/data.js b/data.js @@ -515,6 +515,14 @@ module.exports = [
url: "https://github.com/evandrolg/Feed",
source: "https://raw.githubusercontent.com/EvandroLG/Feed/master/src/feed.js"
},
+ {
+ name: "Stoor",
+ github: "tiaanduplessis/stoor",
+ tags: ["storage", "local-storage", "session-storage"],
+ description: "Local and Session storage wrapper with support for namespacing and multi get, set and remove",
+ url: "https://github.com/tiaanduplessis/stoor",
+ source: "https://raw.githubusercontent.com/tiaanduplessis/stoor/master/dist/stoor.js"
+ },
{
name: "Dom.js",
tags: ["dom", "dom manipulation", "dom traversal", "dom events", "crossbrowser", "event", "traversal"," manipulation"],
| 0 |
diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php @@ -105,7 +105,7 @@ App::get('/v1/database/collections/:collectionId')
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
@@ -214,7 +214,7 @@ App::delete('/v1/database/collections/:collectionId')
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
@@ -271,7 +271,7 @@ App::post('/v1/database/collections/:collectionId/attributes')
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
@@ -321,7 +321,7 @@ App::get('v1/database/collections/:collectionId/attributes')
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
@@ -401,7 +401,7 @@ App::delete('/v1/database/collections/:collectionId/attributes/:attributeId')
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
@@ -468,7 +468,7 @@ App::post('/v1/database/collections/:collectionId/indexes')
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
@@ -516,7 +516,7 @@ App::get('v1/database/collections/:collectionId/indexes')
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
@@ -546,11 +546,11 @@ App::get('v1/database/collections/:collectionId/indexes/:indexId')
->inject('projectDB')
->action(function ($collectionId, $indexId, $response, $dbForExternal) {
/** @var Appwrite\Utopia\Response $response */
- /** @var Appwrite\Database\Database $projectDB */
+ /** @var Utopia\Database\Database $dbForExternal */
$collection = $dbForExternal->getCollection($collectionId);
- if (empty($collection)) {
+ if ($collection->isEmpty()) {
throw new Exception('Collection not found', 404);
}
| 4 |
diff --git a/js/repeater.js b/js/repeater.js this.currentPage = (page !== undefined) ? page : NaN;
+ if (this.infiniteScrollingCont) {
if (data.end === true || (this.currentPage + 1) >= pages) {
this.infiniteScrollingCont.infinitescroll('end', end);
} else {
this.infiniteScrollingCont.infinitescroll('onScroll');
}
+ }
},
initInfiniteScrolling: function initInfiniteScrolling () {
| 1 |
diff --git a/edit.js b/edit.js @@ -4077,15 +4077,6 @@ const _makeTargetMesh = p => {
mesh.frustumCulled = false;
return mesh;
};
-const _makeVolumeMesh = async p => {
- const volumeMesh = await p.getVolumeMesh();
- if (volumeMesh) {
- volumeMesh.frustumCulled = false;
- return volumeMesh;
- } else {
- return new THREE.Object3D();
- }
-};
const lineMeshes = [
makeLineMesh(),
| 2 |
diff --git a/articles/libraries/auth0js/v8/index.md b/articles/libraries/auth0js/v8/index.md @@ -85,7 +85,7 @@ You can choose a method for login based on the type of auth you need in your app
### webAuth.authorize()
-The [`authorize` method](/api/authentication?javascript#login) can be used for logging in users via the [Hosted Login Page](/libraries/auth0js#hosted-login-page), or via social connections, as exhibited in the examples below. This method can take a variety of parameters via the `options` object.
+The `authorize()` method can be used for logging in users via the [Hosted Login Page](/libraries/auth0js#hosted-login-page), or via social connections, as exhibited in the examples below. This method can take a variety of parameters via the `options` object.
| **Parameter** | **Required** | **Description** |
| --- | --- | --- |
| 2 |
diff --git a/docs/json-output.md b/docs/json-output.md @@ -126,6 +126,7 @@ The text element type is of multiple levels of subtypes:
"id": 1028,
"box": {/* ... */},
"type": "word",
+ "font": 4,
"content": [/* ... */], // strictly Character or string type elements
"properties": [/* ... */],
"metadata": [/* ... */],
| 0 |
diff --git a/token-metadata/0x2467AA6B5A2351416fD4C3DeF8462d841feeecEC/metadata.json b/token-metadata/0x2467AA6B5A2351416fD4C3DeF8462d841feeecEC/metadata.json "symbol": "QBX",
"address": "0x2467AA6B5A2351416fD4C3DeF8462d841feeecEC",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/server/render/src/handleShowRender.jsx b/server/render/src/handleShowRender.jsx @@ -57,16 +57,15 @@ module.exports = (req, res) => {
// Workaround, remove when a solution for async httpContext exists
const showState = store.getState().show;
const assetKeys = Object.keys(showState.assetList);
+ const channelKeys = Object.keys(showState.channelList);
if (assetKeys.length !== 0) {
res.claimId = showState.assetList[assetKeys[0]].claimId;
- } else {
- const channelKeys = Object.keys(showState.channelList);
-
- if(channelKeys.length !== 0) {
+ } else if (channelKeys.length !== 0) {
res.claimId = showState.channelList[channelKeys[0]].longId;
res.isChannel = true;
- }
+ } else {
+ res.status(404);
}
// render component to a string
| 12 |
diff --git a/generators/server/templates/src/main/java/package/web/rest/_AccountResource.java b/generators/server/templates/src/main/java/package/web/rest/_AccountResource.java @@ -233,7 +233,7 @@ public class AccountResource {
persistentTokenRepository.findByUser(u).stream()
.filter(persistentToken -> StringUtils.equals(persistentToken.getSeries(), decodedSeries))<% if (databaseType == 'sql' || databaseType == 'mongodb') { %>
.findAny().ifPresent(t -> persistentTokenRepository.delete(decodedSeries)));<% } else { %>
- .findAny().ifPresent(persistentToken -> persistentTokenRepository.delete(persistentToken)));<% } %>
+ .findAny().ifPresent(persistentTokenRepository::delete));<% } %>
}<% } %>
/**
| 14 |
diff --git a/src/js/core/Utils.js b/src/js/core/Utils.js @@ -96,6 +96,8 @@ var Utils = {
/**
* Adds trailing bytes to a byteArray.
*
+ * @author tlwr [[email protected]]
+ *
* @param {byteArray} arr - byteArray to add trailing bytes to.
* @param {number} numBytes - Maximum width of the array.
* @param {Integer} [padByte=0] - The byte to pad with.
@@ -959,6 +961,9 @@ var Utils = {
/**
* Formats a list of files or directories.
+ * A File is an object with a "fileName" and optionally a "contents".
+ * If the fileName ends with "/" and the contents is of length 0 then
+ * it is considered a directory.
*
* @author tlwr [[email protected]]
*
| 0 |
diff --git a/Web3Core.podspec b/Web3Core.podspec @@ -3,7 +3,6 @@ Pod::Spec.new do |spec|
spec.name = 'Web3Core'
spec.version = '3.0.6'
- spec.module_name = 'Core'
spec.ios.deployment_target = "13.0"
spec.osx.deployment_target = "10.15"
spec.license = { :type => 'Apache License 2.0', :file => 'LICENSE.md' }
| 2 |
diff --git a/src/Disp.js b/src/Disp.js @@ -1580,7 +1580,7 @@ CM.Disp.Tooltip = function(type, name) {
if (CM.Config.TooltipNextMultiple == 1) {
var marker = addedAmor ? ')' : 'so far';
var multiple_quantity = CM.Cache.Objects[name].multiple_quantity;
- l('tooltip').innerHTML = l('tooltip').innerHTML.split(marker + '</div>').join(marker + '<br/>• <b>' + multiple_quantity + '</b> left to reach <b>' + (Game.Objects[name].amount + multiple_quantity) + '</b>, <b>' + Beautify(CM.Cache.Objects[name].multiple_price, 2) + '</b> in total</div>');
+ l('tooltip').innerHTML = l('tooltip').innerHTML.split(marker + '</div>').join(marker + '<br/>• <b>' + multiple_quantity + '</b> ' + (multiple_quantity == 1 ? Game.Objects[name].single : Game.Objects[name].plural) + ' left to reach <b>' + (Game.Objects[name].amount + multiple_quantity) + '</b>, <b>' + Beautify(CM.Cache.Objects[name].multiple_price, 2) + '</b> cookies in total (' + CM.Disp.GetTimeColor(CM.Cache.Objects[name].multiple_price, (Game.cookies + CM.Disp.GetWrinkConfigBank()), CM.Disp.GetCPS()).text + ')</div>');
}
if (Game.buyMode == 1) {
| 0 |
diff --git a/buildroot-external/overlay/base/etc/init.d/S60openvpn b/buildroot-external/overlay/base/etc/init.d/S60openvpn @@ -29,7 +29,7 @@ start)
if test -z "$2"; then
for CONFIG in $(cd "$CONFIG_DIR" || return; ls ./*.conf 2>/dev/null); do
- NAME=${CONFIG%%.conf}
+ NAME=$(basename "${CONFIG%%.conf}")
start_vpn
done
else
| 1 |
diff --git a/includes/Plugin.php b/includes/Plugin.php @@ -110,7 +110,6 @@ final class Plugin {
$modules = new Core\Modules\Modules( $this->context, $options, $user_options, $authentication );
$modules->register();
- ( new Core\Authentication\Google_Proxy( $this->context ) )->register();
( new Core\Permissions\Permissions( $this->context, $authentication ) )->register();
( new Core\Util\Tracking( $this->context, $authentication ) )->register();
( new Core\REST_API\REST_Routes( $this->context, $authentication, $modules ) )->register();
| 2 |
diff --git a/src/compiler/ast/ArrayContainer.js b/src/compiler/ast/ArrayContainer.js @@ -28,9 +28,17 @@ class ArrayContainer extends Container {
for (var i=0; i<len; i++) {
var curChild = array[i];
if (curChild === oldChild) {
- array[i] = newChild;
oldChild.detach();
+ if (Array.isArray(newChild)) {
+ let newChildren = newChild;
+ array.splice.apply(array, [i, 1].concat(newChildren));
+ newChildren.forEach((newChild) => {
newChild.container = this;
+ });
+ } else {
+ array[i] = newChild;
+ newChild.container = this;
+ }
return true;
}
}
| 11 |
diff --git a/lib/NormalModule.js b/lib/NormalModule.js @@ -168,6 +168,16 @@ class NormalModule extends Module {
super.disconnect();
}
+ markModuleAsErrored() {
+ this.meta = null;
+ if(this.error) {
+ this.errors.push(this.error);
+ this._source = new RawSource("throw new Error(" + JSON.stringify(this.error.message) + ");");
+ } else {
+ this._source = new RawSource("throw new Error('Module build failed');");
+ }
+ }
+
build(options, compilation, resolver, fs, callback) {
this.buildTimestamp = new Date().getTime();
this.built = true;
@@ -177,23 +187,17 @@ class NormalModule extends Module {
this.warnings.length = 0;
this.meta = {};
- const setError = (err) => {
- this.meta = null;
- if(this.error) {
- this.errors.push(this.error);
- this._source = new RawSource("throw new Error(" + JSON.stringify(this.error.message) + ");");
- } else {
- this._source = new RawSource("throw new Error('Module build failed');");
- }
- callback();
- };
+
return this.doBuild(options, compilation, resolver, fs, (err) => {
this.dependencies.length = 0;
this.variables.length = 0;
this.blocks.length = 0;
this._cachedSource = null;
- if(err) return setError(err);
+ if(err) {
+ this.markModuleAsErrored();
+ return callback();
+ }
if(options.module && options.module.noParse) {
const testRegExp = function testRegExp(regExp) {
return typeof regExp === "string" ?
@@ -216,7 +220,9 @@ class NormalModule extends Module {
});
} catch(e) {
const source = this._source.source();
- return setError(this.error = new ModuleParseError(this, source, e));
+ this.error = new ModuleParseError(this, source, e);
+ this.markModuleAsErrored();
+ return callback();
}
return callback();
});
| 10 |
diff --git a/articles/api-auth/tutorials/password-grant.md b/articles/api-auth/tutorials/password-grant.md ---
-description: How to execute a Resource Owner Password Grant
+title: How to implement the Resource Owner Password Grant
+description: Step-by-step guide on how to implement the OAuth 2.0 Resource Owner Password Grant
toc: true
---
# How to implement the Resource Owner Password Grant
@@ -8,7 +9,9 @@ toc: true
In this tutorial we will go through the steps required to implement the Resource Owner Password Grant.
-Note that this grant should only be used by highly trusted clients and only when redirects are not possible. If your application can support a redirect-based flow, use the [Authorization Code Grant](/api-auth/grant/authorization-code) instead.
+You should use this flow **only if** the following apply:
+- The client is absolutely trusted with the user's credentials. For [client side](/api-auth/grant/implicit) applications and [mobile apps](/api-auth/grant/authorization-code-pkce) we recommend using web flows instead.
+- Using a redirect-based flow is not possible. If this is not the case and redirects are possible in your application you should use the [Authorization Code Grant](/api-auth/grant/authorization-code) instead.
## Before you start
| 3 |
diff --git a/avatars/avatars.js b/avatars/avatars.js @@ -1867,7 +1867,7 @@ class Avatar {
armatureMatrixInverse,
};
}
- static applyModelBoneOutputs(modelBones, modelBoneOutputs, topEnabled, bottomEnabled, lHandEnabled, rHandEnabled) {
+ static applyModelBoneOutputs(modelBones, modelBoneOutputs, /*topEnabled,*/ bottomEnabled, lHandEnabled, rHandEnabled) {
for (const k in modelBones) {
const modelBone = modelBones[k];
const modelBoneOutput = modelBoneOutputs[k];
@@ -1880,7 +1880,7 @@ class Avatar {
modelBone.initialQuaternion
);
- if (topEnabled) {
+ // if (topEnabled) {
if (k === 'Left_wrist') {
if (rHandEnabled) {
modelBone.quaternion.multiply(leftRotation); // center
@@ -1890,7 +1890,7 @@ class Avatar {
modelBone.quaternion.multiply(rightRotation); // center
}
}
- }
+ // }
if (bottomEnabled) {
if (k === 'Left_ankle' || k === 'Right_ankle') {
modelBone.quaternion.multiply(upRotation);
@@ -2294,7 +2294,7 @@ class Avatar {
Avatar.applyModelBoneOutputs(
this.modelBones,
this.modelBoneOutputs,
- this.getTopEnabled(),
+ // this.getTopEnabled(),
this.getBottomEnabled(),
this.getHandEnabled(0),
this.getHandEnabled(1),
| 2 |
diff --git a/src/pages/iou/IOUDetailsModal.js b/src/pages/iou/IOUDetailsModal.js @@ -5,6 +5,7 @@ import {
} from 'react-native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
+import lodashGet from 'lodash/get';
import styles from '../../styles/styles';
import ONYXKEYS from '../../ONYXKEYS';
import TransactionItem from '../../components/TransactionItem';
@@ -44,6 +45,11 @@ const propTypes = {
reportActions: PropTypes.objectOf(PropTypes.shape(ReportActionPropTypes)),
loading: PropTypes.bool,
+ // Session info for the currently logged in user.
+ session: PropTypes.shape({
+ // Currently logged in user email
+ email: PropTypes.string,
+ }).isRequired,
};
class IOUDetailsModal extends Component {
@@ -84,11 +90,12 @@ class IOUDetailsModal extends Component {
{/* Reuse Preview Component here? */}
+ {(this.props.iouReport.managerEmail === sessionEmail &&
<ButtonWithLoader
text="I'll settle up elsewhere"
isLoading={this.props.loading}
onClick={this.performIOUSettlement}
- />
+ />)}
</View>
</ScreenWrapper>
);
@@ -104,10 +111,13 @@ export default compose(
iouReport: {
key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT_IOUS}${route.params.iouReportID}`,
},
- }),
- withOnyx({
- reportActions: {
- key: ({iouReport}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.chatReportID}`,
+ session: {
+ key: ONYXKEYS.SESSION,
},
}),
+ // withOnyx({
+ // reportActions: {
+ // key: ({iouReport}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.chatReportID}`,
+ // },
+ // }),
)(IOUDetailsModal);
| 4 |
diff --git a/app/lib/report_helper.rb b/app/lib/report_helper.rb @@ -390,6 +390,7 @@ module ReportHelper
def fetch_samples_taxons_counts(samples, taxon_ids, parent_ids, background_id)
pipeline_run_ids = samples.map { |s| s.pipeline_runs.first ? s.pipeline_runs.first.id : nil }.compact
parent_ids = parent_ids.to_a
+ parent_ids_clause = parent_ids.empty? ? "" : " OR taxon_counts.tax_id in (#{parent_ids.join(',')}) "
# Note: subsample_fraction is of type 'float' so adjusted_total_reads is too
# Note: stdev is never 0
@@ -429,7 +430,7 @@ module ReportHelper
taxon_counts.genus_taxid != #{TaxonLineage::BLACKLIST_GENUS_ID} AND
taxon_counts.count_type IN ('NT', 'NR') AND
(taxon_counts.tax_id IN (#{taxon_ids.join(',')})
- OR taxon_counts.tax_id in (#{parent_ids.join(',')})
+ #{parent_ids_clause}
OR taxon_counts.genus_taxid IN (#{taxon_ids.join(',')}))").to_hash
# calculating rpm and zscore, organizing the results by pipeline_run_id
| 9 |
diff --git a/tests/operations/tests/Base85.mjs b/tests/operations/tests/Base85.mjs @@ -16,6 +16,10 @@ DIb:@FD,*)+C]U=@3BN#EcYf8ATD3s@q?d$AftVqCh[NqF<G:8+EV:.+Cf>-FD5W8ARlolDIal(\
DId<j@<?3r@:F%a+D58'ATD4$Bl@l3De:,-DJs`8ARoFb/0JMK@qB4^F!,R<AKZ&-DfTqBG%G>u\
D.RTpAKYo'+CT/5+Cei#DII?(E,9)oF*2M7/c";
+const allZeroExample = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+
+const allZeroOutput = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+
TestRegister.addTests([
{
name: "To Base85",
@@ -45,4 +49,22 @@ TestRegister.addTests([
"args": ["!-u", false] }
]
},
+ {
+ name: "From Base85",
+ input: allZeroExample,
+ expectedOutput: allZeroOutput,
+ recipeConfig: [
+ { "op": "From Base85",
+ "args": ["!-u", false] }
+ ]
+ },
+ {
+ name: "From Base85",
+ input: allZeroExample,
+ expectedOutput: allZeroOutput,
+ recipeConfig: [
+ { "op": "From Base85",
+ "args": ["!-u", true] }
+ ]
+ },
]);
| 0 |
diff --git a/semantics-3.0/Semantics.hs b/semantics-3.0/Semantics.hs module Semantics where
-import Data.List.NonEmpty (NonEmpty)
+import Data.List.NonEmpty (NonEmpty(..), (<|))
import Data.Map (Map)
data SetupContract = SetupContract {
@@ -23,7 +23,7 @@ type ActionId = Integer
data Contract =
Commit Party Value Timeout Contract Contract |
Pay Party Value |
- Both (NonEmpty (Value, Contract)) |
+ All (NonEmpty (Value, Contract)) |
-- Catch Contract Contract |
If Observation Contract Contract |
When (NonEmpty Case) Timeout Contract |
@@ -77,3 +77,19 @@ data InputCommand = Perform (NonEmpty ActionId)
data State = State { stateChoices :: Map ChoiceId Integer }
deriving (Eq, Ord, Show, Read)
+
+contractLifespan :: Contract -> Integer
+contractLifespan contract = case contract of
+ Commit _ _ timeout contract1 contract2 ->
+ maximum [timeout, contractLifespan contract1, contractLifespan contract2]
+ Pay _ _ -> 0
+ All shares -> let contractsLifespans = fmap (contractLifespan . snd) shares
+ in maximum contractsLifespans
+ -- TODO simplify observation and check for always true/false cases
+ If observation contract1 contract2 ->
+ max (contractLifespan contract1) (contractLifespan contract2)
+ When cases timeout contract -> let
+ contractsLifespans = fmap (\(Case obs cont) -> contractLifespan cont) cases
+ in maximum (timeout <| contractLifespan contract <| contractsLifespans)
+ While observation timeout contract1 contract2 ->
+ maximum [timeout, contractLifespan contract1, contractLifespan contract2]
| 10 |
diff --git a/src/app/Http/Controllers/Operations/ListOperation.php b/src/app/Http/Controllers/Operations/ListOperation.php @@ -97,7 +97,7 @@ trait ListOperation
// if show entry count is disabled we use the "simplePagination" technique to move between pages.
if ($this->crud->getOperationSetting('showEntryCount')) {
- $totalEntryCount = (int) (empty(request()->get('totalEntryCount')) ? $this->crud->getTotalQueryCount() : request()->get('totalEntryCount'));
+ $totalEntryCount = (int) (request()->get('totalEntryCount') ?: $this->crud->getTotalQueryCount());
$filteredEntryCount = $this->crud->getFilteredQueryCount() ?? $totalEntryCount;
} else {
$totalEntryCount = $length;
| 4 |
diff --git a/demos/generator/typed.html b/demos/generator/typed.html <block type="lambda_app_typed"></block>
<block type="match_typed"></block>
<block type="defined_datatype_typed"></block>
- <block type="create_construct_typed"></block>
<block type="int_type_typed"></block>
<block type="float_type_typed"></block>
<block type="let_typed"></block>
| 2 |
diff --git a/src/app/Sidebar/LeftSidebar.js b/src/app/Sidebar/LeftSidebar.js @@ -91,8 +91,13 @@ const LeftSidebar = injectIntl(({ authenticatedUser, user, intl }) => {
</div>
</div>
</div>}
- {user && <Action style={{ margin: '5px 0' }} text="Transfer" />}
- {user && <Action style={{ margin: '5px 0' }} text="Message" />}
+ {user && <Action
+ style={{ margin: '5px 0' }}
+ text={intl.formatMessage({
+ id: 'transfer',
+ defaultMessage: 'Transfer',
+ })}
+ />}
</div>)}
/>
<Route
| 2 |
diff --git a/frontend/src/app/actions.js b/frontend/src/app/actions.js @@ -1108,7 +1108,7 @@ export function uploadFiles(bucketName, files) {
export function testNode(source, testSet) {
logAction('testNode', { source, testSet });
- const regexp = /=>(\w{3}):\/\/([0-9.]+):(\d+)/;
+ const regexp = /=>(\w{3}):\/\/\[?([.:0-9a-fA-F]+)\]?:(\d+)$/;
const { nodeTestInfo } = model;
nodeTestInfo({
| 1 |
diff --git a/build/shakaBuildHelpers.py b/build/shakaBuildHelpers.py @@ -20,6 +20,8 @@ This uses two environment variables to help with debugging the scripts:
RAISE_INTERRUPT - Will raise keyboard interrupts rather than swallowing them.
"""
+from __future__ import print_function
+
import errno
import json
import logging
@@ -321,6 +323,6 @@ def run_main(main):
except KeyboardInterrupt:
if os.environ.get('RAISE_INTERRUPT'):
raise
- print >> sys.stderr # Clear the current line that has ^C on it.
+ print(file=sys.stderr) # Clear the current line that has ^C on it.
logging.error('Keyboard interrupt')
sys.exit(1)
| 1 |
diff --git a/core/lib/monogatari.js b/core/lib/monogatari.js @@ -740,7 +740,7 @@ class Monogatari {
});
}
- if (data.Engine.Sound !== '' && typeof data.Engine.Dound !== 'undefined') {
+ if (data.Engine.Sound !== '' && typeof data.Engine.Sound !== 'undefined') {
Monogatari.state ({
sound: `${data.Engine.Sound}`,
});
| 1 |
diff --git a/src/templates/Typedoc/Toc.jsx b/src/templates/Typedoc/Toc.jsx @@ -49,7 +49,7 @@ export default class Toc extends PureComponent {
<Scrollspy
items={subIds[0]}
currentClassName={stylesSidebar.scrollspyActive}
- offset={300}
+ offset={-30}
>
{this.subItems(children, name)}
</Scrollspy>
| 7 |
diff --git a/lib/node_modules/@stdlib/_tools/bundle/scripts/npm_bundles b/lib/node_modules/@stdlib/_tools/bundle/scripts/npm_bundles @@ -120,7 +120,7 @@ var bundles = [
]
},
{
- 'name': 'stdlib-datasets',
+ 'name': 'stdlib-datasets-flat',
'standalone': '@stdlib/datasets',
'namespace': 'flat',
'raw': false,
@@ -130,7 +130,7 @@ var bundles = [
]
},
{
- 'name': 'stdlib-repl',
+ 'name': 'stdlib-repl-flat',
'standalone': '@stdlib/repl',
'namespace': 'flat',
'raw': false,
| 10 |
diff --git a/core/workspace_svg.js b/core/workspace_svg.js @@ -685,7 +685,7 @@ Blockly.WorkspaceSvg.prototype.addFlyout_ = function(tagName) {
* @return {Blockly.Flyout} The flyout on this workspace.
* @package
*/
-Blockly.WorkspaceSvg.prototype.getFlyout_ = function() {
+Blockly.WorkspaceSvg.prototype.getFlyout = function() {
if (this.flyout_) {
return this.flyout_;
}
@@ -925,8 +925,8 @@ Blockly.WorkspaceSvg.prototype.setVisible = function(isVisible) {
// Tell the flyout whether its container is visible so it can
// tell when to hide itself.
- if (this.getFlyout_()) {
- this.getFlyout_().setContainerVisible(isVisible);
+ if (this.getFlyout()) {
+ this.getFlyout().setContainerVisible(isVisible);
}
this.getParentSvg().style.display = isVisible ? 'block' : 'none';
| 10 |
diff --git a/android/app/build.gradle b/android/app/build.gradle @@ -143,7 +143,7 @@ def getGitVersion() {
}
def semVersion = System.getenv('BUILD_VERSION') ?: getNpmVersion()
-def buildNumber = System.getenv('BUILD_NUMBER') && System.getenv('BUILD_NUMBER').toInteger() ?: getGitVersion()
+def buildNumber = (System.getenv('BUILD_NUMBER') && System.getenv('BUILD_NUMBER').toInteger()) ?: getGitVersion()
println semVersion
println buildNumber
| 3 |
diff --git a/src/themes/foundation.js b/src/themes/foundation.js @@ -387,7 +387,7 @@ export var foundation6Theme = foundation5Theme.extend({
el.appendChild(input)
}
- if (description) label.appendChild(description)
+ if (description && label) label.appendChild(description)
return el
},
addInputError: function (input, text) {
| 1 |
diff --git a/src/PopupModalityMixin.js b/src/PopupModalityMixin.js @@ -35,16 +35,15 @@ export default function PopupModalityMixin(Base) {
constructor() {
// @ts-ignore
super();
- this.addEventListener('blur', async () => {
+ this.addEventListener('blur', async (event) => {
+ if (!ownEvent(this, event)) {
this[symbols.raiseChangeEvents] = true;
await this.close();
this[symbols.raiseChangeEvents] = false;
+ }
});
this[closeListenerKey] = async (event) => {
- /** @type {any} */
- const element = this;
- const insideEvent = deepContains(element, event.target);
- if (!insideEvent) {
+ if (!ownEvent(this, event)) {
this[symbols.raiseChangeEvents] = true;
await this.close();
this[symbols.raiseChangeEvents] = false;
@@ -116,6 +115,14 @@ function addEventListeners(element) {
}
+// Return true if the event came from within the element or from the element
+// itself; false otherwise.
+function ownEvent(element, event) {
+ const eventSource = event.path[0];
+ return element === eventSource || deepContains(element, eventSource);
+}
+
+
function removeEventListeners(element) {
document.removeEventListener('keydown', element[closeListenerKey]);
window.removeEventListener('blur', element[closeListenerKey]);
| 8 |
diff --git a/src/demo/blank.txt b/src/demo/blank.txt OBJECTS
========
+background .
+black
+
+player
+green
+
=======
LEGEND
=======
@@ -13,6 +19,8 @@ SOUNDS
================
COLLISIONLAYERS
================
+background
+player
======
RULES
@@ -25,3 +33,4 @@ WINCONDITIONS
=======
LEVELS
=======
+.
\ No newline at end of file
| 14 |
diff --git a/lib/assets/javascripts/new-dashboard/i18n/locales/en.json b/lib/assets/javascripts/new-dashboard/i18n/locales/en.json "clientSecret": "Client Secret:",
"clientSecretWarning": "Client secret must be kept secret",
"clientSecretButton": "Reset client secret",
- "clientSecretDesc": "OAuth apps can use OAuth credentials to identify users. Learn more about identifying users by reading our <a href'https://carto.com/developers/fundamentals/oauth-apps/#oauth-flow' target='_blank'>integration developer documentation.</a>",
+ "clientSecretDesc": "OAuth apps can use OAuth credentials to identify users. Learn more about identifying users by reading our <a href='https://carto.com/developers/fundamentals/oauth-apps/#oauth-flow' target='_blank'>integration developer documentation.</a>",
"appInformationTitle": "App Information",
"deleteAppButton": "Delete my app"
}
| 1 |
diff --git a/exampleSite/content/global/nav.md b/exampleSite/content/global/nav.md @@ -15,27 +15,27 @@ weight = 0
text = "Star" # default: "Star"
icon = "fa-github" # defaults: "fa-github"
-[main]
+[[main]]
url = "#"
name = "Long Link"
weight = 10
-[main]
+[[main]]
url = "/about-split"
name = "Page-split"
weight = 30
-[main]
+[[main]]
url = "/about"
name = "Page-single"
weight = 30
-[main]
+[[main]]
url = "#contact-fragment"
name = "Contact"
weight = 50
-[main]
+[[main]]
url = "#"
name = "Link"
weight = 30
| 1 |
diff --git a/packages/app/src/components/Admin/ExportArchiveData/ArchiveFilesTable.jsx b/packages/app/src/components/Admin/ExportArchiveData/ArchiveFilesTable.jsx import React from 'react';
-import PropTypes from 'prop-types';
-import { withTranslation } from 'react-i18next';
+
import { format } from 'date-fns';
+import PropTypes from 'prop-types';
+import { useTranslation } from 'react-i18next';
-import { withUnstatedContainers } from '../../UnstatedUtils';
import AppContainer from '~/client/services/AppContainer';
+import { withUnstatedContainers } from '../../UnstatedUtils';
+
import ArchiveFilesTableMenu from './ArchiveFilesTableMenu';
class ArchiveFilesTable extends React.Component {
@@ -58,9 +60,14 @@ ArchiveFilesTable.propTypes = {
onZipFileStatRemove: PropTypes.func.isRequired,
};
+const ArchiveFilesTableWrapperFC = (props) => {
+ const { t } = useTranslation();
+ return <ArchiveFilesTable t={t} {...props} />;
+};
+
/**
* Wrapper component for using unstated
*/
-const ArchiveFilesTableWrapper = withUnstatedContainers(ArchiveFilesTable, [AppContainer]);
+const ArchiveFilesTableWrapper = withUnstatedContainers(ArchiveFilesTableWrapperFC, [AppContainer]);
-export default withTranslation()(ArchiveFilesTableWrapper);
+export default ArchiveFilesTableWrapper;
| 14 |
diff --git a/app/webpack/taxa/photos/ducks/photos.js b/app/webpack/taxa/photos/ducks/photos.js @@ -189,18 +189,18 @@ function observationPhotosFromObservations( observations ) {
);
}
-function onePhotoPerObservation( observationPhotos ) {
- const singleObservationPhotos = [];
- const obsPhotoHash = {};
- for ( let i = 0; i < observationPhotos.length; i += 1 ) {
- const observationPhoto = observationPhotos[i];
- if ( !obsPhotoHash[observationPhoto.observation.id] ) {
- obsPhotoHash[observationPhoto.observation.id] = true;
- singleObservationPhotos.push( observationPhoto );
- }
- }
- return singleObservationPhotos;
-}
+// function onePhotoPerObservation( observationPhotos ) {
+// const singleObservationPhotos = [];
+// const obsPhotoHash = {};
+// for ( let i = 0; i < observationPhotos.length; i += 1 ) {
+// const observationPhoto = observationPhotos[i];
+// if ( !obsPhotoHash[observationPhoto.observation.id] ) {
+// obsPhotoHash[observationPhoto.observation.id] = true;
+// singleObservationPhotos.push( observationPhoto );
+// }
+// }
+// return singleObservationPhotos;
+// }
export function fetchObservationPhotos( options = {} ) {
return function ( dispatch, getState ) {
@@ -350,10 +350,11 @@ export function reloadPhotos( ) {
// Sets state from URL params. Should not itself alter the URL.
export function hydrateFromUrlParams( params ) {
- return function ( dispatch ) {
+ return function ( dispatch, getState ) {
if ( !params ) {
params = {};
}
+ const { taxon } = getState( );
if ( params.grouping ) {
const termGroupingMatch = params.grouping.match( /terms:([0-9]+)$/ );
if ( termGroupingMatch ) {
@@ -399,14 +400,23 @@ export function hydrateFromUrlParams( params ) {
if ( params.quality_grade ) {
newObservationParams.quality_grade = params.quality_grade;
}
+ if ( taxon ) {
+ const controlledAttrIDs = _.keys( taxon.fieldValues ).map( parseInt );
+ const controlledValueIDs = _.flatten( _.values( taxon.fieldValues ) )
+ .map( v => v.controlled_value.id );
_.forEach( params, ( value, key ) => {
if ( !key.match( /^term(_value)?_id$/ ) ) {
return;
}
+ const attrRelevant = key === "term_id" && controlledAttrIDs.includes( parseInt( value, 0 ) );
+ const valueRelevant = key === "term_value_id" && controlledValueIDs.includes( parseInt( value, 0 ) );
+ if ( attrRelevant || valueRelevant ) {
newObservationParams[key] = value;
+ }
} );
if ( !_.isEmpty( newObservationParams ) ) {
dispatch( setObservationParams( newObservationParams ) );
}
+ }
};
}
| 8 |
diff --git a/lib/copy/__tests__/ncp/ncp.test.js b/lib/copy/__tests__/ncp/ncp.test.js @@ -44,10 +44,8 @@ describe('ncp', () => {
for (const fileName in files) {
const curFile = files[fileName]
if (curFile instanceof Object) {
- return filter(curFile)
- }
-
- if (fileName.substr(fileName.length - 1) === 'a') {
+ filter(curFile)
+ } else if (fileName.substr(fileName.length - 1) === 'a') {
delete files[fileName]
}
}
| 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.