code
stringlengths 122
4.99k
| label
int64 0
14
|
---|---|
diff --git a/src/lib/wallet/GoodWallet.js b/src/lib/wallet/GoodWallet.js @@ -52,11 +52,47 @@ export class GoodWallet {
accounts: Array<string>
networkId: number
gasPrice: number
+ subscribers: any
constructor() {
this.init()
}
+ listenTxUpdates() {
+ this.subscribers = {}
+ this.wallet.eth
+ .getBlockNumber()
+ .then(toBN)
+ .then(toBlock => {
+ this.pollForEvents(
+ {
+ event: 'Transfer',
+ contract: this.tokenContract,
+ fromBlock: new BN('0'),
+ toBlock,
+ filter: { from: this.account }
+ },
+ (error, event) => {
+ // Send for all events. We could define here different events
+ Object.values(this.subscribers['send']).forEach(cb => cb(error, event))
+ }
+ )
+
+ this.pollForEvents(
+ {
+ event: 'Transfer',
+ contract: this.tokenContract,
+ fromBlock: new BN('0'),
+ toBlock,
+ filter: { to: this.account }
+ },
+ (error, event) => {
+ Object.values(this.subscribers['receive']).forEach(cb => cb(error, event))
+ }
+ )
+ })
+ }
+
init(): Promise<any> {
const ready = WalletFactory.create('software')
this.ready = ready
@@ -95,6 +131,7 @@ export class GoodWallet {
from: this.account
}
)
+ this.listenTxUpdates()
log.info('GoodWallet Ready.')
})
.catch(e => {
@@ -121,35 +158,34 @@ export class GoodWallet {
return await this.claimContract.methods.checkEntitlement().call()
}
+ /**
+ * returns dd+eventName so consumer can unsubscribe
+ */
+ subscribeToTx(eventName: string, cb: Function) {
+ // Get last id from subscribersList
+ if (!this.subscribers[eventName]) {
+ this.subscribers[eventName] = {}
+ }
+ const id = Math.max(...Object.keys(this.subscribers[eventName]).map(parseInt)) + 1
+ this.subscribers[eventName][id] = cb
+ return { id, eventName }
+ }
+
+ /**
+ * removes subscriber
+ */
+ unSubscribeToTx({ eventName, id }: { eventName: string, id: number }) {
+ delete this.subscribers[eventName][id]
+ }
+
/**
* Listen to balance changes for the current account
* @param cb
* @returns {Promise<void>}
*/
async balanceChanged(cb: Function) {
- const toBlock = await this.wallet.eth.getBlockNumber().then(toBN)
-
- this.pollForEvents(
- {
- event: 'Transfer',
- contract: this.tokenContract,
- fromBlock: new BN('0'),
- toBlock,
- filter: { from: this.account }
- },
- cb
- )
-
- this.pollForEvents(
- {
- event: 'Transfer',
- contract: this.tokenContract,
- fromBlock: new BN('0'),
- toBlock,
- filter: { to: this.account }
- },
- cb
- )
+ this.subscribeToTx('receive', cb)
+ this.subscribeToTx('send', cb)
}
/**
| 0 |
diff --git a/components/core/DataMeterDetailed.js b/components/core/DataMeterDetailed.js @@ -4,9 +4,6 @@ import * as Strings from "~/common/strings";
import { css } from "@emotion/core";
-// NOTE(jim): Consolidate if used elsewhere on the client (Not node_common)
-const MAX_IN_BYTES = 10737418240 * 4;
-
const STYLES_CONTAINER = css`
border-radius: 4px;
box-shadow: 0 0 0 1px ${Constants.system.lightBorder} inset, 0 0 40px 0 ${Constants.system.shadow};
@@ -19,30 +16,6 @@ const STYLES_CONTAINER = css`
}
`;
-const STYLES_DATA = css`
- width: 100%;
- display: flex;
- align-items: center;
- border-radius: 3px;
- overflow: hidden;
-`;
-
-const STYLES_DATA_METER_BASE = css`
- width: 100%;
- display: flex;
- align-items: center;
- border-radius: 3px;
- background-color: ${Constants.system.foreground};
- overflow: hidden;
-`;
-
-const STYLES_DATA_METER = css`
- flex-shrink: 0;
- top: 0px;
- left: 0px;
- border-radius: 3px 0px 0px 3px;
-`;
-
const STYLES_ROW = css`
font-family: ${Constants.font.code};
color: ${Constants.system.darkGray};
@@ -108,6 +81,7 @@ export const DataMeterBar = (props) => {
const percentagePdf = props.stats.pdfBytes / props.bytes;
const percentageAudio = props.stats.audioBytes / props.bytes;
const percentageFreeSpace = props.bytes - props.maximumBytes;
+
return (
<React.Fragment>
<div css={STYLES_STATS_ROW}>
| 2 |
diff --git a/src/index.js b/src/index.js @@ -79,7 +79,7 @@ export default class TronWeb extends EventEmitter {
if (privateKey)
this.setPrivateKey(privateKey);
- this.fullnodeVersion = '3.5.x';
+ this.fullnodeVersion = '3.5';
this.injectPromise = utils.promiseInjector(this);
}
| 12 |
diff --git a/components/maplibre/ban-map/popups.js b/components/maplibre/ban-map/popups.js import PropTypes from 'prop-types'
+import Image from 'next/image'
import colors from '@/styles/colors'
@@ -7,13 +8,49 @@ import ParcellesList from '@/components/base-adresse-nationale/parcelles-list'
import {sources} from './layers'
-function PopupNumero({numero, suffixe, parcelles, lieuDitComplementNom, nomVoie, nomCommune, codeCommune, sourcePosition}) {
+function PopupLanguagePreview({languages}) {
+ return (
+ <div className='languages'>
+ {Object.keys(languages).map(language => {
+ return (
+ <div className='language' key={language}>
+ <Image src={`/images/icons/flags/${language}.svg`} height={12} width={12} />
+ <div>{languages[language]}</div>
+ </div>
+ )
+ })}
+
+ <style jsx>{`
+ .languages {
+ margin-bottom: 10px;
+ font-size: 12px;
+ font-style: italic;
+ }
+
+ .language {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ }
+ `}</style>
+ </div>
+ )
+}
+
+PopupLanguagePreview.propTypes = {
+ languages: PropTypes.object.isRequired
+}
+
+function PopupNumero({numero, suffixe, parcelles, lieuDitComplementNom, nomVoie, nomAlt, nomCommune, codeCommune, sourcePosition}) {
const position = sources[sourcePosition]
return (
<div>
<div className='heading'>
+ <div>
<b>{numero}{suffixe} {nomVoie} {lieuDitComplementNom ? `(${lieuDitComplementNom})` : ''}</b>
+ {nomAlt && <PopupLanguagePreview languages={nomAlt} />}
+ </div>
<Tag type='numero' />
</div>
<div className='commune'>{nomCommune} - {codeCommune}</div>
@@ -32,7 +69,7 @@ function PopupNumero({numero, suffixe, parcelles, lieuDitComplementNom, nomVoie,
display: grid;
grid-template-columns: 3fr 1fr;
grid-gap: .5em;
- align-items: center;
+ align-items: flex-start;
}
.commune {
@@ -67,21 +104,29 @@ PopupNumero.propTypes = {
parcelles: PropTypes.string,
lieuDitComplementNom: PropTypes.string,
nomVoie: PropTypes.string.isRequired,
+ nomAlt: PropTypes.object,
nomCommune: PropTypes.string.isRequired,
codeCommune: PropTypes.string.isRequired,
sourcePosition: PropTypes.string.isRequired,
}
-function PopupVoie({nomVoie, nomCommune, codeCommune, parcelles, nbNumeros, type}) {
+PopupNumero.defaultProps = {
+ nomAlt: null
+}
+
+function PopupVoie({nomVoie, nomAlt, nomCommune, codeCommune, parcelles, nbNumeros, type}) {
return (
<div>
<div className='heading'>
<div className='address'>
<div><b>{nomVoie}</b></div>
+ {nomAlt && <PopupLanguagePreview languages={nomAlt} />}
<div>{nomCommune} {codeCommune}</div>
</div>
+ <div>
<Tag type={type || 'lieu-dit'} />
</div>
+ </div>
{parcelles && <ParcellesList parcelles={parcelles.split('|')} />}
@@ -108,6 +153,7 @@ function PopupVoie({nomVoie, nomCommune, codeCommune, parcelles, nbNumeros, type
PopupVoie.propTypes = {
nomVoie: PropTypes.string.isRequired,
+ nomAlt: PropTypes.object,
nomCommune: PropTypes.string.isRequired,
codeCommune: PropTypes.string.isRequired,
parcelles: PropTypes.string,
@@ -115,6 +161,10 @@ PopupVoie.propTypes = {
type: PropTypes.string
}
+PopupVoie.defaultProps = {
+ nomAlt: null
+}
+
export default function popupFeatures(features) {
return features.map(({properties}) => (
<div key={properties.id}>
| 9 |
diff --git a/Projects/Algorithmic-Trading/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/ExchangeAPI.js b/Projects/Algorithmic-Trading/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/ExchangeAPI.js let secret
let uid
let password
+ let brokerId
let sandBox = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.sandbox || false;
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference !== undefined) {
secret = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.secret
uid = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.uid
password = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.password
+ brokerId = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.brokerId
}
}
+
+ switch (exchangeId) {
+ case 'okex':
+ case 'okex3':
+ case 'okex5':
+ if (brokerId === undefined) {
+ brokerId = 'c77ccd60ec7b4cBC'
+ }
+ break;
+ }
+ options.brokerId = brokerId
+
const exchangeClass = ccxt[exchangeId]
const exchangeConstructorParams = {
'apiKey': key,
| 12 |
diff --git a/packages/inertia/src/url.ts b/packages/inertia/src/url.ts @@ -8,9 +8,20 @@ export function hrefToUrl(href: string|URL): URL {
export function mergeDataIntoQueryString(
method: Method,
- url: URL,
+ href: URL|string,
data: Record<string, FormDataConvertible>,
-): [URL, Record<string, FormDataConvertible>] {
+): {
+ href: string,
+ data: Record<string, FormDataConvertible>
+} {
+ const hasHost = href.toString().includes('http')
+ const hasAbsolutePath = hasHost || href.toString().startsWith('/')
+ const hasRelativePath = !hasAbsolutePath && !href.toString().startsWith('#') && !href.toString().startsWith('?')
+ const hasSearch = href.toString().includes('?') || (method === Method.GET && Object.keys(data).length)
+ const hasHash = href.toString().includes('#')
+
+ const url = new URL(href.toString(), 'http://localhost')
+
if (method === Method.GET && Object.keys(data).length) {
url.search = qs.stringify(
deepmerge(qs.parse(url.search, { ignoreQueryPrefix: true }), data), {
@@ -20,10 +31,17 @@ export function mergeDataIntoQueryString(
)
data = {}
}
- return [
- url,
+
+ return {
+ href: [
+ hasHost ? `${url.protocol}//${url.host}` : '',
+ hasAbsolutePath ? url.pathname : '',
+ hasRelativePath ? url.pathname.substring(1) : '',
+ hasSearch ? url.search : '',
+ hasHash ? url.hash : '',
+ ].join(''),
data,
- ]
+ }
}
export function urlWithoutHash(url: URL|Location): URL {
| 7 |
diff --git a/rig.js b/rig.js @@ -242,6 +242,18 @@ class RigManager {
}
}
+ setPeerAvatarUrl(peerId, avatarUrl) {
+ const peerRig = this.peerRigs.get(peerId);
+ if (peerRig) {
+ if (peerRig.app.contentId !== avatarUrl) {
+ throw new Error('do not know how to set change avatar url yet');
+ // debugger;
+ }
+ } else {
+ console.warn('set peer avatar url for unknown peer:', peerRig);
+ }
+ }
+
/* setPeerAvatarName(name, peerId) {
const peerRig = this.peerRigs.get(peerId);
peerRig.textMesh.text = name;
| 0 |
diff --git a/src/encoded/static/components/award.js b/src/encoded/static/components/award.js @@ -859,7 +859,8 @@ class CumulativeGraph extends React.Component {
}],
},
options: {
- maintainAspectRatio: true,
+ responsive: true,
+ maintainAspectRatio: false,
legend: {
display: false,
labels: {
@@ -923,6 +924,7 @@ class Award extends React.Component {
<div className="status-line">
<div className="characterization-status-labels">
<StatusLabel status={statuses} />
+ <a href={`/report/?type=Experiment&award.name=${context.name}`}>Report</a>
</div>
</div>
</div>
| 0 |
diff --git a/assets/js/googlesitekit/widgets/components/WidgetAreaRenderer.js b/assets/js/googlesitekit/widgets/components/WidgetAreaRenderer.js @@ -131,8 +131,6 @@ export default function WidgetAreaRenderer( { slug, totalAreas } ) {
</Row>
</div>
- { inactiveWidgets.length &&
- (
<div className="googlesitekit-widget-area-widgets">
{ inactiveWidgets.map( ( widget ) => (
<div className={ HIDDEN_CLASS } key={ widget.slug }>
@@ -140,8 +138,6 @@ export default function WidgetAreaRenderer( { slug, totalAreas } ) {
</div>
) ) }
</div>
- )
- }
</Grid>
);
}
| 2 |
diff --git a/test/e2e/support/helpers.js b/test/e2e/support/helpers.js @@ -352,10 +352,10 @@ function environmentIs (...conditions) {
return false;
}
-function getValue (attribute) {
+function getValue (selector) {
if (environmentIs(DEVICES.ANDROID)) {
- return attribute.getProperty('value');
+ return selector.getProperty('value');
} else {
- return attribute.getValue();
+ return selector.getValue();
}
}
| 10 |
diff --git a/lib/assets/core/test/spec/cartodb3/deep-insights-integrations.spec.js b/lib/assets/core/test/spec/cartodb3/deep-insights-integrations.spec.js @@ -808,6 +808,25 @@ describe('deep-insights-integrations/dii', function () {
expect(layerDefinitionModel.styleModel.resetPropertiesFromAutoStyle).toHaveBeenCalled();
});
+ it('should update layer definition model\'s style properly based on previous custom style', function () {
+ var css = '#layer { marker-width: 5; marker-fill: red; marker-fill-opacity: 1; marker-line-width: 1; marker-line-color: #ff0e0e; marker-line-opacity: 1; }';
+ var model = dashBoard.getWidget(category.id);
+
+ model.set({ autoStyle: true });
+
+ expect(layerDefinitionModel.get('cartocss_custom')).toBe(false);
+
+ layerDefinitionModel.set({
+ previousCartoCSSCustom: true,
+ previousCartoCSS: css
+ });
+
+ model.set({ autoStyle: false });
+
+ expect(layerDefinitionModel.get('cartocss_custom')).toBe(true);
+ expect(layerDefinitionModel.get('cartocss')).toBe(css);
+ });
+
it('should update layer definition model\'s color properly', function () {
var model = dashBoard.getWidget(category.id);
model.set({autoStyle: true}, {silent: true});
| 3 |
diff --git a/templates/export/resources.js b/templates/export/resources.js @@ -109,7 +109,7 @@ module.exports = Object.assign(
"Environment": {
"Variables": {
outputBucket: {"Ref": "ExportBucket"},
- s3Prefix: "connect/",
+ s3Prefix: "genesys/",
accountId: {"Ref": "AWS::AccountId"},
region: {"Ref": "AWS::Region"},
LexVersion: {"Ref": "LexVersion"},
| 3 |
diff --git a/userscript.user.js b/userscript.user.js @@ -24544,7 +24544,7 @@ var $$IMU_EXPORT$$;
imu: theobj
}
}, function() {
- popups_active = true;
+ //popups_active = true;
});
return;
}
@@ -25545,6 +25545,8 @@ var $$IMU_EXPORT$$;
if (ret === false) {
event.preventDefault();
+ event.stopImmediatePropagation();
+ event.stopPropagation();
}
return ret;
| 1 |
diff --git a/_data/conferences.yml b/_data/conferences.yml note: Mandatory abstract deadline on May 21, 2021
- title: WACV
- year: 2022
- id: wacv22
- link: http://wacv2022.thecvf.com/
- deadline: '2021-06-02 23:59:59'
+ year: 2023
+ id: wacv23
+ link: http://wacv2023.thecvf.com/
+ deadline: '2021-07-13 11:59:59'
timezone: America/Los_Angeles
place: Waikoloa, Hawaii, USA
- date: January 4-8, 2022
- start: 2022-01-04
- end: 2022-01-08
+ date: January 3-7, 2023
+ start: 2023-01-03
+ end: 2023-01-07
hindex: 54
sub: CV
- note: Second round submission deadline on Aug. 11th 2021
+ note: Second round submission deadline on Aug. 29th 2022
- title: ICDM
year: 2021
| 3 |
diff --git a/shared/styles/mixins.scss b/shared/styles/mixins.scss $unitless-min: strip-unit($min-size);
$unitless-size: strip-unit($size);
+ $baseline: strip-unit($min-mobile);
- $baseline: $min-mobile;
- $font-multiplier: (($unitless-size - $unitless-min) / (strip-unit($limit) - strip-unit($baseline)));
- $font-baseline: ($unitless-min - $font-multiplier * strip-unit($baseline));
+ $font-multiplier: (($unitless-size - $unitless-min) / (strip-unit($limit) - $baseline));
+ $font-baseline: ($unitless-min - $font-multiplier * $baseline);
@if $unitless-min >= $unitless-size {
@warn 'Responsive font: min-size equal or greater than size';
font-size: #{$unitless-min}px;
font-size: calc(#{$unitless-min}px * #{var(--scale-font)});
- @media (min-width: $baseline) {
+ @media (min-width: $min-mobile) {
font-size: #{$unitless-min}px;
font-size: calc((#{$font-multiplier} * #{100vw} + (#{$font-baseline}px)) * #{var(--scale-font)});
}
}
}
-@mixin v-scale($property, $number) {
+@mixin vertically-responsive($property, $number) {
#{$property}: $number;
@supports (--css: variables) {
$padding-top-unitless: strip-unit($padding-top);
$padding-bottom-unitless: strip-unit($padding-bottom);
- @include v-scale(padding-top, $padding-top-mobile-unitless * 1px);
- @include v-scale(padding-bottom, $padding-bottom-mobile-unitless * 1px);
+ @include vertically-responsive(padding-top, $padding-top-mobile-unitless * 1px);
+ @include vertically-responsive(padding-bottom, $padding-bottom-mobile-unitless * 1px);
@media (min-width: $min-tablet) {
- @include v-scale(padding-top, percentage(($padding-top-unitless * 1px) / $page-limit));
- @include v-scale(padding-bottom, percentage(($padding-bottom-unitless * 1px) / $page-limit));
+ @include vertically-responsive(padding-top, percentage(($padding-top-unitless * 1px) / $page-limit));
+ @include vertically-responsive(padding-bottom, percentage(($padding-bottom-unitless * 1px) / $page-limit));
}
@media (min-width: $page-limit) {
- @include v-scale(padding-top, $padding-top-unitless * 1px);
- @include v-scale(padding-bottom, $padding-bottom-unitless * 1px);
+ @include vertically-responsive(padding-top, $padding-top-unitless * 1px);
+ @include vertically-responsive(padding-bottom, $padding-bottom-unitless * 1px);
}
}
| 10 |
diff --git a/js/feature/mergedTrack.js b/js/feature/mergedTrack.js @@ -49,6 +49,8 @@ const MergedTrack = extend(TrackBase, function (config, browser) {
if (!tconf.type) inferTrackTypes(tconf);
tconf.isMergedTrack = true;
+ tconf.height = config.height;
+
var t = browser.createTrack(tconf);
if (t) {
| 11 |
diff --git a/whydJS/app/models/email.js b/whydJS/app/models/email.js @@ -15,7 +15,6 @@ var emailImpl = require("./" + emailModule);
// http://www.regular-expressions.info/email.html
var emailCheck = /^[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9\u007F-\uffff!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i;
-
exports.validate = function(email) {
if (!email) return email;
if (typeof email != "string") {
| 13 |
diff --git a/readme.md b/readme.md @@ -42,7 +42,7 @@ To use the samples clone this GitHub repository using Git.
| Sample Name | Description | .NET CORE | NodeJS | .NET Web API | JS (es6) | Typescript |
|-----------------------|--------------------------------------------------------------------------------|-------------|-------------|--------------|-------------|-------------|
-|1.console-echo | Introduces the concept of adapter and demonstrates a simple echo bot on console adapter and how to send a reply and access the incoming the incoming message. |[View][cs#1] |[View][js#1] | :runner: | |[View][ts#1] |
+|1.console-echo | Introduces the concept of adapter and demonstrates a simple echo bot on console adapter and how to send a reply and access the incoming message. |[View][cs#1] |[View][js#1] | :runner: | |[View][ts#1] |
|1.a.browser-echo | Introduces browser adapter | | | |[View][es#1a]| |
|2.echo-with-counter | Demonstrates how to use state. Shows commented out code for all natively supported storage providers. Storage providers should include InMemory and Blob storage. |[View][cs#2] |[View][js#2] |[View][wa#2] | |[View][ts#2] |
|3.welcome-user | Introduces activity types and providing a welcome message on conversation update activity. |[View][cs#3] |[View][js#3] | | | |
| 2 |
diff --git a/articles/connections/database/password-change.md b/articles/connections/database/password-change.md @@ -107,11 +107,7 @@ The Management API v2 provides an additional endpoint, [Generate a password rese
:::
-In the Classic Experience you can [configure a url](/email/templates#redirect-to-results-for-the-change-password-email-template) to redirect users after completing the password reset. The URL will receive a success indicator and a message. The New Experience will redirect the users to the [default login route](/universal-login/default-login-url) when it succeeds, and will handle the error cases as part of the Universal Login flow. The Redirect URL in the email template will be ignored.
-
-In most cases, if the password reset is successful, the user's destination can be set in the [password reset email](/email/templates#configuring-the-redirect-to-url) if you wish to customize it.
-
-However, for applications using the New Universal Login Experience, the redirect destination is handled differently. Users are instead redirected to the [default login route](/universal-login/default-login-url) upon success. Any error cases are then automatically handled as part of the Universal Login flow, and the Redirect URL in the email template will be ignored.
+In the Classic Experience you can [configure a url](/email/templates#configuring-the-redirect-to-url) to redirect users after completing the password reset. The URL will receive a success indicator and a message. The New Experience will redirect the users to the [default login route](/universal-login/default-login-url) when it succeeds, and will handle the error cases as part of the Universal Login flow. The Redirect URL in the email template will be ignored.
## Directly set the new password
| 2 |
diff --git a/src/TrackpadSwipeMixin.js b/src/TrackpadSwipeMixin.js @@ -167,6 +167,11 @@ function handleWheel(element, event) {
return true;
}
+ if (eventAxis !== swipeAxis) {
+ // Move wasn't along the axis we care about, ignore it.
+ return false;
+ }
+
if (!cast[postGestureDelayCompleteKey]) {
// It's too soon after a gesture; absorb the event.
return true;
| 8 |
diff --git a/functions/kubernetes/k8sJobSubmit.js b/functions/kubernetes/k8sJobSubmit.js @@ -128,7 +128,7 @@ var submitK8sJob = async(kubeconfig, jobArr, taskIdArr, contextArr, customParams
if (process.env.HF_VAR_K8S_TEST=="1") {
console.log(JSON.stringify(jobYaml, null, 4));
console.log(JSON.stringify(jobMessages, null, 2));
- return 0;
+ return taskIdArr.map(x => 0);
}
var namespace = process.env.HF_VAR_NAMESPACE || 'default';
| 1 |
diff --git a/app/models/data_import.rb b/app/models/data_import.rb @@ -212,6 +212,7 @@ class DataImport < Sequel::Model
raise CartoDB::QuotaExceeded, 'More tables required'
end
+ # TODO: move to new model
def mark_as_failed_if_stuck!
return false unless stuck?
@@ -314,13 +315,6 @@ class DataImport < Sequel::Model
self
end
- def table
- # We can assume the owner is always who imports the data
- # so no need to change to a Visualization::Collection based load
- # TODO better to use an association for this
- ::Table.new(user_table: UserTable.where(id: table_id, user_id: user_id).first)
- end
-
def tables
table_names_array.map do |table_name|
UserTable.where(name: table_name, user_id: user_id).first.service
| 2 |
diff --git a/src/components/splash/Splash.js b/src/components/splash/Splash.js @@ -13,9 +13,9 @@ Image.prefetch(goodDollarImage)
Image.prefetch(wavePattern)
const Splash = () => (
- <Wrapper style={styles.container}>
<Wrapper style={styles.wrapper}>
- <Section style={styles.content} grow justifyContent="space-between">
+ <Section style={styles.container}>
+ <Section.Stack style={styles.content} grow justifyContent="space-between">
<Section.Text fontSize={22} fontFamily="regular" color="darkBlue">
{`Welcome and thank you\nfor participating in GoodDollar's\n`}
<Section.Text fontSize={22} fontFamily="bold" color="darkBlue">
@@ -27,9 +27,9 @@ const Splash = () => (
<Section.Text fontSize={22} fontFamily="regular" color="darkBlue">
V2.0
</Section.Text>
+ </Section.Stack>
</Section>
</Wrapper>
- </Wrapper>
)
Splash.navigationOptions = {
@@ -37,20 +37,21 @@ Splash.navigationOptions = {
}
const styles = StyleSheet.create({
- container: {
+ wrapper: {
padding: 0,
},
- wrapper: {
+ container: {
alignItems: 'center',
justifyContent: 'center',
backgroundImage: `url(${wavePattern})`,
backgroundRepeat: 'repeat-y',
+ backgroundColor: 'transparent',
backgroundSize: 'cover',
transform: 'rotateY(180deg)',
+ flex: 1,
},
content: {
transform: 'rotateY(180deg)',
- backgroundColor: 'transparent',
marginVertical: '10vh',
},
logo: {
| 14 |
diff --git a/src/client/js/components/PageEditor/HandsontableModal.jsx b/src/client/js/components/PageEditor/HandsontableModal.jsx @@ -92,7 +92,7 @@ export default class HandsontableModal extends React.Component {
</Navbar.Form>
</Navbar>
<div className="p-4">
- <HotTable data={this.state.markdownTable.data} settings={this.settings} />
+ <HotTable data={this.state.markdownTable.table} settings={this.settings} />
</div>
</Modal.Body>
<Modal.Footer>
| 4 |
diff --git a/app/src/views/AdminView.js b/app/src/views/AdminView.js @@ -4,8 +4,6 @@ import fetch from '../util/fetch';
import onboardingTopics from '../static-data/onboarding-topics';
import { Link } from 'react-router-dom';
-let interests = onboardingTopics['Interests'];
-
class AdminView extends React.Component {
constructor(props) {
super(props);
@@ -187,10 +185,10 @@ class PodcastRow extends React.Component {
value={this.props.interest}
>
<option value="none">None</option>
- {interests.map(interest => {
+ {onboardingTopics.map(interest => {
return (
- <option key={interest} value={interest}>
- {interest}
+ <option key={interest.name} value={interest.name}>
+ {interest.name}
</option>
);
})}
@@ -337,10 +335,10 @@ class RssRow extends React.Component {
value={this.props.interest}
>
<option value="none">None</option>
- {interests.map(interest => {
+ {onboardingTopics.map(interest => {
return (
- <option key={interest} value={interest}>
- {interest}
+ <option key={interest.name} value={interest.name}>
+ {interest.name}
</option>
);
})}
| 4 |
diff --git a/src/journeys_utils.js b/src/journeys_utils.js @@ -586,7 +586,7 @@ journeys_utils.setJourneyLinkData = function(html) {
var src = match[1];
var linkData = safejson.parse(src);
if (linkData) {
- var journeyLinkDataPropertiesToFilterOut = ['browser_fingerprint_id', 'app_id', 'source', 'open_app'];
+ var journeyLinkDataPropertiesToFilterOut = ['browser_fingerprint_id', 'app_id', 'source', 'open_app', 'link_click_id'];
utils.removePropertiesFromObject(linkData['journey_link_data'], journeyLinkDataPropertiesToFilterOut)
data = utils.merge(data, linkData);
}
| 2 |
diff --git a/src/patterns/components/toggle/collection.yaml b/src/patterns/components/toggle/collection.yaml @@ -2,19 +2,19 @@ description: |
A simple way of showing, hiding and breaking down lengthy content. This component has a clickable or tappable
link that shows or hides a block of content underneath it.
information:
- - Icon will always appear on the left side of the Toggle followed by the Toggle title
- - The icon and the title of the Toggle will both open and close the content when clicked or tapped
- - Toggles will look and function the same in all viewports
- - Spark-Core has included Toggle JS that will setup the showing and hiding of the toggle content
- - Spark-Core's Toggle JS will take care of adding and adjusting the aria-expanded attribute based on
- if the content is hidden or shown
- - You can adjust the spacing between the trigger link and the content by adjusting the spacing utility class on the content
+ - Icon will always appear on the left side of the Toggle content followed by the Toggle title.
+ - The icon and the title of the Toggle will both open and close the content when clicked or tapped.
+ - Toggles will look and function the same in all viewports.
+ - Spark-Core has included Toggle JS that will setup the showing and hiding of the toggle content.
+ - Spark-Core's Toggle JS will take care of initially adding and adjusting the aria-expanded HTML attribute based on
+ if the content is hidden or visible.
+ - You can adjust the spacing between the trigger link and the content by changing the spacing utility class on the content to a different size.
sparkPackageCore: true
restrictions:
- Content that requires user interaction or consumption should
- not be housed within a Toggle
- - A single Toggle should be used at a time and not several in succession
- - Sizing should be dependent on type size, but should remain large enough to be tappable on a mobile device
+ not be housed within a Toggle.
+ - A single Toggle should be used at a time and not several in succession.
+ - Overall sizing of the Toggle should be dependent on type size, but should remain large enough to be tappable on a mobile device
- Content length inside the Toggle does not have a limit, but shouldn't exceed a reasonable
- length
- - The title of the Toggle doesn't have a specific length either and can wrap if needed
+ length.
+ - The title of the Toggle doesn't have a specific maximum length and can wrap if needed.
| 3 |
diff --git a/circle.yml b/circle.yml @@ -40,7 +40,7 @@ jobs:
- run: ./_buildscripts/build-swagger.sh
- run: bundle exec jekyll build
- run: cp -r ./github ./_site/
- - run: bundle exec htmlproofer ./_site --assume-extension --check-html --allow-hash-href --empty-alt-ignore --only-4xx --disable-external
+ #- run: bundle exec htmlproofer ./_site --assume-extension --check-html --allow-hash-href --empty-alt-ignore --only-4xx --disable-external
- run: mkdir -p ~/.ssh
- run: echo $SSH_KNOWN_HOSTS | base64 -d >> ~/.ssh/known_hosts
- run: rsync --delete -avP --exclude "Makefile" --rsync-path="sudo -u www-data rsync" ./_site/ [email protected]:/data2tb/developers.italia.it/
@@ -61,3 +61,4 @@ workflows:
branches:
ignore:
- master
+ - new-version-master
| 8 |
diff --git a/src/commands/sites/create.js b/src/commands/sites/create.js @@ -18,7 +18,27 @@ class SitesCreateCommand extends Command {
const accounts = await api.listAccountsForUser()
+ let accountSlug = flags['account-slug']
+ if (!accountSlug) {
+ const results = await inquirer.prompt([
+ {
+ type: 'list',
+ name: 'accountSlug',
+ message: 'Team:',
+ choices: accounts.map(account => ({
+ value: account.slug,
+ name: account.name
+ }))
+ }
+ ])
+ accountSlug = results.accountSlug
+ }
+
let name = flags.name
+ let site
+
+ // Allow the user to reenter site name if selected one isn't available
+ const inputSiteName = async (name) => {
if (!name) {
const userName = await api.getCurrentUser()
const suggestions = [
@@ -45,23 +65,6 @@ class SitesCreateCommand extends Command {
name = results.name
}
- let accountSlug = flags['account-slug']
- if (!accountSlug) {
- const results = await inquirer.prompt([
- {
- type: 'list',
- name: 'accountSlug',
- message: 'Team:',
- choices: accounts.map(account => ({
- value: account.slug,
- name: account.name
- }))
- }
- ])
- accountSlug = results.accountSlug
- }
-
- let site
let body = {}
if (typeof name === 'string') {
body.name = name.trim()
@@ -73,11 +76,15 @@ class SitesCreateCommand extends Command {
})
} catch (error) {
if (error.status === 422) {
- this.error(`${name}.netlify.com already exists. Please try a different slug.`)
+ this.warn(`${name}.netlify.com already exists. Please try a different slug.`)
+ await inputSiteName()
} else {
this.error(`createSiteInTeam error: ${error.status}: ${error.message}`)
}
}
+ }
+ await inputSiteName(name)
+
this.log()
this.log(chalk.greenBright.bold.underline(`Site Created`))
this.log()
| 11 |
diff --git a/common/deck_validation.js b/common/deck_validation.js @@ -6,7 +6,7 @@ const TEXT_QUESTION_MAX_LENGTH = 400;
const DESCRIPTION_MAX_LENGTH = 500;
const ANSWERS_TOTAL_MAX_LENGTH = 200;
const COMMENT_MAX_LENGTH = 600;
-const MAX_CARDS = 20000;
+const MAX_CARDS = 10000;
const NON_LINE_ERROR_LINE = -1;
const SHORT_NAME_ALLOWED_CHARACTERS_REGEX_HTML = '^[a-zA-Z0-9_]{1,25}$';
const SHORT_NAME_ALLOWED_CHARACTERS_REGEX = /^[a-z0-9_]{1,25}$/;
| 12 |
diff --git a/src/core/Core.test.js b/src/core/Core.test.js @@ -843,6 +843,31 @@ describe('src/Core', () => {
})
describe('removeUpload', () => {
- xit('should remove all files from the specified upload', () => {})
+ it('should remove all files from the specified upload', () => {
+ // this uploader will run once the upload has started
+ const uploader = () => {
+ return Promise.resolve().then(() => {
+ const uploadId = Object.keys(core.state.currentUploads)[0]
+ expect(typeof core.state.currentUploads[uploadId]).toEqual('object')
+ expect(core.state.currentUploads[uploadId].fileIDs.length).toEqual(1)
+ core.removeUpload(uploadId)
+ expect(typeof core.state.currentUploads[uploadId]).toEqual('undefined')
+ })
+ }
+
+ const core = new Core()
+ core.run()
+ core.addUploader(uploader)
+ return core
+ .addFile({
+ source: 'jest',
+ name: 'foo.jpg',
+ type: 'image/jpg',
+ data: utils.dataURItoFile(sampleImageDataURI, {})
+ })
+ .then(() => {
+ return core.upload(true)
+ })
+ })
})
})
| 2 |
diff --git a/src/scripts/interactive-video.js b/src/scripts/interactive-video.js @@ -919,8 +919,7 @@ InteractiveVideo.prototype.addBookmarks = function () {
*/
InteractiveVideo.prototype.toggleBookmarksChooser = function (show = false, firstPlay = false) {
if (this.controls.$bookmarksButton) {
- show = (show === undefined ? !this.controls.$bookmarksChooser.hasClass('h5p-show') : show);
- var hiding = this.controls.$bookmarksChooser.hasClass('h5p-show');
+ show = !this.controls.$bookmarksChooser.hasClass('h5p-show');
if(show) {
this.controls.$more.attr('aria-expanded', 'true');
@@ -948,7 +947,7 @@ InteractiveVideo.prototype.toggleBookmarksChooser = function (show = false, firs
}
// Add classes if changing visibility
- this.controls.$bookmarksChooser.toggleClass('h5p-transitioning', show || hiding);
+ this.controls.$bookmarksChooser.toggleClass('h5p-transitioning', show || !show);
}
};
| 1 |
diff --git a/app/webpack/projects/form/components/shared_form.jsx b/app/webpack/projects/form/components/shared_form.jsx @@ -263,6 +263,7 @@ class SharedForm extends React.Component {
<Row className="project-type">
<Col xs={12}>
<h2>{ I18n.t( "views.projects.project_type" ) }</h2>
+ <label className="inline checkboxradio" htmlFor="project-type-regular">
<input
type="radio"
id="project-type-regular"
@@ -270,9 +271,9 @@ class SharedForm extends React.Component {
checked={project.project_type !== "umbrella"}
onChange={( ) => updateProject( { project_type: "regular" } )}
/>
- <label className="inline" htmlFor="project-type-regular">
{ I18n.t( "views.projects.collection" ) }
</label>
+ <label className="inline checkboxradio" htmlFor="project-type-umbrella">
<input
type="radio"
id="project-type-umbrella"
@@ -280,9 +281,9 @@ class SharedForm extends React.Component {
checked={project.project_type === "umbrella"}
onChange={( ) => updateProject( { project_type: "umbrella" } )}
/>
- <label className="inline" htmlFor="project-type-umbrella">
- { I18n.t( "views.projects.umbrella" ) } ({
- I18n.t( "views.projects.tracks_multiple_projects" ) })
+ { I18n.t( "views.projects.umbrella" ) }
+ { " " }
+ ({ I18n.t( "views.projects.tracks_multiple_projects" ) })
</label>
</Col>
</Row>
| 1 |
diff --git a/articles/libraries/lock-ios/v2/index.md b/articles/libraries/lock-ios/v2/index.md @@ -73,7 +73,9 @@ It is strongly encouraged that this SDK be used in OIDC Conformant mode. When th
}
```
-For more information, please see the [OIDC adoption guide](/api-auth/tutorials/adoption).
+::: note
+For more information, please see our [Introduction to OIDC Conformant Authentication](/api-auth/intro) and the [OIDC adoption guide](/api-auth/tutorials/adoption).
+:::
To show Lock, add the following snippet in your `UIViewController`.
| 0 |
diff --git a/userscript.user.js b/userscript.user.js @@ -11618,6 +11618,77 @@ var $$IMU_EXPORT$$;
return null;
};
+ var find_postid_from_el = function(el) {
+ var currentel = el;
+
+ while ((currentel = currentel.parentElement)) {
+ var id = currentel.getAttribute("id");
+ if (!id)
+ continue;
+
+ var match = id.match(/^photoset_([0-9]+)$/);
+ if (match) {
+ return match[1];
+ }
+
+ if (currentel.tagName === "ARTICLE") {
+ return id;
+ }
+ }
+
+ return null;
+ };
+
+ var el_has_mediakey = function(el, mediakey) {
+ if (el.tagName === "IMG") {
+ return find_mediakey_from_url(el.src) === mediakey;
+ } else if (el.tagName === "IFRAME" && /\/post\/+[0-9]+\/+/.test(el.src)) {
+ try {
+ var images = el.contentDocument.querySelectorAll("img");
+ for (var i = 0; i < images.length; i++) {
+ if (el_has_mediakey(images[i], mediakey))
+ return true;
+ }
+ } catch (e) {
+ console_error(e, el);
+ return false;
+ }
+ }
+
+ return false;
+ };
+
+ var try_finding_postid_from_url = function(url) {
+ if (!options.document)
+ return null;
+
+ var mediakey = find_mediakey_from_url(url);
+ if (!mediakey)
+ return null;
+
+ // use api_cache because this has the chance of being relatively cpu-intensive
+ // don't use fetch because this is synchronous
+ var cache_key = "tumblr_url_postid:" + mediakey;
+ if (api_cache.has(cache_key)) {
+ return api_cache.get(cache_key);
+ }
+
+ var els = options.document.querySelectorAll("article img, article iframe");
+ for (var i = 0; i < els.length; i++) {
+ // todo: get_el_mediakeys.indexOf(mediakey) >= 0, then set cache for all the media keys for performance
+ if (el_has_mediakey(els[i], mediakey)) {
+ var postid = find_postid_from_el(els[i]);
+ if (postid) {
+ api_cache.set(cache_key, postid);
+ }
+
+ return postid;
+ }
+ }
+
+ return null;
+ }
+
var try_finding_info = function() {
var info = find_blogname_id_from_url(options.host_url);
if (info)
@@ -11633,15 +11704,14 @@ var $$IMU_EXPORT$$;
blogname: blogname
};
- var currentel = options.element;
- while ((currentel = currentel.parentElement)) {
- if (currentel.tagName === "ARTICLE") {
- var id = currentel.getAttribute("id");
- if (id) {
- obj.postid = id;
- return obj;
- }
+ var postid = find_postid_from_el(options.element);
+ if (!postid) {
+ postid = try_finding_postid_from_url(src);
}
+
+ if (postid) {
+ obj.postid = postid;
+ return obj;
}
} else if (host_domain_nowww === "tumblr.com") {
// Tumblr homepage
| 7 |
diff --git a/assets/js/googlesitekit/widgets/components/WidgetNull.js b/assets/js/googlesitekit/widgets/components/WidgetNull.js @@ -29,7 +29,7 @@ import Null from '../../../components/Null';
// The supported props must match `Null` (except `widgetSlug`).
export default function WidgetNull( { widgetSlug } ) {
- useWidgetStateEffect( widgetSlug, Null, {} );
+ useWidgetStateEffect( widgetSlug, Null );
return <Null />;
}
| 2 |
diff --git a/common/state.js b/common/state.js -const STATIC_ADDRESS_TYPE_MAP = {
- bls: "BLS",
- secp256k1: "SECP256K1",
- multisig: "MULTISIG",
-};
-
-const transformAddresses = (addrsList, info) => {
- const balanceMap = {};
- info.balancesList.forEach((b) => {
- balanceMap[b.addr.addr] = b.balance;
- });
-
- return addrsList.map((each, index) => {
- return {
- id: each.addr,
- value: each.addr,
- balance: balanceMap[each.addr],
- name: each.name,
- address: each.addr,
- type: STATIC_ADDRESS_TYPE_MAP[each.type],
- deals: 0,
- transactions: [],
- };
- });
-};
-
-const transformPeers = (peersList = []) => {
- return peersList.map((each) => {
- return {
- id: each.addrInfo.id,
- "peer-avatar": null,
- "chain-head": null,
- height: null,
- location: null,
- upload: null,
- download: null,
- };
- });
-};
-
export const getInitialState = (props) => {
if (!props) {
return null;
@@ -45,63 +5,3 @@ export const getInitialState = (props) => {
return { ...props };
};
-
-export const _deprecated_getInitialState = (props) => {
- if (!props) {
- return null;
- }
-
- const {
- id,
- status,
- stats,
- messageList,
- peersList,
- addrsList,
- info,
- library,
- data,
- settings,
- username,
- storageList,
- retrievalList,
- slates,
- keys,
- } = props;
-
- return {
- id,
- username,
- data,
-
- // NOTE(jim): Local settings
- settings_deals_auto_approve: settings.deals_auto_approve,
-
- // NOTE(jim): Powergate Hot Settings
- settings_hot_enabled: info.defaultStorageConfig.hot.enabled,
- settings_hot_allow_unfreeze: info.defaultStorageConfig.hot.allowUnfreeze,
- settings_hot_ipfs_add_timeout: info.defaultStorageConfig.hot.ipfs.addTimeout,
-
- // NOTE(jim): Powergate Cold Settings
- settings_cold_enabled: info.defaultStorageConfig.cold.enabled,
- settings_cold_default_address: info.defaultStorageConfig.cold.filecoin.addr,
- settings_cold_default_duration: info.defaultStorageConfig.cold.filecoin.dealMinDuration,
- settings_cold_default_replication_factor: info.defaultStorageConfig.cold.filecoin.repFactor,
- settings_cold_default_excluded_miners:
- info.defaultStorageConfig.cold.filecoin.excludedMinersList,
- settings_cold_default_trusted_miners: info.defaultStorageConfig.cold.filecoin.trustedMinersList,
- settings_cold_default_max_price: info.defaultStorageConfig.cold.filecoin.maxPrice,
- settings_cold_default_auto_renew: info.defaultStorageConfig.cold.filecoin.renew.enabled,
- settings_cold_default_auto_renew_max_price:
- info.defaultStorageConfig.cold.filecoin.renew.threshold,
-
- storageList,
- retrievalList,
- slates,
- keys,
- stats,
- library,
- peers: transformPeers(peersList),
- addresses: transformAddresses(addrsList, info),
- };
-};
| 2 |
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js */
var RevealNotes = (function() {
+ var notesPopup = null;
+
function openNotes( notesFilePath ) {
+ if (notesPopup && !notesPopup.closed) {
+ notesPopup.focus();
+ return;
+ }
+
if( !notesFilePath ) {
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
notesFilePath = jsFileLocation + 'notes.html';
}
- var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
+ notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
if( !notesPopup ) {
alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' );
| 9 |
diff --git a/packages/laconia-core/src/handler.js b/packages/laconia-core/src/handler.js -module.exports = handler => (event, context, callback) => {
+module.exports = fn => (event, context, callback) => {
const laconiaContext = { event, context };
return Promise.resolve()
- .then(_ => handler(laconiaContext))
+ .then(_ => fn(laconiaContext))
.then(result => callback(null, result))
.catch(err => callback(err));
};
| 10 |
diff --git a/packages/app-project/src/shared/components/SubjectSetPicker/components/SubjectSetCard/SubjectSetCard.js b/packages/app-project/src/shared/components/SubjectSetPicker/components/SubjectSetCard/SubjectSetCard.js @@ -17,7 +17,7 @@ const PossiblyTransparentBox = styled(Box)`
Summary card for a subject set, showing a preview subject, the set name, total subject count and completeness percentage.
*/
function SubjectSetCard ({
- completeness,
+ completeness = 0,
display_name,
id,
set_member_subjects_count,
| 12 |
diff --git a/lib/client.js b/lib/client.js @@ -501,13 +501,16 @@ Request.prototype.accept = function(type){
* Set Authorization field value with `user` and `pass`.
*
* @param {String} user
- * @param {String} pass
- * @param {Object} options with 'type' property 'auto' or 'basic' (default 'basic')
+ * @param {String} [pass] optional in case of using 'bearer' as type
+ * @param {Object} options with 'type' property 'auto', 'basic' or 'bearer' (default 'basic')
* @return {Request} for chaining
* @api public
*/
Request.prototype.auth = function(user, pass, options){
+ if (typeof pass === 'object' && pass !== null) { // pass is optional and can substitute for options
+ options = pass;
+ }
if (!options) {
options = {
type: 'function' === typeof btoa ? 'basic' : 'auto',
@@ -523,6 +526,10 @@ Request.prototype.auth = function(user, pass, options){
this.username = user;
this.password = pass;
break;
+
+ case 'bearer': // usage would be .auth(accessToken, { type: 'bearer' })
+ this.set('Authorization', 'Bearer ' + user);
+ break;
}
return this;
};
| 0 |
diff --git a/README.md b/README.md @@ -81,7 +81,7 @@ Finally, existing bundlers are built around string loaders/transforms, where the
`parcel` transforms a tree of assets to a tree of bundles. Many other bundlers are fundamentally based around JavaScript assets, with other formats tacked on - for example, by default inlined as strings into JS files. `parcel` is file-type agnostic - it will work with any type of assets the way you'd expect, with no configuration.
-`parcel` takes as input a single entry asset, which could be any type: a JS file, HTML, CSS, image, etc. There are various asset types defined in `parcel` which know how to handle specific file types. The assets are parsed, their dependencies are extracted, and they are transformed to their final compiled form. This creates a tree of assets.
+`parcel` takes as input a single entry asset, which could be any file type: JS, HTML, CSS, image, etc. There are various asset types defined in `parcel` which know how to handle specific file types. The assets are parsed, their dependencies are extracted, and they are transformed to their final compiled form. This creates a tree of assets.
Once the asset tree has been constructed, the assets are placed into a bundle tree. A bundle is created for the entry asset, and child bundles are created for dynamic imports, which cause code splitting to occur. Child bundles are also created when assets of a different type are imported, for example if you imported a CSS file from JavaScript, it would be placed into a sibling bundle to the corresponding JavaScript. If an asset is required in more than one bundle, it is hoisted up to the nearest common ancestor in the bundle tree so it is not included more than once.
| 1 |
diff --git a/src/middleware/packages/activitypub/services/object.js b/src/middleware/packages/activitypub/services/object.js const DbService = require('moleculer-db');
+const urlJoin = require('url-join');
const { TripleStoreAdapter } = require('@semapps/ldp');
+const { OBJECT_TYPES } = require('../constants');
const ObjectService = {
name: 'activitypub.object',
@@ -11,13 +13,30 @@ const ObjectService = {
context: 'https://www.w3.org/ns/activitystreams'
},
actions: {
+ async create(ctx) {
+ // If there is already a tombstone in the desired URI,
+ // remove it first to avoid automatic incrementation of the slug
+ if (ctx.params.slug) {
+ const desiredUri = urlJoin(this.settings.containerUri, ctx.params.slug);
+ let object;
+ try {
+ object = await this.getById(desiredUri);
+ } catch (e) {
+ // Do nothing if object is not found
+ }
+ if (object && object.type === OBJECT_TYPES.TOMBSTONE) {
+ await this._remove(ctx, { id: desiredUri });
+ }
+ }
+ return await this._create(ctx, ctx.params);
+ },
async remove(ctx) {
// TODO use PUT method when it will be available instead of DELETE+POST
await this._remove(ctx, { id: ctx.params.id });
const tombstone = {
'@context': this.settings.context,
- type: 'Tombstone',
+ type: OBJECT_TYPES.TOMBSTONE,
slug: ctx.params.id.match(new RegExp(`.*/(.*)`))[1],
deleted: new Date().toISOString()
};
| 9 |
diff --git a/apps/golfview/index.html b/apps/golfview/index.html <body>
<p id="status">No course</p>
- <button id="upload" class="btn btn-primary" disabled="true">Upload</button>
+ <div>
+ <button id="upload" class="btn btn-primary" disabled="true">Upload to Device</button>
+ <button id="download" class="btn btn-primary" disabled="true">Download Course</button>
+ </div>
<script src="../../core/lib/customize.js"></script>
<script src="./maptools.js"></script>
}
// if we find a feature add it to the corresponding hole
- if (/(green)|(bunker)|(tee)|(teebox)|(fairway)|(water_hazard)/.test(element.tags.golf)) { //TODO missing cartpath
+ if (/(green)|(bunker)|(tee)|(teebox)|(fairway)|(water_hazard)/.test(element.tags.golf)) {
let nodes = []
for (const node_id of element.nodes) {
nodes.push(findNodeCoordinates(course_verbose, node_id));
return course_processed;
}
- function preprocessCoords(course_input) { //todo posibly remove other coordinates for ~0.5 size reduction
+ function preprocessCoords(course_input) {
// first do the high-level way
for (var hole in course_input.holes) {
course_input.holes[hole].nodesXY = arraytoXY(course_input.holes[hole].nodes, course_input.holes[hole].nodes[0])
// then do the shapes in the features
for (var feature in course_input.holes[hole].features) {
many_points = arraytoXY(course_input.holes[hole].features[feature].nodes, course_input.holes[hole].nodes[0]);
- less_points = simplify(many_points, 3, true); // from simplify-js
+ less_points = simplify(many_points, 2, true); // from simplify-js
// convert to int to save some memory
course_input.holes[hole].features[feature].nodesXY = less_points.map(function (pt) {
return { x: Math.round(pt.x), y: Math.round(pt.y) }
delete course_input.holes[hole].features[feature].nodes; // delete coords because they take up a lot of memory
}
- // find out how the hole is angled
course_input.holes[hole].angle = angle(course_input.holes[hole].nodesXY[0], course_input.holes[hole].nodesXY[course_input.holes[hole].nodesXY.length - 1])
}
return course_input;
}
+ $("#upload").click(function () {
+ sendCustomizedApp({
+ storage: courses
+ });
+ });
+
+ $("#download").click(function () {
+ downloadObjectAsJSON(out.holes, "course_data");
+ });
+
var out = {};
// download info from the course
$.post(url, query, function (result) {
console.log(out);
$('#status').text("Course retrieved!");
$('#upload').attr("disabled", false);
+ $('#download').attr("disabled", false);
})
- // When the 'upload' button is clicked...
- document.getElementById("upload").addEventListener("click", function () {
- downloadObjectAsJSON(out.holes, "course_data");
- sendCustomizedApp({
- storage: courses
- });
- });
-
</script>
</body>
| 4 |
diff --git a/src/components/accordion/_accordion.scss b/src/components/accordion/_accordion.scss cursor: pointer;
-webkit-appearance: none;
+ @include govuk-not-ie8 {
+ // Ensure the default focus styles are not shown for buttons
+ &:focus {
+ outline: none;
+ background: none;
+ }
+ }
+
@include govuk-if-ie8 {
&:focus {
color: $govuk-text-colour;
| 9 |
diff --git a/server/caas/registration/api.js b/server/caas/registration/api.js @@ -44,7 +44,7 @@ module.exports = function(app/*, options*/) {
});
});
}
- });
+ }, res);
});
@@ -388,7 +388,8 @@ module.exports = function(app/*, options*/) {
}
- function checkExistingAccount(email, cb) {
+ function checkExistingAccount(email, cb, res) {
+ var ogRes = res || null;
return newRequest({
url: `${rancherApiUrl}/passwords?publicValue=${email}`,
method: 'GET',
@@ -398,7 +399,7 @@ module.exports = function(app/*, options*/) {
} else {
return cb(false);
}
- }, null);
+ }, ogRes);
}
function isPasswordActive(accountId, cb) {
| 1 |
diff --git a/outbound/hmail.js b/outbound/hmail.js @@ -1038,12 +1038,12 @@ class HMailItem extends events.EventEmitter {
"\r": '#10',
"\n": '#13'
};
- const escape_pattern = new RegExp('[' + Object.keys(escaped_chars).join() + ']', 'g');
+ const escape_pattern = new RegExp(`[${Object.keys(escaped_chars).join()}]`, 'g');
bounce_msg_html_.forEach(line => {
line = line.replace(/\{(\w+)\}/g, (i, word) => {
if (word in values) {
- return String(values[word]).replace(escape_pattern, m => '&' + escaped_chars[m] + ';');
+ return String(values[word]).replace(escape_pattern, m => `&${escaped_chars[m]};`);
}
else {
return '?';
| 14 |
diff --git a/app/models/carto/api_key.rb b/app/models/carto/api_key.rb @@ -108,9 +108,9 @@ module Carto
REDIS_KEY_PREFIX = 'api_keys:'.freeze
def process_granted_apis
- apis = grants.find { |v| v[:type] == 'apis' }[:apis]
+ apis = grants.find { |v| v[:type] == 'apis' }
raise UnprocesableEntityError.new('apis array is needed for type "apis"') unless apis
- apis
+ apis[:apis] || []
end
def process_table_permissions
@@ -122,7 +122,7 @@ module Carto
databases[:tables].each do |table|
table_id = "#{table[:schema]}.#{table[:name]}"
table_permissions[table_id] ||= Carto::TablePermissions.new(schema: table[:schema], name: table[:name])
- table_permissions[table_id].merge!(table[:permissions])
+ table_permissions[table_id].merge!(table[:permissions]) if table[:permissions]
end
table_permissions
| 9 |
diff --git a/src/plots/plots.js b/src/plots/plots.js @@ -1960,7 +1960,19 @@ plots.doAutoMargin = function(gd) {
} else {
fullLayout._redrawFromAutoMarginCount = 1;
}
+
+ // Always allow at least one redraw and give each margin-push
+ // call 3 loops to converge. Of course, for most cases this way too many,
+ // but let's keep things on the safe side until we fix our
+ // auto-margin pipeline problems:
+ // https://github.com/plotly/plotly.js/issues/2704
+ var maxNumberOfRedraws = 3 * (1 + Object.keys(pushMarginIds).length);
+
+ if(fullLayout._redrawFromAutoMarginCount < maxNumberOfRedraws) {
return Registry.call('plot', gd);
+ } else {
+ Lib.warn('Too many auto-margin redraws.');
+ }
}
};
| 0 |
diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php @@ -1115,7 +1115,7 @@ App::post('/v1/database/collections/:collectionId/documents')
$usage
->setParam('database.documents.create', 1)
- ->setParam('database.collections.' . $collectionId . '.documents.create', 1)
+ ->setParam('collectionId', $collectionId)
;
$audits
@@ -1188,7 +1188,7 @@ App::get('/v1/database/collections/:collectionId/documents')
$usage
->setParam('database.documents.read', 1)
- ->setParam('database.collections.' . $collectionId . '.documents.read', 1)
+ ->setParam('collectionId', $collectionId)
;
$response->dynamic(new Document([
@@ -1231,7 +1231,7 @@ App::get('/v1/database/collections/:collectionId/documents/:documentId')
$usage
->setParam('database.documents.read', 1)
- ->setParam('database.collections.' . $collectionId . '.documents.read', 1)
+ ->setParam('collectionId', $collectionId)
;
$response->dynamic($document, Response::MODEL_DOCUMENT);
@@ -1303,7 +1303,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId')
$usage
->setParam('database.documents.update', 1)
- ->setParam('database.collections.' . $collectionId . '.documents.update', 1)
+ ->setParam('collectionId', $collectionId)
;
$audits
@@ -1356,7 +1356,7 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId')
$usage
->setParam('database.documents.delete', 1)
- ->setParam('database.collections.' . $collectionId . '.documents.delete', 1)
+ ->setParam('collectionId', $collectionId)
;
$events
| 12 |
diff --git a/lib/dependencies/HarmonyDetectionParserPlugin.js b/lib/dependencies/HarmonyDetectionParserPlugin.js @@ -13,9 +13,11 @@ module.exports = class HarmonyDetectionParserPlugin {
const isStrictHarmony = parser.state.module.type === "javascript/esm";
const isHarmony =
isStrictHarmony ||
- ast.body.some(statement => {
- return /^(Import|Export).*Declaration$/.test(statement.type);
- });
+ ast.body.some(statement => statement =>
+ statement.type === "ImportDeclaration" ||
+ statement.type === "ExportDefaultDeclaration" ||
+ statement.type === "ExportNamedDeclaration"
+ );
if (isHarmony) {
const module = parser.state.module;
const compatDep = new HarmonyCompatibilityDependency(module);
| 4 |
diff --git a/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.component.ts b/generators/client/templates/angular/src/main/webapp/app/admin/user-management/_user-management.component.ts @@ -129,17 +129,9 @@ export class UserMgmtComponent implements OnInit, OnDestroy {
<%_ } _%>
private onSuccess(data, headers) {
- // hide anonymous user from user management: it's a required user for Spring Security
- let hiddenUsersSize = 0;
- for (let i in data) {
- if (data[i]['login'] === 'anonymoususer') {
- data.splice(i, 1);
- hiddenUsersSize++;
- }
- }
<%_ if (databaseType !== 'cassandra') { _%>
this.links = this.parseLinks.parse(headers.get('link'));
- this.totalItems = headers.get('X-Total-Count') - hiddenUsersSize;
+ this.totalItems = headers.get('X-Total-Count');
this.queryCount = this.totalItems;
<%_ } _%>
this.users = data;
| 2 |
diff --git a/src/client/js/components/Admin/ImportData/GrowiZipImportItem.jsx b/src/client/js/components/Admin/ImportData/GrowiZipImportItem.jsx @@ -114,7 +114,7 @@ export default class GrowiZipImportItem extends React.Component {
{ ['insert', 'upsert', 'flushAndInsert'].map((mode) => {
return (
<li key={`buttonMode_${mode}`}>
- <a href="#" onClick={() => this.modeSelectedHandler(mode)}>
+ <a type="button" role="button" onClick={() => this.modeSelectedHandler(mode)}>
{this.renderModeLabel(mode, true)}
</a>
</li>
| 7 |
diff --git a/src/lib.js b/src/lib.js @@ -1040,7 +1040,10 @@ module.exports = {
pet.rarity = pet.tier.toLowerCase();
pet.level = getPetLevel(pet);
- const petData = constants.pet_data[pet.type]
+ const petData = constants.pet_data[pet.type];
+
+ if(!petData)
+ continue;
pet.texture_path = petData.head;
| 8 |
diff --git a/packages/vue-cli-plugin-hbuilderx/module-alias.js b/packages/vue-cli-plugin-hbuilderx/module-alias.js @@ -17,6 +17,8 @@ moduleAlias.addAlias('@vue/component-compiler-utils/package.json', require.resol
'@dcloudio/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/package.json'))
if (isInHBuilderX) {
+ moduleAlias.addAlias('typescript', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
+ 'compile-typescript/node_modules/typescript'))
moduleAlias.addAlias('less', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
'compile-less/node_modules/less'))
moduleAlias.addAlias('node-sass', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
| 13 |
diff --git a/token-metadata/0xE5Dada80Aa6477e85d09747f2842f7993D0Df71C/metadata.json b/token-metadata/0xE5Dada80Aa6477e85d09747f2842f7993D0Df71C/metadata.json "symbol": "DOCK",
"address": "0xE5Dada80Aa6477e85d09747f2842f7993D0Df71C",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/src/compiler/test-file/formats/typescript/compiler.js b/src/compiler/test-file/formats/typescript/compiler.js @@ -21,7 +21,8 @@ export default class TypeScriptTestFileCompiler extends APIBasedTestFileCompiler
lib: ['lib.es6.d.ts'],
baseUrl: __dirname,
paths: { testcafe: ['../../../../../ts-defs/index.d.ts'] },
- suppressOutputPathCheck: true
+ suppressOutputPathCheck: true,
+ skipLibCheck: true
};
}
| 0 |
diff --git a/assets/scss/main.scss b/assets/scss/main.scss @@ -241,7 +241,8 @@ body {
p, ul, ol, pre, hr, figure { margin: 20px auto; }
img {
border-radius: 2px;
- box-shadow: 0 0 30px transparentize(black, .9);
+ filter: drop-shadow(0 0 10px transparentize(black, 0.9));
+ -webkit-filter: drop-shadow(0 0 10px transparentize(black, 0.9));
max-width: 100%;
}
a { color: #158fdc; }
| 7 |
diff --git a/lib/global-admin/addon/security/roles/index/controller.js b/lib/global-admin/addon/security/roles/index/controller.js @@ -46,10 +46,6 @@ export default Controller.extend({
headers: null,
showOnlyDefaults: false,
- _showOnlyDefaults: observer('showOnlyDefaults', function() {
- this.send('changeView', get(this, 'context'));
- }),
-
readableMode: computed('context', function() {
return get(this, 'context').capitalize();
}),
@@ -68,7 +64,7 @@ export default Controller.extend({
return get(this, 'model.roleTemplates').filter( (role ) => !get(role, 'hidden') && (get(role, 'context') !== 'project') || !role.hasOwnProperty('context'));
}),
- filteredContent: computed('context', 'model.roleTemplates.@each.{name,state,transitioning}', function() {
+ filteredContent: computed('context', 'model.roleTemplates.@each.{name,state,transitioning}', 'showOnlyDefaults', function() {
let content = null;
const { context, showOnlyDefaults } = this;
let headers = [...HEADERS];
@@ -118,6 +114,6 @@ export default Controller.extend({
})
- return content.filter((row) => C.ACTIVEISH_STATES.includes(row.state));
+ return content.filter((row) => C.ACTIVEISH_STATES.includes(row.state) || row.type === 'globalRole');
}),
});
| 2 |
diff --git a/.circleci/config.yml b/.circleci/config.yml @@ -209,6 +209,7 @@ jobs:
- image: circleci/node:10.15.3-browsers
# Secondary container image on common network which runs the testnet
- image: lunieio/testnet:v0.34.3
+ working_directory: *WORKSPACE
steps:
- run:
name: Avoid hosts unknown for github
| 12 |
diff --git a/README.md b/README.md @@ -144,10 +144,10 @@ Name |type | Reason
------------------|-----------------|-------------------
`unslick` | method | same functionality can be achieved with `unslick` prop
`slickSetOption` | method | same functionality can be achieved via props and managing state for them in wrapper
-`slickFilter` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides example
-`slickUnfilter` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides example
-`slickAdd` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides example
-`slickRemove` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides example
+`slickFilter` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides [example](https://github.com/akiran/react-slick/blob/master/examples/DynamicSlides.js)
+`slickUnfilter` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides [example](https://github.com/akiran/react-slick/blob/master/examples/DynamicSlides.js)
+`slickAdd` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides [example](https://github.com/akiran/react-slick/blob/master/examples/DynamicSlides.js)
+`slickRemove` | method | same functionality can be achieved as with dynamic slides, look at dynamic slides [example](https://github.com/akiran/react-slick/blob/master/examples/DynamicSlides.js)
`slickCurrentSlide`| method | same functionality can be achieved with `beforeChange hook`
`slickGetOption` | method | manage wrapper state for desired options
`getSlick` | method | a simple ref will do
| 0 |
diff --git a/src/blockchain/Managers.js b/src/blockchain/Managers.js @@ -198,6 +198,7 @@ class Managers {
// we make the assumption that if there is a plugin, then the project is a milestone, otherwise it is a campaign
return this.liquidPledging.getNoteManager(projectId)
.then(project => {
+ console.log(project);
return (project.plugin !== '0x0000000000000000000000000000000000000000') ? this._addMilestone(project, projectId, txHash) : this._addCampaign(project, projectId, txHash);
});
}
@@ -274,7 +275,7 @@ class Managers {
reviewerAddress: reviewer,
recipientAddress: recipient,
title: project.name,
- ownerAddress: recipient, //TODO remove this?
+ pluginAddress: project.plugin,
accepted: false,
canceled: false,
}))
| 12 |
diff --git a/token-metadata/0xf67041758D3B6e56D6fDafA5B32038302C3634DA/metadata.json b/token-metadata/0xf67041758D3B6e56D6fDafA5B32038302C3634DA/metadata.json "symbol": "TST",
"address": "0xf67041758D3B6e56D6fDafA5B32038302C3634DA",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/src/Router.svelte b/src/Router.svelte import Route from "./Route.svelte";
import init from "./navigator.js";
import { routes } from "generatedRoutes.js";
+ export let scoped
let components, route;
init(routes, update => ({ components, route } = update));
</script>
-<Route {components} {route} {routes} {url} />
+<Route {components} {route} {routes} {url} rootScope={scoped} />
| 11 |
diff --git a/scene.js b/scene.js @@ -302,7 +302,11 @@ class Scene {
this.globalState = glState;
// Transform
+ if (gltf.nodes[0].matrix) {
+ this.transform = mat4.clone(gltf.nodes[0].matrix);
+ } else {
this.transform = mat4.create();
+ }
var scale = gltf.nodes[0].scale;
var translate = gltf.nodes[0].translation;
if (scale) {
| 4 |
diff --git a/package.json b/package.json "react-dom": "^16.6.0",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
+ "redux-devtools-extension": "^2.13.2",
"request": "^2.88.0",
"sass-loader": "^7.1.0",
"status-indicator": "^1.0.9",
"postcss-nested": "^4.1.0",
"postcss-pxtorem": "^4.0.1",
"react-json-view": "^1.19.1",
- "redux-devtools-extension": "^2.13.2",
"style-loader": "^0.23.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
| 5 |
diff --git a/packages/create-snowpack-app/README.md b/packages/create-snowpack-app/README.md @@ -22,6 +22,7 @@ npx create-snowpack-app new-dir --template @snowpack/app-template-NAME [--use-ya
- [11st-Starter-Kit](https://github.com/stefanfrede/11st-starter-kit) (11ty +
Snowpack + tailwindcss)
- [app-template-reason-react](https://github.com/jihchi/app-template-reason-react) (ReasonML (BuckleScript) & reason-react on top of [@snowpack/app-template-react](/templates/app-template-react))
+- [svelte-tailwind](https://github.com/agneym/svelte-tailwind-snowpack) (Adds PostCSS and TailwindCSS using [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess))
- PRs that add a link to this list are welcome!
## Official Snowpack Plugins
| 0 |
diff --git a/src/gml/GmlAPI.hx b/src/gml/GmlAPI.hx @@ -7,6 +7,7 @@ import tools.Dictionary;
import ace.AceWrap;
import tools.NativeString;
using tools.ERegTools;
+using StringTools;
/**
* ...
@@ -32,6 +33,7 @@ class GmlAPI {
//
public static var helpLookup:Dictionary<String> = null;
public static var helpURL:String = null;
+ public static var ukSpelling:Bool = false;
//
public static var stdDoc:Dictionary<GmlFuncDoc> = new Dictionary();
public static var stdComp:AceAutoCompleteItems = [];
@@ -84,6 +86,10 @@ class GmlAPI {
var args = rx.matched(3);
var kind = rx.matched(4);
//
+ if (!ukSpelling && version != GmlVersion.v2) {
+ name = NativeString.replace(name, "colour", "color");
+ }
+ //
stdKind.set(name, "function");
stdComp.push({
name: name,
@@ -152,6 +158,7 @@ class GmlAPI {
var confPath = Main.relPath(dir + "/config.json");
if (FileSystem.existsSync(confPath)) {
var conf:GmlConfig = FileSystem.readJsonFileSync(confPath);
+ ukSpelling = conf.ukSpelling;
//
var confKeywords = conf.keywords;
if (confKeywords != null) for (kw in confKeywords) {
@@ -211,6 +218,8 @@ typedef GmlConfig = {
?helpIndex:String,
/** Additional keywords (if any) */
?keywords:Array<String>,
+ /** Whether to use UK spelling for names */
+ ?ukSpelling:Bool,
};
typedef GmlFuncDoc = {
pre:String, post:String, args:Array<String>, rest:Bool
| 14 |
diff --git a/articles/appliance/monitoring/index.md b/articles/appliance/monitoring/index.md @@ -11,6 +11,7 @@ In addition to providing tools for monitoring your PSaaS Appliance, Auth0 provid
Your options include:
* **Instrumentation**: If [Instrumentation](/appliance/instrumentation) has been enabled for your PSaaS Appliance instances, you can gather and visualize data about your infrastructure and processes
+ * If you've enabled Instrumentation, you can send your data to DataDog. You'll need to supply your DataDog API key in the configuration page to do this. When viewing your metrics in DataDog, it will *not* appear in the standard DataDog UI under Infrastructure. You'll need to add your own dashboard and search for the PSaaS Appliance data you want displayed.
* **Health Checks**: [Health Checks](/appliance/dashboard/troubleshoot#health-check) provide minute-by-minute summaries of your PSaaS Appliance infrastructure at a given point in time. These logs are available for the the previous twenty-nine days and can be found in the [Troubleshoot](/appliance/dashboard/troubleshoot) page of your PSaaS Appliance Configuration Area;
* **[Auth0's `testall` Endpoint](/appliance/monitoring/testall)**: The `testall` endpoint is an unauthenticated endpoint that is particularly useful for monitoring by load balancers;
* **[Auth0's Authenticated Testing Endpoints](/appliance/monitoring/authenticated-endpoints)**: Auth0 provides endpoints that you may, once authenticated, call to receive status codes such as *204*, *520*, or *429*;
| 0 |
diff --git a/token-metadata/0xEBBdf302c940c6bfd49C6b165f457fdb324649bc/metadata.json b/token-metadata/0xEBBdf302c940c6bfd49C6b165f457fdb324649bc/metadata.json "symbol": "HYDRO",
"address": "0xEBBdf302c940c6bfd49C6b165f457fdb324649bc",
"decimals": 18,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/source/datastore/store/Store.js b/source/datastore/store/Store.js @@ -353,8 +353,9 @@ const Store = Class({
addAccount ( accountId, data ) {
const _accounts = this._accounts;
- if ( !_accounts[ accountId ] ) {
- _accounts[ accountId ] = {
+ let account = _accounts[ accountId ];
+ if ( !account ) {
+ account = {
isDefault: data.isDefault,
// Transform [ ...uri ] into { ...uri: true } for fast access
hasDataFor: data.hasDataFor.reduce( ( obj, uri ) => (
@@ -375,17 +376,17 @@ const Store = Class({
typeToIdToSK: {},
};
}
- if ( accountId && data.isDefault ) {
+ if ( data.isDefault ) {
this._defaultAccountId = accountId;
this._nestedStores.forEach( store => {
store._defaultAccountId = accountId;
});
- if ( _accounts[ '' ] ) {
- _accounts[ accountId ].typeToIdToSK =
- _accounts[ '' ].typeToIdToSK;
+ if ( accountId && _accounts[ '' ] ) {
+ account.typeToIdToSK = _accounts[ '' ].typeToIdToSK;
delete _accounts[ '' ];
}
}
+ _accounts[ accountId ] = account;
return this;
},
| 11 |
diff --git a/articles/users/search/v3/index.md b/articles/users/search/v3/index.md @@ -182,7 +182,6 @@ The user search engine v2 has been deprecated as of **June 6th 2018** and will b
* User fields are not tokenized like in v2, so `user_id:auth0` will not match a `user_id` with value `auth0|12345`, instead, use `user_id:auth0*`. See [wildcards](/users/search/v3/query-syntax#wildcards) and [exact matching](/users/search/v3/query-syntax#exact-match).
* Wildcards can be used for prefix matching, for example `name:j*`. For other uses of wildcards (e.g. suffix matching), literals must have 3 characters or more. For example, `name:*usa` is allowed, but `name:*sa` is not.
* The `.raw` field extension is no longer supported and must be removed. In v3, fields match the whole value that is provided and are not tokenized as they were in v2 without the `.raw` suffix.
-* The `_missing_` filter is not supported, consider using `NOT _exists_:...` instead.
### Queries to migrate
| 2 |
diff --git a/main.go b/main.go @@ -2,9 +2,9 @@ package main
import (
"github.com/gorilla/handlers"
+ "github.com/reportportal/commons-go/commons"
"github.com/reportportal/commons-go/conf"
"github.com/reportportal/commons-go/server"
- "github.com/reportportal/commons-go/commons"
"goji.io"
"goji.io/pat"
"log"
@@ -30,9 +30,6 @@ func main() {
srv := server.New(rpConf, info)
srv.AddRoute(func(router *goji.Mux) {
- router.Use(func(next http.Handler) http.Handler {
- return handlers.LoggingHandler(os.Stdout, next)
- })
router.Use(func(next http.Handler) http.Handler {
return handlers.CompressHandler(next)
})
@@ -47,6 +44,10 @@ func main() {
return handlers.LoggingHandler(os.Stdout, next)
})
+ router.Use(func(next http.Handler) http.Handler {
+ return handlers.LoggingHandler(os.Stdout, next)
+ })
+
router.Handle(pat.Get("/*"), http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
//trim query params
ext := filepath.Ext(trimQuery(r.URL.String(), "?"))
@@ -56,7 +57,7 @@ func main() {
w.Header().Add("Cache-Control", "no-cache")
}
- http.FileServer(http.Dir(dir)).ServeHTTP(w, r)
+ http.FileServer(http.Dir(dir)).ServeHTTP(&redirectingRW{ResponseWriter: w, Request: r}, r)
}))
})
@@ -72,3 +73,30 @@ func trimQuery(s string, sep string) string {
}
return s
}
+
+type redirectingRW struct {
+ *http.Request
+ http.ResponseWriter
+ ignore bool
+}
+
+func (hrw *redirectingRW) Header() http.Header {
+ return hrw.ResponseWriter.Header()
+}
+
+func (hrw *redirectingRW) WriteHeader(status int) {
+ if status == 404 {
+ hrw.ignore = true
+ http.Redirect(hrw.ResponseWriter, hrw.Request, "/ui/404.html", http.StatusTemporaryRedirect)
+ } else {
+ hrw.ResponseWriter.WriteHeader(status)
+ }
+
+}
+
+func (hrw *redirectingRW) Write(p []byte) (int, error) {
+ if hrw.ignore {
+ return len(p), nil
+ }
+ return hrw.ResponseWriter.Write(p)
+}
| 9 |
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml @@ -21,7 +21,7 @@ jobs:
- name: Build Relay
working-directory: ./relay
run: |
- npm install && npm run build && docker build -t sphinxlightning/sphinx-relay-test .
+ npm install && npm run build && docker build -t sphinxlightning/sphinx-relay .
- name: Checkout stack
run: |
git clone https://github.com/stakwork/sphinx-stack.git stack
| 3 |
diff --git a/src/mode/fdm/prepare.js b/src/mode/fdm/prepare.js layerout.appendAll(tmpout);
lastOut = slice;
lastExt = lastOut.ext
- if (layerRetract) {
+ if (layerRetract && layerout.length) {
layerout.last().retract = true;
}
}
| 1 |
diff --git a/_includes/landscape/mesh-timeline.html b/_includes/landscape/mesh-timeline.html height: 1880px;
}
.up-arrow {
- left: 48.2%;
+ left: 47.7%;
position: relative;
bottom: 23px;
border-left: 25px solid transparent;
position: absolute;
width: 25px;
height: 25px;
- right: -22px;
+ right: -18px;
background-color: white;
border: 4px solid #FF9F55;
top: 15px;
/* Fix the circle for data-conts on the right side */
.arr0::after {
- left: -19px;
+ left: -23px;
}
/* The actual content */
font-size: 20px;
}
+ @media screen and (max-width: 1450px) {
+ .arr0::after {
+ left: -19px;
+ }
+
+ .data-cont::after {
+ right: -22px;
+ }
+
+ .up-arrow {
+ left: 48.2%;
+ }
+ }
@media screen and (max-width: 1300px) and (min-width: 1250px) {
.arr1 {
left: 15%;
}
@media screen and (max-width: 1049px) and (min-width: 1000px) {
+
+ .data-cont::after {
+ right: -19px;
+ }
+
+ .arr0::after {
+ left: -22px;
+ }
+
.arr1 {
- left: 5%;
+ left: 6.2%;
}
/* Place the data-cont to the right */
.arr0 {
- left: 6%;
+ left: 7.5%;
+ }
+
+ .up-arrow {
+ left: 47.6%;;
}
}
}
.data-cont {
- width: 60%;
+ width: 70%;
height: 100px;
}
width: 15px;
height: 15px;
top: 25px;
- left: 28px;
+ left: 29px;
}
.arr0, .arr1 {
}
.mesh-name {
- font-size: 10px;
+ font-size: 15px;
}
.mesh-ann-date {
- font-size: 8px;
+ font-size: 10px;
}
.img-style0, .img-style1 {
- width: 25px;
- height: 20px;
+ width: 30px;
+ height: 25px;
}
.up-arrow {
border-bottom: 15px solid white;
}
}
+
+ @media screen and (max-width: 375px) {
+ .mesh-name {
+ font-size: 12px;
+ }
+
+ .mesh-ann-date {
+ font-size: 10px;
+ }
+
+ .data-cont::after {
+ left: 26px;
+ }
+ }
+
+ @media screen and (max-width: 320px) {
+ .mesh-name {
+ font-size: 9px;
+ }
+
+ .mesh-ann-date {
+ font-size: 9px;
+ }
+
+ .data-cont::after {
+ left: 22px;
+ }
+
+ .up-arrow {
+ left: 3%;
+ }
+ }
</style>
<span class="up-arrow"></span>
| 1 |
diff --git a/Source/Core/barycentricCoordinates.js b/Source/Core/barycentricCoordinates.js define([
'./Cartesian2',
'./Cartesian3',
- './defined',
- './DeveloperError'
+ './Check',
+ './defined'
], function(
Cartesian2,
Cartesian3,
- defined,
- DeveloperError) {
+ Check,
+ defined ) {
'use strict';
var scratchCartesian1 = new Cartesian3();
@@ -37,9 +37,10 @@ define([
*/
function barycentricCoordinates(point, p0, p1, p2, result) {
//>>includeStart('debug', pragmas.debug);
- if (!defined(point) || !defined(p0) || !defined(p1) || !defined(p2)) {
- throw new DeveloperError('point, p0, p1, and p2 are required.');
- }
+ Check.defined('point', point);
+ Check.defined('p0', p0);
+ Check.defined('p1', p1);
+ Check.defined('p2', p2);
//>>includeEnd('debug');
| 14 |
diff --git a/app/addons/databases/actions.js b/app/addons/databases/actions.js // the License.
import app from "../../app";
import FauxtonAPI from "../../core/api";
+import { get } from "../../core/ajax";
import Stores from "./stores";
import ActionTypes from "./actiontypes";
import Resources from "./resources";
@@ -26,17 +27,13 @@ function getDatabaseDetails (dbList, fullDbList) {
fetch(url)
.then((res) => {
databaseDetails.push(res);
- })
- .fail(() => {
+ }).catch(() => {
failedDbs.push(db);
- })
- .always(() => {
+ }).then(() => {
seen++;
-
if (seen !== dbList.length) {
return;
}
-
updateDatabases({
dbList: dbList,
databaseDetails: databaseDetails,
@@ -48,11 +45,10 @@ function getDatabaseDetails (dbList, fullDbList) {
}
function fetch (url) {
- return $.ajax({
- cache: false,
- url: url,
- dataType: 'json'
- }).then((res) => {
+ return get(url).then(res => {
+ if (res.error) {
+ throw new Error(res.reason || res.error);
+ }
return res;
});
}
@@ -189,20 +185,14 @@ export default {
});
const url = `${app.host}/_all_dbs${query}`;
- $.ajax({
- cache: false,
- url: url,
- dataType: 'json'
- }).then((dbs) => {
+ get(url).then((dbs) => {
const options = dbs.map(db => {
return {
value: db,
label: db
};
});
- callback(null, {
- options: options
- });
+ callback(null, { options: options });
});
}
};
| 2 |
diff --git a/src/query/panelComponent.html b/src/query/panelComponent.html data-toggle="tooltip"
title="{{'While active, click on the map multiple times to draw a polygon, which will issue a query using it' | translate}}"
class="btn btn-default"
- ng-class="{active: qpCtrl.ngeoQueryModeSelector.mode === 'drawpolygon'}"
- ng-click="qpCtrl.ngeoQueryModeSelector.mode = 'drawpolygon'"
+ ng-class="{active: $ctrl.ngeoQueryModeSelector.mode === 'drawpolygon'}"
+ ng-click="$ctrl.ngeoQueryModeSelector.mode = 'drawpolygon'"
>
<%=require('ngeo/icons/polygon.svg?viewbox&height=1em')%>
</button>
| 10 |
diff --git a/src/components/dashboard/FeedItems/EventCounterParty.js b/src/components/dashboard/FeedItems/EventCounterParty.js @@ -6,14 +6,10 @@ import { withStyles } from '../../../lib/styles'
const EventCounterParty = ({ feedItem, styles, style }) => {
const direction =
feedItem.type === 'send' ? 'To:' : ['claim', 'receive', 'withdraw'].indexOf(feedItem.type) > -1 ? 'From:' : ''
- const withdrawStatusText =
- feedItem.type === 'send' && feedItem.data.endpoint.withdrawStatus
- ? ` by link - ${feedItem.data.endpoint.withdrawStatus}`
- : ''
return (
<Text style={[styles.rowDataText, style]} numberOfLines={1} ellipsizeMode="tail">
<Text style={styles.direction}>{direction}</Text>
- <Text style={styles.fullName}>{` ${feedItem.data.endpoint.fullName}${withdrawStatusText}`}</Text>
+ <Text style={styles.fullName}>{` ${feedItem.data.endpoint.fullName}`}</Text>
</Text>
)
}
| 2 |
diff --git a/edit.js b/edit.js @@ -1127,11 +1127,6 @@ const _makeChunkMesh = (seedString, subparcels, parcelSize, subparcelSize) => {
buildMeshClone.build = build;
buildMeshClone.meshId = ++nextMeshId;
buildMeshClone.buildMeshType = buildMesh.buildMeshType;
- /* buildMeshClone.hullMesh = buildMesh.hullMesh.clone();
- buildMeshClone.hullMesh.geometry = buildMesh.hullMesh.geometry.clone();
- _decorateMeshForRaycast(buildMeshClone.hullMesh);
- buildMeshClone.hullMesh.isBuildHullMesh = true;
- buildMeshClone.hullMesh.buildMesh = buildMeshClone; */
let animation = null;
let hp = 100;
buildMeshClone.hit = dmg => {
@@ -1314,15 +1309,9 @@ const _makeChunkMesh = (seedString, subparcels, parcelSize, subparcelSize) => {
mesh.buildMeshes.push(buildMeshClone);
physicsWorker.requestLoadBuildMesh(buildMeshClone.meshId, buildMeshClone.buildMeshType, buildMeshClone.getWorldPosition(new THREE.Vector3()).toArray(), buildMeshClone.getWorldQuaternion(new THREE.Quaternion()).toArray());
-
- /* buildMeshClone.hullMesh.position.copy(buildMeshClone.position);
- buildMeshClone.hullMesh.quaternion.copy(buildMeshClone.quaternion);
- buildMeshClone.hullMesh.scale.copy(buildMeshClone.scale);
- mesh.add(buildMeshClone.hullMesh); */
};
const _removeBuildMesh = buildMeshClone => {
mesh.remove(buildMeshClone);
- // mesh.remove(buildMeshClone.hullMesh);
mesh.buildMeshes.splice(mesh.buildMeshes.indexOf(buildMeshClone), 1);
physicsWorker.requestUnloadBuildMesh(buildMeshClone.meshId);
| 2 |
diff --git a/README.md b/README.md @@ -28,7 +28,7 @@ Say thanks!
<td>Instagram<br><img src="https://edent.github.io/SuperTinyIcons/images/svg/instagram.svg" width="125" title="Instagram" /><br>768 Bytes</td>
</tr>
<tr>
-<td>Reddit<br><img src="https://edent.github.io/SuperTinyIcons/images/svg/reddit.svg" width="125" title="Reddit" /><br>607 Bytes</td>
+<td>reddit<br><img src="https://edent.github.io/SuperTinyIcons/images/svg/reddit.svg" width="125" title="reddit" /><br>607 Bytes</td>
<td>Pinterest<br><img src="https://edent.github.io/SuperTinyIcons/images/svg/pinterest.svg" width="125" title="Pinterest" /><br>526 Bytes</td>
<td>VK<br><img src="https://edent.github.io/SuperTinyIcons/images/svg/vk.svg" width="125" title="VK" /><br>534 Bytes</td>
<td>Mastodon<br><img src="https://edent.github.io/SuperTinyIcons/images/svg/mastodon.svg" width="125" title="Mastodon" /><br>550 Bytes</td>
| 3 |
diff --git a/config/sidebar.yml b/config/sidebar.yml @@ -634,7 +634,11 @@ appliance:
- title: Extensions
url: /appliance/extensions
- title: Disaster Recovery
- url: /appliance/geo-ha/disaster-recovery
+ url: /appliance/disaster-recovery
+ children:
+ - title: Roles and Responsibilities
+ url: /appliance/disaster-recovery-raci
+
- title: Release Notes
url: https://auth0.com/changelog/appliance
external: true
| 0 |
diff --git a/packages/app/src/server/routes/apiv3/in-app-notification.ts b/packages/app/src/server/routes/apiv3/in-app-notification.ts -import { Request, Response } from 'express';
-// import ApiResponse from 'server/util/apiResponse';
-import Crowi from '../../crowi';
-
-// export default (crowi: Crowi) => {
import { InAppNotification } from '../../models/in-app-notification';
+const express = require('express');
+
+const router = express.Router();
+
+
+module.exports = () => {
const actions = {} as any;
actions.api = {} as any;
-/**
- * @api {get} /notifications.list
- * @apiName ListNotifications
- * @apiGroup Notification
- *
- * @apiParam {String} linit
- */
-actions.api.list = function(req: Request, res: Response) {
- const user = req.user/* as UserDocument */;
-
- const limit = 10;
+ router.get('/list', (req, res) => {
+ const user = req.user;
+
+ let limit = 10;
if (req.query.limit) {
- // limit = parseInt(req.query.limit, 10);
+ limit = parseInt(req.query.limit, 10);
}
- const offset = 0;
+ let offset = 0;
if (req.query.offset) {
- // offset = parseInt(req.query.offset, 10);
+ offset = parseInt(req.query.offset, 10);
}
const requestLimit = limit + 1;
@@ -53,10 +47,10 @@ actions.api.list = function(req: Request, res: Response) {
.catch((err) => {
return res.apiv3Err(err);
});
-};
+ });
-actions.api.read = function(req: Request, res: Response) {
- const user = req.user/* as UserDocument */;
+ router.post('/read', (req, res) => {
+ const user = req.user;
try {
const notification = InAppNotification.read(user);
@@ -66,10 +60,10 @@ actions.api.read = function(req: Request, res: Response) {
catch (err) {
return res.apiv3Err(err);
}
-};
+ });
-actions.api.open = async function(req: Request, res: Response) {
- const user = req.user/* as UserDocument */;
+ router.post('/open', async(req, res) => {
+ const user = req.user;
const id = req.body.id;
try {
@@ -80,10 +74,10 @@ actions.api.open = async function(req: Request, res: Response) {
catch (err) {
return res.apiv3Err(err);
}
-};
+ });
-actions.api.status = async function(req: Request, res: Response) {
- const user = req.user/* as UserDocument */;
+ router.get('/status', async(req, res) => {
+ const user = req.user;
try {
const count = await InAppNotification.getUnreadCountByUser(user._id);
@@ -93,4 +87,6 @@ actions.api.status = async function(req: Request, res: Response) {
catch (err) {
return res.apiv3Err(err);
}
+ });
+
};
| 14 |
diff --git a/core/server/api/v3/posts-public.js b/core/server/api/v3/posts-public.js const models = require('../../models');
-const i18n = require('../../../shared/i18n');
+const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const allowedIncludes = ['tags', 'authors'];
-
+const messages = {
+ postNotFound: 'Post not found.'
+};
module.exports = {
docName: 'posts',
@@ -63,7 +65,7 @@ module.exports = {
.then((model) => {
if (!model) {
throw new errors.NotFoundError({
- message: i18n.t('errors.api.posts.postNotFound')
+ message: tpl(messages.postNotFound)
});
}
| 14 |
diff --git a/articles/architecture-scenarios/_includes/_authorization/_introduction.md b/articles/architecture-scenarios/_includes/_authorization/_introduction.md @@ -2,7 +2,7 @@ Let's start by taking a step back and talking about Access Control. There isn't
* **Authentication**: the process of determining if a principal (a user or application) is who or what they say they are.
* **Authorization**: the process of determining what is allowed, based on the principal, what permissions they have been given, and/or the set of contextually specific access criteria.
-* **Consent**: what permissions the user (Resource Owner) has given permission to an application to do on its behalf. This is generally a requirement of delegated authorization. The user has to give permission to the Client (Relying Party) to access the user's data in a different system.
+* **Consent**: what permissions the user (Resource Owner) has given permission to an application to do on its behalf. This is generally a requirement of delegated authorization. The user has to give permission to the Client to access the user's data in a different system.
* **Policy Enforcement**: The act of enforcing the policies of the application or API, rejecting or allowing access based on a user's authentication and/or authorization information.
In general we typically group different types of access control into three distinct categories so that it's easier to understand a) which actor is responsible for storing the information, b) which actor is responsible for making decisions, and c) which is responsible for enforcing the restrictions.
| 2 |
diff --git a/kotobaweb/src/dashboard/reports/index.jsx b/kotobaweb/src/dashboard/reports/index.jsx @@ -28,7 +28,7 @@ function Scorer({ id, username, discriminator, avatar, points, index }) {
function ScorerAvatarSmall({ discordUser }) {
const uri = avatarUriForAvatar(discordUser.avatar, discordUser.id);
- return <img src={uri} key={discordUser.id} className="rounded-circle mr-1" width="24" height="24" />;
+ return <img src={uri} key={discordUser.id} className="rounded-circle mr-1 mb-1" width="24" height="24" />;
}
function ScorersCell({ scorers, participantForId }) {
@@ -308,11 +308,11 @@ class ReportView extends Component {
<table className="table mt-5 table-bordered table-hover">
<thead>
<tr>
- <th width="20px"><input type="checkbox" checked={this.state.checkAll} onChange={this.onCheckAll} /></th>
- <th scope="col">Question</th>
- <th scope="col" width="200px">Answers</th>
- <th scope="col">Comment</th>
- <th scope="col">Scorers</th>
+ <th width="5%"><input type="checkbox" checked={this.state.checkAll} onChange={this.onCheckAll} /></th>
+ <th scope="col" width="25%">Question</th>
+ <th scope="col" width="30%">Answers</th>
+ <th scope="col" width="25%">Comment</th>
+ <th scope="col" width="15%">Scorers</th>
</tr>
</thead>
<tbody>
| 7 |
diff --git a/app/scripts/main.mjs b/app/scripts/main.mjs @@ -460,7 +460,7 @@ import { decode } from './qrclient.js'
}
if (useMediaDevices) {
- mediaDevices.getUserMedia(params)
+ navigator.mediaDevices.getUserMedia(params)
.then(selectStream)
.catch(console.error);
}
@@ -489,7 +489,7 @@ import { decode } from './qrclient.js'
var sourceManager;
// Where are we getting the data from
- if(gUMPresent) {
+ if(gUMPresent === false) {
cameraRoot = root.querySelector('.CameraFallback');
sourceManager = new CameraFallbackManager(cameraRoot);
}
| 1 |
diff --git a/accessibility-checker/test/mocha/aChecker.Fast/aChecker.ObjectStructure/aChecker.getCompliance.JSONObjectVerification.test.js b/accessibility-checker/test/mocha/aChecker.Fast/aChecker.ObjectStructure/aChecker.getCompliance.JSONObjectVerification.test.js @@ -126,7 +126,7 @@ describe("JSON Structure Verification Zombie", function () {
return b.ruleId.localeCompare(a.ruleId);
})
// Run the diff algo to get the list of differences
- differences = aChecker.diffResultsWithExpected(report, expected, false);console.log("report=" + JSON.stringify(report));
+ differences = aChecker.diffResultsWithExpected(report, expected, false);
}
expect(typeof differences).to.equal("undefined", "\nDoes not follow the correct JSON structure or can't load baselines" + JSON.stringify(differences, null, ' '));
// Mark the testcase as done.
| 3 |
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml @@ -19,6 +19,11 @@ jobs:
cd android/
bundle install
cd ..
+ - name: Decode sentry.properties file
+ uses: timheuer/base64-to-file@v1
+ with:
+ fileName: "android/sentry.properties"
+ encodedString: ${{ secrets.SENTRY_PROPERTIES_BASE64 }}
- name: Run Fastlane
run: |
cd android/
| 9 |
diff --git a/tests/unit/utils/debounce.spec.js b/tests/unit/utils/debounce.spec.js import { debounce } from '@/utils/utils';
-const sleep = (time) => new Promise(resolve => setTimeout(resolve, time));
-const debounceTime = 10;
-const sleepTime = 15;
-
describe('utils: debounce', () => {
- test('it calls a function only once in a given window', async () => {
+ const debounceTime = 1000;
+ const sleepTime = 1500;
+
+ beforeAll(() => {
+ jest.useFakeTimers();
+ });
+
+ afterAll(() => {
+ jest.useRealTimers();
+ });
+
+ test('it calls a function only once in a given window', () => {
const fn = jest.fn();
const debounced = debounce(fn, debounceTime);
debounced();
debounced();
debounced();
- await sleep(sleepTime);
+ jest.advanceTimersByTime(sleepTime);
expect(fn.mock.calls.length).toBe(1);
});
- test('it allows multiple calls when outside the given window', async () => {
+ test('it allows multiple calls when outside the given window', () => {
const fn = jest.fn();
const debounced = debounce(fn, debounceTime);
debounced();
- await sleep(sleepTime);
+ jest.advanceTimersByTime(sleepTime);
debounced();
debounced();
- await sleep(sleepTime);
+ jest.advanceTimersByTime(sleepTime);
expect(fn.mock.calls.length).toBe(2);
});
- test('it passes arguments to the debounced function', async () => {
+ test('it passes arguments to the debounced function', () => {
const fn = jest.fn();
const debounced = debounce(fn, debounceTime);
debounced(1, 'two', { three: 4 });
- await sleep(sleepTime);
+ jest.advanceTimersByTime(sleepTime);
expect(fn.mock.calls.length).toBe(1);
@@ -44,20 +51,20 @@ describe('utils: debounce', () => {
expect(fn.mock.calls[0][2]).toEqual({ three: 4 });
});
- test('it only executes the final call in the time window, even with different arguments', async () => {
+ test('it only executes the final call in the time window, even with different arguments', () => {
const fn = jest.fn();
const debounced = debounce(fn, debounceTime);
debounced('a');
debounced('b');
debounced('c');
- await sleep(sleepTime);
+ jest.advanceTimersByTime(sleepTime);
expect(fn.mock.calls.length).toBe(1);
expect(fn.mock.calls[0][0]).toBe('c');
});
- test('it keeps the window open on subsequent calls, until it first expires', async () => {
+ test('it keeps the window open on subsequent calls, until it first expires', () => {
const fn = jest.fn();
const debounced = debounce(fn, debounceTime);
@@ -66,15 +73,15 @@ describe('utils: debounce', () => {
// window length plus the full sleep time, we expect only the final call to be
// actually executed.
debounced(1);
- await sleep(debounceTime * 0.8);
+ jest.advanceTimersByTime(debounceTime * 0.8);
debounced(2);
- await sleep(debounceTime * 0.8);
+ jest.advanceTimersByTime(debounceTime * 0.8);
debounced(3);
- await sleep(debounceTime * 0.8);
+ jest.advanceTimersByTime(debounceTime * 0.8);
debounced(4);
- await sleep(debounceTime * 0.8);
+ jest.advanceTimersByTime(debounceTime * 0.8);
debounced(5);
- await sleep(sleepTime);
+ jest.advanceTimersByTime(sleepTime);
expect(fn.mock.calls.length).toBe(1);
expect(fn.mock.calls[0][0]).toBe(5);
| 14 |
diff --git a/app-template/bitcoincom/appConfig.json b/app-template/bitcoincom/appConfig.json "pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet",
"version": "4.0.1",
- "androidVersion": "400000",
+ "androidVersion": "400101",
"_extraCSS": "",
"_enabledExtensions": {
"coinbase": false,
| 3 |
diff --git a/packages/app/src/stores/search.tsx b/packages/app/src/stores/search.tsx @@ -24,12 +24,10 @@ type ISearchConfigurationsFixed = {
includeUserPages: boolean,
}
-export type ISearchConditions = {
- conditions: ISearchConfigurationsFixed & {
+export type ISearchConditions = ISearchConfigurationsFixed & {
keyword: string,
rawQuery: string,
}
-}
const createSearchQuery = (keyword: string, includeTrashPages: boolean, includeUserPages: boolean): string => {
let query = keyword;
@@ -47,7 +45,7 @@ const createSearchQuery = (keyword: string, includeTrashPages: boolean, includeU
export const useSWRxFullTextSearch = (
keyword: string, configurations: ISearchConfigurations,
-): SWRResponse<IFormattedSearchResult, Error> & ISearchConditions => {
+): SWRResponse<IFormattedSearchResult, Error> & { conditions: ISearchConditions } => {
const {
limit, offset, sort, order, includeTrashPages, includeUserPages,
| 7 |
diff --git a/src/feed/SubFeed.js b/src/feed/SubFeed.js @@ -28,7 +28,6 @@ import ScrollToTop from '../components/Utils/ScrollToTop';
authenticated: getIsAuthenticated(state),
loaded: getIsLoaded(state),
user: getAuthenticatedUser(state),
- auth: state.auth,
feed: state.feed,
posts: state.posts,
}),
| 2 |
diff --git a/rig.js b/rig.js @@ -259,14 +259,14 @@ class RigManager {
}
}
- isPeerRig(rig) {
+ /* isPeerRig(rig) {
for (const peerRig of this.peerRigs.values()) {
if (peerRig === rig) {
return true;
}
}
return false;
- }
+ } */
async addPeerRig(peerId) {
const peerRig = new Avatar(null, {
| 2 |
diff --git a/src/plots/cartesian/set_convert.js b/src/plots/cartesian/set_convert.js @@ -301,7 +301,10 @@ module.exports = function setConvert(ax, fullLayout) {
};
}
else if(ax.type === 'multicategory') {
- // ax.d2c = ax.d2l = setMultiCategoryIndex;
+ // N.B. multicategory axes don't define d2c and d2l,
+ // as 'data-to-calcdata' conversion needs to take into
+ // account all data array items as in ax.makeCalcdata.
+
ax.r2d = ax.c2d = ax.l2d = getCategoryName;
ax.d2r = ax.d2l_noadd = getCategoryIndex;
| 0 |
diff --git a/src/core/lib/FileSignatures.mjs b/src/core/lib/FileSignatures.mjs @@ -2914,15 +2914,119 @@ export function extractSQLITE(bytes, offset) {
export function extractPListXML(bytes, offset) {
const stream = new Stream(bytes.slice(offset));
- // Find closing tag (</plist>)
- stream.continueUntil([0x3c, 0x2f, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x3e]);
- stream.moveForwardsBy(8);
+ let braceCount = 0;
+
+ // Continue to the first (<plist).
+ stream.continueUntil([0x3c, 0x70, 0x6c, 0x69, 0x73, 0x74]);
+ stream.moveForwardsBy(6);
+ braceCount++;
+
+ // While we have an unequal amount of braces.
+ while (braceCount > 0 && stream.hasMore()) {
+ if (stream.readInt(1) === 0x3c) {
+
+ // If we hit an <plist.
+ if (stream.getBytes(5).join("") === [0x70, 0x6c, 0x69, 0x73, 0x74].join("")) {
+ braceCount++;
+ } else {
+ stream.moveBackwardsBy(5);
+ }
+
+ // If we hit an </plist>.
+ if (stream.getBytes(7).join("") === [0x2f, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x3e].join("")) {
+ braceCount--;
+ } else {
+ stream.moveBackwardsBy(7);
+ }
+ }
+ }
stream.consumeIf(0x0a);
return stream.carve();
}
+/**
+ * OLE2 extractor.
+ *
+ * @param {Uint8Array} bytes
+ * @param {number} offset
+ * @returns {Uint8Array}
+ */
+export function extractOLE2(bytes, offset) {
+ const stream = new Stream(bytes.slice(offset));
+ const entries = [[[0x52, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x20, 0x00, 0x45, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x72, 0x00, 0x79], 19, "Root Entry"],
+ [[0x57, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x6b], 15, "Workbook"],
+ [[0x43, 0x00, 0x75, 0x00, 0x72, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x20, 0x00, 0x55, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72], 23, "Current User"],
+ [[0x50, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x65, 0x00, 0x72, 0x00, 0x50, 0x00, 0x6f, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x20, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x75, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74], 37, "PowerPoint Document"],
+ [[0x57, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x64, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x75, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74], 23, "WordDocument"],
+ [[0x44, 0x00, 0x61, 0x00, 0x74, 0x00, 0x61], 7, "Data"],
+ [[0x50, 0x00, 0x69, 0x00, 0x63, 0x00, 0x74, 0x00, 0x75, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73], 15, "Pictures"],
+ [[0x31, 0x00, 0x54, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65], 11, "1Table"],
+ [[0x05, 0x00, 0x53, 0x00, 0x75, 0x00, 0x6d, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x79, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e], 37, "SummaryInformation"],
+ [[0x05, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x75, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x53, 0x00, 0x75, 0x00, 0x6d, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x79, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e], 53, "DocumentSummaryInformation"],
+ [[0x43, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x4f, 0x00, 0x62, 0x00, 0x6a], 13, "Comp Obj"],
+ [[0x01, 0x00], 2, "Entry"]];
+ let endianness = "le";
+
+ // Move to endianess field.
+ stream.moveForwardsBy(28);
+ if (stream.readInt(2, endianness) === 0xfffe)
+ endianness = "le";
+
+ // Calculate the size of the normal sectors.
+ const sizeOfSector = 2 ** stream.readInt(2, endianness);
+
+ // Move to root directory offset field.
+ stream.moveTo(48);
+
+ // Read root directory offset.
+ const rootStuff = stream.readInt(4, endianness);
+
+ // Calculate root directory offset.
+ let total = 512 + (rootStuff * sizeOfSector);
+ stream.moveTo(total);
+ let found = true;
+
+ // While valid directory entries.
+ while (found) {
+ found = false;
+
+ // Attempt to determine what directory entry it is.
+ for (const element of entries) {
+ if (stream.getBytes(element[1]).join("") === element[0].join("")) {
+ stream.moveBackwardsBy(element[1]);
+ found = true;
+
+ // Move forwards by the size of the comp obj.
+ if (element[2] === "Comp Obj") {
+ total += (128*6);
+ stream.moveTo(total);
+ } else if (element[2] === "Entry") {
+
+ // If there is an entry move backwards by 126 to then move forwards by 128. Hence a total displacement of 2.
+ stream.moveBackwardsBy(126);
+ }
+ break;
+ }
+ stream.moveBackwardsBy(element[1]);
+ }
+
+ // If we have found a valid entry, move forwards by 128.
+ if (found) {
+ total += 128;
+ stream.moveForwardsBy(128);
+ }
+ }
+
+ // Round up to a multiple of 512.
+ total = Math.ceil(total / 512) * 512;
+
+ stream.moveTo(total);
+ return stream.carve();
+}
+
+
/**
* GZIP extractor.
*
| 0 |
diff --git a/lib/devstates.js b/lib/devstates.js @@ -1871,14 +1871,25 @@ const devices = [{
const commonStates = [
states.link_quality,
- states.groups,
];
const groupStates = [].concat(lightStatesWithColor);
+const byZigbeeModel = new Map();
+for (const device of devices) {
+ for (const zigbeeModel of device.models) {
+ const stripModel = zigbeeModel.replace(/\0.*$/g, '').trim();
+ byZigbeeModel.set(stripModel, device);
+ }
+}
+
module.exports = {
devices: devices,
commonStates: commonStates,
groupStates: groupStates,
- findModel: (model) => devices.find((d) => d.models.includes(model)),
+ groupsState: states.groups,
+ findModel: (model) => {
+ const stripModel = model.replace(/\0.*$/g, '').trim();
+ return byZigbeeModel.get(stripModel);
+ }
};
| 8 |
diff --git a/FAQ.md b/FAQ.md @@ -247,7 +247,7 @@ To better support numeric computing, standards bodies can do the following:
1. __64-bit integers__: add support for 64-bit integers. 64-bit integers (both signed and unsigned) are important for the following reasons:
- * __Bit manipulation__. Currently, the only way to manipulate the bits of a double-precision floating-point number is to use typed arrays (see [`toWords()`][stdlib-float64-to-words]), which is problematic because the process is, when compared to modern languages, [slow][stdlib-frexp] and [inefficient][stdlib-ldexp]. Modern languages with 64-bit integer support allow the bits of a double-precision floating-point number to be [reinterpreted][golang-float64bits] as a 64-bit integer, thus enabling easier manipulation, faster operations, and more efficient [code][golang-frexp]. This is especially important for low level implementations of transcendental [functions][stdlib-exp10] where bit manipulation can lead to significant performance gains.
+ * __Bit manipulation__. Currently, the only way to manipulate the bits of a double-precision floating-point number is to use typed arrays (see [`toWords()`][@stdlib/math/base/utils/float64-to-words]), which is problematic because the process is, when compared to modern languages, [slow][@stdlib/math/base/special/frexp] and [inefficient][@stdlib/math/base/special/ldexp]. Modern languages with 64-bit integer support allow the bits of a double-precision floating-point number to be [reinterpreted][golang-float64bits] as a 64-bit integer, thus enabling easier manipulation, faster operations, and more efficient [code][golang-frexp]. This is especially important for low level implementations of transcendental [functions][@stdlib/math/base/special/exp10] where bit manipulation can lead to significant performance gains.
* __Pseudorandom number generation__. Modern pseudorandom number generators (PRNGs) commonly use 64-bit integers. Hence, lack of native 64-bit integer support prevents implementing more robust PRNGs which have longer periods and better randomness qualities (e.g., [xorshift*][xorshift*], [PCG][pcg], and [Mersenne twister (64-bit)][mersenne-twister]).
* __IDs__. In modern applications, 32-bit integer IDs are rarely enough. 32-bit integers have on the order of `10**9` unique values compared to `10**19` for 64-bit integers. With 64-bit integer support, additional efficient hashing and bit masking algorithms become feasible.
@@ -682,10 +682,10 @@ See the [contributing guide][contributing-guide].
[julia-bigint]: http://docs.julialang.org/en/stable/stdlib/numbers/?highlight=bigfloat#Base.BigInt
[julia-bigfloat]: http://docs.julialang.org/en/stable/stdlib/numbers/?highlight=bigfloat#Base.BigFloat
-[stdlib-frexp]: https://github.com/stdlib-js/stdlib/blob/0b1a64efef8859a17a60edb7ccaab62937b77a63/lib/node_modules/%40stdlib/math/base/special/frexp/lib/frexp.js#L67
-[stdlib-ldexp]: https://github.com/stdlib-js/stdlib/blob/0b1a64efef8859a17a60edb7ccaab62937b77a63/lib/node_modules/%40stdlib/math/base/special/ldexp/lib/ldexp.js#L105
-[stdlib-exp10]: https://github.com/stdlib-js/stdlib/blob/0b1a64efef8859a17a60edb7ccaab62937b77a63/lib/node_modules/%40stdlib/math/base/special/exp10/lib/exp10.js#L131
-[stdlib-float64-to-words]: https://github.com/stdlib-js/stdlib/blob/1db589dcd5a8f8c4e4ab3bae8e8c47bd0c0266e8/lib/node_modules/%40stdlib/math/base/utils/float64-to-words/lib/to_words.js
+[@stdlib/math/base/special/frexp]: https://github.com/stdlib-js/stdlib/blob/0b1a64efef8859a17a60edb7ccaab62937b77a63/lib/node_modules/%40stdlib/math/base/special/frexp/lib/frexp.js#L67
+[@stdlib/math/base/special/ldexp]: https://github.com/stdlib-js/stdlib/blob/0b1a64efef8859a17a60edb7ccaab62937b77a63/lib/node_modules/%40stdlib/math/base/special/ldexp/lib/ldexp.js#L105
+[@stdlib/math/base/special/exp10]: https://github.com/stdlib-js/stdlib/blob/0b1a64efef8859a17a60edb7ccaab62937b77a63/lib/node_modules/%40stdlib/math/base/special/exp10/lib/exp10.js#L131
+[@stdlib/math/base/utils/float64-to-words]: https://github.com/stdlib-js/stdlib/blob/1db589dcd5a8f8c4e4ab3bae8e8c47bd0c0266e8/lib/node_modules/%40stdlib/math/base/utils/float64-to-words/lib/to_words.js
[xorshift*]: https://en.wikipedia.org/wiki/Xorshift
[pcg]: http://www.pcg-random.org/other-rngs.html
| 10 |
diff --git a/src/components/webView/webViewInstances.js b/src/components/webView/webViewInstances.js import Config from '../../config/config'
import { createIframe } from './iframe.web'
-export const PrivacyPolicyAndTerms = createIframe(
- `https://community.gooddollar.org/${Config.isEToro ? 'pilot-terms' : 'tou'}/`,
- 'Privacy Policy & Terms',
-)
-export const PrivacyPolicy = createIframe('https://community.gooddollar.org/tou/#privacy-policy', 'Privacy Policy')
+const tou = Config.isPhaseOne ? 'tou1' : 'tou'
+export const PrivacyPolicyAndTerms = createIframe(`https://community.gooddollar.org/${tou}/`, 'Privacy Policy & Terms')
+export const PrivacyPolicy = createIframe(`https://community.gooddollar.org/${tou}/#privacy-policy`, 'Privacy Policy')
// export const PrivacyArticle = createIframe(
// 'https://medium.com/gooddollar/gooddollar-identity-pillar-balancing-identity-and-privacy-part-i-face-matching-d6864bcebf54',
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.