code
stringlengths 122
4.99k
| label
int64 0
14
|
---|---|
diff --git a/articles/multifactor-authentication/developer/mfa-from-id-token.md b/articles/multifactor-authentication/developer/mfa-from-id-token.md @@ -29,29 +29,55 @@ For more information on the signature verification and claims validation, see [I
## Example
-This example is built on top of the [JSON Web Token Sample Code](https://github.com/auth0/node-jsonwebtoken).
+In this section we will see how you can check if a user logged in with MFA in a Node.js web app. The code snippets use the following modules:
-The code verifies the token's signature (`jwt.verify`), decodes the token, and checks whether the payload contains `amr` and if it does whether it contains the value `mfa`. The results are logged in the console.
+- [jwks-rsa](https://github.com/auth0/node-jwks-rsa): Library that retrieves the RSA signing keys from a [**JWKS** (JSON Web Key Set)](/jwks) endpoint. We will use this to retrieve your RSA keys from Auth0 so we can verify the signed ID Token.
+- [express-jwt](https://github.com/auth0/express-jwt): Library that validates JWT tokens in your Node.js applications. It provides several functions that make working with JWTs easier.
-```js
-const AUTH0_CLIENT_SECRET = '${account.clientSecret}';
-const jwt = require('jsonwebtoken')
+### 1. Authenticate the user
-jwt.verify(id_token, AUTH0_CLIENT_SECRET, { algorithms: ['HS256'] }, function(err, decoded) {
- if (err) {
- console.log('invalid token');
- return;
- }
+First, we need to authenticate a user and get an ID Token. To do that we will use the [OAuth 2.0 Authorization Code grant](/client-auth/server-side-web).
- if (Array.isArray(decoded.amr) && decoded.amr.indexOf('mfa') >= 0) {
- console.log('You used mfa');
- return;
- }
- console.log('you are not using mfa');
- });
+```text
+https://${account.namespace}/authorize?
+ audience=${account.namespace}/userinfo&
+ scope=openid&
+ response_type=code&
+ client_id=${account.clientId}&
+ redirect_uri=${account.callback}&
+ state=CRYPTOGRAPHIC_NONCE
```
+Where:
+
+| **Parameter** | **Description** |
+|-|-|
+| `audience` | Audience(s) that the generated [Access Token](/tokens/access-token) is intended for. This example's value will generate a token that can be used to retrieve the user's profile from the [Authentication API /userinfo endpoint](/api/authentication#get-user-info). |
+| `scope` | Must contain the `openid` value in order to get an ID Token. For more info see [Scopes](/scopes). |
+| `response_type` | Tells Auth0 which [OAuth 2.0 grant](/protocols/oauth2#authorization-grant-types) to execute. |
+| `client_id` | Client ID of your app. Find it in [Client Settings](${account.namespace}/#/clients/${account.clientId}/settings). |
+| `redirect_uri` | The URI to which Auth0 will send the response after the user authenticates. Set it to the URI that you want to redirect the user after login. Whitelist this value in [Client Settings](${account.namespace}/#/clients/${account.clientId}/settings). |
+| `state` | An authentication parameter used to help mitigate CSRF attacks. For more info see [State](/protocols/oauth2/oauth-state)|
+
+Call this URL when a user tries to log in. For example:
+
+```html
+<a href="https://${account.namespace}/authorize?scope=openid&audience=${account.namespace}/userinfo&response_type=code&client_id=${account.clientId}&redirect_uri=${account.callback}&state=123456">
+ Log In
+</a>
+```
+
+Provided that the user authenticates successfully, the response from Auth0 will be as follows:
+
+```text
+http://localhost:3000/?code=9nmp6bZS8GqJm4IQ&state=SAME_VALUE_YOU_SENT_AT_THE_REQUEST
+```
+
+You need to verify that the `state` value is the same with the one you sent at the request and extract the code parameter (we will use it in the next step).
+
+## 2. Get an ID Token
+
## Keep reading
::: next-steps
| 14 |
diff --git a/packages/three-vrm/lib/three-vrm.module.js b/packages/three-vrm/lib/three-vrm.module.js @@ -1699,7 +1699,7 @@ class VRMLookAtImporter {
const getEncodingComponents = (encoding) => {
switch (encoding) {
case THREE.LinearEncoding:
- return ['Linear', '( value )'];
+ // return ['Linear', '( value )'];
case THREE.sRGBEncoding:
return ['sRGB', '( value )'];
case THREE.RGBEEncoding:
| 0 |
diff --git a/packages/sampler/stories/qa/VirtualGridList.js b/packages/sampler/stories/qa/VirtualGridList.js @@ -51,7 +51,7 @@ const updateDataSize = (dataSize) => {
updateDataSize(defaultDataSize);
-storiesOf('VirtualList.VirtualGridList', module)
+storiesOf('VirtualGridList', module)
.add(
'Horizontal VirtualGridList',
() => (
| 5 |
diff --git a/src/config.js b/src/config.js @@ -88,14 +88,6 @@ module.exports = {
keyCode: 73,
text: "i"
},
- {
- name: "Superscript",
- title: "superscript",
- iconName: "fmt-superscript",
- cmd: "superscriptPrompt",
- keyCode: 190,
- text: "superscript"
- },
{
name: "Link",
title: "link",
| 2 |
diff --git a/assets/js/components/GoogleChartV2.js b/assets/js/components/GoogleChartV2.js @@ -145,9 +145,13 @@ export default function GoogleChartV2( props ) {
height={ height }
getChartWrapper={ ( chartWrapper, google ) => {
// Remove all the event listeners on the old chart before we draw
- // a new one.
+ // a new one. Only run this if the old chart and the new chart aren't
+ // the same reference though, otherwise we'll remove existing `onReady`
+ // events and other event listeners, which will cause bugs.
+ if ( chartWrapper !== chartWrapperRef.current ) {
// eslint-disable-next-line no-unused-expressions
googleRef.current?.visualization.events.removeAllListeners( chartWrapperRef.current?.getChart() );
+ }
chartWrapperRef.current = chartWrapper;
googleRef.current = google;
| 2 |
diff --git a/src/core/util/strings.js b/src/core/util/strings.js @@ -73,8 +73,8 @@ export function stringWidth(text, font) {
* @memberOf StringUtil
*/
export function stringLength(text, font) {
- if (stringLength.env) {
- return stringLength.env(text, font);
+ if (stringLength.node) {
+ return stringLength.node(text, font);
} else {
const ruler = getDomRuler('span');
ruler.style.font = font;
| 3 |
diff --git a/storage.js b/storage.js @@ -66,6 +66,11 @@ function readJointDirectly(conn, unit, callbacks, bRetrying) {
objectHash.cleanNulls(objUnit);
var bVoided = (objUnit.content_hash && main_chain_index < min_retrievable_mci);
var bRetrievable = (main_chain_index >= min_retrievable_mci || main_chain_index === null);
+
+ // unit hash verification below will fail if:
+ // 1. the unit was received already voided, i.e. its messages are stripped and content_hash is set
+ // 2. the unit is still retrievable (e.g. we are syncing)
+ // In this case, bVoided=false hence content_hash will be deleted but the messages are missing
if (bVoided){
//delete objUnit.last_ball;
//delete objUnit.last_ball_unit;
@@ -186,8 +191,11 @@ function readJointDirectly(conn, unit, callbacks, bRetrying) {
"SELECT app, payload_hash, payload_location, payload, payload_uri, payload_uri_hash, message_index \n\
FROM messages WHERE unit=? ORDER BY message_index", [unit],
function(rows){
- if (rows.length === 0)
+ if (rows.length === 0){
+ if (conf.bLight)
throw new Error("no messages in unit "+unit);
+ return callback(); // any errors will be caught by verifying unit hash
+ }
objUnit.messages = [];
async.eachSeries(
rows,
| 11 |
diff --git a/includes/Modules/PageSpeed_Insights.php b/includes/Modules/PageSpeed_Insights.php @@ -153,8 +153,7 @@ final class PageSpeed_Insights extends Module {
protected function parse_data_response( $method, $datapoint, $response ) {
if ( 'GET' === $method ) {
switch ( $datapoint ) {
- case 'site-pagespeed-mobile':
- case 'site-pagespeed-desktop':
+ case 'pagespeed':
// TODO: Parse this response to a regular array.
return $response->getLighthouseResult();
}
| 3 |
diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss }
}
+.primary-checkpoint {
+ border: 1px solid $secondary-green;
+ background-color: white;
+ padding-left: 4px;
+ padding-top: 4px;
+ text-align: center;
+ cursor: pointer;
+
+ &:hover {
+ opacity: 1;
+ border-color: $primary-green;
+ transition: .2s ease-in-out
+ }
+}
+
.users-text-container {
margin-top: 20px;
padding-left: 4px;
| 1 |
diff --git a/CodingChallenges/CC_29_SmartRockets/population.js b/CodingChallenges/CC_29_SmartRockets/population.js @@ -23,7 +23,7 @@ function Population() {
for (var i = 0; i < this.popsize; i++) {
// Calculates fitness
this.rockets[i].calcFitness();
- // If current fitness is greater than max, then make max eqaul to current
+ // If current fitness is greater than max, then make max equal to current
if (this.rockets[i].fitness > maxfit) {
maxfit = this.rockets[i].fitness;
}
| 1 |
diff --git a/shared/js/content-scripts/click-to-load.js b/shared/js/content-scripts/click-to-load.js /**
* Creates a safe element and replaces the original tracking element with it.
- * @param {Object} widgetData - a single entry from elementData
- * @param {Element} originalElement - the element on the page we are replacing
+ * @param {string} entity
+ * The entity (e.g. company) associated with the tracking element.
+ * @param {Object} widgetData
+ * A single entry from the CTP configuration file.
+ * @param {Element} originalElement
+ * The tracking element on the page which we're replacing with a placeholder.
*/
function createReplacementWidget (entity, widgetData, originalElement) {
// Construct the widget based on data in the original element
| 7 |
diff --git a/map.html b/map.html import App from './app.js';
import {camera, orthographicCamera, renderer} from './app-object.js';
import {world} from './world.js';
+ import {parseQuery} from './util.js';
import {homeScnUrl} from './constants.js';
const width = 128;
camera.updateProjectionMatrix();
camera.up.set(0, 0, -1);
- // const w = 4;
- const s = 16;
- const w = 10;
- const h = 12;
-
- orthographicCamera.left = -s/2;
- orthographicCamera.right = s/2;
- orthographicCamera.top = s/2;
- orthographicCamera.bottom = -s/2;
- orthographicCamera.near = 0;
- orthographicCamera.far = 2000;
- orthographicCamera.updateProjectionMatrix();
- camera.projectionMatrix.copy(orthographicCamera.projectionMatrix);
+ const tileScale = 16;
(async () => {
const app = new App();
// fixes a glitch where the first render has black opaque
app.render();
- setTimeout(() => {
+ const {dst} = parseQuery(location.search);
+ if (!dst) {
+ const w = 10;
+ const h = 12;
+
+ setTimeout(() => { // wait for load; should really be a lock
+ orthographicCamera.left = -tileScale/2;
+ orthographicCamera.right = tileScale/2;
+ orthographicCamera.top = tileScale/2;
+ orthographicCamera.bottom = -tileScale/2;
+ orthographicCamera.near = 0;
+ orthographicCamera.far = 2000;
+ orthographicCamera.updateProjectionMatrix();
+ camera.projectionMatrix.copy(orthographicCamera.projectionMatrix);
+
// document.body.appendChild(renderer.domElement);
for (let x = -w; x < w; x++) {
for (let z = -h; z < h; z++) {
- const v = new THREE.Vector3(x * s, 0, z * s);
- camera.position.copy(cameraPosition).add(v);
- camera.lookAt(cameraTarget.clone().add(v).add(new THREE.Vector3(2, 0, -w/2)));
+ const offset = new THREE.Vector3(x * tileScale, 0, z * tileScale);
+ camera.position.copy(cameraPosition).add(offset);
+ camera.lookAt(cameraTarget.clone().add(offset).add(new THREE.Vector3(2, 0, -5)));
renderer.clear();
app.render();
}
}, 5000);
- /* if (dst) {
- fetch(dst, {
- method: 'POST',
- headers: {
- 'Content-Type': mimeType,
- },
- body: arrayBuffer,
- }).then(res => res.blob());
- }
-
- window.parent.postMessage({
- method: 'result',
- result: arrayBuffer,
- }, '*', [arrayBuffer]); */
- })();
(async () => {
const res = await fetch(`https://webaverse.github.io/parcels/parcels.json`);
const ps = await res.json();
div.innerHTML = `\
<div class=details>${p.name}</div>
`;
- const localWidth = (x2-x1)*width/s;
- const localHeight = (z2-z1)*height/s;
- div.style.left = (width*(w+0.5)) - (localWidth/2) + (x1*width/s) + `px`;
- div.style.top = (height*(h+1)) - (localHeight/2) + (z1*height/s) + `px`;
+ const localWidth = (x2-x1)*width/tileScale;
+ const localHeight = (z2-z1)*height/tileScale;
+ div.style.left = (width*(w+0.5)) - (localWidth/2) + (x1*width/tileScale) + `px`;
+ div.style.top = (height*(h+1)) - (localHeight/2) + (z1*height/tileScale) + `px`;
div.style.width = localWidth + `px`;
div.style.height = localHeight + `px`;
document.body.appendChild(div);
}
})();
+ } else {
+ let {x, y, sw, sh, dw, dh} = parseQuery(location.search);
+
+ x = parseInt(x);
+ y = parseInt(y);
+ sw = parseInt(sw);
+ sh = parseInt(sh);
+ dw = parseInt(dw);
+ dh = parseInt(dh);
+
+ orthographicCamera.left = -sw/2;
+ orthographicCamera.right = sw/2;
+ orthographicCamera.top = sh/2;
+ orthographicCamera.bottom = -sh/2;
+ orthographicCamera.near = 0;
+ orthographicCamera.far = 2000;
+ orthographicCamera.updateProjectionMatrix();
+ camera.projectionMatrix.copy(orthographicCamera.projectionMatrix);
+
+ cameraTarget.set(x + sw/2, 0, y + sh/2);
+
+ const offset = new THREE.Vector3(x * tileScale, 0, y * tileScale);
+ camera.position.copy(cameraPosition).add(offset);
+ camera.lookAt(cameraTarget.clone().add(offset).add(new THREE.Vector3(2, 0, -5)));
+
+ renderer.setSize(dw, dh);
+
+ renderer.clear();
+ app.render();
+
+ document.body.appendChild(renderer.domElement);
+
+ const blob = await new Promise((accept, reject) => {
+ renderer.domElement.toBlob(accept);
+ });
+
+ fetch(dst, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'image/png',
+ },
+ body: blob,
+ }).then(res => res.blob());
+
+ /* const arrayBuffer = await blob.arrayBuffer();
+ window.parent.postMessage({
+ method: 'result',
+ result: arrayBuffer,
+ }, '*', [arrayBuffer]); */
+ }
+ })();
</script>
</body>
| 0 |
diff --git a/src/client/js/components/Admin/Customize/CustomizeTitle.jsx b/src/client/js/components/Admin/Customize/CustomizeTitle.jsx @@ -36,9 +36,13 @@ class CustomizeTitle extends React.Component {
return (
<React.Fragment>
+ <div className="row">
+ <div className="col-12">
<h2 className="admin-setting-header">{t('admin:customize_setting.custom_title')}</h2>
+ </div>
- <Card className="card well my-3">
+ <div className="col-12">
+ <Card className="card well">
<CardBody className="px-0 py-2">
<span
// eslint-disable-next-line react/no-danger
@@ -46,22 +50,25 @@ class CustomizeTitle extends React.Component {
/>
</CardBody>
</Card>
+ </div>
{/* TODO i18n */}
- <div className="form-text text-muted">
+ <div className="form-text text-muted col-12">
Default Value: <code>{{page}} - {{sitename}}</code>
<br />
Default Output: <pre><code className="xml"><title>/Sandbox - {'GROWI'}</title></code></pre>
</div>
- <div className="form-group">
+ <div className="form-group col-12">
<input
className="form-control"
defaultValue={currentCustomizeTitle}
onChange={(e) => { adminCustomizeContainer.changeCustomizeTitle(e.target.value) }}
/>
</div>
-
+ <div className="col-12">
<AdminUpdateButtonRow onClick={this.onClickSubmit} disabled={adminCustomizeContainer.state.retrieveError != null} />
+ </div>
+ </div>
</React.Fragment>
);
}
| 12 |
diff --git a/app/stores/WalletDb.js b/app/stores/WalletDb.js @@ -16,7 +16,7 @@ import {ChainStore, PrivateKey, key, Aes} from "bitsharesjs";
import {Apis, ChainConfig} from "bitsharesjs-ws";
import AddressIndex from "stores/AddressIndex";
import SettingsActions from "actions/SettingsActions";
-import notify from "actions/NotificationActions";
+import {Notification} from "bitshares-ui-style-guide";
import counterpart from "counterpart";
let aes_private = null;
@@ -442,9 +442,8 @@ class WalletDb extends BaseStore {
if (!foundRole) {
let alsoCheckRole =
role === "active" ? "owner" : "active";
- acc
- .getIn([alsoCheckRole, "key_auths"])
- .forEach(auth => {
+ acc.getIn([alsoCheckRole, "key_auths"]).forEach(
+ auth => {
if (auth.get(0) === key.pubKey) {
setKey(
alsoCheckRole,
@@ -454,7 +453,8 @@ class WalletDb extends BaseStore {
foundRole = true;
return false;
}
- });
+ }
+ );
}
}
}
@@ -467,10 +467,8 @@ class WalletDb extends BaseStore {
true
);
if (success && !cloudMode) {
- notify.addNotification({
- message: counterpart.translate("wallet.local_switch"),
- level: "success",
- timeout: 5
+ Notification.success({
+ message: counterpart.translate("wallet.local_switch")
});
SettingsActions.changeSetting({
setting: "passwordLogin",
| 14 |
diff --git a/readme.md b/readme.md @@ -19,12 +19,18 @@ Please follow the format of existing issues for consistency.
## Development
-Development requires [Hugo static site generator](https://gohugo.io) v0.61.0 from [releases page](https://github.com/gohugoio/hugo/releases) or with Homebrew
+Development requires [Hugo static site generator](https://gohugo.io) v0.61.0 from [releases page](https://github.com/gohugoio/hugo/releases) or with Homebrew for Linux and macOS users.
```
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/79894aee20a146d6cf7db7b4a362e7d491f499a1/Formula/hugo.rb
```
+Windows users can install [Chocolatey](https://chocolatey.org/install). After that Hugo can be installed with
+
+```
+choco install hugo-extended --version 0.61.0
+```
+
For general info see [Hugo documentation](https://gohugo.io/documentation/).
Content is in `content` in [CommonMark](https://commonmark.org/help/) markdown format, as implemented by [goldmark](https://github.com/yuin/goldmark);
@@ -33,10 +39,14 @@ Layout templates are in `layouts` in HTML format and go template syntax for "act
## Preview
-Preview the site in http://localhost:1313/ by launching:
+Linux and macOS users can preview the site in http://localhost:1313/ by launching:
```
./serve.sh
```
+Windows users launch:
+```
+./serve.cmd
+```
It will usually refresh automatically when anything is changed
| 3 |
diff --git a/i18n/en/docusaurus-plugin-content-docs/current/reference/units/decomposition.md b/i18n/en/docusaurus-plugin-content-docs/current/reference/units/decomposition.md @@ -232,7 +232,7 @@ However, as a result of [discussions and analysis of extensive experience][disc-
[ref-layers]: /docs/reference/units/layers
[ref-segments]: /docs/reference/units/segments
[ref-low-coupling]: /docs/reference/isolation/coupling-cohesion
-[ref-grouping]: /docs/reference/units/layers/features#structural-grouping-features
+[ref-grouping]: /docs/reference/units/layers/features#structural-grouping-of-features
[disc-src]: https://github.com/feature-sliced/documentation/discussions/31
| 1 |
diff --git a/articles/security/bulletins/index.md b/articles/security/bulletins/index.md @@ -27,7 +27,7 @@ Each bulletin contains a description of the vulnerability, how to identify if yo
| **Date** | **Bulletin number** | **Title** | **Affected software** |
|-|-|-|-|
-| October 04, 2019 | [CVE 2019-16929](/security/bulletins/cve-2019-16929.md) | Auth0 Security Bulletin for auth0.net between versions 5.8.0 and 6.5.3 inclusive | [auth0.net](https://www.nuget.org/packages/Auth0.AuthenticationApi/) |
+| October 04, 2019 | [CVE 2019-16929](/security/bulletins/cve-2019-16929) | Auth0 Security Bulletin for auth0.net between versions 5.8.0 and 6.5.3 inclusive | [auth0.net](https://www.nuget.org/packages/Auth0.AuthenticationApi/) |
| September 05, 2019 | [Auth0 bulletin](/security/bulletins/2019-09-05_scopes) | Auth0 Security Bulletin for assigning scopes based on email address | Custom code within Auth0 rules |
| July 23, 2019 | [CVE 2019-13483](/security/bulletins/cve-2019-13483) | Security Bulletin for Passport-SharePoint < 0.4.0 | [Passport-SharePoint](https://github.com/auth0/passport-sharepoint) |
| February 15, 2019 | [CVE 2019-7644](/security/bulletins/cve-2019-7644) | Security Bulletin for Auth0-WCF-Service-JWT < 1.0.4 | [Auth0-WCF-Service-JWT](https://www.nuget.org/packages/Auth0-WCF-Service-JWT/) |
| 1 |
diff --git a/articles/quickstart/webapp/laravel/01-login.md b/articles/quickstart/webapp/laravel/01-login.md @@ -15,15 +15,15 @@ github:
---
<%= include('../_includes/_getting_started', { library: 'Laravel', callback: 'http://localhost:3000/callback' }) %>
-## Install and Configure Laravel 5.5
+## Install and Configure Laravel 5.7
If you are installing Auth0 to an existing app, you can skip this section. Otherwise, walk through the Laravel guides below to get started with a sample project.
-1. **[Installation](https://laravel.com/docs/5.5/installation)**
+1. **[Installation](https://laravel.com/docs/5.7/installation)**
* Use any of the install methods listed to start a new project
* PHP can be served any way that works for your development process (we use Homebrew-installed Apache and PHP)
* Walk through the "Configuration" section completely
-2. **[Configuration](https://laravel.com/docs/5.5/configuration)**
+2. **[Configuration](https://laravel.com/docs/5.7/configuration)**
* Create a .env file, used later for critical and sensitive Auth0 connection values
* Make sure `APP_DEBUG` is set to `true`
@@ -138,7 +138,7 @@ return array(
### Set Up Routes
-The plugin works with the [Laravel authentication system](https://laravel.com/docs/5.5/authentication) by creating a callback route to handle the authentication data from the Auth0 server.
+The plugin works with the [Laravel authentication system](https://laravel.com/docs/5.7/authentication) by creating a callback route to handle the authentication data from the Auth0 server.
First, we'll add our route and controller to `routes/web.php`. The route used here must match the `redirect_uri` configuration option set previously:
@@ -199,7 +199,7 @@ Route::get('/logout', 'Auth\Auth0IndexController@logout' )->name( 'logout' )->mi
### Integrate with Laravel authentication system
-The [Laravel authentication system](https://laravel.com/docs/5.5/authentication) needs a *User Object* given by a *User Provider*. With these two abstractions, the user entity can have any structure you like and can be stored anywhere. You configure the *User Provider* indirectly, by selecting a user provider in `config/auth.php`. The default provider is Eloquent, which persists the User model in a database using the ORM.
+The [Laravel authentication system](https://laravel.com/docs/5.7/authentication) needs a *User Object* given by a *User Provider*. With these two abstractions, the user entity can have any structure you like and can be stored anywhere. You configure the *User Provider* indirectly, by selecting a user provider in `config/auth.php`. The default provider is Eloquent, which persists the User model in a database using the ORM.
The plugin comes with an authentication driver called `auth0` which defines a user structure that wraps the [Normalized User Profile](/user-profile) defined by Auth0. This driver does not actually persist the User, it just stores it in session for future calls. This works fine for basic testing or if you don't really need to persist the user. For persistence in the database, see the "Custom User Handling" section below.
| 3 |
diff --git a/src/components/Modeler.vue b/src/components/Modeler.vue <b-col
class="paper-container h-100 pr-4"
ref="paper-container"
- :class="[cursor, { 'dragging-cursor' : isDragging }]"
+ :class="[cursor, { 'dragging-cursor' : isGrabbing }]"
:style="{ width: parentWidth, height: parentHeight }"
>
<div class="btn-toolbar tool-buttons d-flex mt-3 position-relative" role="toolbar" aria-label="Toolbar" :class="{ 'ignore-pointer': canvasDragPosition }">
@@ -179,7 +179,7 @@ export default {
minimumScale: 0.2,
scaleStep: 0.1,
toggleMiniMap: false,
- isDragging: false,
+ isGrabbing: false,
};
},
watch: {
@@ -825,11 +825,11 @@ export default {
this.paper.on('blank:pointerdown', (event, x, y) => {
const scale = this.paper.scale();
this.canvasDragPosition = { x: x * scale.sx, y: y * scale.sy};
- this.isDragging = true;
+ this.isGrabbing = true;
});
this.paper.on('cell:pointerup blank:pointerup', () => {
this.canvasDragPosition = null;
- this.isDragging = false;
+ this.isGrabbing = false;
});
this.$el.addEventListener('mousemove', event => {
| 10 |
diff --git a/lib/editor/components/ScheduleExceptionForm.js b/lib/editor/components/ScheduleExceptionForm.js @@ -71,7 +71,10 @@ export default class ScheduleExceptionForm extends Component {
{EXEMPLARS.map(exemplar => {
return (
<option value={exemplar} key={exemplar}>
- {toSentenceCase(exemplar)}
+ {exemplar === 'SWAP'
+ ? 'Swap, add, or remove'
+ : toSentenceCase(exemplar)
+ }
</option>
)
})}
@@ -110,7 +113,7 @@ export default class ScheduleExceptionForm extends Component {
? <FormGroup
controlId={`custom`}
className={`col-xs-12`}>
- <ControlLabel>Select calendars to add:</ControlLabel>
+ <ControlLabel>Select calendars to add (optional):</ControlLabel>
<Select
placeholder='Select calendar...'
clearable
@@ -132,7 +135,7 @@ export default class ScheduleExceptionForm extends Component {
})
: []
} />
- <ControlLabel>Select calendars to remove:</ControlLabel>
+ <ControlLabel>Select calendars to remove (optional):</ControlLabel>
<Select
placeholder='Select calendar...'
clearable
| 1 |
diff --git a/tests/e2e/plugins/site-verification-api-mock.php b/tests/e2e/plugins/site-verification-api-mock.php @@ -83,7 +83,7 @@ add_action( 'rest_api_init', function () {
return array(
'updated' => true,
- 'sites' => array( $data['siteURL'] ),
+ 'sites' => array(),
'identifier' => $data['siteURL'],
);
}
| 3 |
diff --git a/lib/determine-basal/determine-basal.js b/lib/determine-basal/determine-basal.js @@ -502,14 +502,15 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
} else {
rT.reason += " and waiting " + nextBolusMins + "m to microbolus again";
}
- //return tempBasalFunctions.setTempBasal(rate, durationReq, profile, rT, currenttemp);
rT.duration = durationReq;
- return rT;
// TODO: add the following for additional safety checks:
// The expected reservoir volume at which to deliver the microbolus (the reservoir volume from immediately before the last pumphistory run)
console.error(reservoir_data);
+ rT.reservoir = reservoir_data;
// The timestamp before which the microbolus needs to be sent (the timestamp of the next expected glucose reading)
+ //return tempBasalFunctions.setTempBasal(rate, durationReq, profile, rT, currenttemp);
+ return rT;
}
var maxSafeBasal = tempBasalFunctions.getMaxSafeBasal(profile);
| 12 |
diff --git a/app/models/taxon_change.rb b/app/models/taxon_change.rb @@ -45,7 +45,10 @@ class TaxonChange < ActiveRecord::Base
scope :taxon, lambda{|taxon|
joins(TAXON_JOINS).
- where("t1.id = ? OR t2.id = ? OR t1.ancestry LIKE ? OR t1.ancestry LIKE ?", taxon, taxon, "#{taxon.ancestry}/%", "#{taxon.ancestry}/%" )
+ where(
+ "t1.id = ? OR t2.id = ? OR t1.ancestry LIKE ? OR t1.ancestry LIKE ?",
+ taxon, taxon, "#{taxon.ancestry}/#{taxon.id}/%", "#{taxon.ancestry}/#{taxon.id}/%"
+ )
}
scope :input_taxon, lambda{|taxon|
| 1 |
diff --git a/minimap.js b/minimap.js @@ -21,6 +21,11 @@ const localMatrix = new THREE.Matrix4();
const cameraHeight = 50;
+// XXX TODO:
+// render at mose once per frame
+// do not render avatars
+// debug mirrors
+
const vertexShader = `\
varying vec2 vUv;
| 0 |
diff --git a/server/preprocessing/other-scripts/base.R b/server/preprocessing/other-scripts/base.R @@ -45,7 +45,7 @@ get_papers <- function(query, params, limit=100,
# add "textus:" to each word/phrase to enable verbatim search
# make sure it is added after any opening parentheses to enable queries such as "(a and b) or (a and c)"
- exact_query = gsub('([\"\']+(.*?)[\"\']+)|(?<=\\(\\b|\\+|-\\"\\b)|(?!or\\b|and\\b|-[\\"\\(]*\\b)(?<!\\S)(?=\\S)(?!\\(|\\+)'
+ exact_query = gsub('([\"\']+(.*?)[\"\']+)|(?<=\\(\\b|\\+|-\\"\\b)|(?!or\\b|and\\b|[-]+[\\"\\(]*\\b)(?<!\\S)(?=\\S)(?!\\(|\\+)'
, "textus:\\1", query_cleaned, perl=T)
blog$info(paste("BASE query:", exact_query))
| 9 |
diff --git a/monitoring/alerts.yaml b/monitoring/alerts.yaml @@ -61,8 +61,8 @@ groups:
# version listing operation latency is more than 300ms
- alert: ListingLatencyWarning
expr: |
- rate(http_request_duration_seconds_sum{namespace="${namespace}",service="${service}",action="getService|listBucket"}[1m])
- / rate(http_request_duration_seconds_count{namespace="${namespace}",service="${service}",action="getService|listBucket"}[1m])
+ rate(http_request_duration_seconds_sum{namespace="${namespace}",service="${service}",action="listBucket"}[1m])
+ / rate(http_request_duration_seconds_count{namespace="${namespace}",service="${service}",action="listBucket"}[1m])
>= 0.300
for: 5m
labels:
@@ -74,8 +74,8 @@ groups:
# version listing operation latency is more than 500ms
- alert: ListingLatencyCritical
expr: |
- rate(http_request_duration_seconds_sum{namespace="${namespace}",service="${service}",action="getService|listBucket"}[1m])
- / rate(http_request_duration_seconds_count{namespace="${namespace}",service="${service}",action="getService|listBucket"}[1m])
+ rate(http_request_duration_seconds_sum{namespace="${namespace}",service="${service}",action="listBucket"}[1m])
+ / rate(http_request_duration_seconds_count{namespace="${namespace}",service="${service}",action="listBucket"}[1m])
>= 0.500
for: 5m
labels:
| 4 |
diff --git a/src/pages/strategy/strategy.html b/src/pages/strategy/strategy.html <script type="text/javascript" src="../../library/managers/ShipManager.js"></script>
<script type="text/javascript" src="../../library/managers/GoalTemplateManager.js"></script>
<!-- @nonbuildend -->
- <script type="text/javascript" src="../../../../library/modules/RemodelDb.js"></script>
- <script type="text/javascript" src="../../../../library/modules/Database.js"></script>
- <script type="text/javascript" src="../../../../library/modules/Master.js"></script>
- <script type="text/javascript" src="../../../../library/modules/Translation.js"></script>
- <script type="text/javascript" src="../../../../library/modules/Meta.js"></script>
- <script type="text/javascript" src="../../../../library/modules/DataBackup.js"></script>
- <script type="text/javascript" src="../../../../library/modules/WhoCallsTheFleetDb.js"></script>
- <script type="text/javascript" src="../../library/modules/PictureBook.js"></script>
- <script type="text/javascript" src="../../../../library/modules/AntiAir.js"></script>
- <script type="text/javascript" src="../../../../library/modules/Expedition.js"></script>
<script type="text/javascript" src="../../library/modules/RemodelDb.js"></script>
+ <script type="text/javascript" src="../../library/modules/Database.js"></script>
+ <script type="text/javascript" src="../../library/modules/Master.js"></script>
+ <script type="text/javascript" src="../../library/modules/Translation.js"></script>
+ <script type="text/javascript" src="../../library/modules/Meta.js"></script>
+ <script type="text/javascript" src="../../library/modules/DataBackup.js"></script>
+ <script type="text/javascript" src="../../library/modules/WhoCallsTheFleetDb.js"></script>
+ <script type="text/javascript" src="../../library/modules/PictureBook.js"></script>
+ <script type="text/javascript" src="../../library/modules/AntiAir.js"></script>
+ <script type="text/javascript" src="../../library/modules/Expedition.js"></script>
<script type="text/javascript" src="strategy.js"></script>
| 1 |
diff --git a/lib/git-shell-out-strategy.js b/lib/git-shell-out-strategy.js @@ -416,10 +416,23 @@ export default class GitShellOutStrategy {
}
async getCommitMessageFromTemplate() {
- const templatePath = await this.getConfig('commit.template');
- if (!templatePath || ! await fileExists(templatePath)) return;
+ let templatePath = await this.getConfig('commit.template');
+ if (!templatePath) return;
+
+ // Get absolute path from git path
+ // https://git-scm.com/docs/git-config#git-config-pathname
+ const homeDir = os.homedir();
+ const regex = new RegExp('^~([^\/]*)\/');
+ templatePath = templatePath.trim().replace(regex, (_, user) => {
+ return `${user ? path.join(path.dirname(homeDir), user) : homeDir}/`
+ })
+ if (!path.isAbsolute(templatePath)) {
+ templatePath = path.join(this.workingDir, templatePath);
+ }
+
+ if(!await fileExists(templatePath)) return;
const message = await fs.readFile(templatePath, { encoding: 'utf8'})
- return message
+ return message.trim();
}
unstageFiles(paths, commit = 'HEAD') {
| 9 |
diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js @@ -217,9 +217,10 @@ class TileLayer extends Layer {
};
let containerExtent = map.getContainerExtent();
+ const extent2d = map._get2DExtent();
const maskExtent = this._getMask2DExtent();
if (maskExtent) {
- const intersection = maskExtent.intersection(map._get2DExtent());
+ const intersection = maskExtent.intersection(extent2d);
if (!intersection) {
return emptyGrid;
}
@@ -231,8 +232,6 @@ class TileLayer extends Layer {
//Get description of center tile including left and top offset
const c = this._project(map._getPrjCenter());
- const extent2d = map._get2DExtent(),
- center2D = extent2d.getCenter();
const pmin = this._project(map._pointToPrj(extent2d.getMin())),
pmax = this._project(map._pointToPrj(extent2d.getMax()));
@@ -293,8 +292,9 @@ class TileLayer extends Layer {
}
//sort tiles according to tile's distance to center
+ const center = map._containerPointToPoint(containerExtent.getCenter(), zoom);
tiles.sort(function (a, b) {
- return (b.point.distanceTo(center2D) - a.point.distanceTo(center2D));
+ return (b.point.distanceTo(center) - a.point.distanceTo(center));
});
return {
| 7 |
diff --git a/lib/plugins/account/src/test/account-backend-test.js b/lib/plugins/account/src/test/account-backend-test.js @@ -12,11 +12,16 @@ require.cache[require.resolve('abacus-request')].exports = {
const backendResponse = require('./backend-test-response.json');
-process.env.ACCOUNT_IGNORE_PATTERN = 'idz:';
+describe('abacus-account-plugin-backend', () => {
-const accountBackend = require('../lib/account-backend');
+ let accountBackend;
-describe('abacus-account-plugin-backend', () => {
+ beforeEach(() => {
+ sandbox.reset();
+
+ delete require.cache[require.resolve('../lib/account-backend')];
+ accountBackend = require('../lib/account-backend');
+ });
context('when backend URI is not provided', () => {
it('returns default/sample account information', (done) => {
@@ -31,7 +36,7 @@ describe('abacus-account-plugin-backend', () => {
context('when backend URI is available', () => {
context('and backend responds OK', () => {
- before(() => {
+ beforeEach(() => {
getStub.yields(undefined, { statusCode: 200, body: backendResponse });
});
@@ -59,30 +64,58 @@ describe('abacus-account-plugin-backend', () => {
});
context('when no account info is available for an org', () => {
- it('returns sample account information', (done) => {
+ let error;
+ let accountInfo;
+
+ beforeEach((done) => {
const accounts = accountBackend('https://test-backend.com/accounts', () => 'test');
accounts('testOrg', (err, val) => {
- expect(err).to.equal(undefined);
- expect(val).to.deep.equal(accountBackend.sampleAccount);
+ error = err;
+ accountInfo = val;
done();
});
});
+
+ it('calls account backend', () => {
+ sinon.assert.calledOnce(getStub);
+ });
+
+ it('returns sample account information', () => {
+ expect(error).to.equal(undefined);
+ expect(accountInfo).to.deep.equal(accountBackend.sampleAccount);
+ });
});
context('when org id matches ignore pattern', () => {
- it('returns sample account information', (done) => {
+ let error;
+ let accountInfo;
+
+ before(() => {
+ process.env.ACCOUNT_IGNORE_PATTERN = 'idz:';
+ });
+
+ beforeEach((done) => {
const accounts = accountBackend('https://test-backend.com/accounts', () => 'test');
accounts('idz:testOrg', (err, val) => {
- expect(err).to.equal(undefined);
- expect(val).to.deep.equal(accountBackend.sampleAccount);
+ error = err;
+ accountInfo = val;
done();
});
});
+
+ it('does not call account backend', () => {
+ sinon.assert.notCalled(getStub);
+ });
+
+ it('returns sample account information', () => {
+ expect(error).to.equal(undefined);
+ expect(accountInfo).to.deep.equal(accountBackend.sampleAccount);
+ });
});
});
context('when the backend fails', () => {
- before(() => {
+ beforeEach(() => {
getStub.yields(undefined, { statusCode: 422 });
});
| 7 |
diff --git a/src/lib/composite-layer.js b/src/lib/composite-layer.js @@ -7,7 +7,12 @@ export default class CompositeLayer extends Layer {
// Initialize layer is usually not needed for composite layers
// Provide empty definition to disable check for missing definition
- initializeLayer() {}
+ initializeLayer(updateParams) {
+ // Call subclass lifecycle methods
+ this.initializeState();
+ this.updateState(updateParams);
+ // End subclass lifecycle methods
+ }
getPickingInfo(opts) {
// do not call onHover/onClick on the container
| 1 |
diff --git a/hooks/src/index.js b/hooks/src/index.js @@ -16,12 +16,12 @@ options.beforeRender = vnode => {
const hooks = component.__hooks;
- if (hooks) {
+ if (!hooks) return;
+
let effect;
while (effect = hooks._pendingEffects.shift()) {
invokeEffect(effect);
}
- }
};
@@ -34,7 +34,8 @@ options.afterDiff = vnode => {
const hooks = c.__hooks;
- if (hooks) {
+ if (!hooks) return;
+
stateChanged = false;
let effect;
@@ -43,7 +44,6 @@ options.afterDiff = vnode => {
}
if (stateChanged) c.forceUpdate();
- }
};
@@ -54,13 +54,13 @@ options.beforeUnmount = vnode => {
const c = vnode._component;
const hooks = c.__hooks;
- if (hooks) {
+ if (!hooks) return;
+
for (let i = 0; i < hooks._list.length; i++) {
if (hooks._list[i]._cleanup) {
hooks._list[i]._cleanup();
}
}
- }
};
const createHook = (create, shouldRun) => (...args) => {
| 4 |
diff --git a/package.json b/package.json {
"name": "monaco-json",
- "version": "2.3.0",
+ "version": "2.2.0",
"description": "JSON plugin for the Monaco Editor",
"scripts": {
"compile": "mrmdir ./out && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json",
| 13 |
diff --git a/packages/shared/styles/components/SfIcon.scss b/packages/shared/styles/components/SfIcon.scss @@ -36,6 +36,8 @@ $sf-icon-colors : (
outline: none;
background-color: transparent;
box-sizing: border-box;
+ display: flex;
+
fill: var(--icon-color);
width: var(--icon-size);
height: var(--icon-size);
@@ -52,8 +54,8 @@ $sf-icon-colors : (
}
}
- * {
- width: 100%;
- height: 100%;
+ :not(path) {
+ width: inherit;
+ height: inherit;
}
}
| 1 |
diff --git a/lib/node_modules/@stdlib/math/generics/random/shuffle/README.md b/lib/node_modules/@stdlib/math/generics/random/shuffle/README.md @@ -38,7 +38,7 @@ By default, the function returns a shallow copy. To mutate the input `array` (e.
var arr = [ 1, 2, 3 ];
var out = shuffle( arr, {
'copy': 'none'
-})
+});
var bool = ( arr === out );
// returns true
```
@@ -72,7 +72,7 @@ bool = ( arr[2] === out[2] );
#### shuffle.factory( \[options\] )
-Returns a `function` to shuffle elements of `array`-like object.
+Returns a `function` to shuffle elements of `array`-like objects.
``` javascript
var myshuffle = shuffle.factory();
@@ -97,20 +97,20 @@ var out = myshuffle( [ 0, 1, 2, 3, 4 ] )
By default, the returned functions create shallow copies when shuffling. To override the default `copy` strategy, set the `copy` option.
``` javascript
-var shuffle = factory({
+var myshuffle = shuffle.factory({
'copy': 'none',
'seed': 867
});
// Created shuffle function mutates input array by default:
var arr = [ 1, 2, 3, 4, 5, 6 ];
-var out = shuffle( arr );
+var out = myshuffle( arr );
var bool = ( arr === out );
// returns true
// Default option can be overridden:
arr = [ 1, 2, 3, 4 ];
-out = shuffle( arr, {
+out = myshuffle( arr, {
'copy': 'shallow'
});
bool = ( arr === out );
| 7 |
diff --git a/experimental/adaptive-dialog/docs/anatomy-and-runtime-behavior.md b/experimental/adaptive-dialog/docs/anatomy-and-runtime-behavior.md - [Inputs](#Inputs)
<p align="center">
- <img alt="Adaptive_dialog_anatomy" src="./assets/adaptive-dialog-anatomy.png" style="max-width:700px;" />
+ <img alt="Adaptive_dialog_anatomy" src="./Assets/adaptive-dialog-anatomy.png" style="max-width:700px;" />
</p>
### Recognizers
@@ -48,7 +48,7 @@ To help illustrate this, let's take a scenario based walk through of the runtime
```
<p align="center">
- <img alt="Adaptive_dialog_scenario_setup" src="./assets/adaptive-dialog-scenario-setup.png" style="max-width:700px;" />
+ <img alt="Adaptive_dialog_scenario_setup" src="./Assets/adaptive-dialog-scenario-setup.png" style="max-width:700px;" />
</p>
For this scenario, we have three adaptive dialogs -
@@ -59,13 +59,13 @@ For this scenario, we have three adaptive dialogs -
Here's the flow when user says `I'd like to book a flight`
<p align="center">
- <img alt="Adaptive_dialog_scenario_setup" src="./assets/adaptive-dialog-first-utterance.png" style="max-width:700px;" />
+ <img alt="Adaptive_dialog_scenario_setup" src="./Assets/adaptive-dialog-first-utterance.png" style="max-width:700px;" />
</p>
And here's the flow when user says `How's the weather in Seattle?`
<p align="center">
- <img alt="Adaptive_dialog_scenario_setup" src="./assets/adaptive-dialog-second-utterance.png" style="max-width:700px;" />
+ <img alt="Adaptive_dialog_scenario_setup" src="./Assets/adaptive-dialog-second-utterance.png" style="max-width:700px;" />
</p>
At the crux:
| 1 |
diff --git a/src/ServerlessOffline.js b/src/ServerlessOffline.js @@ -11,14 +11,14 @@ import {
import pkg from '../package.json'
export default class ServerlessOffline {
- constructor(serverless, options) {
+ constructor(serverless, cliOptions) {
this._http = null
this._schedule = null
this._webSocket = null
this._lambda = null
this._config = serverless.config
- this._options = options
+ this._cliOptions = cliOptions
this._provider = serverless.service.provider
this._service = serverless.service
this._version = serverless.version
@@ -230,7 +230,7 @@ export default class ServerlessOffline {
apiKey: createDefaultApiKey(),
...defaults,
...customOptions,
- ...this._options,
+ ...this._cliOptions,
}
// Parse CORS options
| 10 |
diff --git a/test/geometry/LineStringSpec.js b/test/geometry/LineStringSpec.js @@ -414,7 +414,9 @@ describe('Geometry.LineString', function () {
layer = new maptalks.VectorLayer('id2');
var polyline = new maptalks.LineString([
map.getCenter(),
- map.getCenter().add(0.01, 0.01)
+ map.getCenter().add(0.01, 0.01),
+ map.getCenter().add(0.01, 0),
+ map.getCenter().add(0, 0),
], {
'smoothness' : 0.1,
'visible' : false
| 3 |
diff --git a/packages/build/src/core/main.js b/packages/build/src/core/main.js @@ -41,13 +41,7 @@ const { doDryRun } = require('./dry')
* @returns {string[]} buildResult.logs - When using the `buffer` option, all log messages
*/
const build = async function(flags = {}) {
- const buildTimer = startTimer()
-
- const logs = getBufferLogs(flags)
- logBuildStart(logs)
-
- const { testOpts, bugsnagKey, ...flagsA } = normalizeFlags(flags, logs)
- const errorMonitor = startErrorMonitor({ flags: flagsA, logs, bugsnagKey })
+ const { flags: flagsA, errorMonitor, logs, testOpts, buildTimer } = startBuild(flags)
try {
const {
@@ -112,6 +106,20 @@ const build = async function(flags = {}) {
}
}
+// Performed on build start. Must be kept small and unlikely to fail since it
+// does not have proper error handling. Error handling relies on `errorMonitor`
+// being built, which relies itself on flags being normalized.
+const startBuild = function(flags) {
+ const buildTimer = startTimer()
+
+ const logs = getBufferLogs(flags)
+ logBuildStart(logs)
+
+ const { testOpts, bugsnagKey, ...flagsA } = normalizeFlags(flags, logs)
+ const errorMonitor = startErrorMonitor({ flags: flagsA, logs, bugsnagKey })
+ return { flags: flagsA, errorMonitor, logs, testOpts, buildTimer }
+}
+
// Runs a build then report any plugin statuses
const runAndReportBuild = async function({
netlifyConfig,
| 5 |
diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js @@ -413,10 +413,10 @@ function formatReportLastMessageText(lastMessageText) {
* @returns {String}
*/
function getDefaultAvatar(login = '') {
- // There are 8 possible default avatars, so we choose which one this user has based
+ // There are 24 possible default avatars, so we choose which one this user has based
// on a simple hash of their login
- const loginHashBucket = (Math.abs(hashCode(login.toLowerCase())) % 8) + 1;
- return `${CONST.CLOUDFRONT_URL}/images/avatars/avatar_${loginHashBucket}.png`;
+ const loginHashBucket = (Math.abs(hashCode(login.toLowerCase())) % 24) + 1;
+ return `${CONST.CLOUDFRONT_URL}/images/avatars/default-avatar_${loginHashBucket}.png`;
}
/**
| 4 |
diff --git a/token-metadata/0xa19A40FbD7375431fAB013a4B08F00871B9a2791/metadata.json b/token-metadata/0xa19A40FbD7375431fAB013a4B08F00871B9a2791/metadata.json "symbol": "SWAGG",
"address": "0xa19A40FbD7375431fAB013a4B08F00871B9a2791",
"decimals": 4,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/src/pages/guidelines/color/overview.mdx b/src/pages/guidelines/color/overview.mdx @@ -168,7 +168,7 @@ color.
| Theme | Primary background | Token | Hex value | |
| -------- | ----------------------- | ---------------- | --------- | ------------------------------------------: |
| White | Global Background Light | `$ui-background` | `#ffffff` | <ColorBlock size="xs">#ffffff</ColorBlock> |
-| Gray 10 | Global Background Light | `$ui-background` | `#f3f3f3` | <ColorBlock size="xs">#f3f3f3</ColorBlock> |
+| Gray 10 | Global Background Light | `$ui-background` | `#f4f4f4` | <ColorBlock size="xs">#f4f4f4</ColorBlock> |
| Gray 90 | Global Background Dark | `$ui-background` | `#282828` | <ColorBlock size="xs">#282828</ColorBlock> |
| Gray 100 | Global Background Dark | `$ui-background` | `#171717` | <ColorBlock size="xs">#171717</ColorBlock> |
| 12 |
diff --git a/src/article/converter/html/ArticleHTMLExporter.js b/src/article/converter/html/ArticleHTMLExporter.js @@ -22,4 +22,43 @@ export default class ArticleHTMLExporter extends HTMLExporter {
}
return super.annotatedText(path)
}
+
+ getDefaultBlockConverter () {
+ return defaultBlockConverter // eslint-disable-line no-use-before-define
+ }
+}
+
+// TODO: the default converter is used for nodes that do not have a converter registered
+const defaultBlockConverter = {
+ export: function (node, el, converter) {
+ el.attr('data-type', node.type)
+ const nodeSchema = node.getSchema()
+ for (let prop of nodeSchema) {
+ const name = prop.name
+ if (name === 'id' || name === 'type') continue
+ // using RDFa like attributes
+ let propEl = converter.$$('div').attr('property', name)
+ let value = node[name]
+ if (prop.isText()) {
+ propEl.append(converter.annotatedText([node.id, name]))
+ } else if (prop.isReference()) {
+ if (prop.isOwned()) {
+ value = node.resolve(name)
+ if (prop.isArray()) {
+ propEl.append(value.map(child => converter.convertNode(child)))
+ } else {
+ propEl.append(converter.convertNode(value))
+ }
+ } else {
+ // TODO: what to do with relations? maybe create a link pointing to the real one?
+ // or render a label of the other
+ // For now, we skip such props
+ continue
+ }
+ } else {
+ propEl.append(value)
+ }
+ el.append(propEl)
+ }
+ }
}
| 7 |
diff --git a/documentation/assertions/any/to-satisfy.md b/documentation/assertions/any/to-satisfy.md @@ -17,13 +17,16 @@ expect({ hey: { there: true } }, 'to exhaustively satisfy', {
});
```
-Regular expressions and `expect.it` expressions in the right-hand side object
-will be run against the corresponding values in the subject:
+Regular expressions in the right-hand side object will be run against the
+corresponding value in the subject:
```js
expect({ bar: 'quux', baz: true }, 'to satisfy', { bar: /QU*X/i });
```
+Additional support exists for making statements about valid values and this is
+detailed in the [complex specifications](#complex-specifications) section below.
+
## array-like
When satisfying against an array-like, length is always taken into account. The
@@ -87,10 +90,10 @@ arrayWithNonNumerics.someProperty = 'baz';
expect(arrayWithNonNumerics, 'to satisfy', { someProperty: 'baz' });
```
-## Complex specifications
+## [Complex specifications](#complex-specifications)
`to satisfy` specifications allow complex statements to be made about the values
-corresponding to a specific key. When combined with `expect.it` these specifications
+corresponding to a specific key. Using the `expect.it` function these specifications
can delegate to other assertions:
```js
| 2 |
diff --git a/src/pages/developers/tutorials.tsx b/src/pages/developers/tutorials.tsx @@ -266,6 +266,11 @@ const TutorialsPage = ({
[pageContext.locale]
)
+ const allTags = useMemo(
+ () => getSortedTutorialTagsForLang(filteredTutorialsByLang),
+ [filteredTutorialsByLang]
+ )
+
const intl = useIntl()
const [isModalOpen, setModalOpen] = useState(false)
const [filteredTutorials, setFilteredTutorials] = useState(
@@ -273,11 +278,6 @@ const TutorialsPage = ({
)
const [selectedTags, setSelectedTags] = useState<Array<string>>([])
- const allTags = useMemo(
- () => getSortedTutorialTagsForLang(filteredTutorials),
- [filteredTutorials]
- )
-
useEffect(() => {
let tutorials = filteredTutorialsByLang
| 13 |
diff --git a/packages/next/next-server/server/config.ts b/packages/next/next-server/server/config.ts @@ -97,7 +97,7 @@ function assignDefaults(userConfig: { [key: string]: any }) {
`The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://err.sh/zeit/next.js/can-not-output-to-public`
)
}
- // make sure distDir isn't an empty string which can result the provided
+ // make sure distDir isn't an empty string as it can result in the provided
// directory being deleted in development mode
if (userDistDir.length === 0) {
throw new Error(
| 7 |
diff --git a/resources/functions/media/mpris.js b/resources/functions/media/mpris.js @@ -76,7 +76,7 @@ module.exports = {
const MetaData = {
'mpris:trackid': app.mpris.objectPath(`track/${attributes.playParams.id.replace(/[.]+/g, "")}`),
'mpris:length': attributes.durationInMillis * 1000, // In microseconds
- 'mpris:artUrl': (attributes.artwork.url.replace('/{w}x{h}bb', '/35x35bb')).replace('/2000x2000bb', '/35x35bb'),
+ 'mpris:artUrl': (attributes.artwork.url.replace('/{w}x{h}bb', '/512x512bb')).replace('/2000x2000bb', '/35x35bb'),
'xesam:title': `${attributes.name}`,
'xesam:album': `${attributes.albumName}`,
'xesam:artist': [`${attributes.artistName}`,],
| 7 |
diff --git a/priv/public/ui/app/mn_admin/mn_xdcr/reference_dialog/mn_xdcr_reference_dialog.html b/priv/public/ui/app/mn_admin/mn_xdcr/reference_dialog/mn_xdcr_reference_dialog.html </div>
<div class="formrow">
<textarea
- rows="3"
+ rows="4"
autocorrect="off"
autocompleterg="off"
spellcheck="false"
ng-show="xdcrReferenceDialogCtl.cluster.demandEncryption"
ng-model="xdcrReferenceDialogCtl.cluster.certificate"
- placeholder="Copy paste the Certificate information from Remote Cluster here. You can find the certificate information on Couchbase Admin UI under Security > Root Certificate tab.">
+ placeholder="Copy/paste the certificate information from your remote cluster into this field. You can find the certificate information on the Couchbase Web Console in the security area.">
</textarea>
</div>
</div>
| 7 |
diff --git a/contracts/Synthetix.sol b/contracts/Synthetix.sol @@ -482,8 +482,8 @@ contract Synthetix is ExternStateToken {
/**
* @notice Function that allows synth contract to delegate sending fee to the fee Pool.
- * @dev Only the synth contract can call this function
- * @param from The address to
+ * @dev Only the synth contract can call this function.
+ * @param from The address fee is coming from.
* @param sourceCurrencyKey source currency fee from.
* @param sourceAmount The amount, specified in UNIT of source currency.
* @return Boolean that indicates whether the transfer succeeded or failed.
@@ -510,9 +510,7 @@ contract Synthetix is ExternStateToken {
);
// Tell the fee pool about this.
- if (result) {
feePool.feePaid(sourceCurrencyKey, sourceAmount);
- }
return result;
}
| 3 |
diff --git a/src/components/Backtester/style.scss b/src/components/Backtester/style.scss margin-bottom: 10px;
.hfui-backtester_row {
- margin-bottom: 5px !important;
+ margin-bottom: spacing(0.25) !important;
}
.hfui-dropdown__button, .react-datepicker__input-container input {
border: none;
}
- .input-label {
- color: $grey-color;
- font-size: 11px;
- line-height: 16px;
- padding-right: 15px;
- }
-
.hfui-backtester__flex_start {
display: flex;
flex: 1;
}
.hfui-backtester__wrapper {
- padding: 20px 40px 20px 10px;
+ padding: spacing();
+
+ .ufx-dropdown {
+ margin-right: spacing(0.75);
+ }
}
| 7 |
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml @@ -130,7 +130,7 @@ jobs:
- name: Build Android Release
env:
RELEASE_ANDROID_PASSPHRASE: ${{ secrets.RELEASE_ANDROID_PASSPHRASE }}
- ENVFILE: '.env.${{ env.ENV }}'
+ ENVFILE: '../.env.${{ env.ENV }}'
BUILD_NUMBER: ${{ github.run_number }}
run: |
BUILD_VERSION=`node -pe "require('./package.json')['version']"`
| 3 |
diff --git a/src/architecture/network.js b/src/architecture/network.js @@ -132,6 +132,7 @@ function Network(input_size, output_size) {
// Activate nodes chronologically - first input, then hidden, then output
// activate input nodes
// TODO: fix, this should be activated according to nodes order
+
let input_node_index = 0;
for (let i = 0; i < self.nodes.length; i++) {
if (input_node_index === self.input_nodes.size) {
@@ -139,11 +140,8 @@ function Network(input_size, output_size) {
}
const node = self.nodes[i];
if (!self.input_nodes.has(node)) continue;
- if (trace) {
- node.activate(input[input_node_index++]);
- } else {
- node.noTraceActivate(input[input_node_index++]);
- }
+
+ node.activate(input[input_node_index++], { trace })
}
if (input_node_index !== input.length) {
throw Error(`There are ${input_node_index} input nodes, but ${input.length} inputs were passed`);
@@ -155,11 +153,8 @@ function Network(input_size, output_size) {
if (self.input_nodes.has(node) || self.output_nodes.has(node)) return;
if (dropout_rate) node.mask = Math.random() < dropout_rate ? 0 : 1;
- if (trace) {
- node.activate();
- } else {
- node.noTraceActivate();
- }
+
+ node.activate({ trace })
});
const output = [];
@@ -169,18 +164,15 @@ function Network(input_size, output_size) {
}
const node = self.nodes[i];
if (!self.output_nodes.has(node)) continue;
+
// only activate output nodes this run
- let node_output;
- if (trace) {
- node_output = node.activate();
- } else {
- node_output = node.noTraceActivate();
- }
- output.push(node_output);
+ output.push(node.activate({ trace }))
}
+
if (output.length !== self.output_nodes.size) {
throw Error(`There are ${self.output_nodes.size} output nodes, but ${output.length} outputs were passed`);
}
+
return output;
}
| 14 |
diff --git a/docker-compose.example.yml b/docker-compose.example.yml @@ -7,7 +7,7 @@ services:
- 1705:1705
- 1780:1780
volumes:
- - HOST_SNAPCAST_TEMP:/tmp
+ - /tmp/snapserver:/tmp
- ./docker/snapserver.conf:/etc/snapserver.conf
mopidy:
image: jaedb/iris
@@ -26,5 +26,5 @@ services:
#- ./IRIS_VERSION:/iris/IRIS_VERSION
- ./docker/data:/var/lib/mopidy/iris
- ./docker/mopidy.conf:/config/mopidy.conf
- - HOST_MUSIC_DIRECTORY:/var/lib/mopidy/media
- - HOST_SNAPCAST_TEMP:/tmp
+ - /mnt/Music:/var/lib/mopidy/media
+ - /tmp/snapserver:/tmp
| 4 |
diff --git a/src/resources/basis.js b/src/resources/basis.js @@ -18,7 +18,7 @@ const getCompressionFormats = (device) => {
const prepareWorkerModules = (config, callback) => {
const getWorkerBlob = () => {
const code = '(' + BasisWorker.toString() + ')()\n\n';
- return new File([code], 'basis_worker.js', { type: 'application/javascript' });
+ return new Blob([code], { type: 'application/javascript' });
};
const wasmSupported = () => {
| 14 |
diff --git a/src/components/TableSelectCell.js b/src/components/TableSelectCell.js @@ -9,7 +9,7 @@ import KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight';
const defaultSelectCellStyles = theme => ({
root: {
[theme.breakpoints.down('sm')]: {
- display: 'none',
+ backgroundColor: theme.palette.background.paper,
},
},
fixedHeader: {
| 11 |
diff --git a/src/yy/YyObject.hx b/src/yy/YyObject.hx @@ -140,7 +140,7 @@ import yy.YyResourceRef;
if (ev != null) {
// OK!
}
- else if (YyTools.isV22(this)) {
+ else if (v22) {
ev = {
id: new YyGUID(),
modelName: "GMEvent",
@@ -162,7 +162,7 @@ import yy.YyResourceRef;
parent: { name: this.name, path: 'objects/${this.name}/${this.name}.yy' },
eventType: idat.type,
eventNum: idat.numb != null ? idat.numb : 0,
- name: null,
+ name: "",
tags: [],
};
}
| 1 |
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md @@ -312,3 +312,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Jon Beniston](https://github.com/srcejon)
- [Ugnius Malukas](https://github.com/ugnelis)
- [Justin Peter](https://github.com/themagicnacho)
+- [Jefferson Chua](https://github.com/jeffechua)
| 3 |
diff --git a/src/browser/provider/built-in/chrome/local-chrome.js b/src/browser/provider/built-in/chrome/local-chrome.js +import OS from 'os-family';
+import Promise from 'pinkie';
import browserTools from 'testcafe-browser-tools';
import killBrowserProcess from '../../utils/kill-browser-process';
+import delay from '../../../../utils/delay';
+const MACOS_PROCESS_THROTTLING = 500;
+
+var throttlingPromise = Promise.resolve();
+
function buildChromeArgs (config, cdpPort, platformArgs, profileDir) {
return []
.concat(
@@ -20,7 +27,13 @@ export async function start (pageUrl, { browserName, config, cdpPort, tempProfil
chromeOpenParameters.cmd = buildChromeArgs(config, cdpPort, chromeOpenParameters.cmd, tempProfileDir);
- await browserTools.open(chromeOpenParameters, pageUrl);
+ var currentThrottlingPromise = throttlingPromise;
+
+ if (OS.mac)
+ throttlingPromise = throttlingPromise.then(() => delay(MACOS_PROCESS_THROTTLING));
+
+ await currentThrottlingPromise
+ .then(() => browserTools.open(chromeOpenParameters, pageUrl));
}
export async function stop ({ browserId }) {
| 0 |
diff --git a/data.js b/data.js @@ -4999,6 +4999,14 @@ module.exports = [
url: "https://github.com/kylepaulsen/NanoModal",
source: "https://raw.githubusercontent.com/kylepaulsen/NanoModal/master/nanomodal.js"
},
+ {
+ name: "pure-dialog",
+ github: "john-doherty/pure-dialog",
+ tags: ["modal", "dialog", "popup", "pop under", "alert"],
+ description: "Pure JavaScript modal dialog designed to simplify the creation of dialogs in Web and Hybrid Mobile apps",
+ url: "https://github.com/john-doherty/pure-dialog",
+ source: "https://raw.githubusercontent.com/john-doherty/pure-dialog/master/dist/pure-dialog.min.js"
+ },
{
name: "dom-i18n",
github: "ruyadorno/dom-i18n",
| 0 |
diff --git a/util.js b/util.js @@ -819,6 +819,16 @@ export const proxifyUrl = u => {
return u;
}
};
+export const createRelativeUrl = (u, baseUrl) => {
+ if (/^(?:[\.\/]|([a-z0-9]+):\/\/)/i.test(u)) {
+ return u;
+ } else {
+ if (!/([a-z0-9]+):\/\//i.test(baseUrl)) {
+ baseUrl = new URL(baseUrl, window.location.href).href;
+ }
+ return new URL(u, baseUrl).href;
+ }
+};
export const getDropUrl = o => {
let u = null;
if (typeof o?.start_url === 'string') {
| 0 |
diff --git a/components/button/__docs__/storybook-stories.jsx b/components/button/__docs__/storybook-stories.jsx @@ -65,7 +65,7 @@ storiesOf(BUTTON, module)
))
.add('Icon Container Small', () =>
getIconButton({
- assistiveText: { icon: 'Icon border container small' },
+ assistiveText: { icon: 'Icon container small' },
iconCategory: 'utility',
iconName: 'settings',
iconSize: 'large',
| 3 |
diff --git a/src/PanelTraits/Update.php b/src/PanelTraits/Update.php @@ -59,7 +59,7 @@ trait Update
$field['value'][] = $entry->{$subfield['name']};
}
} else {
- $field['value'] = $this->getEntryValue($entry, $field);
+ $field['value'] = $this->getModelAttributeValue($entry, $field);
}
}
}
@@ -79,18 +79,18 @@ trait Update
/**
* Get the value of the 'name' attribute from the declared relation model in the given field.
*
- * @param Model $entry The model.
+ * @param Model $model The current CRUD model.
* @param array $field The CRUD field array.
*
* @return mixed The value of the 'name' attribute from the relation model.
*/
- private function getEntryValue($entry, $field)
+ private function getModelAttributeValue($model, $field)
{
if (isset($field['entity'])) {
$relationArray = explode('.', $field['entity']);
$relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) {
return $obj->{$method} ? $obj->{$method} : $obj;
- }, $entry);
+ }, $model);
$relationMethod = end($relationArray);
if ($relatedModel->{$relationMethod} && $relatedModel->{$relationMethod}() instanceof HasOneOrMany) {
@@ -100,6 +100,6 @@ trait Update
}
}
- return $entry->{$field['name']};
+ return $model->{$field['name']};
}
}
| 10 |
diff --git a/spec/models/table_spec.rb b/spec/models/table_spec.rb @@ -224,20 +224,16 @@ describe Table do
}
}
- # To forget about internals of zooming
- ::Map.any_instance.stubs(:recalculate_zoom).returns(nil)
- Carto::Map.any_instance.stubs(:recalculate_zoom).returns(nil)
-
visualizations = CartoDB::Visualization::Collection.new.fetch.to_a.length
table = create_table(name: "epaminondas_pantulis", user_id: @user.id)
CartoDB::Visualization::Collection.new.fetch.to_a.length.should == visualizations + 1
map = table.map
map.should be
- map.zoom.should eq 3
- map.bounding_box_sw.should eq "[#{::Map::DEFAULT_OPTIONS[:bounding_box_sw][0]}, #{::Map::DEFAULT_OPTIONS[:bounding_box_sw][1]}]"
- map.bounding_box_ne.should eq "[#{::Map::DEFAULT_OPTIONS[:bounding_box_ne][0]}, #{::Map::DEFAULT_OPTIONS[:bounding_box_ne][1]}]"
- map.center.should eq "[0.0,0.0]"
+ map.zoom.should eq Carto::Map::DEFAULT_OPTIONS[:zoom]
+ map.bounding_box_sw.should eq Carto::Map::DEFAULT_OPTIONS[:bounding_box_sw]
+ map.bounding_box_ne.should eq Carto::Map::DEFAULT_OPTIONS[:bounding_box_ne]
+ map.center.should eq Carto::Map::DEFAULT_OPTIONS[:center]
map.provider.should eq 'leaflet'
map.layers.count.should == 2
map.layers.map(&:kind).should == ['tiled', 'carto']
| 1 |
diff --git a/scene-previewer.js b/scene-previewer.js @@ -304,9 +304,11 @@ class ScenePreviewer extends THREE.Object3D {
// pop old state
popPreviewContainerTransform();
popRenderSettings();
- }
+ } */
{
+ const popRenderSettings = this.#pushRenderSettings();
+
const worldResolution = new THREE.Vector2(2048, 2048);
const worldDepthResolution = new THREE.Vector2(512, 512);
@@ -329,6 +331,8 @@ class ScenePreviewer extends THREE.Object3D {
lodMesh.visible = oldVisible;
this.lodMesh = lodMesh;
+
+ popRenderSettings();
}
this.rendered = true;
| 0 |
diff --git a/services/user-mover/export_user.rb b/services/user-mover/export_user.rb @@ -62,7 +62,7 @@ module CartoDB
private
def pg_dump_bin_path
- get_pg_dump_bin_path(user_pg_conn)
+ get_pg_dump_bin_path(@conn)
end
end
end
@@ -492,7 +492,7 @@ module CartoDB
redis_conn.quit
if @options[:data]
DumpJob.new(
- pg_conn,
+ user_pg_conn,
@user_data['database_host'] || '127.0.0.1',
@user_data['database_name'],
@options[:path],
@@ -535,7 +535,7 @@ module CartoDB
if @options[:data] && !@options[:split_user_schemas]
DumpJob.new(
- pg_conn,
+ user_pg_conn,
@database_host,
@database_name,
@options[:path],
| 4 |
diff --git a/lib/recurly/elements.js b/lib/recurly/elements.js @@ -52,25 +52,27 @@ export default class Elements extends Emitter {
* @param {Element} element
*/
add (element) {
+ const { elements } = this;
+
if (!(element instanceof Element)) {
throw new Error(`Invalid element. Expected Element, got ${typeof element}`);
}
- if (this.elements.some(e => e.constructor.name === element.constructor.name)) {
+ if (elements.some(e => e.constructor.name === element.constructor.name)) {
throw new Error(`Invalid element. There is already a \`${element.constructor.name}\` in this set.`);
}
// Validate that the new element can be added to the existing set
- // TODO: Documentation link to the set rules
- const newSet = this.elements.concat(element);
+ // TODO: Add set rules documentation link to the error
+ const newSet = elements.concat(element);
if (!this.constructor.VALID_SETS.some(set => newSet.every(ne => ~set.indexOf(ne.constructor.name)))) {
throw new Error(`
Invalid element. A \`${element.constructor.name}\` may not be added to the existing set:
- ${this.elements.map(e => `'${e.constructor.name}'`).join(', ')}
+ ${elements.map(e => `'${e.constructor.name}'`).join(', ')}
`);
}
- this.elements.push(element);
+ elements.push(element);
element.on('attach', this.onElementAttach.bind(this));
element.on('remove', this.onElementRemove.bind(this));
@@ -85,8 +87,9 @@ export default class Elements extends Emitter {
* @return {Boolean} whether the removal was performed
*/
remove (element) {
- const pos = this.elements.indexOf(element);
- return ~pos && this.elements.splice(pos, 1);
+ const { elements } = this;
+ const pos = elements.indexOf(element);
+ return ~pos && elements.splice(pos, 1);
}
/**
| 3 |
diff --git a/modules/Collections/Controller/RestApi.php b/modules/Collections/Controller/RestApi.php @@ -124,7 +124,7 @@ class RestApi extends \LimeExtra\Controller {
return $this->stop('{"error": "Collection not found"}', 412);
}
- if (!$id) {
+ if (!$id && !$this->param('filter')) {
return $this->stop('{"error": "Missing id parameter"}', 412);
}
@@ -138,6 +138,12 @@ class RestApi extends \LimeExtra\Controller {
}
}
+ $filter = $this->param('filter');
+
+ if (!$filter) {
+ $filter = ['_id' => $id];
+ }
+
$options = [];
if ($fields = $this->param('fields', null)) $options['fields'] = $fields;
@@ -153,7 +159,7 @@ class RestApi extends \LimeExtra\Controller {
$options['fieldsFilter'] = $fieldsFilter;
}
- $entry = $this->module('collections')->findOne($collection['name'], ['_id' => $id], $options['fields'] ?? null, $options['populate'] ?? false, $options['fieldsFilter'] ?? []);
+ $entry = $this->module('collections')->findOne($collection['name'], $filter, $options['fields'] ?? null, $options['populate'] ?? false, $options['fieldsFilter'] ?? []);
if (!$entry) {
return $this->stop('{"error": "Entry not found."}', 404);
| 11 |
diff --git a/src/content/runtime-apis/fetch-event.md b/src/content/runtime-apis/fetch-event.md ## Background
-The event type for HTTP requests dispatched to a Worker (i.e the `Object` passed through as `event` in [`addEventListener()`](/runtime-apis/add-event-listener).
+The event type for HTTP requests dispatched to a Worker.
-## Constructor
+The `Object` passed through as `event` in [`addEventListener()`](/runtime-apis/add-event-listener).
+
+## Context
```js
-addEventListener("fetch", (event) => {
- event.respondWith(eventHandler(event))
+addEventListener("fetch", event => {
+ event.respondWith(handleRequest(event))
})
```
@@ -44,8 +46,6 @@ When a Workers script receives a request, the Workers runtime triggers a FetchEv
</Definitions>
-
-
## See also
-To learn more about using the `FetchEvent`, see [FetchEvent LifeCycle](learning/fetch-event-lifecycle).
\ No newline at end of file
+To learn more about using the `FetchEvent`, see [`FetchEvent` LifeCycle](/learning/fetch-event-lifecycle).
| 7 |
diff --git a/cli/cli.js b/cli/cli.js @@ -91,46 +91,48 @@ Object.entries(allCommands).forEach(([key, opts]) => {
command
.allowUnknownOption()
.description(opts.desc)
- .action((first, second, third) => {
- let args;
+ .action((...everything) => {
let cmdOptions;
- let unknownArgs;
- logger.debug(`first command arg: ${toString(first)}`);
- logger.debug(`second command arg: ${toString(second)}`);
- logger.debug(`third command arg: ${toString(third)}`);
-
- if (opts.argument) {
- // Option that contains arguments
- // first=arguments second=cmdOptions third=unknownArgs
- if (Array.isArray(first)) {
- // Var args unknown options are concatenated.
- // consider valid args before first unknown option (starts with -).
- args = [];
- unknownArgs = [];
- let unknown = false;
- first.forEach(item => {
- if (item.startsWith('-')) {
- unknown = true;
- }
- if (unknown) {
- unknownArgs.push(item);
+ let unknownArgs = [];
+ const last = everything.pop();
+ if (Array.isArray(last)) {
+ unknownArgs = last || [];
+ cmdOptions = everything.pop();
} else {
- args.push(item);
+ cmdOptions = last;
}
- });
- } else if (first !== undefined) {
- args = [first];
+
+ // Arguments processing merges unknown options with cmd args, move unknown options back
+ // Unknown options should be disabled for jhipster 7
+ const splitUnknown = argsToSplit => {
+ const args = [];
+ const unknown = [];
+ argsToSplit.find((item, index) => {
+ if (item && item.startsWith('-')) {
+ unknown.push(...argsToSplit.slice(index));
+ return true;
}
- cmdOptions = second;
- if (third) {
- unknownArgs = (unknownArgs || []).concat(third);
+ args.push(item);
+ return false;
+ });
+ return [args, unknown];
+ };
+ const variadicArg = everything.pop();
+
+ const splitted = splitUnknown(everything);
+ const args = splitted[0];
+ unknownArgs.unshift(...splitted[1]);
+
+ if (variadicArg) {
+ if (Array.isArray(variadicArg)) {
+ const splittedVariadic = splitUnknown(variadicArg);
+ if (splittedVariadic[0].length > 0) {
+ args.push(splittedVariadic[0]);
}
+ unknownArgs.unshift(...splittedVariadic[1]);
} else {
- // Option that doesn't contain arguments
- // first=cmdOptions second=unknownArgs
- args = [];
- cmdOptions = first;
- unknownArgs = second || [];
+ args.push(variadicArg);
+ }
}
const firstUnknownArg = Array.isArray(unknownArgs) && unknownArgs.length > 0 ? unknownArgs[0] : undefined;
@@ -163,6 +165,11 @@ Object.entries(allCommands).forEach(([key, opts]) => {
if (opts.cliOnly) {
logger.debug('Executing CLI only script');
+ if (args.length > 0 && Array.isArray(args[args.length - 1])) {
+ // Convert the variadic argument into a argument for backward compatibility.
+ // Remove for jhipster 7
+ args.push(...args.pop());
+ }
/* eslint-disable global-require, import/no-dynamic-require */
require(`./${key}`)(args, options, env);
/* eslint-enable */
| 7 |
diff --git a/packages/component-library/stories/HeatMap.story.js b/packages/component-library/stories/HeatMap.story.js /* eslint-disable import/no-extraneous-dependencies */
import React from "react";
import { storiesOf } from "@storybook/react";
-import { withKnobs, number, select } from "@storybook/addon-knobs";
+import { withKnobs, select } from "@storybook/addon-knobs";
import { checkA11y } from "@storybook/addon-a11y";
import { HeatMap, DemoJSONLoader } from "../src";
@@ -130,12 +130,7 @@ const heatmapComponent = data => {
"rgb(175, 240, 91)"
]
};
- const colorScale = select(
- "Heat Color",
- colorOptions,
- colorOptions.Plasma,
- "Heat Map"
- );
+ const colorScale = select("Heat Color", colorOptions, colorOptions.Plasma);
const heatMapColorScale = [
"interpolate",
@@ -229,34 +224,10 @@ export default () =>
.addDecorator(withKnobs)
.addDecorator(checkA11y)
.add("Simple usage", () => {
- const selectionOptions = {
- "Single Family":
- "?new_type=Single+Family+Dwelling&new_class=New+Construction&is_adu=false",
- "Multi Family":
- "?new_type=Apartments/Condos,Duplex,Rowhouse,Townhouse&new_class=New+Construction&is_adu=false",
- "Accessory Dwelling Units":
- "?new_class=New+Construction,Alteration,Addition&is_adu=true"
- };
- const selection = select(
- "Data:",
- selectionOptions,
- selectionOptions["Single Family"],
- "Heat Map"
- );
-
- const yearOptions = {
- range: true,
- min: 1995,
- max: 2016,
- step: 1
- };
- const year = number("Year", 1995, yearOptions, "Heat Map");
-
- const base =
- "https://service.civicpdx.org/housing-affordability/api/permits/";
- const options = "&format=json&limit=30000&year=";
- const url = base + selection + options + year;
-
+ const url =
+ "https://service.civicpdx.org/housing-affordability/api/permits/" +
+ "?new_type=Apartments/Condos,Duplex,Rowhouse,Townhouse&new_class=New+Construction&is_adu=false" +
+ "&format=json&limit=3000&year=2015";
return (
<DemoJSONLoader urls={[url]}>
{data => heatmapComponent(data)}
| 2 |
diff --git a/game.js b/game.js @@ -25,6 +25,7 @@ import npcManager from './npc-manager.js';
import raycastManager from './raycast-manager.js';
import zTargeting from './z-targeting.js';
import Avatar from './avatars/avatars.js';
+import {makeId} from './util.js'
const localVector = new THREE.Vector3();
const localVector2 = new THREE.Vector3();
@@ -1436,6 +1437,7 @@ class GameManager extends EventTarget {
const app = await metaversefileApi.createAppAsync({
start_url: u,
});
+ app.instanceId = makeId(5);
world.appManager.importApp(app);
app.activate();
// XXX set to index
| 0 |
diff --git a/components/core/DataView.js b/components/core/DataView.js @@ -198,7 +198,6 @@ export default class DataView extends React.Component {
state = {
menu: null,
loading: {},
- startIndex: 0,
checked: {},
view: "grid",
viewLimit: 50,
@@ -251,8 +250,8 @@ export default class DataView extends React.Component {
html.scrollHeight,
html.offsetHeight
);
- const windowBottom = windowHeight + window.pageYOffset + 200;
- if (windowBottom >= docHeight) {
+ const windowBottom = windowHeight + window.pageYOffset;
+ if (windowBottom >= docHeight - 200) {
this.setState({ viewLimit: this.state.viewLimit + 30 });
}
};
@@ -559,20 +558,17 @@ export default class DataView extends React.Component {
<React.Fragment>
{header}
<div css={STYLES_IMAGE_GRID}>
- {this.props.items
- .slice(this.state.startIndex, this.state.startIndex + this.state.viewLimit)
- .map((each, i) => {
+ {this.props.items.slice(this.state.viewLimit).map((each, i) => {
const cid = each.ipfs.replace("/ipfs/", "");
return (
<div
key={each.id}
css={STYLES_IMAGE_BOX}
- onClick={() => this._handleSelect(i + this.state.startIndex)}
+ onClick={() => this._handleSelect(i)}
onMouseEnter={() => this.setState({ hover: i })}
onMouseLeave={() => this.setState({ hover: null })}
>
<SlateMediaObjectPreview
- blurhash={each.blurhash}
url={`${Constants.gateways.ipfs}/${each.ipfs.replace("/ipfs/", "")}`}
title={each.file || each.name}
type={each.type || each.icon}
@@ -625,9 +621,7 @@ export default class DataView extends React.Component {
text: "Delete",
onClick: (e) => {
e.stopPropagation();
- this.setState({ menu: null }, () =>
- this._handleDelete(cid)
- );
+ this.setState({ menu: null }, () => this._handleDelete(cid));
},
},
]}
@@ -640,22 +634,22 @@ export default class DataView extends React.Component {
e.stopPropagation();
e.preventDefault();
let checked = this.state.checked;
- if (checked[this.state.startIndex + i]) {
- delete checked[this.state.startIndex + i];
+ if (checked[i]) {
+ delete checked[i];
} else {
- checked[this.state.startIndex + i] = true;
+ checked[i] = true;
}
this.setState({ checked });
}}
>
<CheckBox
- name={this.state.startIndex + i}
- value={!!this.state.checked[this.state.startIndex + i]}
+ name={i}
+ value={!!this.state.checked[i]}
onChange={this._handleCheckBox}
boxStyle={{
height: 24,
width: 24,
- backgroundColor: this.state.checked[this.state.startIndex + i]
+ backgroundColor: this.state.checked[i]
? Constants.system.brand
: "rgba(255, 255, 255, 0.75)",
}}
@@ -714,9 +708,7 @@ export default class DataView extends React.Component {
width: "48px",
},
];
- const rows = this.props.items
- .slice(this.state.startIndex, this.state.startIndex + this.state.viewLimit)
- .map((each, index) => {
+ const rows = this.props.items.slice(this.state.viewLimit).map((each, index) => {
const cid = each.ipfs.replace("/ipfs/", "");
const isOnNetwork = each.networks && each.networks.includes("FILECOIN");
@@ -724,8 +716,8 @@ export default class DataView extends React.Component {
...each,
checkbox: (
<CheckBox
- name={this.state.startIndex + index}
- value={!!this.state.checked[this.state.startIndex + index]}
+ name={index}
+ value={!!this.state.checked[index]}
onChange={this._handleCheckBox}
boxStyle={{ height: 16, width: 16 }}
style={{
@@ -738,10 +730,7 @@ export default class DataView extends React.Component {
),
name: (
<FilePreviewBubble url={cid} type={each.type}>
- <div
- css={STYLES_CONTAINER_HOVER}
- onClick={() => this._handleSelect(this.state.startIndex + index)}
- >
+ <div css={STYLES_CONTAINER_HOVER} onClick={() => this._handleSelect(index)}>
<div css={STYLES_ICON_BOX_HOVER} style={{ paddingLeft: 0, paddingRight: 18 }}>
<FileTypeIcon type={each.type} height="24px" />
</div>
| 2 |
diff --git a/js/drawSamples.js b/js/drawSamples.js @@ -12,13 +12,13 @@ var labelFont = 12;
// rounding that up to the next half-order.
//
// XXX 1.2 is lifted from vgmixed, which uses this to set line height for
-// a given font. The 0.5 fudge is due to floating point noise, I think. Otherwise
+// a given font. The 0.1 fudge is due to floating point noise, I think. Otherwise
// we can end up with a height that is smaller than one line, and the labels
// will not be drawn due to clipping in vgmixed.
function stripeHeight(start, end, height) {
- var in10 = (end - start) * (1.2 * labelFont + 0.5) / height,
+ var in10 = (end - start) * (1.2 * labelFont + 0.1) / height,
order = Math.pow(10, Math.floor(Math.log10(in10))),
- fsd = Math.floor(in10 / order), // 1st significant digit, 1..9
+ fsd = in10 / order, // 1st significant digit, 1..9
rounded = fsd > 5 ? 10 : fsd > 1 ? 5 : 1;
return Math.max(rounded * order, 1);
| 7 |
diff --git a/components/core/FontFrame/Views/Glyphs.js b/components/core/FontFrame/Views/Glyphs.js @@ -14,22 +14,24 @@ const STYLES_GLYPHS_LETTER = css`
const STYLES_GLYPHS_GRID = css`
margin-top: -16px;
display: grid;
- grid-template-columns: repeat(auto-fill, minmax(12px, 1fr));
+ grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
grid-template-rows: repeat(12, 1fr);
grid-column-gap: 28px;
grid-auto-rows: 0px;
overflow: hidden;
+ font-size: 32px;
`;
export default function Glyphs() {
- const content = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 ?!()[]{}&*^%$#@~`;
- const glyphs = React.useMemo(() => new Array(6).fill(content).join("").split(""), []);
+ const content = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890?!()[]{}&*^%$#@~`.split(
+ ""
+ );
return (
<div css={STYLES_GLYPHS_WRAPPER}>
<div css={STYLES_GLYPHS_LETTER}>Aa</div>
<div css={STYLES_GLYPHS_GRID}>
- {glyphs.map((letter, i) => (
+ {content.map((letter) => (
<div
- key={letter + i}
+ key={letter}
css={css`
margin-top: 16px;
`}
| 3 |
diff --git a/src/algorithms/utils/createMitigationInterval.ts b/src/algorithms/utils/createMitigationInterval.ts @@ -14,7 +14,7 @@ export function suggestNextMitigationInterval(intervals: MitigationIntervals): M
id: uuidv4(),
name: `Intervention from ${tMinMoment.format('D MMM YYYY')}`,
timeRange,
- mitigationValue: 10,
+ mitigationValue: [10, 30],
}
const color = createColor(interval)
| 1 |
diff --git a/src/muncher/importMonster.js b/src/muncher/importMonster.js @@ -87,6 +87,17 @@ async function addNPCToCompendium(npc) {
}
if (!updateImages && existingNPC.data.token.img !== "icons/svg/mystery-man.svg") {
npc.token.img = existingNPC.data.token.img;
+ npc.token.scale = existingNPC.data.token.scale;
+ npc.token.randomImg = existingNPC.data.token.randomImg;
+ npc.token.mirrorX = existingNPC.data.token.mirrorX;
+ npc.token.mirrorY = existingNPC.data.token.mirrorY;
+ npc.token.lockRotation = existingNPC.data.token.lockRotation;
+ npc.token.rotation = existingNPC.data.token.rotation;
+ npc.token.alpha = existingNPC.data.token.alpha;
+ npc.token.lightAlpha = existingNPC.data.token.lightAlpha;
+ npc.token.lightAnimation = existingNPC.data.token.lightAnimation;
+ npc.token.tint = existingNPC.data.token.tint;
+ npc.token.lightColor = existingNPC.data.token.lightColor;
}
npc._id = npcMatch._id;
await copySupportedItemFlags(existingNPC.data, npc);
| 7 |
diff --git a/assets/js/modules/analytics/dashboard/dashboard-widget.js b/assets/js/modules/analytics/dashboard/dashboard-widget.js @@ -183,7 +183,7 @@ class AnalyticsDashboardWidget extends Component {
<Layout
header
/* translators: %s: date range */
- title={ sprintf( __( 'Audience overview for the HELLO last %s', 'google-site-kit' ), dateRange ) }
+ title={ sprintf( __( 'Audience overview for the last %s', 'google-site-kit' ), dateRange ) }
headerCtaLabel={ __( 'See full stats in Analytics', 'google-site-kit' ) }
headerCtaLink="http://analytics.google.com"
>
| 2 |
diff --git a/js/pdfViewer.js b/js/pdfViewer.js @@ -54,25 +54,3 @@ var PDFViewer = {
}
ipc.on('openPDF', PDFViewer.handlePDFOpenEvent)
-
-/*
-migrate legacy bookmarked PDFs to the new viewer URL
-TODO remove this in a future version
-*/
-
-var legacyPDFViewerURL = 'file://' + __dirname + '/pdfjs/web/viewer.html?url='
-
-db.transaction('rw', db.places, function () {
- db.places.where('url').startsWith(legacyPDFViewerURL).each(function (item) {
- var oldItemURL = item.url
-
- var pdfBaseURL = oldItemURL.replace(legacyPDFViewerURL, '')
- var newViewerURL = PDFViewer.url.base + PDFViewer.url.queryString.replace('%l', encodeURIComponent(pdfBaseURL))
-
- item.url = newViewerURL
-
- db.places.put(item).then(function () {
- db.places.where('url').equals(oldItemURL).delete()
- })
- })
-})
| 2 |
diff --git a/packages/config/src/validate/helpers.js b/packages/config/src/validate/helpers.js @@ -6,9 +6,9 @@ const isBoolean = function(value) {
return typeof value === 'boolean'
}
-const validProperties = function(propNames) {
+const validProperties = function(propNames, legacyPropNames = propNames) {
return {
- check: value => Object.keys(value).every(propName => propNames.includes(propName)),
+ check: value => Object.keys(value).every(propName => [...propNames, ...legacyPropNames].includes(propName)),
message: `has unknown properties. Valid properties are:
${propNames.map(propName => ` - ${propName}`).join('\n')}`,
}
| 11 |
diff --git a/src/journeys_utils.js b/src/journeys_utils.js @@ -303,11 +303,7 @@ journeys_utils.addIframeOuterCSS = function(cssIframeContainer) {
if (cssIframeContainer) {}
else if (journeys_utils.position === 'top') {
var calculatedBodyMargin = +bannerMarginNumber + bodyMarginTopNumber;
- document.body.style.marginTop = calculatedBodyMargin.toString() + 'px';
- }
- else if (journeys_utils.position === 'bottom') {
- var calculatedBodyMargin = +bannerMarginNumber + bodyMarginBottomNumber;
- document.body.style.marginBottom = calculatedBodyMargin.toString() + 'px';
+ document.body.style.transform = `translate(0, ${calculatedBodyMargin.toString()}px)`;
}
// adds margin to the parent of div being inserted into
@@ -463,13 +459,10 @@ journeys_utils.animateBannerEntrance = function(banner, cssIframeContainer) {
banner.style.top = null;
banner.style.bottom = null;
} else {
- if (journeys_utils.position === 'top') {
- banner.style.top = '0';
- }
- else if (journeys_utils.position === 'bottom') {
+ if (journeys_utils.position === 'bottom') {
// check if safeAreaRequired is true or not
if (journeys_utils.journeyLinkData && journeys_utils.journeyLinkData['journey_link_data'] && !journeys_utils.journeyLinkData['journey_link_data']['safeAreaRequired']) {
- banner.style.bottom = '0';
+ banner.style.transform = `translate(0px, -${journeys_utils.bannerHeight})`
} else {
journeys_utils._dynamicallyRepositionBanner();
}
| 2 |
diff --git a/src/commands/DefaultRoles/AddDefaultRole.js b/src/commands/DefaultRoles/AddDefaultRole.js @@ -8,7 +8,7 @@ class AddDefaultRole extends Command {
this.usages = [
{ description: 'Add a new default role for persons joining the server.', parameters: ['role id'] },
];
- this.regex = new RegExp(`^${this.call}\\s?(\\d+)?$`, 'i');
+ this.regex = new RegExp(`^${this.call}\\s?(?:(?:<@&)(\\d+)(?:>))?$`, 'i');
this.requiresAuth = true;
this.allowDM = false;
}
| 11 |
diff --git a/source/common/res/features/pacing/main.js b/source/common/res/features/pacing/main.js const showDays = ynabToolKit.options.pacing === '2';
const showIndicator = ynabToolKit.options.pacing === '3';
- var temperature = (pace > 1) ? 'cautious' : 'positive';
-
var deemphasized = masterCategory.get('isDebtPaymentCategory') || $.inArray(masterCategoryDisplayName + '_' + subCategoryDisplayName, deemphasizedCategories) >= 0;
var display = Math.round((budgeted * timeSpent() - activity) * 1000);
const displayInDays = getDaysAheadOfSchedule(display, budgeted, activity);
: ynabToolKit.shared.formatCurrency(display, true);
const tooltip = getTooltip(display, displayInDays, transactionCount, deemphasized);
-
- $(this).append('<li class="budget-table-cell-available budget-table-cell-pacing"><span title="' + tooltip +
- '" class="budget-table-cell-pacing-display currency ' + temperature +
- (deemphasized ? ' deemphasized' : '') + (showIndicator ? ' indicator' : '') +
- '" data-name="' + masterCategoryDisplayName + '_' + subCategoryDisplayName + '">' +
- formattedDisplay + '</span></li>');
+ const deemphasizedClass = deemphasized ? 'deemphasized' : '';
+ const indicatorClass = showIndicator ? 'indicator' : '';
+ const temperatureClass = (pace > 1) ? 'cautious' : 'positive';
+ $(this).append(`
+ <li class="budget-table-cell-available budget-table-cell-pacing">
+ <span
+ title="${tooltip}"
+ class="budget-table-cell-pacing-display currency ${temperatureClass} ${deemphasizedClass} ${indicatorClass}"
+ data-name="${masterCategoryDisplayName}_${subCategoryDisplayName}"
+ >
+ ${formattedDisplay}
+ </span>
+ </li>
+ `);
});
$('.budget-table-cell-pacing-display').click(function (e) {
| 7 |
diff --git a/activities/Planets.activity/js/activity.js b/activities/Planets.activity/js/activity.js -define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activity, datastore) {
+define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore"], function (activity, env, datastore) {
// Manipulate the DOM only when it is ready.
requirejs(['domReady!'], function (doc) {
@@ -46,9 +46,19 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
document.getElementById("list-button").style.display = "none";
document.getElementById("radius-button").style.display = "none";
+ //Data to save to Journal
+ var saveData = [false, true, null, true, true];
+
planetPos.style.display="none";
- initPosition("Sun", "Star", 0);
+
+ //Init Sun
+ initPosition("Sun", "Star", null);
+
+ var currentenv;
+ env.getEnvironment(function(err, environment){
+ currentenv = environment;
+
for (var i = 0; i < planet.length; i ++){
var planetList = document.createElement('div');
planetList.id = 'planet-' + planet[i].name;
@@ -94,6 +104,57 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
});
}
+ //Load from datastore
+ if(!environment.objectId){
+ console.log("New instance");
+ }
+ else {
+ console.log("Existing instance");
+ activity.getDatastoreObject().loadAsText(function(error, metadata, data) {
+ if (error==null && data!=null) {
+ saveData = JSON.parse(data);
+ if (saveData[0] === true){
+ document.getElementById("position-button").click();
+ if(saveData[1] === false){
+ document.getElementById("radius-button").click();
+ }
+ }
+ else{
+ if (saveData[2] !== null){
+ document.getElementById("planet-"+saveData[2]).click();
+
+ if (saveData[3] === false){
+ document.getElementById("rotation-button").click();
+ }
+ if (saveData[4] === false){
+ document.getElementById("info-button").click();
+ }
+ }
+ }
+
+
+ }
+ });
+
+
+ }
+ });
+
+ document.getElementById("stop-button").addEventListener("click", function(event){
+ console.log("writing...");
+ var jsonData = JSON.stringify(saveData);
+ activity.getDatastoreObject().setDataAsText(jsonData);
+ activity.getDatastoreObject().save(function (error){
+ if (error === null){
+ console.log("writing done");
+ }
+ else {
+ console.log("writing failed");
+ }
+ });
+ });
+
+
//Show planet function
function initPlanet(name, type, year, mass, temperature, moons, distance){
@@ -192,6 +253,8 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
document.getElementById("info-button").style.display = "inline";
document.getElementById("image-button").style.display = "inline";
+ saveData[2] = name;
+
//Remove previous scene
while(scene.children.length > 0){
scene.remove(scene.children[0]);
@@ -314,6 +377,8 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
document.getElementById("rotation-button").classList.remove("active");
}
+ saveData[3] = stopRotation;
+
});
//Toggle Planet Info
@@ -335,6 +400,8 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
showInfo = true;
document.getElementById("info-button").classList.add("active");
}
+
+ saveData[4] = showInfo;
planetDisplay.appendChild(renderer.domElement);
});
@@ -344,6 +411,7 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
interactContainer.style.display = "none";
homeDisplay.style.display = "block";
mainCanvas.style.backgroundColor = "black";
+ saveData[2] = null;
stopRotation = true;
requestAnim = false;
document.getElementById("rotation-button").style.display = "none";
@@ -513,6 +581,8 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
document.getElementById("list-button").style.display = "inline";
document.getElementById("radius-button").style.display = "inline";
+ saveData[0] = true;
+
requestAnim = true;
scene.add(planetMesh);
@@ -582,7 +652,8 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
//Need to set to false so to cancel animation
document.getElementById("list-button").addEventListener("click", function(){
-
+ saveData[2] = null;
+ saveData[0] = false;
requestAnim = false;
document.getElementById("radius-button").style.display = "none";
});
@@ -603,6 +674,7 @@ define(["sugar-web/activity/activity", 'sugar-web/datastore'], function (activit
}
document.getElementById("radius-button").classList.remove("active");
}
+ saveData[1] = showRadius;
});
| 9 |
diff --git a/test/functional/test.js b/test/functional/test.js @@ -131,7 +131,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, auth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
@@ -197,7 +197,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, auth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
@@ -272,7 +272,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, bigipAuth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
@@ -295,7 +295,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, bigipAuth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
@@ -343,7 +343,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, bigipAuth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
@@ -376,7 +376,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, bigipAuth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
@@ -451,7 +451,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, bigipAuth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
@@ -502,7 +502,7 @@ describe('Declarative Onboarding Functional Test Suite', function performFunctio
return common.dumpDeclaration(bigipAddress, auth);
})
.then((declarationStatus) => {
- reject(new Error(declarationStatus));
+ reject(new Error(JSON.stringify(declarationStatus, null, 2)));
})
.catch((err) => {
reject(err);
| 7 |
diff --git a/source/guides/tooling/IDE-integration.md b/source/guides/tooling/IDE-integration.md @@ -15,7 +15,7 @@ The first time you click a file path, Cypress will prompt you to select which lo
- A specified application path
{% note warning %}
-Cypress attempts to find available file editors on your system and display those as options. If your preferred editor is not list, you can specify the (full) path to it by selecting **Other**. Cypress will make every effort to open the file, *but it is not guaranteed to work with every application*.
+Cypress attempts to find available file editors on your system and display those as options. If your preferred editor is not listed, you can specify the (full) path to it by selecting **Other**. Cypress will make every effort to open the file, *but it is not guaranteed to work with every application*.
{% endnote %}
After setting your file opener preference, any files will automatically open in your selected application without prompting you to choose. If you want to change your selection, you can do so in the **Settings** tab of the Cypress Test Runner by clicking under **File Opener Preference**.
| 7 |
diff --git a/lib/carto/tracking/events.rb b/lib/carto/tracking/events.rb @@ -172,24 +172,14 @@ module Carto
class ConnectionEvent < Event
include Carto::Tracking::Services::Hubspot
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::User
required_properties :user_id, :connection
end
- class CompletedConnection < ConnectionEvent
- def pubsub_name
- 'connection_completed'
- end
- end
-
- class FailedConnection < ConnectionEvent
- def pubsub_name
- 'connection_failed'
- end
- end
+ class CompletedConnection < ConnectionEvent; end
+ class FailedConnection < ConnectionEvent; end
class ExceededQuota < Event
include Carto::Tracking::Services::Segment
@@ -207,30 +197,20 @@ module Carto
class ScoredTrendingMap < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id, :mapviews
-
- def pubsub_name
- 'trending_map_scored'
- end
end
class VisitedPrivatePage < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::User
required_properties :user_id, :page
- def pubsub_name
- 'private_page_visited'
- end
-
def report_to_user_model
@format.fetch_record!(:user).view_dashboard if @format.to_hash['page'] == 'dashboard'
end
@@ -297,10 +277,6 @@ module Carto
required_properties :user_id, :visualization_id, :sql
optional_properties :node_id, :dataset_id
-
- def pubsub_name
- 'sql_applied'
- end
end
class AppliedCartocss < Event
@@ -310,38 +286,24 @@ module Carto
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id, :layer_id, :cartocss
-
- def pubsub_name
- 'cartocss_applied'
- end
end
class ModifiedStyleForm < AppliedCartocss
required_properties :style_properties
-
- def pubsub_name
- 'style_form_modified'
- end
end
class CreatedWidget < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Widget::Existence
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id, :widget_id
-
- def pubsub_name
- 'widget_created'
- end
end
class DownloadedLayer < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::Layer
@@ -351,95 +313,61 @@ module Carto
:source, :visible, :table_name
optional_properties :from_view
-
- def pubsub_name
- 'layer_downloaded'
- end
end
class StyledByValue < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id, :attribute, :attribute_type
-
- def pubsub_name
- 'styled_by_value'
- end
end
class DraggedNode < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id
-
- def pubsub_name
- 'node_dragged'
- end
end
class CreatedLayer < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::Layer
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id, :layer_id, :empty
-
- def pubsub_name
- 'layer_created'
- end
end
class ChangedDefaultGeometry < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id
-
- def pubsub_name
- 'default_geometry_changed'
- end
end
class AggregatedGeometries < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id, :previous_agg_type, :agg_type
-
- def pubsub_name
- 'geometries_aggregated'
- end
end
class UsedAdvancedMode < Event
include Carto::Tracking::Services::Segment
- include Carto::Tracking::Services::PubSub
include Carto::Tracking::Validators::Visualization::Writable
include Carto::Tracking::Validators::User
required_properties :user_id, :visualization_id, :mode_type
-
- def pubsub_name
- 'advanced_mode_used'
- end
end
class OauthAppEvent < Event
| 2 |
diff --git a/publish/deployed/mainnet/synths.json b/publish/deployed/mainnet/synths.json "desc": "Inverted Binance Coin",
"subclass": "PurgeableSynth",
"inverted": {
- "entryPoint": 12.57,
- "upperLimit": 18.86,
- "lowerLimit": 6.29
+ "entryPoint": 22.258,
+ "upperLimit": 33.387,
+ "lowerLimit": 11.129
}
},
{
"desc": "Inverted Tezos",
"subclass": "PurgeableSynth",
"inverted": {
- "entryPoint": 1.57,
- "upperLimit": 2.355,
- "lowerLimit": 0.785
+ "entryPoint": 3.651,
+ "upperLimit": 5.4765,
+ "lowerLimit": 1.8255
}
},
{
| 3 |
diff --git a/userscript.user.js b/userscript.user.js @@ -99830,7 +99830,9 @@ var $$IMU_EXPORT$$;
var modified_date = null;
- var newobj_ext = null;
+ var contenttype_ext = null;
+ var orig_filename = null;
+ var wanted_ext = null;
if (respdata) {
try {
var headers = parse_headers(respdata.responseHeaders);
@@ -99867,21 +99869,25 @@ var $$IMU_EXPORT$$;
loops++;
}
} else if (header_name === "content-type") {
- newobj_ext = get_ext_from_contenttype(header_value);
+ contenttype_ext = get_ext_from_contenttype(header_value);
} else if (header_name === "last-modified") {
modified_date = new Date(header_value);
if (isNaN(modified_date.getTime())) modified_date = null;
}
- if (newobj.filename.length > 0 && newobj_ext)
+ if (newobj.filename.length > 0 && contenttype_ext && modified_date) {
+ // we found everything we're looking for
break;
}
+ }
} catch (e) {
console_error(e);
}
var is_data = /^data:/.test(url);
+ if (is_data) newobj.filename = "";
+
var found_filename_from_url = false;
if (newobj.filename.length === 0 && !is_data) {
newobj.filename = url.replace(/.*\/([^?#/]*)(?:[?#].*)?$/, "$1");
@@ -99893,25 +99899,31 @@ var $$IMU_EXPORT$$;
}
}
- // e.g. for /?...
- if (newobj.filename.length === 0 || is_data) {
- newobj.filename = "download";
- }
-
- if (string_indexof(newobj.filename, ".") < 0 && newobj_ext) {
- newobj.filename += "." + newobj_ext;
- }
-
// thanks to fireattack on discord for reporting.
// test: https://hiyoko-bunko.com/specials/h0xmtix1pv/
// https://images.microcms-assets.io/protected/ap-northeast-1:92243b3c-cb7c-44e8-9c84-28ba954120c5/service/hiyoko-bunko/media/hb_sns_%E3%82%A4%E3%83%98%E3%82%99%E3%83%B3%E3%83%88%E5%BD%93%E6%97%A5_200831.jpg
if (found_filename_from_url) {
newobj.filename = decodeURIComponent(newobj.filename);
}
+
+ orig_filename = newobj.filename;
+
+ // e.g. for /?...
+ if (newobj.filename.length === 0) {
+ newobj.filename = "download";
+ }
+
+ if (contenttype_ext && string_indexof(orig_filename, ".") < 0) {
+ orig_filename += "." + contenttype_ext;
+ newobj.filename += "." + contenttype_ext;
+ }
+
+ wanted_ext = newobj.filename.replace(/.*\./, "");
+ if (wanted_ext === newobj.filename) wanted_ext = null;
}
// to avoid formatting the filename multiple times
- if (!newobj._orig_filename) newobj._orig_filename = newobj.filename;
+ if (!("_orig_filename" in newobj)) newobj._orig_filename = orig_filename;
var format_vars = {
filename: newobj._orig_filename
@@ -99987,18 +99999,18 @@ var $$IMU_EXPORT$$;
var ext_split = url_basename(format_vars.filename, {split_ext: true});
format_vars.filename_noext = ext_split[0];
- if (ext_split[1])
- format_vars.ext = "." + ext_split[1];
+ if (wanted_ext)
+ format_vars.ext = "." + wanted_ext;
create_date("download", new Date());
var formatted = format_string(settings.filename_format, format_vars);
if (formatted) {
newobj.filename = formatted;
-
- if (string_indexof(newobj.filename, ".") < 0 && newobj_ext) {
- newobj.filename += "." + newobj_ext;
}
+
+ if (string_indexof(newobj.filename, ".") < 0 && wanted_ext) {
+ newobj.filename += "." + wanted_ext;
}
newobj.format_vars = format_vars;
| 11 |
diff --git a/avatars/avatars.js b/avatars/avatars.js @@ -2144,6 +2144,95 @@ class Avatar {
}
this.lastBackwardFactor = mirrorFactor;
+ const _updateSound = () => {
+ if (idleWalkFactor > 0.7 && !this.jumpState) {
+ const isRunning = walkRunFactor > 0.5;
+ const isCrouching = crouchFactor > 0.5;
+ const animationAngles = isCrouching ?
+ keyAnimationAnglesOther
+ :
+ (isRunning ? keyRunAnimationAngles : keyWalkAnimationAngles);
+ const walkRunAnimationName = animationAngles[0].name;
+
+ const soundFiles = isCrouching ?
+ walkSoundFiles
+ :
+ (isRunning ? runSoundFiles : walkSoundFiles);
+
+ const animationIndices = animationStepIndices.find(i => i.name === walkRunAnimationName);
+ const {leftStepIndices, rightStepIndices} = animationIndices;
+
+ if (typeof window.lol !== 'number') {
+ window.lol = 0.18;
+ window.lol2 = 0.18;
+ }
+
+ const sneakingOffset = -0.14;
+ const walkingOffset = 0.13;
+ const walkingBackwardOffset = window.lol;
+ const strafeWalkingOffset = 0.24;
+ const offsets = {
+ 'Sneaking Forward.fbx': sneakingOffset,
+ 'walking.fbx': walkingOffset,
+ 'walking backwards.fbx': walkingBackwardOffset,
+ 'Fast Run.fbx': 0,
+ 'left strafe walking.fbx': strafeWalkingOffset,
+ 'right strafe walking.fbx': strafeWalkingOffset,
+ };
+ const offset = offsets[walkRunAnimationName] ?? window.lol;
+ const t1 = (timeSeconds + offset) % animationAngles[0].animation.duration;
+ const walkFactor1 = t1 / animationAngles[0].animation.duration;
+ // const walkFactor2 = t2 / animationAngles[1].animation.duration;
+ // console.log('animation angles', {walkRunAnimationName, animationIndices, isCrouching, keyWalkAnimationAngles, keyAnimationAnglesOther});
+ // console.log('got animation name', walkRunAnimationName);
+
+ const startIndex = Math.floor(this.lastWalkFactor * leftStepIndices.length);
+ const endIndex = Math.floor(walkFactor1 * leftStepIndices.length);
+ for (let i = startIndex;; i++) {
+ i = i % leftStepIndices.length;
+ // console.log('check', i, startIndex, endIndex);
+ if (i !== endIndex) {
+ if (leftStepIndices[i] && !this.lastStepped[0]) {
+ const candidateAudios = soundFiles//.filter(a => a.paused);
+ if (candidateAudios.length > 0) {
+ /* for (const a of candidateAudios) {
+ !a.paused && a.pause();
+ } */
+
+ const audio = candidateAudios[Math.floor(Math.random() * candidateAudios.length)];
+ audio.currentTime = 0;
+ audio.paused && audio.play();
+ // break;
+ // console.log('left');
+ }
+ }
+ this.lastStepped[0] = leftStepIndices[i];
+
+ if (rightStepIndices[i] && !this.lastStepped[1]) {
+ const candidateAudios = soundFiles// .filter(a => a.paused);
+ if (candidateAudios.length > 0) {
+ /* for (const a of candidateAudios) {
+ !a.paused && a.pause();
+ } */
+
+ const audio = candidateAudios[Math.floor(Math.random() * candidateAudios.length)];
+ audio.currentTime = 0;
+ audio.paused && audio.play();
+ // break;
+ // console.log('right');
+ }
+ }
+ this.lastStepped[1] = rightStepIndices[i];
+ } else {
+ break;
+ }
+ }
+
+ this.lastWalkFactor = walkFactor1;
+ }
+ };
+ _updateSound();
+
const _getHorizontalBlend = (k, lerpFn, isPosition, target) => {
_get7wayBlend(
keyWalkAnimationAngles,
| 0 |
diff --git a/src/technologies/a.json b/src/technologies/a.json "icon": "aws.svg",
"implies": "Amazon Web Services",
"headers": {
- "x-amzn-waf-action": ""
+ "x-amzn-waf-action": "^captcha$"
},
+ "scriptSrc": "captcha\\.awswaf\\.com/",
"saas": true,
"pricing": [
"recurring",
| 7 |
diff --git a/bl-kernel/helpers/theme.class.php b/bl-kernel/helpers/theme.class.php @@ -234,7 +234,7 @@ class Theme {
public static function favicon($file='favicon.png', $typeIcon='image/png')
{
- return '<link rel="shortcut icon" href="'.DOMAIN_THEME.$file.'" type="'.$typeIcon.'">'.PHP_EOL;
+ return '<link rel="icon" href="'.DOMAIN_THEME.$file.'" type="'.$typeIcon.'">'.PHP_EOL;
}
public static function keywords($keywords)
| 2 |
diff --git a/jenkins-build-pack-api/Jenkinsfile b/jenkins-build-pack-api/Jenkinsfile @@ -44,6 +44,7 @@ def Event_Status = [
@Field def configLoader
@Field def scmModule
@Field def serviceConfigdata
+@Field def utilModule
@Field def auth_token = ''
@Field def g_svc_admin_cred_ID = 'SVC_ADMIN'
@@ -57,7 +58,7 @@ node() {
def jazzBuildModuleURL = getBuildModuleUrl()
loadBuildModule(jazzBuildModuleURL)
- def jazz_prod_api_id = getAPIId(configLoader.AWS.API["PROD"], "jazz", "*")
+ def jazz_prod_api_id = utilModule.getAPIIdForCore(configLoader.AWS.API["PROD"])
g_base_url = "https://${jazz_prod_api_id}.execute-api.${configLoader.AWS.REGION}.amazonaws.com/prod"
g_base_url_for_swagger = "http://editor.swagger.io/?url=http://${configLoader.AWS.S3.API_DOC}.s3-website-${configLoader.AWS.REGION}.amazonaws.com/"
@@ -186,7 +187,7 @@ node() {
if (fileExists('swagger/swagger.json')) {
echo "Generating swagger file for environment: ${env_key}"
- def api_id = getAPIId(configLoader.AWS.API[env_key], config)
+ def api_id = utilModule.getAPIId(configLoader.AWS.API[env_key], config)
def apiHostName = "${api_id}.execute-api.${configLoader.AWS.REGION}.amazonaws.com"
generateSwaggerEnv(current_environment, "${configLoader.INSTANCE_PREFIX}-${current_environment}", apiHostName,config)
@@ -677,23 +678,6 @@ def getBuildModuleUrl() {
}
}
-/**
-getAPIId takes api Id mapping document and a config object to return an API Id
-*/
-def getAPIId(apiIdMapping, config) {
- if (!apiIdMapping) {
- error "No mapping document provided to lookup API Id!!"
- }
-
- if (apiIdMapping["${config['domain']}_${config['service']}"]) {
- return apiIdMapping["${config['domain']}_${config['service']}"];
- }else if (apiIdMapping["${config['domain']}_*"]) {
- return apiIdMapping["${config['domain']}_*"];
- }else {
- apiIdMapping["*"];
- }
-}
-
/*
* Load environment variables from build module
*/
@@ -715,5 +699,7 @@ def loadBuildModule(buildModuleUrl){
serviceConfigdata = load "service-configuration-data-loader.groovy"
+ utilModule = load "utility-loader.groovy"
+
}
}
| 4 |
diff --git a/src/upgrade/platform_upgrade.js b/src/upgrade/platform_upgrade.js @@ -224,6 +224,25 @@ async function platform_upgrade_2_8_0() {
await exec('systemctl restart systemd-tmpfiles-clean.service');
}
+async function supervisor_tmp_deletion_rules() {
+ if (process.env.PLATFORM === 'docker') return;
+ dbg.log0('UPGRADE: running supervisor_tmp_deletion_rules');
+ const tmp_conf = await fs.readFileAsync('/usr/lib/tmpfiles.d/tmp.conf').toString();
+ let should_restart = false;
+ if (tmp_conf.indexOf('x /tmp/supervisor*') < 0) {
+ await fs.appendFileAsync('/usr/lib/tmpfiles.d/tmp.conf', 'x /tmp/supervisor*\n');
+ should_restart = true;
+ }
+ if (tmp_conf.indexOf('x /tmp/test') < 0) {
+ await fs.appendFileAsync('/usr/lib/tmpfiles.d/tmp.conf', 'x /tmp/test\n');
+ should_restart = true;
+ }
+ if (should_restart) {
+ // exclude cleaning of supervisor and upgrade files
+ await exec('systemctl restart systemd-tmpfiles-clean.service');
+ }
+}
+
async function platform_upgrade_2_7_0() {
dbg.log0('UPGRADE: running platform_upgrade_2_7_0');
//verify abrt package is removed
@@ -239,6 +258,7 @@ async function platform_upgrade_2_4_0() {
async function platform_upgrade_common(params) {
await copy_first_install();
+ await supervisor_tmp_deletion_rules();
}
async function copy_first_install() {
| 1 |
diff --git a/source/localisation/RelativeDate.js b/source/localisation/RelativeDate.js @@ -73,11 +73,14 @@ const formatDuration = Date.formatDuration = function ( durationInMS, approx ) {
approx - {Boolean} (optional) If true, only return a string for the
most significant part of the relative time (e.g. just "5
hours ago" instead of "5 hours 34 mintues ago").
+ mustNotBeFuture - {Boolean} (optional) If true and a date is supplied in
+ the future, it is assumed this is due to clock skew
+ and the string "just now" is always returned.
Returns:
{String} Relative date string.
*/
-Date.prototype.relativeTo = function ( date, approx ) {
+Date.prototype.relativeTo = function ( date, approx, mustNotBeFuture ) {
if ( !date ) {
date = new Date();
}
@@ -89,8 +92,11 @@ Date.prototype.relativeTo = function ( date, approx ) {
if ( isFuture ) {
duration = -duration;
}
+ if ( !duration || ( isFuture && mustNotBeFuture ) ) {
+ return loc( 'just now' );
+ }
// Less than a day
- if ( duration < 1000 * 60 * 60 * 24 ) {
+ else if ( duration < 1000 * 60 * 60 * 24 ) {
time = formatDuration( duration, approx );
// Less than 6 weeks
} else if ( duration < 1000 * 60 * 60 * 24 * 7 * 6 ) {
| 0 |
diff --git a/src/DevChatter.Bot.Core/Commands/GiveCommand.cs b/src/DevChatter.Bot.Core/Commands/GiveCommand.cs @@ -21,7 +21,7 @@ public GiveCommand(IRepository repository, IChatUserCollection chatUserCollectio
public override void Process(IChatClient chatClient, CommandReceivedEventArgs eventArgs)
{
string coinGiver = eventArgs?.ChatUser?.DisplayName;
- string coinReceiver = eventArgs?.Arguments?.ElementAtOrDefault(0).NoAt();
+ string coinReceiver = eventArgs?.Arguments?.ElementAtOrDefault(0)?.NoAt();
string coinsToGiveText = eventArgs?.Arguments?.ElementAtOrDefault(1);
if (string.IsNullOrWhiteSpace(coinReceiver) || string.IsNullOrWhiteSpace(coinsToGiveText) ||
| 1 |
diff --git a/token-metadata/0xAFFCDd96531bCd66faED95FC61e443D08F79eFEf/metadata.json b/token-metadata/0xAFFCDd96531bCd66faED95FC61e443D08F79eFEf/metadata.json "symbol": "PMGT",
"address": "0xAFFCDd96531bCd66faED95FC61e443D08F79eFEf",
"decimals": 5,
- "dharmaVerificationStatus": {
"dharmaVerificationStatus": "VERIFIED"
}
\ No newline at end of file
-}
\ No newline at end of file
| 3 |
diff --git a/lib/ui/components/common/MainControls.js b/lib/ui/components/common/MainControls.js @@ -15,6 +15,8 @@ const TeamSync = styled.div`
display: flex;
justify-content: center;
align-items: center;
+ color: #b5b5b5;
+ margin-right: 20px;
`;
const Action = styled.div`
@@ -42,11 +44,9 @@ const toggleMimic = () => {
export const MainControls = ({ closeFullEditor }) => (
<MainActions>
- <Action>
<TeamSync>
- Team Sync <Icon src="pro"/>
+ Team Sync <Icon style={{ marginLeft: 5 }} src="pro"/>
</TeamSync>
- </Action>
<Action onClick={ () => window.open('https://mimic.js.org') }>
<Icon style={{ verticalAlign: 'sub' }} src="help"/>
@@ -88,7 +88,7 @@ export const MainControls = ({ closeFullEditor }) => (
}
<Action>
- <Icon style={{ verticalAlign: 'sub' }}
+ <Icon style={{ verticalAlign: 'sub', marginLeft: 10 }}
src="close"
onClick={ () => UIState.update({ viewMode: 'closed' }) }/>
</Action>
| 7 |
diff --git a/src/components/postHtmlRenderer/postHtmlRenderer.tsx b/src/components/postHtmlRenderer/postHtmlRenderer.tsx @@ -162,6 +162,16 @@ export const PostHtmlRenderer = memo(
}
}
+ if (tnode.children.length === 1 && tnode.children[0].tagName === 'img') {
+ const maxImgWidth = getMaxImageWidth(tnode);
+ return <AutoHeightImage
+ contentWidth={maxImgWidth}
+ imgUrl={tnode.children[0].attributes.src}
+ isAnchored={false}
+ onPress={_onPress}
+ />
+ }
+
return <InternalRenderer tnode={tnode} onPress={_onPress} {...props} />;
};
@@ -236,7 +246,8 @@ export const PostHtmlRenderer = memo(
<ScrollView horizontal={true} scrollEnabled={isScrollable}>
<TDefaultRenderer {...props} />
</ScrollView>
- )}
+ )
+ }
// iframe renderer for rendering iframes in body
| 9 |
diff --git a/.storybook/storybook-data.js b/.storybook/storybook-data.js @@ -120,19 +120,6 @@ module.exports = [
},
},
},
- {
- id: 'dashboard--post-searcher',
- kind: 'Dashboard',
- name: 'Post Searcher',
- story: 'Post Searcher',
- parameters: {
- fileName: './stories/dashboard.stories.js',
- options: {
- hierarchyRootSeparator: '|',
- hierarchySeparator: {},
- },
- },
- },
{
id: 'global--plugin-header',
kind: 'Global',
| 2 |
diff --git a/tests/e2e/specs/modules/pagespeed-insights/activation.test.js b/tests/e2e/specs/modules/pagespeed-insights/activation.test.js @@ -8,7 +8,6 @@ import { visitAdminPage, activatePlugin } from '@wordpress/e2e-test-utils';
*/
import {
deactivateUtilityPlugins,
- pasteText,
resetSiteKit,
setSearchConsoleProperty,
setSiteVerification,
@@ -26,38 +25,15 @@ describe( 'PageSpeed Insights Activation', () => {
await resetSiteKit();
} );
- it( 'should lead you to the activation page', async () => {
+ it( 'leads you to the Site Kit dashboard after activation', async () => {
await visitAdminPage( 'admin.php', 'page=googlesitekit-dashboard' );
- await expect( page ).toMatchElement( 'h3.googlesitekit-cta__title', { text: 'Activate PageSpeed Insights.' } );
+ await Promise.all( [
+ page.waitForNavigation(),
+ expect( page ).toClick( '.googlesitekit-cta-link', { text: 'Activate PageSpeed Insights' } ),
+ ] );
- await expect( page ).toClick( '.googlesitekit-cta-link', { text: 'Activate PageSpeed Insights' } );
- await page.waitForSelector( 'h2.googlesitekit-setup-module__title' );
-
- await expect( page ).toMatchElement( 'h2.googlesitekit-setup-module__title', { text: 'PageSpeed Insights' } );
- } );
-
- it( 'should submit and save the entered key', async () => {
- await visitAdminPage( 'admin.php', 'page=googlesitekit-dashboard' );
-
- await expect( page ).toClick( '.googlesitekit-cta-link', { text: 'Activate PageSpeed Insights' } );
- await page.waitForSelector( 'h2.googlesitekit-setup-module__title' );
-
- await expect( page ).toMatchElement( 'h2.googlesitekit-setup-module__title', { text: 'PageSpeed Insights' } );
-
- await pasteText( 'input.mdc-text-field__input', 'PSIKEYTOSUBMITANDTEST' );
-
- await expect( page ).toClick( 'button.mdc-button', { text: 'Proceed' } );
-
- await page.waitForSelector( 'h3.googlesitekit-heading-3' );
-
- // Check that the correct key is saved on the settings page.
- await visitAdminPage( 'admin.php', 'page=googlesitekit-settings' );
-
- await expect( page ).toClick( 'button.mdc-tab', { text: 'Admin Settings' } );
-
- // Check the API Key text, verifying the submitted value has been stored.
- await expect( page ).toMatchElement( '.googlesitekit-settings-module__meta-item-type', { text: 'API Key' } );
- await expect( page ).toMatchElement( 'h5.googlesitekit-settings-module__meta-item-data', { text: 'PSIKEYTOSUBMITANDTEST' } );
+ await page.waitForSelector( '.googlesitekit-publisher-win__title' );
+ await expect( page ).toMatchElement( '.googlesitekit-publisher-win__title', { text: /Congrats on completing the setup for PageSpeed Insights!/i } );
} );
} );
| 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.