code
stringlengths
122
4.99k
label
int64
0
14
diff --git a/metaversefile-api.js b/metaversefile-api.js @@ -8,6 +8,7 @@ import physicsManager from './physics-manager.js'; import {rigManager} from './rig.js'; import * as ui from './vr-ui.js'; import {ShadertoyLoader} from './shadertoy.js'; +import {GIFLoader} from './GIFLoader.js'; const localVector2D = new THREE.Vector2(); @@ -106,17 +107,30 @@ function createPointerEvents(store) { } } -let loaders = null; -const _getLoaders = () => { - if (!loaders) { - const gltfLoader = new GLTFLoader(); - const shadertoyLoader = new ShadertoyLoader(); - loaders = { - gltfLoader, - shadertoyLoader, +const _memoize = fn => { + let loaded = false; + let cache = null; + return () => { + if (!loaded) { + cache = fn(); + loaded = true; + } + return cache; }; - } - return loaders; +}; +const _gltfLoader = _memoize(() => new GLTFLoader()); +const _shadertoyLoader = _memoize(() => new ShadertoyLoader()); +const _gifLoader = _memoize(() => new GIFLoader()); +const loaders = { + get gltfLoader() { + return _gltfLoader(); + }, + get shadertoyLoader() { + return _shadertoyLoader(); + }, + get gifLoader() { + return _gifLoader(); + }, }; let currentAppRender = null; @@ -212,7 +226,7 @@ metaversefile.setApi({ return localPlayer; }, useLoaders() { - return _getLoaders(); + return loaders; }, usePhysics() { const app = currentAppRender;
4
diff --git a/Source/ui/UI.js b/Source/ui/UI.js import { isNativeObject } from '../dom/utils' function getPluginAlertIcon() { - if (__command.pluginBundle() && __command.pluginBundle().icon()) { + if (__command.pluginBundle() && __command.pluginBundle().alertIcon()) { return __command.pluginBundle().alertIcon() } return NSImage.imageNamed('plugins')
1
diff --git a/src/reducers/status/index.js b/src/reducers/status/index.js @@ -7,6 +7,8 @@ import { setMainLoader } from '../../actions/status' +import { selectAccount } from '../../actions/account' + const initialState = { mainLoader: false, actionStatus: {}, @@ -99,7 +101,10 @@ const clearReducer = handleActions({ } : undefined) }), {}) - }) + }), + [selectAccount]: () => { + return initialState + } }, initialState) const mainLoader = handleActions({
9
diff --git a/public/app/js/cbus-data.js b/public/app/js/cbus-data.js @@ -124,16 +124,10 @@ cbus.data.updateMedias = function() { }; cbus.data.getEpisodeElem = function(options) { - if (options.id || (typeof options.index !== "undefined" && options.index !== null)) { - var elem = null; - if (options.id) { - elem = document.querySelector("cbus-episode[data-id='" + options.id + "']"); - } else { // options.index - elem = document.querySelectorAll("cbus-episode")[Number(options.index)]; - } - - return elem; + return document.querySelector("cbus-episode[data-id='" + options.id + "']"); + } else if (options.index || options.index !== 0) { + return document.getElementsByTagName("cbus-episode")[Number(options.index)]; } return false; };
7
diff --git a/policykit/scripts/starterkits.py b/policykit/scripts/starterkits.py @@ -514,7 +514,7 @@ democracy_policy2_slack = GenericPolicy.objects.create( import math voter_users = users.filter(groups__name__in=['Democracy: Voter']) -yes_votes = action.proposal.get_yes_votes(users=voter_users, value=True) +yes_votes = action.proposal.get_yes_votes(users=voter_users) if len(yes_votes) >= math.ceil(voter_users.count()/2): return PASSED elif action.proposal.get_time_elapsed() > datetime.timedelta(days=1): @@ -554,7 +554,7 @@ else: import math voter_users = users.filter(groups__name__in=['Democracy: Voter']) -yes_votes = action.proposal.get_yes_votes(users=voter_users, value=True) +yes_votes = action.proposal.get_yes_votes(users=voter_users) if len(yes_votes) >= math.ceil(voter_users.count()/2): return PASSED elif action.proposal.get_time_elapsed() > datetime.timedelta(days=1): @@ -591,18 +591,20 @@ else: """, initialize="pass", check=""" +import datetime import math +def hasVoterRole(user): + return user.has_role('Democracy: Voter') +voter_users = list(filter(hasVoterRole, users)) +yes_votes = action.proposal.get_yes_votes(users=voter_users) -voter_users = users.filter(groups__name__in=['Democracy: Voter']) -yes_votes = action.proposal.get_yes_votes(users=voter_users, value=True) if len(yes_votes) >= math.ceil(voter_users.count()/2): return PASSED elif action.proposal.get_time_elapsed() > datetime.timedelta(days=1): return FAILED """, notify=""" -voter_users = users.filter(groups__name__in=['Democracy: Voter']) -action.community.notify_action(action, policy, users=voter_users, template='Please vote') +action.community.notify_action(action, policy, users, template='Please vote on proposal') """, success="action.execute()", fail="pass", @@ -634,7 +636,7 @@ else: import math voter_users = users.filter(groups__name__in=['Democracy: Voter']) -yes_votes = action.proposal.get_yes_votes(users=voter_users, value=True) +yes_votes = action.proposal.get_yes_votes(users=voter_users) if len(yes_votes) >= math.ceil(voter_users.count()/2): return PASSED elif action.proposal.get_time_elapsed() > datetime.timedelta(days=1):
3
diff --git a/articles/api/authentication/_login.md b/articles/api/authentication/_login.md @@ -170,11 +170,6 @@ Given the social provider's `access_token` and the `connection`, this endpoint w - The `email` scope value requests access to the `email` and `email_verified` Claims. -### Error Codes - -For the complete error code reference for this endpoint refer to [Errors > POST /oauth/access_token](#post-oauth-access_token). - - ### More Information - [Call an Identity Provider API](/tutorials/calling-an-external-idp-api) - [Identity Provider Access Tokens](/tokens/idp)
2
diff --git a/src/index.js b/src/index.js @@ -611,7 +611,7 @@ class Offline { handler = functionHelper.createHandler(funOptions, this.options); } catch (err) { - return this._reply500(response, `Error while loading ${funName}`, err, requestId); + return this._reply500(response, `Error while loading ${funName}`, err); } /* REQUEST TEMPLATE PROCESSING (event population) */ @@ -627,7 +627,7 @@ class Offline { event = renderVelocityTemplateObject(requestTemplate, velocityContext); } catch (err) { - return this._reply500(response, `Error while parsing template "${contentType}" for ${funName}`, err, requestId); + return this._reply500(response, `Error while parsing template "${contentType}" for ${funName}`, err); } } else if (typeof request.payload === 'object') { @@ -685,7 +685,7 @@ class Offline { // it here and reply in the same way that we would have above when // we lazy-load the non-IPC handler function. if (this.options.useSeparateProcesses && err.ipcException) { - return this._reply500(response, `Error while loading ${funName}`, err, requestId); + return this._reply500(response, `Error while loading ${funName}`, err); } const errorMessage = (err.message || err).toString(); @@ -845,7 +845,7 @@ class Offline { } else { if (result && result.body && typeof result.body !== 'string') { - return this._reply500(response, 'According to the API Gateway specs, the body content must be stringified. Check your Lambda response and make sure you are invoking JSON.stringify(YOUR_CONTENT) on your body object', {}, requestId); + return this._reply500(response, 'According to the API Gateway specs, the body content must be stringified. Check your Lambda response and make sure you are invoking JSON.stringify(YOUR_CONTENT) on your body object', {}); } response.source = result; } @@ -897,7 +897,7 @@ class Offline { } else { if (result.body && typeof result.body !== 'string') { - return this._reply500(response, 'According to the API Gateway specs, the body content must be stringified. Check your Lambda response and make sure you are invoking JSON.stringify(YOUR_CONTENT) on your body object', {}, requestId); + return this._reply500(response, 'According to the API Gateway specs, the body content must be stringified. Check your Lambda response and make sure you are invoking JSON.stringify(YOUR_CONTENT) on your body object', {}); } response.source = result.body; } @@ -938,7 +938,7 @@ class Offline { catch (error) { // When request body validation fails, APIG will return back 400 as detailed in: // https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html - return this._replyError(400, response, `Invalid request body for '${funName}' handler`, error, requestId); + return this._replyError(400, response, `Invalid request body for '${funName}' handler`, error); } } @@ -954,7 +954,7 @@ class Offline { } } catch (error) { - return this._reply500(response, `Uncaught error in your '${funName}' handler`, error, requestId); + return this._reply500(response, `Uncaught error in your '${funName}' handler`, error); } finally { setTimeout(() => { @@ -1080,9 +1080,9 @@ class Offline { response.send(); } - _reply500(response, message, err, requestId) { + _reply500(response, message, err) { // APIG replies 200 by default on failures - this._replyError(200, response, message, err, requestId); + this._replyError(200, response, message, err); } _replyTimeout(response, funName, funTimeout, requestId) {
2
diff --git a/deepfence_ui/app/scripts/helpers/auth-helper.js b/deepfence_ui/app/scripts/helpers/auth-helper.js @@ -84,7 +84,7 @@ async function refreshAuthTokenIfRequired() { export function getUserRole() { if (localStorage.getItem('authToken')) { const jwt = decodeJwtToken(localStorage.getItem('authToken')); - return jwt.identity.role; + return jwt.sub.role; } return null; }
13
diff --git a/src/components/CheckMarkCard/CheckMarkCard.jsx b/src/components/CheckMarkCard/CheckMarkCard.jsx @@ -195,7 +195,13 @@ CheckMarkCard.propTypes = { inputRef: PropTypes.func, /** Whether the card should be focused */ isFocused: PropTypes.bool, - /** Give the card special status styles, it also disables the input */ + /** Give the card special status styles, it also disables the input + * status: Not needed, but if provided it will add a class name of "is-YOUR_STATUS" to the component + * iconName: Icon to render + * iconSize: Size of the icon, default 20 + * color: color of the Card (border and background of the mark) + * tooltipText: If a tooltip is desired, provide the message here + */ withStatus: PropTypes.shape({ status: PropTypes.string, iconName: PropTypes.string,
7
diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js @@ -3749,6 +3749,7 @@ function makePlotFramework(gd) { .classed('main-svg', true); fullLayout._modebardiv = fullLayout._paperdiv.append('div'); + delete fullLayout._modeBar; fullLayout._hoverpaper = fullLayout._paperdiv.append('svg') .classed('main-svg', true);
1
diff --git a/.storybook/storybook-data.js b/.storybook/storybook-data.js @@ -209,19 +209,6 @@ module.exports = [ }, }, }, - { - id: 'adsense-module--adsense-outro', - kind: 'AdSense Module', - name: 'AdSense Outro', - story: 'AdSense Outro', - parameters: { - fileName: './stories/module-adsense.stories.js', - options: { - hierarchyRootSeparator: '|', - hierarchySeparator: {}, - }, - }, - }, { id: 'analytics-module--audience-overview-chart', kind: 'Analytics Module',
2
diff --git a/versions/3.0.md b/versions/3.0.md @@ -1276,7 +1276,7 @@ Field Name | Type | Description <a name="mediaTypeSchema"></a>schema | [Schema Object](#schemaObject) \| [Reference Object](#referenceObject) | The schema defining the type used for the request body. <a name="mediaTypeExample"></a>example | Any | Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The `example` object is mutually exclusive of the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the example provided by the schema. <a name="mediaTypeExamples"></a>examples | Map[ `string`, [Example Object](#exampleObject) \| [Reference Object](#referenceObject)] | Examples of the media type. Each example object SHOULD match the media type and specified schema if present. The `examples` object is mutually exclusive of the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema. -<a name="mediaTypeEncoding"></a>encoding | Map[`string`, [Encoding Object](#encodingObject)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHOULD apply only to `requestBody` objects when the content type is `multipart`. +<a name="mediaTypeEncoding"></a>encoding | Map[`string`, [Encoding Object](#encodingObject)] | A map between a property name and its encoding information. The key, being the property name, MUST exist in the schema as a property. The encoding object SHOULD only apply to `requestBody` objects when the content type is `multipart`. This object can be extended with [Specification Extensions](#specificationExtensions).
13
diff --git a/magda-storage-api/src/createApiRouter.ts b/magda-storage-api/src/createApiRouter.ts @@ -202,13 +202,13 @@ export default function createApiRouter(options: ApiRouterOptions) { // We could just return true here, but we'll give ourself a bit of extra cover by // asserting that the id is correct return record.id === recordId ? 200 : 404; - } catch (e) { - if (e.e && e.e.response && e.e.response.statusCode === 404) { + } catch (err) { + if (err.e && err.e.response && err.e.response.statusCode === 404) { return 404; } else { console.error( "Error occurred when trying to contact registry", - e.message + err.message ); return 500; }
10
diff --git a/assets/js/components/ModulesList.js b/assets/js/components/ModulesList.js @@ -85,9 +85,6 @@ function ModulesList( { moduleSlugs } ) { // Filter out internal modules and remove modules with dependencies. const modules = Object.values( moduleObjects ).filter( ( module ) => ! module.internal && 0 === module.dependencies.length ); - - // Sort modules and exclude those that required other modules to be set up. - // Logic still in place below in case we want to add blocked modules back. const sortedModules = modules .sort( ( module1, module2 ) => module1.sort - module2.sort );
2
diff --git a/embed.html b/embed.html <!-- build:css css/embed.style.min.css --> <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css"> <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap-theme.css"> +<link rel="stylesheet" href="node_modules/select2/dist/css/select2.css"> <link rel="stylesheet" href="node_modules/vis/dist/vis.css"> <link rel="stylesheet" href="node_modules/ekko-lightbox/dist/ekko-lightbox.css"> <link rel="stylesheet" href="node_modules/bootstrap-table/dist/bootstrap-table.css"> @@ -64,6 +65,21 @@ body { background-color: rgba(255, 255, 255, 0.8); z-index: 401; /* one above .leaflet-pane */ } + +.edit { + position: fixed; + bottom: 0.5em; + left: 0; + font-size: 2em; + z-index: 401; /* one above .leaflet-pane */ + padding: 0.2em; + border-radius: 5px; + background-color: rgba(255,255,255,0.8); +} +.popover { + min-width: 300px; + white-space: nowrap; +} </style> <body> @@ -78,7 +94,9 @@ body { </div> <div id="query-result"></div> - <a class="link" target="_blank" title="Wikidata Query Service SPARQL"><small>Edit on query.Wikidata.org</small></a> + <a class="link edit-link" target="_blank" title="Wikidata Query Service SPARQL"><small>Edit on query.Wikidata.org</small></a> + <a href="#" class="edit edit-link" data-toggle="popover"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a> + <!-- JS files --> <!-- build:js js/embed.vendor.min.js --> @@ -97,7 +115,10 @@ body { <script src="node_modules/dimple-js/dist/dimple.latest.js"></script> <script src="node_modules/js-cookie/src/js.cookie.js"></script> <script src="node_modules/vis/dist/vis.js"></script> + <script src="node_modules/select2/dist/js/select2.js"></script> <script src="node_modules/moment/min/moment-with-locales.js"></script> + <script src="vendor/sparqljs/dist/sparqljs-browser-min.js"></script> + <script src="vendor/bootstrapx-clickover/bootstrapx-clickover.js"></script> <!-- endbuild --> <!-- build:js js/embed.wdqs.min.js --> @@ -119,8 +140,12 @@ body { <script src="wikibase/queryService/ui/resultBrowser/GraphResultBrowser.js"></script> <script src="wikibase/queryService/ui/resultBrowser/GraphResultBrowserNodeBrowser.js"></script> <script src="wikibase/queryService/api/Sparql.js"></script> + <script src="wikibase/queryService/api/Wikibase.js"></script> <script src="wikibase/queryService/api/Tracking.js"></script> <script src="wikibase/queryService/RdfNamespaces.js"></script> + <script src="wikibase/queryService/ui/visualEditor/VisualEditor.js"></script> + <script src="wikibase/queryService/ui/visualEditor/SparqlQuery.js"></script> + <script src="wikibase/queryService/ui/visualEditor/SelectorBox.js"></script> <!-- endbuild --> <script type="text/javascript"> @@ -165,24 +190,47 @@ body { }; $( document ).ready( function() { - $( '.link' ).attr( 'href', 'https://query.wikidata.org/' + window.location.hash ) - - var query = decodeURIComponent( window.location.hash.substr( 1 ) ); + function getResultBrowser( query ) { + var browser = null; var browserPackage = wikibase.queryService.ui.resultBrowser; try { var browserKey = query.match( /#defaultView:(\w+)/ )[1]; var browserClass = RESULT_BROWSER[browserKey].class; - var browser = new browserPackage[browserClass](); + browser = new browserPackage[browserClass](); } catch ( e ) { var browserClass = RESULT_BROWSER.Table.class; - var browser = new browserPackage[browserClass](); + browser = new browserPackage[browserClass](); } var tracking = new wikibase.queryService.api.Tracking(); tracking.track( 'wikibase.queryService.ui.embed.' + ( browserKey || 'default' ) ); + return browser; + } + + function renderEdit( query, callback ) { + var ve = new wikibase.queryService.ui.visualEditor.VisualEditor(); + ve.setChangeListener( function( v ) { + callback( v.getQuery() ); + } ); + var $editor = $( '<div>' ); + ve.setQuery( query ); + ve.draw( $editor ); + $('.edit').on('click',function(e){ + e.preventDefault(); + }).popover( { + placement: 'top', + 'html': true, + 'content': $editor + } ); + } + + function renderQuery( query ) { + var browser = getResultBrowser( query ); var api = new wikibase.queryService.api.Sparql(); + $( '#query-result' ).hide(); + $( '#progress' ).show(); api.query( query ).done( function() { try { browser.setResult( api.getResultRawData() ); @@ -197,6 +245,12 @@ body { $( '#progress' ).hide(); $( '#error' ).show(); } ); + } + + $( '.edit-link' ).attr( 'href', 'https://query.wikidata.org/' + window.location.hash ) + var query = decodeURIComponent( window.location.hash.substr( 1 ) ); + renderQuery( query ); + renderEdit( query, renderQuery ); } ); </script> </body>
11
diff --git a/src/mavo.js b/src/mavo.js @@ -201,7 +201,6 @@ let _ = self.Mavo = $.Class(class Mavo { } }); - if (this.primaryBackend) { // Fetch existing data this.permissions.can("read", () => this.load()); @@ -433,7 +432,9 @@ let _ = self.Mavo = $.Class(class Mavo { } if (!backend) { - backend = _.Functions.url(`${this.id}-${role}`) || this.element.getAttribute(attribute) || null; + backend = _.Functions.url(`${this.id}-${role}`) + || _.Functions.url(`${this.id.toLowerCase()}-${role}`) + || this.element.getAttribute(attribute) || null; } if (backend) {
11
diff --git a/angular/projects/spark-angular/package.json b/angular/projects/spark-angular/package.json }, "schematics": "./schematics/collection.json", "peerDependencies": { - "@angular/animations": ">=7.0.0 < 9.2.0", - "@angular/common": ">=7.0.0 < 9.2.0", - "@angular/compiler": ">=7.0.0 < 9.2.0", - "@angular/compiler-cli": ">=7.0.0 < 9.2.0", - "@angular/core": ">=7.0.0 < 9.2.0", - "@angular/forms": ">=7.0.0 < 9.2.0", - "@angular/platform-browser": ">=7.0.0 < 9.2.0", - "@angular/platform-browser-dynamic": ">=7.0.0 < 9.2.0", - "@angular/router": ">=7.0.0 < 9.2.0" + "@angular/animations": ">=7.0.0 < 11.2.14", + "@angular/common": ">=7.0.0 < 11.2.14", + "@angular/compiler": ">=7.0.0 < 11.2.14", + "@angular/compiler-cli": ">=7.0.0 < 11.2.14", + "@angular/core": ">=7.0.0 < 11.2.14", + "@angular/forms": ">=7.0.0 < 11.2.14", + "@angular/platform-browser": ">=7.0.0 < 11.2.14", + "@angular/platform-browser-dynamic": ">=7.0.0 < 11.2.14", + "@angular/router": ">=7.0.0 < 11.2.14" }, "dependencies": { "@sparkdesignsystem/spark-styles": "^3.0.0",
3
diff --git a/content/blog/building-the-open-source-community-we-want/index.md b/content/blog/building-the-open-source-community-we-want/index.md @@ -3,7 +3,9 @@ slug: 'building-the-open-source-community-we-want' title: 'Building The Open Source Community We Want' date: '2019-10-08' author: 'Kent C. Dodds' -description: "_Let's be intentionally inclusive_" +description: + "_Let's be intentional about the open source community we want and work hard + to build it._" categories: - 'open source' banner: './images/banner.jpg'
7
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml @@ -71,7 +71,7 @@ jobs: echo "SECRET_NAME=DEV_ENV" >> $GITHUB_ENV echo "APPCENTER_NAME=GoodDollar/GoodDollar-Android-development" >> $GITHUB_ENV echo "$GITHUB_HEAD_REF $GITHUB_REF ${{ env.BRANCH }} ${{ env.SECRET_NAME }} ${{ env.APPCENTER_NAME }}" - echo "contains: ${{ contains('staging',env.BRANCH) }}" + echo "contains: ${{ contains('staging',env.BRANCH) }} branch: ${{ env.BRANCH }}" - name: Pre-checks - Env is QA if: ${{ contains('staging',env.BRANCH) }}
0
diff --git a/src/components/ImageBackground.js b/src/components/ImageBackground.js @@ -23,13 +23,13 @@ export class ImageBackground extends Component<Props, State> { this.state = { imageSize: null }; } - onLayout({ + onLayout = ({ nativeEvent: { layout: { width, height } } - }) { + }) => { this.setState({ imageSize: { width, height } }); - } + }; render() { const { reference, getImageDetails, ...props } = this.props; @@ -48,11 +48,7 @@ export class ImageBackground extends Component<Props, State> { : imageNotLoadedPlaceholder; return ( - <RNImageBackground - onLayout={this.onLayout.bind(this)} - source={imgSrc} - {...props} - /> + <RNImageBackground onLayout={this.onLayout} source={imgSrc} {...props} /> ); } }
2
diff --git a/src/providers/hive/dhive.js b/src/providers/hive/dhive.js @@ -710,7 +710,7 @@ const _vote = (currentAccount, pin, author, permlink, weight) => { return new Promise((resolve, reject) => { client.broadcast - .vote(args, privateKey) + .sendOperations(args, privateKey) .then((result) => { Alert.alert('dhive transaction id: ' + result.id); resolve(result);
14
diff --git a/scss/typography/_small.scss b/scss/typography/_small.scss @@ -13,5 +13,5 @@ $siimple-small-text-size: 12px; .siimple-small { //font-family: $siimple-default-text-font; font-size: $siimple-small-text-size; - color: $siimple-navy-4; + color: $siimple-navy-light; }
1
diff --git a/src/Navigation.js b/src/Navigation.js @@ -197,14 +197,6 @@ const ParadeTabNav = createMaterialTopTabNavigator( }, upperCaseLabel: false, getTabTestID: getTabTestId - }, - navigationOptions: { - header: ( - <Header - title={text.paradeInformationScreen.headerTitle} - testID="page-heading-parade" - /> - ) } } ); @@ -217,10 +209,7 @@ const ParadeStack = createStackNavigator( initialRouteName: PARADE, navigationOptions: { header: ( - <Header - title={text.paradeInformationScreen.headerTitle} - testID="page-heading-parade" - /> + <Header title={text.parade.headerTitle} testID="page-heading-parade" /> ) }, cardStyle: styles.card
2
diff --git a/app/components/billing/BillingUpgrade.js b/app/components/billing/BillingUpgrade.js @@ -124,6 +124,8 @@ class BillingUpgrade extends React.Component { } renderSummary() { + let interval = this.state.summary.interval === "monthly" ? "per month" : "per year"; + return ( <div className="border border-gray rounded mb2"> @@ -143,7 +145,7 @@ class BillingUpgrade extends React.Component { <div className="p3 flex items-center bg-silver"> <div className="right-align flex-auto"> - <h3 className="h3 m0 py1 semi-bold">${this.state.summary.price / 100} per month</h3> + <h3 className="h3 m0 py1 semi-bold">${formatNumber(this.state.summary.price / 100)} {interval}</h3> </div> </div> </div>
4
diff --git a/assets/js/components/ViewOnlyMenu/Description.js b/assets/js/components/ViewOnlyMenu/Description.js @@ -49,10 +49,6 @@ export default function Description() { select( CORE_SITE ).getProxySetupURL() ); - const isConnected = useSelect( ( select ) => - select( CORE_SITE ).isConnected() - ); - const { navigateTo } = useDispatch( CORE_LOCATION ); const onButtonClick = useCallback( @@ -65,13 +61,9 @@ export default function Description() { proxySetupURL ? 'proxy' : 'custom-oauth' ); - if ( proxySetupURL && ! isConnected ) { - await trackEvent( viewContext, 'start_site_setup', 'proxy' ); - } - navigateTo( proxySetupURL ); }, - [ proxySetupURL, isConnected, navigateTo, viewContext ] + [ proxySetupURL, navigateTo, viewContext ] ); const onLinkClick = useCallback( () => {
2
diff --git a/src/scripts/interactive-video.js b/src/scripts/interactive-video.js @@ -591,7 +591,11 @@ InteractiveVideo.prototype.setCaptionTracks = function (tracks) { // Insert popup and button self.controls.$captionsButton = $(self.captionsTrackSelector.control); self.popupMenuButtons.push(self.controls.$captionsButton); + if (self.controls.$volume) { $(self.captionsTrackSelector.control).insertAfter(self.controls.$volume); + } else { + $(self.captionsTrackSelector.control).insertAfter(self.controls.$qualityButton); + } $(self.captionsTrackSelector.popup).css(self.controlsCss).insertAfter($(self.captionsTrackSelector.control)); self.popupMenuChoosers.push($(self.captionsTrackSelector.popup)); $(self.captionsTrackSelector.overlayControl).insertAfter(self.controls.$qualityButtonMinimal);
0
diff --git a/lib/cartodb/models/aggregation/aggregation-query.js b/lib/cartodb/models/aggregation/aggregation-query.js @@ -50,6 +50,7 @@ const SUPPORTED_AGGREGATE_FUNCTIONS = { }; const aggregateColumns = ctx => { + // TODO: always add count let columns = ctx.columns || {}; if (Object.keys(columns).length === 0) { // default aggregation @@ -117,7 +118,7 @@ const aggregationQueryTemplates = { GROUP BY _cdb_gx, _cdb_gy ) SELECT - ST_SetSRID(ST_MakePoint(_cdb_gx*(res+0.5), _cdb_gy*(res*0.5)), 3857) AS the_geom_webmercator, + ST_SetSRID(ST_MakePoint(_cdb_gx*(res+0.5), _cdb_gy*(res+0.5)), 3857) AS the_geom_webmercator, _cdb_feature_count FROM _cdb_clusters, _cdb_params `,
1
diff --git a/accessibility-checker-engine/help-v4/en-US/aria_descendant_valid.html b/accessibility-checker-engine/help-v4/en-US/aria_descendant_valid.html ### Why is this important? -This rule helps ensures that assistive technologies can gather the correct information about all the user interface components. -When certain elements that are specified in ARIA to have presentational descendants, browsers **_should not**_ expose the descendants through the platform accessibility API to assistive technologies. -If user agents do not hide the descendants contents and semantics in the accessibility tree, some information may be presented (spoken) twice and confuse the end user. +Correct roles and descendants help ensure that assistive technologies can gather the correct information about all the user interface components. +When certain elements that are specified in ARIA to have presentational descendants, browsers _should not_ expose the descendants through the platform accessibility API to assistive technologies. +If user agents do not hide the descendants contents and semantics from the accessibility tree, some information may be presented (spoken) twice and confuse the end user. The content contained by the element, i.e., inner text, as well as contents of all its descendants remain visible to assistive technologies, except, of course, when the text is explicitly hidden, e.g., styled with `display:none` or has `aria-hidden="true"`. -This rule is triggered when one of the following elements contain more than presentational children: `button`, `checkbox`, `img`, `math`, `menuitemcheckbox`, `menuitemradio`, `option`, `progressbar`, `radio`, `scrollbar`, `separator`, `slider`, `switch`, and `tab`. +This rule is triggered when one of the following elements contain more than presentational descendants: `button`, `checkbox`, `img`, `math`, `menuitemcheckbox`, `menuitemradio`, `option`, `progressbar`, `radio`, `scrollbar`, `separator`, `slider`, `switch`, and `tab`. Refer to the table in [ARIA in HTML - Allowed descendants of ARIA roles](https://www.w3.org/TR/html-aria/#allowed-descendants-of-aria-roles) for the normative definition for each ARIA role, the kinds of content categories for each role, and what [kinds of elements](https://html.spec.whatwg.org/multipage/dom.html#kinds-of-content) can be descendants. @@ -63,7 +63,7 @@ but does not allow [interactive content](https://html.spec.whatwg.org/multipage/ ### What to do - * Remove any incorrect descendant element(s) + * Remove the incorrect descendant element </script></mark-down>
3
diff --git a/checkfiles/checkfiles.py b/checkfiles/checkfiles.py @@ -766,7 +766,8 @@ def check_file(config, session, url, job): 'set -o pipefail; gunzip --stdout {} | grep -c \'^#\''.format(local_path), shell=True, executable='/bin/bash', stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: - if e.returncode > 1: # empty file, or other type of error + # empty file, or other type of error + if e.returncode > 1: errors['grep_bed_problem'] = e.output.decode(errors='replace').rstrip('\n') # comments lines found, need to calculate content md5sum as usual # remove the comments and create modified.bed to give validateFiles scritp @@ -830,7 +831,8 @@ def remove_local_file(path_to_the_file, errors): def fetch_files(session, url, search_query, out, include_unexpired_upload=False, file_list=None): graph = [] - if file_list: # checkfiles using a file with a list of file accessions to be checked + # checkfiles using a file with a list of file accessions to be checked + if file_list: r = None ACCESSIONS = [] if os.path.isfile(file_list): @@ -841,7 +843,8 @@ def fetch_files(session, url, search_query, out, include_unexpired_upload=False, r.raise_for_status() local = copy.deepcopy(r.json()['@graph']) graph.extend(local) - else: # checkfiles using a query + # checkfiles using a query + else: r = session.get( urljoin(url, '/search/?field=@id&limit=all&type=File&' + search_query)) r.raise_for_status()
1
diff --git a/views/channel.handlebars b/views/channel.handlebars <p>Below are all the free claims in this channel.</p> {{#each channelContents}} <div class="all-claims-item"> - {{#ifConditional this.fileType '===' 'video/mp4'}} + {{#ifConditional this.contentType '===' 'video/mp4'}} <video class="all-claims-img" autoplay controls> <source src="/{{this.claimId}}/{{this.name}}.{{this.fileExtension}}"> {{!--fallback--}}
1
diff --git a/package.json b/package.json "@pixiv/three-vrm": "./packages/three-vrm", "@react-three/fiber": "^7.0.6", "@shaderfrog/glsl-parser": "^0.1.20", - "borc": "^3.0.0", "classnames": "^2.3.1", "dids": "^2.4.0", "encoding-japanese": "^1.0.30",
2
diff --git a/CHANGELOG.md b/CHANGELOG.md All notable changes to this project are documented in this file. -## Head +## 13.13.0 - Added: `no-invalid-position-at-import-rule` rule ([#5202](https://github.com/stylelint/stylelint/pull/5202)). - Added: `no-irregular-whitespace` rule ([#5209](https://github.com/stylelint/stylelint/pull/5209)).
6
diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -10,6 +10,27 @@ https://github.com/plotly/plotly.js/compare/vX.Y.Z...master where X.Y.Z is the semver of most recent plotly.js release. +## [1.52.2] -- 2020-02-03 + +## Fixed +- Handle 'missing' matching axes [#4529] +- Fix hover for `mesh3d`, `isosurface` and `volume` + when using `plotGlPixelRatio > 1` (bug introduced in 1.45.0) [#4534] +- Fix hover of `mesh3d` traces with `facecolor` and `intensitymode: 'cell'` [#4539] +- Fix gl3d rendering on iPad Pro & iPad 7th + iOs v13 + Safari [#4360, #4546] +- Fix pixel-rounding logic for blank bars [#4522] +- Fix `pathbar.visible` updates in `treemap` traces [#4516] +- Fix `waterfall` `'closest'` hover when cursor is below the size axis [#4537] +- Fix mapbox layout layer opacity for raster types [#4525] +- Allow `0` in `grouby` transform `nameformat` templates [#4526] +- Fix `Plotly.validate` for `valType:'any'` attributes [#4526] +- Bump `d3-interpolate` to v1.4.0 [#4475] +- Bump `d3-hierarchy` to v1.1.9 [#4475] +- Fix typo in annotation `align` attribute description [#4528] +- Fix `plot_bgcolor` and `paper_bgcolor` attribute description [#4536] +- Fix `insidetextorientation` description for pie and sunburst traces [#4523] + + ## [1.52.1] -- 2020-01-13 ### Fixed
3
diff --git a/modules/xmpp/ChatRoom.js b/modules/xmpp/ChatRoom.js @@ -309,7 +309,7 @@ export default class ChatRoom extends Listenable { // The name of the action is a little bit confusing but it seems this is the preferred name by the consumers // of the analytics events. - Statistics.sendAnalytics(createConferenceEvent('joined', meetingId)); + Statistics.sendAnalytics(createConferenceEvent('joined', { meetingId })); } }
1
diff --git a/rig.js b/rig.js @@ -127,6 +127,30 @@ class RigManager { this.localRig.textMesh.sync(); } + setLocalAvatarImage(avatarImage) { + const geometry = new THREE.CircleBufferGeometry(0.1, 32); + const img = new Image(); + img.src = avatarImage; + img.crossOrigin = 'Anonymous'; + img.onload = () => { + texture.needsUpdate = true; + }; + img.onerror = err => { + console.warn(err.stack); + }; + const texture = new THREE.Texture(img); + const material = new THREE.MeshBasicMaterial({ + map: texture, + side: THREE.DoubleSide, + }); + const avatarMesh = new THREE.Mesh(geometry, material); + avatarMesh.position.x = -0.5; + avatarMesh.position.y = -0.02; + this.localRig.textMesh.add(avatarMesh); + + this.localRig.textMesh.sync(); + } + async setLocalAvatarUrl(url, filename) { // await this.localRigQueue.lock();
0
diff --git a/tests/test_datalad.py b/tests/test_datalad.py @@ -19,7 +19,7 @@ def test_delete_dataset(annex_path, new_dataset): assert not os.path.exists(new_dataset.path) -def test_commit_file(annex_path, new_dataset): +def test_commit_file(celery_app, annex_path, new_dataset): ds_id = os.path.basename(new_dataset.path) # Write some files into the dataset first file_path = os.path.join(new_dataset.path, 'LICENSE')
11
diff --git a/package.json b/package.json "sw-precache-webpack-plugin": "0.11.3", "sweetalert2": "^7.0.9", "url-loader": "0.5.9", - "web3": "file:submodules/oracles-web3-1.0/packages/web3", "webpack": "^2.6.1", "webpack-dev-server": "2.5.0", "webpack-manifest-plugin": "1.1.0",
2
diff --git a/frontend/lost/src/components/SIA/SIA.js b/frontend/lost/src/components/SIA/SIA.js @@ -54,7 +54,7 @@ class SIA extends Component { right: 5 }, notification: undefined, - filteredData: undefined, + // filteredData: undefined, currentRotation: 0 } this.siteHistory = createHashHistory() @@ -150,13 +150,13 @@ class SIA extends Component { this.requestImageFromBackend() } } - if(prevState.filteredData != this.state.filteredData){ - console.log('Filtered Data changed') - this.setState({image:{ - ...this.state.image, - data: this.state.filteredData - }}) - } + // if(prevState.filteredData != this.state.filteredData){ + // console.log('Filtered Data changed') + // this.setState({image:{ + // ...this.state.image, + // data: this.state.filteredData + // }}) + // } if(prevProps.annos !== this.props.annos){ this.setState({annos:this.props.annos}) } @@ -357,9 +357,13 @@ class SIA extends Component { bAnnosNew = this.canvas.current.getAnnos(undefined, false) } this.setState({ - filteredData: response.data, + // filteredData: response.data, + image: { + data: response.data, + id: this.props.annos.image.id + }, annos: { - image: {...this.state.image}, + image: {...this.props.image}, annotations: bAnnosNew.annotations } }) @@ -369,9 +373,13 @@ class SIA extends Component { }) this.canvas.current.resetZoom() // } + return } requestImageFromBackend(){ + if (filterTools.active(this.props.filter)){ + this.filterImage(this.props.filter) + } else { this.props.getSiaImage(this.props.annos.image.url).then(response=> { this.setState({image: { @@ -381,10 +389,8 @@ class SIA extends Component { }}) } ) - this.props.getWorkingOnAnnoTask() - if (filterTools.active(this.props.filter)){ - this.filterImage(this.props.filter) } + this.props.getWorkingOnAnnoTask() } setFullscreen(fullscreen = true) {
12
diff --git a/src/screens/EventDetailsScreen/EventContact.js b/src/screens/EventDetailsScreen/EventContact.js // @flow import React from "react"; -import { Image, StyleSheet } from "react-native"; +import { Image } from "react-native"; import { email as sendEmail, phonecall } from "react-native-communications"; import LayoutColumn from "../../components/LayoutColumn"; import Text from "../../components/Text"; @@ -11,8 +11,8 @@ import text from "../../constants/text"; import TextLink from "./TextLink"; type Props = { - email: string, - phone: string + email?: string, + phone?: string }; const EventContact = ({ email, phone }: Props) => ( @@ -22,7 +22,7 @@ const EventContact = ({ email, phone }: Props) => ( </Text> <LayoutColumn spacing={16}> {email && ( - <IconItem icon={<Image source={emailIcon} style={styles.mailIcon} />}> + <IconItem icon={<Image source={emailIcon} />}> <TextLink onPress={() => sendEmail( @@ -39,7 +39,7 @@ const EventContact = ({ email, phone }: Props) => ( </IconItem> )} {phone && ( - <IconItem icon={<Image source={callIcon} style={styles.phoneIcon} />}> + <IconItem icon={<Image source={callIcon} />}> <TextLink onPress={() => phonecall(phone, false)}>{phone}</TextLink> </IconItem> )} @@ -47,14 +47,9 @@ const EventContact = ({ email, phone }: Props) => ( </LayoutColumn> ); -const styles = StyleSheet.create({ - mailIcon: { - // marginTop: 7 - }, - phoneIcon: { - // marginTop: 6, - // marginLeft: 2 - } -}); +EventContact.defaultProps = { + email: undefined, + phone: undefined +}; export default EventContact;
2
diff --git a/src/components/upvote/container/upvoteContainer.js b/src/components/upvote/container/upvoteContainer.js @@ -47,18 +47,16 @@ const UpvoteContainer = (props) => { _calculateVoteStatus(); }, [activeVotes]); - useEffect(() => { - if (localVoteMap) { - _handleLocalVote(); - } - }, []); - const _calculateVoteStatus = async () => { const _isVoted = await isVotedFunc(activeVotes, get(currentAccount, 'name')); const _isDownVoted = await isDownVotedFunc(activeVotes, get(currentAccount, 'name')); setIsVoted(_isVoted && parseInt(_isVoted, 10) / 10000); setIsDownVoted(_isDownVoted && (parseInt(_isDownVoted, 10) / 10000) * -1); + + if (localVoteMap) { + _handleLocalVote(); + } }; const _setUpvotePercent = (value) => { @@ -79,7 +77,7 @@ const UpvoteContainer = (props) => { return; } - setTotalPayout(totalPayout + amount); + setTotalPayout(get(content, 'total_payout') + amount); if (incrementStep > 0) { incrementVoteCount(); }
9
diff --git a/src/content/en/updates/2017/10/chrome-63-deprecations.md b/src/content/en/updates/2017/10/chrome-63-deprecations.md @@ -20,13 +20,7 @@ Chrome 63, which is in beta as of October 26. Visit the for more deprecations and removals from this and previous versions of Chrome. This list is subject to change at any time. -## Security and privacy - -## CSS - -## JavaScript and APIs - -### Interface properties with a Promise type no longer throw exceptions +## Interface properties with a Promise type no longer throw exceptions Interface properties and functions that return a promise have been inconsistent about whether error conditions throw exceptions or reject, which would invoke a @@ -45,7 +39,7 @@ been made for functions. [Chromestatus Tracker](https://www.chromestatus.com/features/5654995223445504) &#124; [Chromium Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=758023) -### Remove getMatchedCSSRules() +## Remove getMatchedCSSRules() The getMatchedCSSRules() method is a webkit-only API to get a list of all the style rules applied to a particular element. Webkit has an [open bug to remove @@ -57,7 +51,7 @@ look at [this Stackoverflow post](https://stackoverflow.com/questions/2952667/fi [Chromestatus Tracker](https://groups.google.com/a/chromium.org/d/topic/blink-dev/-_Al0I5Rm9Q/discussion) &#124; [Chromium Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=437569&desc=2) -### Remove RTCRtcpMuxPolicy of "negotiate" +## Remove RTCRtcpMuxPolicy of "negotiate" The `rtcpMuxPolicy` is used by Chrome to specify its preferred policy regarding use of RTP/RTCP multiplexing. In Chrome 57, we changed the default
1
diff --git a/source/views/panels/PopOverView.js b/source/views/panels/PopOverView.js @@ -100,10 +100,12 @@ const PopOverView = Class({ break; } + // 0% rather than 0 for IE11 compatibility due to Bug #4 + // in https://github.com/philipwalton/flexbugs switch ( alignEdge ) { case 'top': aFlex = '0 1 ' + ( posTop + offsetTop ) + 'px'; - bFlex = '1 0 0'; + bFlex = '1 0 0%'; break; case 'middle': startDistance = @@ -115,13 +117,13 @@ const PopOverView = Class({ ( 100 * startDistance / ( startDistance + endDistance ) ) + '%'; break; case 'bottom': - aFlex = '1 0 0'; + aFlex = '1 0 0%'; bFlex = '0 1 ' + ( rootView.get( 'pxHeight' ) - ( posTop + posHeight + offsetTop ) ) + 'px'; break; case 'left': aFlex = '0 1 ' + ( posLeft + offsetLeft ) + 'px'; - bFlex = '1 0 0'; + bFlex = '1 0 0%'; break; case 'centre': startDistance = @@ -133,7 +135,7 @@ const PopOverView = Class({ ( 100 * startDistance / ( startDistance + endDistance ) ) + '%'; break; case 'right': - aFlex = '1 0 0'; + aFlex = '1 0 0%'; bFlex = '0 1 ' + ( rootView.get( 'pxWidth' ) - ( posLeft + posWidth + offsetLeft ) ) + 'px'; break;
0
diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html var hex_only = /^[0-9a-f]+$/i; var output = ""; for (var i=0; i<string.length; i++) { - if($.inArray(string[i], to_escape) != -1) { + if(string[i].includes(to_escape)) { output += '\\'+string[i]; } else {
14
diff --git a/lib/withInNativeApp.js b/lib/withInNativeApp.js @@ -96,10 +96,12 @@ export const postMessage = !inNativeAppBrowser typeof msg === 'string' ? msg : JSON.stringify(msg), '*' ) - : msg => + : window.ReactNativeWebView + ? msg => window.ReactNativeWebView.postMessage( typeof msg === 'string' ? msg : JSON.stringify(msg) ) + : msg => console.warn('postMessage unavailable', msg) export const useInNativeApp = () => { const headers = useHeaders()
9
diff --git a/magda-web-client/src/Components/Common/DataPreviewMap.tsx b/magda-web-client/src/Components/Common/DataPreviewMap.tsx @@ -22,6 +22,8 @@ import isStorageApiUrl from "helpers/isStorageApiUrl"; import { useAsync } from "react-async-hook"; import fetch from "isomorphic-fetch"; import xml2json from "../../helpers/xml2json"; +import ReactSelect from "react-select"; +import CustomStyles from "../Common/react-select/ReactSelectStyles"; console.log(xml2json("<a><b>2332</b></a>")); @@ -255,24 +257,39 @@ export default function DataPreviewMapWrapper(props: { <h3 className="section-heading">Map Preview</h3> {wmsWfsGroupItems?.length ? ( <div className="wms-wfs-group-item-selection"> - <span> - {isWms - ? "Select WMS Layer: " - : "Select WFS Feature Type:"} - </span> - <select - onChange={(e) => + <ReactSelect + placeholder={ + isWms + ? "Select WMS Layer..." + : "Select WFS Feature Type..." + } + className="accrual-periodicity-select" + styles={CustomStyles} + isSearchable={true} + options={ + wmsWfsGroupItems.map((item) => ({ + label: item?.title ? item.title : item.name, + value: item.name + })) as any + } + value={ + selectedWmsWfsGroupItemName + ? { + label: wmsWfsGroupItems.find( + (item) => + item.name === + selectedWmsWfsGroupItemName + )?.title, + value: selectedWmsWfsGroupItemName + } + : null + } + onChange={(option) => setSelectedWmsWfsGroupItemName( - e.currentTarget.value + (option as any).value ) } - > - {wmsWfsGroupItems.map((item, idx) => ( - <option key={idx} value={item.name}> - {item?.title ? item.title : item.name} - </option> - ))} - </select> + /> </div> ) : null} <Small>
14
diff --git a/.circleci/config.yml b/.circleci/config.yml @@ -7,13 +7,14 @@ orbs: datadog: airswap/datadog@volatile references: + working_directory: &working_directory + working_directory: ~/repo + container_config: &container_config docker: - image: circleci/node:10 working_directory: *working_directory - working_directory: &working_directory - working_directory: ~/repo jobs: run_tests:
9
diff --git a/app.js b/app.js @@ -13,7 +13,7 @@ import * as universe from './universe.js'; import * as blockchain from './blockchain.js'; // import minimap from './minimap.js'; import cameraManager from './camera-manager.js'; -import controlsManager from './controls-manager.js'; +// import controlsManager from './controls-manager.js'; import weaponsManager from './weapons-manager.js'; import hpManager from './hp-manager.js'; // import activateManager from './activate-manager.js'; @@ -245,7 +245,7 @@ export default class WebaverseApp extends EventTarget { if (rigManager.localRig) { rigManager.localRig.model.visible = true; avatarScene.add(rigManager.localRig.model); - const decapitated = controlsManager.isPossessed() && (/^(?:camera|firstperson)$/.test(cameraManager.getMode()) || !!renderer.xr.getSession()); + const decapitated = /*controlsManager.isPossessed() &&*/ (/^(?:camera|firstperson)$/.test(cameraManager.getMode()) || !!renderer.xr.getSession()); if (decapitated) { rigManager.localRig.decapitate(); // rigManager.localRig.aux.decapitate(); @@ -276,13 +276,13 @@ export default class WebaverseApp extends EventTarget { const cameraOffset = cameraManager.getCameraOffset(); cameraOffset.z = 0; } - controlsManager.setPossessed(!!url); + // controlsManager.setPossessed(!!url); /* if (!url) { rigManager.setLocalRigMatrix(null); } */ } setPossessed(possessed) { - controlsManager.setPossessed(possessed); + // controlsManager.setPossessed(possessed); } async possess(object) { await cameraManager.requestPointerLock();
2
diff --git a/server/interpreter/scope.go b/server/interpreter/scope.go @@ -41,8 +41,9 @@ type scope struct { } // newScope is a factory for scope objects. The parent param is a -// pointer to the parent (enclosing scope); it is nil if the scope -// being created is the global scope. +// pointer to the parent (enclosing scope). The this param is the +// value of ThisExpression in the given scope. Both should be nil if +// the scope being created is the global scope. func newScope(parent *scope, this data.Value) *scope { return &scope{make(map[string]data.Value), parent, this} }
7
diff --git a/.travis.yml b/.travis.yml @@ -50,7 +50,7 @@ before_install: - export PATH=$HOME/.yarn/bin:$PATH install: - - yarn install --no-lockfile --non-interactive + - yarn install --no-lockfile --non-interactive --ignore-engines script: - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
8
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -2,6 +2,7 @@ variables: CI: "true" DOCKER_DRIVER: overlay2 SBT_OPTS: "-Dsbt.ivy.home=$CI_PROJECT_DIR/sbt-cache/ivy" + INT_TEST_CACHE_KEY: "intTestD" stages: - builders @@ -78,7 +79,7 @@ buildtest:intTestA: - pip3 install docker-compose - docker-compose --version cache: - key: $CI_JOB_NAME + key: $INT_TEST_CACHE_KEY paths: - "$CI_PROJECT_DIR/sbt-cache" - "$CI_PROJECT_DIR/sbt-cache/ivy" @@ -86,6 +87,7 @@ buildtest:intTestA: - "*/target" - "*/project/target" - "$CI_PROJECT_DIR/pip-cache" + policy: pull services: - docker:dind variables: @@ -140,7 +142,7 @@ buildtest:intTestB: - pip3 install docker-compose - docker-compose --version cache: - key: $CI_JOB_NAME + key: $INT_TEST_CACHE_KEY paths: - "$CI_PROJECT_DIR/sbt-cache" - "$CI_PROJECT_DIR/sbt-cache/ivy" @@ -148,6 +150,7 @@ buildtest:intTestB: - "*/target" - "*/project/target" - "$CI_PROJECT_DIR/pip-cache" + policy: pull services: - docker:dind variables: @@ -201,7 +204,7 @@ buildtest:intTestC: - pip3 install docker-compose - docker-compose --version cache: - key: $CI_JOB_NAME + key: $INT_TEST_CACHE_KEY paths: - "$CI_PROJECT_DIR/sbt-cache" - "$CI_PROJECT_DIR/sbt-cache/ivy" @@ -209,6 +212,7 @@ buildtest:intTestC: - "*/target" - "*/project/target" - "$CI_PROJECT_DIR/pip-cache" + policy: pull services: - docker:dind variables: @@ -262,7 +266,7 @@ buildtest:intTestD: - pip3 install docker-compose - docker-compose --version cache: - key: $CI_JOB_NAME + key: $INT_TEST_CACHE_KEY paths: - "$CI_PROJECT_DIR/sbt-cache" - "$CI_PROJECT_DIR/sbt-cache/ivy" @@ -270,6 +274,7 @@ buildtest:intTestD: - "*/target" - "*/project/target" - "$CI_PROJECT_DIR/pip-cache" + policy: pull-push services: - postgres:9.6 - docker:dind
4
diff --git a/source/views/collections/ToolbarView.js b/source/views/collections/ToolbarView.js import { Class } from '../../core/Core'; import '../../foundation/ComputedProps'; // For Function#property import '../../foundation/ObservableProps'; // For Function#observes -import RunLoop from '../../foundation/RunLoop'; import { lookupKey } from '../../dom/DOMEvent'; import Element from '../../dom/Element'; import { loc } from '../../localisation/LocaleController'; import View from '../View'; +import RootView from '../RootView'; import ViewEventsController from '../ViewEventsController'; import PopOverView from '../panels/PopOverView'; import MenuButtonView from '../menu/MenuButtonView'; @@ -71,10 +71,10 @@ const OverflowMenuView = Class({ }); const viewIsBeforeFlex = function ( view, flex ) { - var layer = view.get( 'layer' ); - var childNodes = flex.parentNode.childNodes; - var l = childNodes.length; - var node; + const layer = view.get( 'layer' ); + const childNodes = flex.parentNode.childNodes; + let l = childNodes.length; + let node; while ( l-- ) { node = childNodes[l]; if ( node === layer ) { @@ -177,12 +177,15 @@ const ToolbarView = Class({ left: function () { let leftConfig = this.get( 'leftConfig' ); + if ( this.get( 'preventOverlap' ) ) { const rightConfig = this.get( 'rightConfig' ); - let pxWidth = this.get( 'pxWidth' ); const widths = this._widths; - let i, l, config; - - if ( this.get( 'preventOverlap' ) ) { + let pxWidth = this.get( 'pxWidth' ); + let rootView, i, l, config; + if ( !pxWidth ) { + rootView = this.getParent( RootView ); + pxWidth = rootView ? rootView.get( 'pxWidth' ) : 1024; + } pxWidth -= this.get( 'minimumGap' ); for ( i = 0, l = rightConfig.length; i < l; i += 1 ) { pxWidth -= widths[ rightConfig[i] ]; @@ -291,12 +294,10 @@ const ToolbarView = Class({ }, didEnterDocument () { - this.beginPropertyChanges(); ToolbarView.parent.didEnterDocument.call( this ); if ( this.get( 'preventOverlap' ) ) { - RunLoop.invokeInNextFrame( this.postMeasure, this ); + this.postMeasure(); } - this.endPropertyChanges(); return this; }, @@ -324,7 +325,7 @@ const ToolbarView = Class({ redrawSide ( layer, isLeft, oldViews, newViews ) { let start = 0; let isEqual = true; - var flex = this._flex; + const flex = this._flex; let i, l, view, parent; for ( i = start, l = oldViews.length; i < l; i += 1 ) {
7
diff --git a/story.js b/story.js +/* +this file contains the story beat triggers (battles, victory, game over, etc.) +*/ + import * as THREE from 'three'; -// import {Pass} from 'three/examples/jsm/postprocessing/Pass.js'; -// import {ShaderPass} from 'three/examples/jsm/postprocessing/ShaderPass.js'; -// import {UnrealBloomPass} from 'three/examples/jsm/postprocessing/UnrealBloomPass.js'; -// import {AdaptiveToneMappingPass} from 'three/examples/jsm/postprocessing/AdaptiveToneMappingPass.js'; -// import {BloomPass} from 'three/examples/jsm/postprocessing/BloomPass.js'; -// import {AfterimagePass} from 'three/examples/jsm/postprocessing/AfterimagePass.js'; -// import {BokehPass} from './BokehPass.js'; -// import {SSAOPass} from './SSAOPass.js'; -// import {RenderPass} from './RenderPass.js'; -// import {DepthPass} from './DepthPass.js'; import {SwirlPass} from './SwirlPass.js'; import { getRenderer, getComposer, rootScene, - sceneHighPriority, - scene, - sceneLowPriority, - // postSceneOrthographic, - // postScenePerspective, + // sceneHighPriority, + // scene, + // sceneLowPriority, camera, - // orthographicCamera, } from './renderer.js'; -// import {rigManager} from './rig.js'; -// import {getRandomString} from './util.js'; -// import cameraManager from './camera-manager.js'; -// import {WebaverseRenderPass} from './webaverse-render-pass.js'; -// import renderSettingsManager from './rendersettings-manager.js'; -// import metaversefileApi from 'metaversefile'; -// import {parseQuery} from './util.js'; import * as sounds from './sounds.js'; import musicManager from './music-manager.js';
0
diff --git a/packages/civic-sandbox/src/components/Packages/index.js b/packages/civic-sandbox/src/components/Packages/index.js @@ -112,14 +112,9 @@ export class Packages extends React.Component { <a onClick={this.closeMap}>&lt; Back to Packages</a> </p> <SandboxComponent /> - {selectedFoundationDatum && <div - style={{ - top: '175px', - position: 'absolute', - width: '100%', - }} - > - <CivicSandboxDashboard data={selectedFoundationDatum} /> + {selectedFoundationDatum && <div> + <CivicSandboxDashboard data={selectedFoundationDatum}> + </CivicSandboxDashboard> </div>} </section>)} </div>
11
diff --git a/src/components/Composer/index.js b/src/components/Composer/index.js @@ -265,7 +265,9 @@ class Composer extends React.Component { return; } - const plainText = event.clipboardData.getData('text/plain'); + // The regex replace is there because when doing a "paste without formatting", there are extra line breaks added to the content (I do not know why). To fix the problem, anytime + // there is a double set of newline characters, they are replaced with a single newline. This preserves the same number of newlines between pasting with and without formatting. + const plainText = event.clipboardData.getData('text/plain').replace(/\n\n/g, '\n'); this.paste(Str.htmlDecode(plainText)); }
14
diff --git a/assets/src/dashboard/app/views/myStories/index.js b/assets/src/dashboard/app/views/myStories/index.js @@ -72,7 +72,7 @@ const PlayArrowIcon = styled(PlayArrowSvg).attrs({ width: 11, height: 14 })` function MyStories() { const [status, setStatus] = useState(STORY_STATUSES[0].value); const [typeaheadValue, setTypeaheadValue] = useState(''); - const [viewStyle, setViewStyle] = useState(VIEW_STYLE.LIST); + const [viewStyle, setViewStyle] = useState(VIEW_STYLE.GRID); const [currentPage, setCurrentPage] = useState(1); const [currentStorySort, setCurrentStorySort] = useState(
12
diff --git a/package.json b/package.json "react-native-web": "^0.11.4", "react-native-web-lottie": "^1.2.0", "react-native-web-webview": "^0.2.8", - "react-native-zoom": "GoodDollar/ReactNativeZoom#master", "react-phone-number-input": "^2.3.18", "react-qr-reader": "^2.2.1", "recaptcha-v3-react": "^3.0.3",
2
diff --git a/src/components/postDropdown/container/postDropdownContainer.tsx b/src/components/postDropdown/container/postDropdownContainer.tsx @@ -2,7 +2,6 @@ import React, { PureComponent, Fragment } from 'react'; import { connect } from 'react-redux'; import { withNavigation } from 'react-navigation'; import { Share } from 'react-native'; -import ActionSheet from 'react-native-actionsheet'; import { injectIntl } from 'react-intl'; import get from 'lodash/get'; @@ -22,6 +21,7 @@ import { getPostUrl } from '../../../utils/post'; // Component import PostDropdownView from '../view/postDropdownView'; +import { OptionsModal } from '../../atoms'; /* * Props Name Description Value @@ -278,7 +278,7 @@ class PostDropdownContainer extends PureComponent { handleOnDropdownSelect={this._handleOnDropdownSelect} {...this.props} /> - <ActionSheet + <OptionsModal ref={(o) => (this.ActionSheet = o)} options={['Reblog', intl.formatMessage({ id: 'alert.cancel' })]} title={intl.formatMessage({ id: 'post.reblog_alert' })}
14
diff --git a/angular/projects/spark-angular/src/lib/components/sprk-modal/sprk-modal.component.ts b/angular/projects/spark-angular/src/lib/components/sprk-modal/sprk-modal.component.ts @@ -125,12 +125,10 @@ export class SprkModalComponent { @Input() cancelAnalyticsString: string; /** - * The value supplied will be assigned - * to the `data-id` attribute on the - * component. This is intended to be - * used as a selector for automated - * tools. This value should be unique - * per page. + * The value supplied will be assigned to the + * `data-analytics` attribute + * on the close button. Intended + * for an outside library to capture data. */ @Input() closeAnalyticsString: string;
3
diff --git a/docs/elements/tag.html b/docs/elements/tag.html @@ -34,7 +34,7 @@ prev: "elements-spinner" You can add the <code class="siimple-code">siimple-tag--rounded</code> modifier to a tag to make it rounded. </div> <div class="sd-snippet-demo" align="center"> - <span class="siimple-tag siimple-tag--rounded">Rounded tag</span> + <span class="siimple-tag siimple-tag--primary siimple-tag--rounded">Rounded tag</span> </div> <pre class="sd-snippet-code"> &lt;span class="siimple-tag siimple-tag--primary siimple-tag--rounded"&gt;
1
diff --git a/src/commands/unlink.js b/src/commands/unlink.js @@ -21,7 +21,7 @@ class UnlinkCommand extends Command { this.site.delete('siteId') this.log( - `Unlinked ${path.relative(path.join(process.cwd(), '..'), this.site.path)} from ${site ? site.name : siteId}` + `Unlinked ${this.site.path} from ${site ? site.name : siteId}` ) } }
3
diff --git a/package.json b/package.json "d3-interpolate": "1.1.2", "jquery": "2.1.4", "moment": "^2.18.1", - "moment-timezone": "^0.5.13", "node-polyglot": "^2.2.2", "perfect-scrollbar": "git://github.com/CartoDB/perfect-scrollbar.git#master", "postcss": "5.0.19",
2
diff --git a/src/resources/views/list.blade.php b/src/resources/views/list.blade.php data-orderable="{{ var_export($column['orderable'], true) }}" data-priority="{{ $column['priority'] }}" data-visible-in-modal="{{ (isset($column['visibleInModal']) && $column['visibleInModal'] == false) ? 'false' : 'true' }}" + data-visible="{{ !isset($column['visibleInTable']) ? 'true' : (($column['visibleInTable'] == false) ? 'false' : 'true') }}" data-exportable="{{ (isset($column['exportable']) && $column['exportable'] == false) ? 'false' : 'true' }}" - data-visible="{{ (isset($column['hidden']) && $column['hidden'] == true) ? 'false' : 'true' }}" > {!! $column['label'] !!} </th>
10
diff --git a/assets/js/components/help/HelpMenu.js b/assets/js/components/help/HelpMenu.js @@ -79,7 +79,7 @@ export default function HelpMenu( { children } ) { aria-expanded={ menuOpen } aria-label={ __( 'Help', 'google-site-kit' ) } aria-haspopup="menu" - className="googlesitekit-header__dropdown googlesitekit-border-radius-round googlesitekit-button-icon googlesitekit-help-menu__button googlesitekit-margin-right-0 mdc-button--dropdown" + className="googlesitekit-header__dropdown googlesitekit-border-radius-round googlesitekit-button-icon googlesitekit-help-menu__button mdc-button--dropdown" icon={ <HelpIcon width="20" height="20" /> } onClick={ handleMenu } text
2
diff --git a/src/traces/scatter3d/attributes.js b/src/traces/scatter3d/attributes.js @@ -161,6 +161,8 @@ var attrs = module.exports = overrideAll({ family: extendFlat({}, scatterAttrs.textfont.family, {arrayOk: false}) }, + opacity: baseAttrs.opacity, + hoverinfo: extendFlat({}, baseAttrs.hoverinfo) }, 'calc', 'nested');
1
diff --git a/src/inertia.js b/src/inertia.js @@ -2,25 +2,28 @@ import axios from 'axios' import nprogress from 'nprogress' export default { - setPage: null, + resolveComponent: null, + updatePage: null, version: null, + visitId: null, cancelToken: null, progressBar: null, modal: null, - init(page, setPage) { - this.version = page.version - this.setPage = setPage + init({ initialPage, resolveComponent, updatePage }) { + this.resolveComponent = resolveComponent + this.updatePage = updatePage if (window.history.state && this.navigationType() === 'back_forward') { this.setPage(window.history.state) } else { - this.setPage(page) - this.setState(page) + this.setPage(initialPage) } window.addEventListener('popstate', this.restoreState.bind(this)) document.addEventListener('keydown', this.hideModalOnEscape.bind(this)) + + this.initProgressBar() }, navigationType() { @@ -33,24 +36,40 @@ export default { return response && response.headers['x-inertia'] }, - showProgressBar() { - this.progressBar = setTimeout(() => nprogress.start(), 100) + initProgressBar() { + nprogress.configure({ showSpinner: false }) }, - hideProgressBar() { - nprogress.done() - clearTimeout(this.progressBar) + startProgressBar() { + nprogress.set(0) + nprogress.start() }, - visit(url, { method = 'get', data = {}, replace = false, preserveScroll = false } = {}) { - this.hideModal() - this.showProgressBar() + incrementProgressBar() { + nprogress.inc(0.4) + }, + + stopProgressBar() { + nprogress.done() + }, + cancelActiveVisits() { if (this.cancelToken) { this.cancelToken.cancel(this.cancelToken) } this.cancelToken = axios.CancelToken.source() + }, + + createVisitId() { + this.visitId = {} + return this.visitId + }, + + visit(url, { method = 'get', data = {}, replace = false, preserveScroll = false } = {}) { + this.startProgressBar() + this.cancelActiveVisits() + let visitId = this.createVisitId() return axios({ method, @@ -74,25 +93,19 @@ export default { if (axios.isCancel(error)) { return } else if (error.response.status === 409 && error.response.headers['x-inertia-location']) { + this.stopProgressBar() return this.hardVisit(true, error.response.headers['x-inertia-location']) } else if (this.isInertiaResponse(error.response)) { return error.response.data } else if (error.response) { + this.stopProgressBar() this.showModal(error.response.data) } else { return Promise.reject(error) } }).then(page => { if (page) { - this.version = page.version - this.setState(page, replace) - - return this.setPage(page).then(() => { - this.setScroll(preserveScroll) - this.hideProgressBar() - }) - } else { - this.hideProgressBar() + this.setPage(page, visitId, replace, preserveScroll) } }) }, @@ -105,6 +118,19 @@ export default { } }, + setPage(page, visitId = this.createVisitId(), replace = false, preserveScroll = false) { + this.incrementProgressBar() + return this.resolveComponent(page.component).then(component => { + if (visitId === this.visitId) { + this.version = page.version + this.setState(page, replace) + this.updatePage(component, page.props) + this.setScroll(preserveScroll) + this.stopProgressBar() + } + }) + }, + setScroll(preserveScroll) { if (!preserveScroll) { window.scrollTo(0, 0)
7
diff --git a/pages/feuilleton.js b/pages/feuilleton.js @@ -11,7 +11,7 @@ import withMembership, { UnauthorizedPage } from '../components/Auth/withMembership' -import { Interaction, A, Loader } from '@project-r/styleguide' +import { Interaction, A, Loader, RawHtml } from '@project-r/styleguide' import { PUBLIC_BASE_URL, CDN_FRONTEND_BASE_URL } from '../lib/constants' @@ -26,11 +26,13 @@ const FeuilletonPage = props => { renderBefore={() => { return ( <Box style={{ padding: 14, textAlign: 'center' }}> - <Interaction.P + <Interaction.P> + <RawHtml dangerouslySetInnerHTML={{ __html: t('feuilleton/deprecatedPage') }} /> + </Interaction.P> </Box> ) }}
7
diff --git a/backend/utils/primeIpfs.js b/backend/utils/primeIpfs.js @@ -32,7 +32,11 @@ async function prime(urlPrefix, dir) { const files = filesWithPath.map((f) => f.split('public/')[1]) for (const file of files) { const url = `${urlPrefix}/${file}` - limiter.schedule((url) => download(url), url) + limiter + .schedule((url) => download(url), url) + .on('error', (err) => { + log.error(`Error occurred when priming ${url}:`, err) + }) } }
9
diff --git a/OmniDB/OmniDB/settings.py b/OmniDB/OmniDB/settings.py @@ -195,4 +195,4 @@ SSL_KEY = "" CH_CMDS_PER_PAGE = 20 PWD_TIMEOUT_TOTAL = 1800 PWD_TIMEOUT_REFRESH = 300 -DESKTOP_MODE = True +DESKTOP_MODE = False
12
diff --git a/src/libs/Navigation/Navigation.js b/src/libs/Navigation/Navigation.js import React from 'react'; import {StackActions, DrawerActions} from '@react-navigation/native'; import {getIsDrawerOpenFromState} from '@react-navigation/drawer'; +import {setModalVisibility} from '../actions/Modal' import linkTo from './linkTo'; import ROUTES from '../../ROUTES'; @@ -52,6 +53,9 @@ function dismissModal() { // This should take us to the first view of the modal's stack navigator navigationRef.current.dispatch(StackActions.popToTop()); + // Update modal visilibity in Onyx + setModalVisibility(false); + // From there we can just navigate back and open the drawer goBack(); openDrawer();
12
diff --git a/package.json b/package.json }, "dependencies": { "@projectstorm/react-diagrams": "^5.3.2", - "@ufx-ui/bfx-containers": "0.8.2", - "@ufx-ui/core": "0.8.2", + "@ufx-ui/bfx-containers": "0.8.3", + "@ufx-ui/core": "0.8.3", "axios": "^0.21.1", "bfx-api-node-models": "^1.2.4", "bfx-api-node-util": "^1.0.8",
3
diff --git a/bin/definition-validators/open-api.js b/bin/definition-validators/open-api.js **/ 'use strict'; const OpenAPIEnforcer = require('../enforcers/open-api'); +const PathsEnforcer = require('../enforcers/paths'); module.exports = OpenAPIObject; @@ -129,6 +130,7 @@ function OpenAPIObject({ major }) { additionalProperties: Parameter }, paths: { + component: PathsEnforcer, required: true, type: 'object', additionalProperties: Path,
12
diff --git a/src/components/common/view/AddWebApp.web.js b/src/components/common/view/AddWebApp.web.js import React, { useEffect, useState } from 'react' import { AsyncStorage, Image, View } from 'react-native' +import { isMobileSafari } from 'mobile-device-detect' import SimpleStore from '../../../lib/undux/SimpleStore' import { useDialog } from '../../../lib/undux/utils/dialog' import { withStyles } from '../../../lib/styles' @@ -11,12 +12,6 @@ import logger from '../../../lib/logger/pino-logger' const log = logger.child({ from: 'AddWebApp' }) -// const handleAddToHomescreenClick = () => { -// alert(` -// 1. Open Share menu -// 2. Tap on "Add to Home Screen" button`) -// } - const mapPropsToStyles = ({ theme }) => { return { image: { @@ -93,6 +88,7 @@ const AddWebApp = props => { }, []) const showExplanationDialog = () => { + log.debug('showExplanationDialog') showDialog({ content: <ExplanationDialog />, }) @@ -171,8 +167,16 @@ const AddWebApp = props => { }, [dialogShown]) useEffect(() => { - log.debug({ installPrompt, show, lastCheck }) - if (installPrompt && show) { + const DAYS_TO_WAIT = 5 + const thirtyDaysFromLastDate = lastCheck + DAYS_TO_WAIT * 24 * 60 * 60 * 1000 + const today = new Date() + log.debug({ installPrompt, show, lastCheck, today, thirtyDaysFromLastDate, DAYS_TO_WAIT }) + + if (thirtyDaysFromLastDate < today) { + return + } + + if ((installPrompt && show) || (isMobileSafari && show)) { setDialogShown(true) } }, [installPrompt, show, lastCheck])
0
diff --git a/sparkx/src/main/scala/edp/wormhole/sparkx/hdfslog/HdfsMainProcess.scala b/sparkx/src/main/scala/edp/wormhole/sparkx/hdfslog/HdfsMainProcess.scala @@ -256,6 +256,12 @@ object HdfsMainProcess extends EdpLogging { logError("kafka consumer error,"+e.getMessage, e) if(e.getMessage.contains("Failed to construct kafka consumer")){ logError("kafka consumer error ,stop spark streaming") + + SparkxUtils.setFlowErrorMessage(List.empty[String], + topicPartitionOffset, config, "testkerberos", "testkerberos", -1, + e, batchId, UmsProtocolType.DATA_BATCH_DATA.toString + "," + UmsProtocolType.DATA_INCREMENT_DATA.toString + "," + UmsProtocolType.DATA_INITIAL_DATA.toString, + -config.spark_config.stream_id, ErrorPattern.StreamError) + stream.stop() throw e
0
diff --git a/packages/stockflux-launcher/public/childWindow.css b/packages/stockflux-launcher/public/childWindow.css @@ -18,8 +18,9 @@ div.scrollWrapperY > p { margin: 0; } -div#root > .spinner { - margin-top: 170px; +.spinner { + position: relative; + top:calc(50vh - var(--search-input-height)) } .card {
3
diff --git a/assets/js/hooks/useChecks.js b/assets/js/hooks/useChecks.js */ import { useEffect, useState } from '@wordpress/element'; -/** - * Internal dependencies - */ -import Data from 'googlesitekit-data'; -import { STORE_NAME as CORE_SITE } from '../googlesitekit/datastore/site/constants'; -const { useSelect } = Data; - /** * Runs a series of asynchronous checks returning the first encountered error. * All checks should be functions that throw their respective errors. @@ -38,8 +31,7 @@ const { useSelect } = Data; * @return {Object} An object containing complete and error properties. */ export function useChecks( checks ) { - const isSiteKitConnected = useSelect( ( select ) => select( CORE_SITE ).isConnected() ); - const [ complete, setComplete ] = useState( isSiteKitConnected ); + const [ complete, setComplete ] = useState( checks.length === 0 ); const [ error, setError ] = useState( undefined ); useEffect( () => { const runChecks = async () => { @@ -51,10 +43,8 @@ export function useChecks( checks ) { setComplete( true ); }; - if ( checks.length ) { + if ( ! complete ) { runChecks(); - } else { - setComplete( true ); } }, [] ); return { complete, error };
2
diff --git a/src/lib/undux/utils/feed.js b/src/lib/undux/utils/feed.js // @flow import type { Store } from 'undux' - +import throttle from 'lodash/throttle' import userStorage from '../../gundb/UserStorage' import pino from '../../logger/pino-logger' const logger = pino.child({ from: 'feeds' }) export const PAGE_SIZE = 10 -export const getInitialFeed = async (store: Store) => { +const getInitial = async (store: Store) => { const currentScreen = store.get('currentScreen') store.set('currentScreen')({ ...currentScreen, loading: true }) const feeds = await userStorage @@ -17,10 +17,13 @@ export const getInitialFeed = async (store: Store) => { store.set('feeds')(feeds) } -export const getNextFeed = async (store: Store) => { +const getNext = async (store: Store) => { const currentFeeds = store.get('feeds') const newFeeds = await userStorage.getFormattedEvents(PAGE_SIZE, false) if (newFeeds.length > 0) { store.set('feeds')([...currentFeeds, ...newFeeds]) } } + +export const getInitialFeed = throttle(getInitial, 1000, { leading: true }) +export const getNextFeed = throttle(getNext, 1000, { leading: true })
0
diff --git a/articles/quickstart/backend/python/01-authorization.md b/articles/quickstart/backend/python/01-authorization.md @@ -48,6 +48,7 @@ from jose import jwt auth0_domain = '${account.namespace}' api_audience = YOUR_API_AUDIENCE +algorithms = ["RS256"] app = Flask(__name__) @@ -110,7 +111,7 @@ def requires_auth(f): payload = jwt.decode( token, rsa_key, - algorithms=unverified_header["alg"], + algorithms=algorithms, audience=API_AUDIENCE, issuer="https://"+AUTH0_DOMAIN+"/" )
2
diff --git a/packages/build/src/log/main.js b/packages/build/src/log/main.js @@ -121,7 +121,7 @@ const logInstallFunctionDependencies = function() { const logDeprecatedFunctionsInstall = function(functionsSrc) { logErrorSubHeader('Missing plugin') logMessage( - THEME.errorLine(`Please use the plugin "@netlify/plugin-functions-install-core" to install dependencies from the "package.json" inside your "${functionsSrc}" directory. + THEME.errorSubHeader(`Please use the plugin "@netlify/plugin-functions-install-core" to install dependencies from the "package.json" inside your "${functionsSrc}" directory. Example "netlify.toml": [build]
4
diff --git a/aleph/archive/s3.py b/aleph/archive/s3.py @@ -59,6 +59,8 @@ class S3Archive(Archive): # pragma: no cover cors.put(CORSConfiguration=config) def _locate_key(self, content_hash): + if content_hash is None: + return prefix = self._get_prefix(content_hash) if prefix is None: return @@ -93,6 +95,9 @@ class S3Archive(Archive): # pragma: no cover return path def cleanup_file(self, content_hash): + """Delete the local cached version of the file.""" + if content_hash is None: + return path = self._get_local_prefix(content_hash) if os.path.isdir(path): shutil.rmtree(path)
9
diff --git a/2-js-basics/1-data-types/translations/assignment.id.md b/2-js-basics/1-data-types/translations/assignment.id.md -# Data Types Practice +# Praktek Tipe Data -## Instructions +## Instruksi -Imagine you are building a shopping cart. Write some documentation on the data types that you would need to complete your shopping experience. How did you arrive at your choices? +Bayangkan Anda sedang membuat keranjang belanja. Tulislah beberapa dokumentasi tentang tipe data yang Anda perlukan untuk melengkapi pengalaman berbelanja Anda. Bagaimana Anda sampai pada pilihan Anda? -## Rubric +## Rubrik | Kriteria | Teladan | Memenuhi Syarat | Perlu Perbaikan | |----------|----------------------------------------------------------------------------------------|------------------------------|----------------------------|
3
diff --git a/create-snowpack-app/cli/README.md b/create-snowpack-app/cli/README.md @@ -40,4 +40,5 @@ npx create-snowpack-app new-dir --template @snowpack/app-template-NAME [--use-ya - [snowpack-cycle](https://github.com/rajasegar/snowpack-cycle) (A pre-configured Snowpack app template for [Cycle.js](https://cycle.js.org)) - [@snowpack-angular/template](https://github.com/YogliB/snowpack-angular/tree/main/templates/base) (A preconfigured template for Snowpack with [Angular](https://angular.io)) - [snowpack-solid](https://github.com/amoutonbrady/snowpack-solid) (A pre-configured Snowpack app template for [Solid](https://github.com/ryansolid/solid)) +- [snowpack-template-ts-rust-wasm](https://github.com/jake-pauls/snowpack-template-ts-rust-wasm) (Snowpack + Typescript + Rust + WebAssembly) - PRs that add a link to this list are welcome!
0
diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js @@ -228,7 +228,7 @@ function fetchIOUReport(iouReportID, chatReportID) { } const iouReportData = response.reports[iouReportID]; if (!iouReportData) { - console.error(`No iouReportData found for reportID ${iouReportID}`); + console.error(`No iouReportData found for reportID ${iouReportID}, report it most likely settled.`); return; } return getSimplifiedIOUReport(iouReportData, chatReportID);
14
diff --git a/token-metadata/0xbC396689893D065F41bc2C6EcbeE5e0085233447/metadata.json b/token-metadata/0xbC396689893D065F41bc2C6EcbeE5e0085233447/metadata.json "symbol": "PERP", "address": "0xbC396689893D065F41bc2C6EcbeE5e0085233447", "decimals": 18, - "dharmaVerificationStatus": { "dharmaVerificationStatus": "VERIFIED" } \ No newline at end of file -} \ No newline at end of file
3
diff --git a/src/index.js b/src/index.js @@ -58,6 +58,8 @@ module.exports = (() => { if (plugin) { plugin(editor, config.pluginsOpts[pluginId] || {}); + } else if (typeof pluginId === 'function') { + pluginId(editor, config.pluginsOpts[pluginId] || {}); } else { console.warn(`Plugin ${pluginId} not found`); }
11
diff --git a/src/app/api/api.gcode.js b/src/app/api/api.gcode.js @@ -87,22 +87,11 @@ export const download = (req, res) => { } const { sender } = controller; - const filename = (function(req) { - const headers = req.headers || {}; - const ua = headers['user-agent'] || ''; - const isIE = (function(ua) { - return (/MSIE \d/).test(ua); - }(ua)); - const isEdge = (function(ua) { - return (/Trident\/\d/).test(ua) && (!(/MSIE \d/).test(ua)); - }(ua)); - - const name = sender.state.name || 'noname.txt'; - return (isIE || isEdge) ? encodeURIComponent(name) : name; - }(req)); + + const filename = sender.state.name || 'noname.txt'; const content = sender.state.gcode || ''; - res.setHeader('Content-Disposition', 'attachment; filename=' + JSON.stringify(filename)); + res.setHeader('Content-Disposition', 'attachment; filename=' + encodeURIComponent(filename)); res.setHeader('Connection', 'close'); res.write(content);
1
diff --git a/src/main/mesh.js b/src/main/mesh.js @@ -11,7 +11,6 @@ function init() { let stores = data.open('mesh', { stores:[ "admin", "cache", "space" ] }).init(), moto = self.moto, api = mesh.api, - sky = false, dark = false, ortho = false, zoomrev = true, @@ -31,7 +30,7 @@ function init() { // setup default workspace space.useDefaultKeys(false); space.sky.set({ - grid: sky, + grid: false, color: dark ? 0 : 0xffffff }); space.init($('container'), delta => { }, ortho); @@ -175,8 +174,6 @@ function space_init(data) { for (let m of selection.models()) { m.debug(); } - } else { - call.space_debug(); } break; case 'Escape': @@ -279,33 +276,11 @@ function space_load(data) { .focus(); } -// on debug key press -function space_debug() { - for (let g of mesh.api.group.list()) { - let { center, size } = g.bounds; - console.group(g.id); - console.log({ - center, - size, - pos: g.group.position - }); - for (let m of g.models) { - console.log(m.id, { - box: m.mesh.getBoundingBox(), - pos: m.mesh.position - }); - } - console.groupEnd(); - } - moto.client.fn.debug(); -} - // bind functions to topics broker.listeners({ load_files, space_init, space_load, - space_debug, }); // remove version cache bust from url
2
diff --git a/includes/Core/Assets/Assets.php b/includes/Core/Assets/Assets.php @@ -465,7 +465,7 @@ final class Assets { 'name' => $current_user->display_name, 'picture' => get_avatar_url( $current_user->user_email ), ), - 'AMPenabled' => function_exists( 'is_amp_endpoint' ), + 'AMPenabled' => (bool) $this->context->get_amp_mode(), 'ampMode' => $this->context->get_amp_mode(), 'homeURL' => home_url(), );
3
diff --git a/src/comments/CommentFormEmbedded.js b/src/comments/CommentFormEmbedded.js @@ -4,10 +4,10 @@ import { connect } from 'react-redux'; import { withRouter } from 'react-router'; import { FormattedMessage } from 'react-intl'; import { isSmall } from 'react-responsive-utils'; +import _ from 'lodash'; import classNames from 'classnames'; import Textarea from 'react-textarea-autosize'; import Icon from '../widgets/Icon'; -import Avatar from '../widgets/Avatar'; import * as commentActions from './commentsActions'; import './CommentForm.scss'; @@ -26,6 +26,9 @@ import './CommentForm.scss'; export default class CommentFormEmbedded extends Component { constructor(props) { super(props); + this.state = { + draftValue: '', + }; } static PropTypes = { @@ -43,30 +46,41 @@ export default class CommentFormEmbedded extends Component { this.props.updateCommentingDraft({ id: parentId, - body: this._input.value, + body: '', parentAuthor: content.author, parentPermlink: content.permlink, category: content.category, isReplyToComment, }); + this.loadDraft(); } - updateDraft() { + updateDraft = _.debounce(() => { this.props.updateCommentingDraft({ id: this.props.parentId, - body: this._input.value, + body: this.state.draftValue, }); + }, 1000); + + loadDraft() { + const { parentId, comments } = this.props; + const draftValue = + comments.commentingDraft[parentId] && + comments.commentingDraft[parentId].body || ''; + + this.setState({ draftValue }); } handleSubmit(e, commentDepth) { e.stopPropagation(); this.updateDraft(); - this.props.sendComment(commentDepth); + this.props.sendComment(commentDepth).then(() => console.log('finished')); } - componentWillUnmount() { + handleTextChange = (e) => { + this.setState({ draftValue: e.target.value }); this.updateDraft(); - } + }; render() { const { comments, posts, isReplyToComment, parentId } = this.props; @@ -92,9 +106,6 @@ export default class CommentFormEmbedded extends Component { commentDepth = 1; } - const draftValue = - comments.commentingDraft[parentId] && - comments.commentingDraft[parentId].body || ''; return ( <div className={commentsClass}> @@ -107,11 +118,10 @@ export default class CommentFormEmbedded extends Component { </div> <Textarea - ref={(c) => { this._input = c; }} className="CommentForm__input my-2 p-2" - onKeyDown={e => this.handleKey(e)} placeholder={'Write a comment...'} - defaultValue={draftValue} + value={this.state.draftValue} + onChange={this.handleTextChange} /> <button onClick={e => this.handleSubmit(e, commentDepth)}
9
diff --git a/src/auth/RequireLogin.js b/src/auth/RequireLogin.js @@ -9,7 +9,7 @@ import Error404 from '../statics/Error404'; auth: state.auth, }) ) -export default class UserProfile extends React.Component { +export default class RequiredLogin extends React.Component { constructor(props) { super(props); }
1
diff --git a/src/components/TableBody.js b/src/components/TableBody.js @@ -283,7 +283,7 @@ class TableBody extends React.Component { colIndex={0} rowIndex={0}> <Typography variant="body1" className={classes.emptyTitle}> - <strong>{options.textLabels.body.noMatch}</strong> + {options.textLabels.body.noMatch} </Typography> </TableBodyCell> </TableBodyRow>
2
diff --git a/converters/toZigbee.js b/converters/toZigbee.js @@ -307,6 +307,7 @@ const converters = { convertSet: async (entity, key, value, meta) => { const onOff = key.endsWith('_onoff'); const command = onOff ? 'stepWithOnOff' : 'step'; + value = Number(value); const mode = value > 0 ? 0 : 1; const transition = getTransition(entity, key, meta).time; const payload = {stepmode: mode, stepsize: Math.abs(value), transtime: transition}; @@ -341,6 +342,7 @@ const converters = { await target.read('genOnOff', ['onOff']); await target.read('genLevelCtrl', ['currentLevel']); } else { + value = Number(value); const payload = {movemode: value > 0 ? 0 : 1, rate: Math.abs(value)}; const command = key.endsWith('onoff') ? 'moveWithOnOff' : 'move'; await entity.command('genLevelCtrl', command, payload, getOptions(meta.mapped, entity));
11
diff --git a/best-practices.md b/best-practices.md * [Field and ID formatting](#field-and-id-formatting) * [Field selection and Metadata Linking](#field-selection-and-metadata-linking) * [Datetime selection](#datetime-selection) -* [Null Geometries](#null-geometries) +* [Unlocated Items](#unlocated-items) * [Representing Vector Layers in STAC](#representing-vector-layers-in-stac) * [Common Use Cases of Additional Fields for Assets](#common-use-cases-of-additional-fields-for-assets) * [Static and Dynamic Catalogs](#static-and-dynamic-catalogs) @@ -70,7 +70,7 @@ might choose to have `datetime` be the start. The key is to put in a date and ti the focus of STAC. If `datetime` is set to `null` then it is strongly recommended to use it in conjunction with a content extension that explains why it should not be set for that type of data. -## Null Geometries +## Unlocated Items Though the [GeoJSON standard](https://tools.ietf.org/html/rfc7946) allows null geometries, in STAC we strongly recommend that every item have a geometry, since the general expectation of someone using a SpatioTemporal Catalog is to be able to query @@ -100,15 +100,14 @@ show up in STAC API searches, as most will at least implicitly use a geometry. T satellite data in mind, one can easily imagine other data types that start with a less precise geometry but have it refined after processing. -### Non-STAC Items +### Data that is not spatial -The other case that often comes up is people who love STAC and want to use it to catalog everything they have, even if its -not spatial. In this case our recommendation is to re-use the STAC structures, creating Items that have everything the same, -except they do not have a geometry. We have discussed mechanisms to make these 'non-spatial' Items differentiated in the -specification, like using an alternate link structure in catalogs. But there are no actual implementations of this, so if -you have one please get in touch and we can figure out how to support it. We likely will not consider these to be actually -STAC-compliant, as the contract in STAC is that Items should be those that represent an asset in space and time. But we -hope to design a solution that enables 'mixed' catalogs with compliant and non-compliant STAC items. +The other case that often comes up is people who love STAC and want to use it to catalog everything they have, even if it is +not spatial. This use case is not currently supported by STAC, as we are focused on data that is both temporal and spatial +in nature. The [OGC API - Records](https://github.com/opengeospatial/ogcapi-records) is an emerging standard that likely +will be able to handle a wider range of data to catalog than STAC. It builds on [OGC API - +Features](https://github.com/opengeospatial/ogcapi-features) just like [STAC API](https://github.com/radiantearth/stac-api-spec/) +does. ## Representing Vector Layers in STAC
3
diff --git a/package.json b/package.json "request": "^2.85.0", "serve-static": "^1.11.1", "shelljs": "^0.5.0", - "solc": "0.4.17", + "solc": "0.4.23", "style-loader": "^0.19.0", "tar": "^3.1.5", "toposort": "^1.0.0",
3
diff --git a/closure/goog/singleton/singleton.js b/closure/goog/singleton/singleton.js @@ -49,9 +49,8 @@ exports.getInstance = (ctor) => { !Object.isSealed(ctor), 'Cannot use getInstance() with a sealed constructor.'); const ctorWithInstance = /** @type {!Singleton} */ (ctor); - if (ctorWithInstance.instance_ && - ctorWithInstance.hasOwnProperty( - reflect.objectProperty('instance_', ctorWithInstance))) { + const prop = reflect.objectProperty('instance_', ctorWithInstance); + if (ctorWithInstance.instance_ && ctorWithInstance.hasOwnProperty(prop)) { return ctorWithInstance.instance_; } if (goog.DEBUG) { @@ -60,6 +59,9 @@ exports.getInstance = (ctor) => { } const instance = new ctor(); ctorWithInstance.instance_ = instance; + assert( + ctorWithInstance.hasOwnProperty(prop), + 'Could not instantiate singleton.'); return instance; };
7
diff --git a/src/main/controllers/rpc-handler.js b/src/main/controllers/rpc-handler.js @@ -91,13 +91,15 @@ module.exports = function(app, store) { }) .then(resp => { let privateKey = keythereum.recover(args.password, keystoreObject); - app.win.webContents.send(RPC_METHOD, actionId, actionName, null, { + const newWallet = { id: resp.id, isSetupFinished: resp.isSetupFinished, publicKey: keystoreObject.address, privateKey: privateKey, keystoreFilePath: keystoreFilePath - }); + }; + store.dispatch(walletOperations.updateWallet(newWallet)); + app.win.webContents.send(RPC_METHOD, actionId, actionName, null, newWallet); }) .catch(error => { log.error(error); @@ -144,14 +146,22 @@ module.exports = function(app, store) { }) .then(resp => { let privateKey = keythereum.recover(args.password, keystoreObject); - app.win.webContents.send(RPC_METHOD, actionId, actionName, null, { + const newWallet = { id: resp.id, isSetupFinished: resp.isSetupFinished, publicKey: keystoreObject.address, privateKey: privateKey, keystoreFilePath: ksFilePathToSave, profile: 'local' - }); + }; + store.dispatch(walletOperations.updateWallet(newWallet)); + app.win.webContents.send( + RPC_METHOD, + actionId, + actionName, + null, + newWallet + ); }) .catch(error => { log.error(error);
1
diff --git a/sections/basics/extending-styles.js b/sections/basics/extending-styles.js @@ -46,7 +46,7 @@ const ExtendingStyles = () => md` > You should only use \`Comp.extend\` if you know that \`Comp\` is a styled component. > If you're importing from another file or a third party library, prefer to use > \`styled(Comp)\` as it accomplishes the same thing but works with *any* React - > component. Read more about [what the difference between \`Comp.extend\` and \`styled(Comp)\` is.](/docs/faqs#when-should-i-use-) + > component. Read more about [what the difference between \`Comp.extend\` and \`styled(Comp)\` is.](/docs/faqs#when-should-i-use-styled) In really rare cases you might want to change which tag or component a styled component renders. For this case, we have an escape hatch. You can use the <Code>withComponent</Code> to extend
1
diff --git a/lime/app/Preloader.hx b/lime/app/Preloader.hx @@ -3,8 +3,11 @@ package lime.app; import haxe.io.Bytes; import haxe.io.Path; +import haxe.macro.Compiler; +import haxe.Timer; import lime.app.Event; import lime.media.AudioBuffer; +import lime.system.System; import lime.utils.AssetLibrary; import lime.utils.Assets; import lime.utils.AssetType; @@ -46,6 +49,7 @@ class Preloader #if flash extends Sprite #end { private var libraryNames:Array<String>; private var loadedLibraries:Int; private var loadedStage:Bool; + private var simulateProgress:Bool; public function new () { @@ -61,6 +65,39 @@ class Preloader #if flash extends Sprite #end { onProgress.add (update); + #if simulate_preloader + var preloadTime = Std.parseInt (Compiler.getDefine ("simulate_preloader")); + + if (preloadTime == 1) { + + preloadTime = 3000; + + } + + var startTime = System.getTimer (); + var currentTime = 0; + var timeStep = Std.int (1000 / 60); + var timer = new Timer (timeStep); + + simulateProgress = true; + + timer.run = function () { + + currentTime = System.getTimer () - startTime; + onProgress.dispatch (currentTime, preloadTime); + + if (currentTime >= preloadTime) { + + timer.stop (); + + simulateProgress = false; + start (); + + } + + }; + #end + } @@ -122,8 +159,12 @@ class Preloader #if flash extends Sprite #end { bytesLoadedCache.set (library, loaded); + if (!simulateProgress) { + onProgress.dispatch (bytesLoaded, bytesTotal); + } + }).onComplete (function (_) { if (!bytesLoadedCache.exists (library)) { @@ -187,8 +228,12 @@ class Preloader #if flash extends Sprite #end { private function updateProgress ():Void { + if (!simulateProgress) { + onProgress.dispatch (bytesLoaded, bytesTotal); + } + if (loadedLibraries == libraries.length && !initLibraryNames) { initLibraryNames = true; @@ -220,10 +265,14 @@ class Preloader #if flash extends Sprite #end { bytesLoadedCache2.set (name, loaded); + if (!simulateProgress) { + onProgress.dispatch (bytesLoaded, bytesTotal); } + } + }).onComplete (function (library) { var total = 200; @@ -257,7 +306,7 @@ class Preloader #if flash extends Sprite #end { } - if (#if flash loadedStage && #end loadedLibraries == (libraries.length + libraryNames.length)) { + if (!simulateProgress && #if flash loadedStage && #end loadedLibraries == (libraries.length + libraryNames.length)) { start (); @@ -269,12 +318,19 @@ class Preloader #if flash extends Sprite #end { #if flash private function current_onEnter (event:flash.events.Event):Void { - // TODO: Merge progress with library load progress - if (!loadedStage && Lib.current.loaderInfo.bytesLoaded == Lib.current.loaderInfo.bytesTotal) { loadedStage = true; - onProgress.dispatch (Lib.current.loaderInfo.bytesLoaded, Lib.current.loaderInfo.bytesTotal); + + if (bytesTotalCache["_root"] > 0) { + + var loaded = Lib.current.loaderInfo.bytesLoaded; + bytesLoaded += loaded - bytesLoadedCache2["_root"]; + bytesLoadedCache2["_root"] = loaded; + + updateProgress (); + + } } @@ -295,21 +351,49 @@ class Preloader #if flash extends Sprite #end { private function loaderInfo_onComplete (event:flash.events.Event):Void { loadedStage = true; - onProgress.dispatch (Lib.current.loaderInfo.bytesLoaded, Lib.current.loaderInfo.bytesTotal); + + if (bytesTotalCache["_root"] > 0) { + + var loaded = Lib.current.loaderInfo.bytesLoaded; + bytesLoaded += loaded - bytesLoadedCache2["_root"]; + bytesLoadedCache2["_root"] = loaded; + + updateProgress (); + + } } private function loaderInfo_onInit (event:flash.events.Event):Void { - onProgress.dispatch (Lib.current.loaderInfo.bytesLoaded, Lib.current.loaderInfo.bytesTotal); + bytesTotal += Lib.current.loaderInfo.bytesTotal; + bytesTotalCache["_root"] = Lib.current.loaderInfo.bytesTotal; + + if (bytesTotalCache["_root"] > 0) { + + var loaded = Lib.current.loaderInfo.bytesLoaded; + bytesLoaded += loaded; + bytesLoadedCache2["_root"] = loaded; + + updateProgress (); + + } } private function loaderInfo_onProgress (event:flash.events.ProgressEvent):Void { - onProgress.dispatch (Lib.current.loaderInfo.bytesLoaded, Lib.current.loaderInfo.bytesTotal); + if (bytesTotalCache["_root"] > 0) { + + var loaded = Lib.current.loaderInfo.bytesLoaded; + bytesLoaded += loaded - bytesLoadedCache2["_root"]; + bytesLoadedCache2["_root"] = loaded; + + updateProgress (); + + } } #end
7
diff --git a/src/value.mjs b/src/value.mjs @@ -75,10 +75,6 @@ export function Value(value) { return value ? trueValue : falseValue; } - if (typeof value === 'symbol') { - return new SymbolValue(value); - } - if (typeof value === 'function') { return new BuiltinFunctionValue(value); }
2
diff --git a/accessibility-checker-extension/src/ts/devtools/Header.tsx b/accessibility-checker-extension/src/ts/devtools/Header.tsx @@ -95,15 +95,15 @@ export default class Header extends React.Component<IHeaderProps, IHeaderState> <div className="bx--row summary"> <div className="bx--col-sm-1"> - <img src={Violation16} style={{verticalAlign:"middle",marginBottom:"4px"}} alt="Needs review" /> + <img src={Violation16} alt="Needs review" /> <span className="summaryBarCounts">{counts["Violation"] || 0}&nbsp;<span className="summaryBarLabels">Violations</span></span> </div> <div className="bx--col-sm-1"> - <img src={NeedsReview16} style={{verticalAlign:"middle",marginBottom:"4px"}} alt="Needs review" /> + <img src={NeedsReview16} alt="Needs review" /> <span className="summaryBarCounts">{counts["Needs review"] || 0}&nbsp;<span className="summaryBarLabels">Needs&nbsp;review</span></span> </div> <div className="bx--col-sm-1"> - <img src={Recommendation16} style={{verticalAlign:"middle",marginBottom:"2px"}} alt="Recommendation" /> + <img src={Recommendation16} alt="Recommendation" /> <span className="summaryBarCounts">{counts["Recommendation"] || 0}&nbsp;<span className="summaryBarLabels">Recommendations</span></span> </div> <div className="bx--col-sm-1">
2
diff --git a/lod.js b/lod.js @@ -5,6 +5,8 @@ const localVector = new THREE.Vector3(); const localVector2 = new THREE.Vector3(); const localVector3 = new THREE.Vector3(); +const onesLodsArray = new Array(8).fill(1); + /* note: the nunber of lods at each level can be computed with this function: @@ -77,6 +79,59 @@ export class LodChunkTracker extends EventTarget { this.chunks = []; this.lastUpdateCoord = new THREE.Vector3(NaN, NaN, NaN); } + setRange(range) { + this.range = range; + + (async () => { + await Promise.resolve(); // wait for next tick to emit chunk events + + const _removeOldChunks = () => { + for (const chunk of this.chunks) { + this.dispatchEvent(new MessageEvent('chunkremove', { + data: { + chunk, + }, + })); + } + this.chunks.length = 0; + }; + _removeOldChunks(); + + const _addRangeChunks = () => { + const minChunkX = Math.floor(this.range.min.x / this.chunkSize); + const minChunkY = (this.trackY ? Math.floor(this.range.min.y / this.chunkSize) : 0); + const minChunkZ = Math.floor(this.range.min.z / this.chunkSize); + + const maxChunkX = Math.floor(this.range.max.x / this.chunkSize); + const maxChunkY = this.trackY ? Math.floor(this.range.max.y / this.chunkSize) : 0; + const maxChunkZ = Math.floor(this.range.max.z / this.chunkSize); + + /* console.log( + 'got range', + this.range.min.toArray(), + this.range.max.toArray(), + minChunkX, minChunkY, minChunkZ, + maxChunkX, maxChunkY, maxChunkZ, + ); */ + + for (let y = minChunkY; y < maxChunkY; y++) { + for (let z = minChunkZ; z < maxChunkZ; z++) { + for (let x = minChunkX; x < maxChunkX; x++) { + // console.log('add chunk', x, y, z); + const chunk = new LodChunk(x, y, z, onesLodsArray); + this.dispatchEvent(new MessageEvent('chunkadd', { + data: { + chunk, + }, + })); + this.chunks.push(chunk); + } + } + } + }; + _addRangeChunks(); + })(); + } #getCurrentCoord(position, target) { const cx = Math.floor(position.x / this.chunkSize); const cy = this.trackY ? Math.floor(position.y / this.chunkSize) : 0; @@ -84,6 +139,8 @@ export class LodChunkTracker extends EventTarget { return target.set(cx, cy, cz); } update(position) { + if (this.range) throw new Error('lod tracker has range and cannot be updated manually'); + const currentCoord = this.#getCurrentCoord(position, localVector); // if we moved across a chunk boundary, update needed chunks
0