Generic/InlineControlStructure: stop listening for T_SWITCH

Description
As originally discussed in https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/482#pullrequestreview-2062765716 (see the "Commit 2 - stop listening for T_SWITCH" section), this PR changes the Generic.ControlStructures.InlineControlStructure sniff to stop listening for T_SWITCH tokens as there is no inline version of a switch in PHP and JS.
Before this change, the sniff would bail early for a T_SWITCH token either because it has a scope opener or because of a syntax error.
Code samples used for the sniff tests that contained a T_SWITCH token were updated to reflect this change. Some of those were actually added as Tokenizer tests before PHPCS had dedicated Tokenizer tests. Below there is more information about each of the modified tests answering the questions left by @jrfnl in https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/482#pullrequestreview-2062765716.

line 82-89: related to https://github.com/squizlabs/PHP_CodeSniffer/issues/497 - looks like this test is about switch and the alternative syntax, which is no longer relevant in this sniff, but the use of ... ?> ... <?php ... within a control structure is an interesting case. Can you think of a code sample which would maintain the value of this test, but uses one of the other control structures ?
Also: should the original test - which was really a tokenizer bug - be moved to a Tokenizer test ?

I updated the original code sample used in the sniff test to use T_IF and T_ELSEIF instead of T_SWITCH. I also created a new Tokenizer::recurseScopeMap() test file and added tests to ensure that the scope indexes are set correctly for switches using the normal and alternative syntaxes.

line 93 - 96: also related to https://github.com/squizlabs/PHP_CodeSniffer/issues/497 - looks like this test is about switch and the alternative syntax, which is no longer relevant in this sniff, but the use of nested alternative syntax control structures could still be a valid test case. Can you think of a code sample which would maintain the value of this test, but uses one of the other control structures ?
Also: should the original test - which was really a tokenizer bug - be moved to a Tokenizer test ?

Similar to the above, I updated the code sample to use T_FOREACH instead of T_SWITCH and created dedicated Tokenizer tests to check setting the scope for T_IF with a nested T_SWITCH and T_CASE when T_CASE is missing T_BREAK.

Line 109 - 117: related to https://github.com/squizlabs/PHP_CodeSniffer/issues/543 - looks like this test is about a closure being used within the condition of a switch, which is no longer relevant in this sniff, but the use of the closure in the condition is still an interesting case. Can you think of a code sample which would maintain the value of this test, but uses one of the other control structures (without curlies) ?
Also: should the original test - which was really a tokenizer bug - be moved to a Tokenizer test ?

I replaced the code sample with an inline T_IF with a closure within the condition. Also, I added a dedicated Tokenizer test to ensure that the scope for a T_SWITCH is set correctly when there is a closure within the condition.

Line 146 - 155: related to https://github.com/squizlabs/PHP_CodeSniffer/issues/879 - looks like this test is about mixing if/elseif/else with braces and without braces in one code sample. I imagine, this test is still valid as-is, or maybe the switch control structure wrapper should be replaced with another control structure wrapper ?
Also: should the original test - which was, in part, a tokenizer bug - be moved to a Tokenizer test ?

I left the code sample as is because I believe it is still valid. The original problem only manifested when the T_IF was nested within a T_SWITCH. A dedicated tokenizer test was added using the same code sample.

Line 204 - 213: related to https://github.com/squizlabs/PHP_CodeSniffer/issues/1590 - looks like this test is about adding braces to an if that's returning a nested function call. I imagine, this test is still valid as-is, or maybe the switch control structure wrapper should be replaced with another control structure wrapper ?
Also: should the original test - which was, in part, a tokenizer bug - be moved to a Tokenizer test ?

I replaced the T_SWITCH in the original code sample with a T_FOR and created a dedicated Tokenizer test.

Test case file *.js:
line 23 - can a meaningful replacement test be created which would use the keyword of one of the other control structures ?

I did replace switch with for. But it is important to note that the original code sample lost part of its value over time as now the sniff bails early if there is no opening parenthesis after the control structure. Ideally, it should be moved to a tokenizer test, but since there are no tests for the JS tokenizer, and support will be dropped in
PHPCS 4.0, I opted to simply use a control structure other than T_SWITCH. This test was originally added in https://github.com/PHPCSStandards/PHP_CodeSniffer/commit/b3f4f83b2c1ad1a07086a8af09cb371fb0f4b1a4.
Suggested changelog entry
Generic.ControlStructures.InlineControlStructure stop listening for T_SWITCH as there is no inline version of this control structure in PHP and JS
Related issues/external references
First discussed in https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/482#pullrequestreview-2062765716
Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

[ ] This change is only breaking for integrators, not for external standards or end-users.

[ ] Documentation improvement

PR checklist

[x] I have checked there is no other PR open for the same change.
[x] I have read the Contribution Guidelines.
[x] I grant the project the right to include and distribute the code under the BSD-3-Clause license (and I have the right to grant these rights).
[x] I have added tests to cover my changes.
[x] I have verified that the code complies with the projects coding standards.
[ ] [Required for new sniffs] I have added XML documentation for the sniff.

@jrfnl, as we discussed last week, I reorganized the commits in this PR so that the changes to the sniff tests are not all in the commit that changes the InlineControlStructure sniff to stop listening for T_SWITCH. Instead, each change to the sniff tests is in the commit that creates the related tokenizer test.
This PR is now ready to be reviewed.

Thanks for your review, @jrfnl!
I answered all the inline comments I believe should be addressed in this PR. As you suggested, I plan to create a follow-up PR to address the comments that were not blocking this PR and that I didn't answer. If I cannot create the follow-up PR right after this one is merged, I will create an issue documenting what needs to be done.

As you suggested, I plan to create a follow-up PR to address the comments that were not blocking this PR and that I didn't answer. If I cannot create the follow-up PR right after this one is merged, I will create an issue documenting what needs to be done.

Thanks.

I split the new changes per related original commit, hoping this will help you combine the commits before merging. Please let me know if this approach makes sense or not.

It does 👍🏻

This PR is ready for another review.

@rodrigoprimo Just one comment left to address: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/595#discussion_r1893235283

@rodrigoprimo Just one comment left to address: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/595#discussion_r1893235283

@jrfnl, I just pushed a new commit addressing this comment.


Xdebug problem with VS Code on Windows 10

Issue Type

Bug Report / Support Request

Your Environment
Vagrant 2.2.4 VirtualBox 6.0.4r128413

Your OS

Windows 10 Pro Version 1803 (OS Build 17134.648)

Summary
I have provisioned the VM with Xdebug to work with VS Code as described in the docs and the installation works ok but when I tried using Xdebug with VS Code by adding ?XDEBUG_SESSION_START to the url I first got the error about the .env file missing (which I created from .env.example without changing its contents) and then I got the following error:
Exception has occurred.
Symfony\Component\Process\Exception\ProcessFailedException: The command "git log -1 --pretty=format:'%H - %s (%ci)' --abbrev-commit" failed.

Exit Code: 128(Invalid exit argument)

Working directory: /var/www/drupalvm/drupal/web

================
fatal: Not a git repository (or any parent up to mount point /var/www/drupalvm)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

I have configured my lauch.json file in VS Code in the following way:
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                "/var/www/drupalvm": "D:/test_bazy_sql/drupal/drupal_sites/drupal-vm/"
              },
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

Is there a way to work around this?

It looks like the error is not related to Xdebug in any way, but instead:
Symfony\Component\Process\Exception\ProcessFailedException: The command "git log -1 --pretty=format:'%H - %s (%ci)' --abbrev-commit" failed.

It looks like it's running a git command inside the working directory (/var/www/drupalvm/drupal/web), and then it realizes that directory is not a git repository (nor is /var/www/drupalvm/drupal or any other directory), and then it fails.
I do not use VSCode and also am not sure how you have your site configured (not sure what that ProcessFailedException is coming from? Maybe a VSCode plugin for Git?), but I would start by investigating that particular error message.
This doesn't seem to have anything to do with Drupal VM or its configuration, however. I'd suggest asking in VSCode forums/help areas, or on Stack Exchange or Drupal Answers.


Instructions improvement when adding the Predicates and PredicateValidations  elements.

[Enter feedback here]
The instructions should also say the sequence where to add the Predicates and PredicateValidations  elements since the XSD schema enforces this sequence.
Predicates element should be added after the ClaimsSchema element as a child of BuildingBlocks.
PredicateValidations element should be added after the Predicates element as a child of BuildingBlocks.

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 7edf25a3-599b-3eb6-0efd-e6f110684c5e
Version Independent ID: dd4b506e-e791-2b26-c5b3-59c077432b02
Content: Validate user inputs by using Azure AD B2C custom policy - Azure AD B2C
Content Source: articles/active-directory-b2c/custom-policies-series-validate-user-input.md
Service: active-directory
Sub-service: b2c
GitHub Login: @kengaderdus
Microsoft Alias: kengaderdus

@Devyandu
Thanks for your feedback! We will investigate and update as appropriate.

@kengaderdus
Can you please check and add your comments on this doc update request as applicable.

@Devyandu
Thanks for your feedback! That's correct. We will update the article.

#please-close


Feature Request: Rename to custom name

Possible to create option allowing renaming to a custom name for all features?
Tend to rename all symbol instance names manually vs just using the master symbol name so it's quicker to scan in the layer list.
E.g. Master Symbol = UI Kit / Buttons / Primary / 44px / Normal gets renamed as [btn-primary] once it's included in an artboard.

@ryanbelisle Interesting idea, I kinda wish I thought of myself. I probably didn't because it flips the script a bit on what the plugin was intended to do, but I think the idea still fits within the paradigm of what the plugin can do... so I will give it some thought. Thanks for the suggestion. 😊

No problem. Thanks again for considering this!

+1 for this idea! Would be very useful.

@ryanbelisle, @mattiasj, please check out version 2.6 of the plugin... I added a new function "Rename Selected Instance(s) with Options…", which will allow you to rename a selected instance (and master), and all other instances of the selected instance as well.


Dynamic resource mapping

Add an option for dynamic resource mapping, that is, resources based on Victoria buildings.

"aluminium" is a misspelling of "aluminum"

Yes, well, take it up with Paradox and the British Empire.


Slide flicks back to initial slide when swiping and using an Ionic Spinner while loading data

Check that this is really a bug

[X] I confirm

Reproduction link
https://github.com/pjc2007/swiper-issue2
Bug description
The above is a sample application when trying to find out why this was happening in my real application.
The basic setup is 2 slides, each with a Angular component, each with some selects, and when swiping from one slide to the next, I show an Ionic spinner while there is a server request for the data of the component in the new slide.
However, I find that if I happen to have opened a select, or any modal popup from within one of the components, and then slide, showing and then hiding the Ionic spinner will cause the slide to go back to the page we just came from.
If I remove the spinner, it does not happen , or we we don't open any "popups" before sliding it does not happen.
The sample app is just a stock newly created Ionic/Angular application, where the main component with the slider is FolderPage. In the slideChanged handler it calls the loadData on the component we are going to, and this is where we call the presentDataLoading and dismissLoaderIfPresent,m which uses the Ionic LoadingController (which I use everywhere wit no issues)
I did do an original post about it on SO (https://stackoverflow.com/questions/78833526/swiper-slidechange-event-sometimes-called-a-second-time-resetting-back-to-the-in)
So, there is some weird interaction between the above elements which is causing the slider to be "pushed" back, but I have no idea what this could be.

Expected Behavior
To be able to slide to the next slide, and not have it then return to the previous when using an LoadingController during the transition
Actual Behavior
once we have opened some sort of popup (a select, even an alert etc.), and we slide as soon as we call the HTMLIonLoadingElement.dismiss() the slider slides back to the original slide
Swiper version
11.1.9
Platform/Target and Browser Versions
All., tested on Windows desktop Chrome, Ipad etc
Validations

[X] Follow our Code of Conduct
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
[X] Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

[ ] I'm willing to open a PR

this happening to me also, I have problems when open IonModal (Ionic on react).
On multiple sliders on one page, it also, from time to time, jumps to specific slider and slide to some slide (not always initial)


add Diamanti to "Platform" box

Diamanti is currently categorized as "Runtime - Cloud-Native Storage"....please update to "Platform - PaaS/Container Service"
Project or Product name: Diamanti
Is it open source? (if you are tempted to say partially, please answer no): No
What are the best URL(s) for it? Repo and homepage (if different) for open source, product homepage for closed source?: https://diamanti.com/products/
What one category does it best belong in? PLATFORM
What's the URL for the best logo (and it needs to include the name)? See attached (one currently used is fine however, but incase you need again...)
Anything else we need to know?: Please move us from "Runtime/Cloud-Native Storage" to "Platform- PaaS/Container Service" box.

Hi @katiecrimi , sure thing, we will make the change to Platforms in the upcoming version.

Closing as this update was included in the most recent version https://github.com/cncf/landscape#current-version


Remove TODOs reminding to check Cipher thread safety

A new instance of Cipher is created for each message and is only used within the one thread.

Nevermind, I now see it is a minor change on top of #1


Introduction To JavaScript updates

The course has changed since the last commit. I've updated most of it.

@WarHatch Thanks for your PR mate! I'm so sorry, I absolutely missed your PR earlier.


Bug or what am I missing information from upload options?

Disclaimer I'm not using the react-s3-uploader function to get the signed URL.  I have a different API through the serverless framework.
serverless code
import json
import logging
import os
import boto3
import sys
import mimetypes
dynamodb = boto3.resource('dynamodb')
s3 = boto3.client('s3')

from model import validate_and_clean, generate

def signedUrl(event, context):
    data = event['queryStringParameters']
    object_name = data.get(u'objectName')
    content_type = data.get(u'contentType',mimetypes.guess_type(object_name)[0])
    signed_url = s3.generate_presigned_url(
        'put_object',
        Params={
        'Bucket':'<BUCKET>',
        'Key': object_name,
        },
        ExpiresIn = 300
    )

    obj = {
        'signedUrl': signed_url,
        'publicUrl' : '/s3/uploads/' + object_name,
        'filename': object_name,
        'fileKey': object_name
    }

    response = {
        'headers': {'Access-Control-Allow-Origin': '<DOMAIN>'},
        "statusCode": 200,
        "body" : json.dumps({
            "data": obj,
            "errors" : [],
            "success": True
        })
    }
    return response

React code
import Dropzone from 'react-dropzone-s3-uploader';
//...
class renderArtDropzoneInput extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      files: [],
    };
    this.onFinish = this.onFinish.bind(this);
  }

  onFinish(acceptedFiles, rejectedFiles) {
    this.props.input.onChange(acceptedFiles);

    this.setState({
      files: acceptedFiles,
    });
  }

  onOpenClick() {
    this.dropzone.open();
  }

  handleFinishedUpload = info => {
    console.log('File uploaded with filename', info.filename)
    console.log('Access it on s3 at', info.fileUrl)
  }

  render() {
    const uploadOptions = {
      server: 'https://####.execute-api.us-west-2.amazonaws.com/beta',
      signingUrlQueryParams: {uploadType: 'avatar'},
      s3Url: 'https://####.s3-us-west-2.amazonaws.com'
    }
    const s3Url = 'https://####.s3-us-west-2.amazonaws.com'

    return (
      <Dropzone
        ref={(node) => { this.dropzone = node; }}
        s3url={s3Url}
        multiple={false}
        onFinish={this.onFinish}
        maxSize={1024 * 1024 * 5}
        upload={uploadOptions}/>
    )
  }
}

I end up getting an error:
s3upload.js:171
PUT http://localhost:3000/user/artist/undefined 404 (Not Found)
  | ./node_modules/react-s3-uploader/s3upload.js.S3Upload.uploadToS3 | @ | s3upload.js:171
I'm not sure how it properly uses the server setting to get the signedUrl from the server but somehow is using the current react application's url for the PUT action to upload the file.
package.json (i had react dropzone installed before trying your lib not sure if this matters)
    "react-dropzone": "^4.1.3",
    "react-dropzone-s3-uploader": "^1.1.0",

Any help you could give @gwilymhumphreys would be appreciated

Issue was that the lib expects the data at root layer of the response not
{
    "data": obj,
    "errors" : [],
    "success": True
}


Using borrowed handles in the FirebirdClient Trait

Also removed the stmt_data_map HashMap, storing the data it the handles instead.
The public API was modified a bit by removing the RefCells from the Connection code, as the Statement needs to store a mutable reference to the Transaction now.

if you replace all occurrences of the associated types in FirebirdClient as you have done, then you could likely achieve the same effect in the implementations instead of the API
impl FirebirdClient for Native.. {
       type DbHandle = SomeConcreteType; //where SomeConcreteType implements BorrowMut<ibase::isc_db_handle>
       ...
    }

Do you mean being able to get a mutable borrow using interior mutability and use only &XYZAttach? That could be done, but one of my goals with this change is to remove all Cells and RefCells, but that would require the handles to have RefCells inside of them.

A modification of these changes which would have some obvious merits in my view, is if the signatures were mixed:
* `detach_database`, `drop_database`, takes just `DbHandle`, not `&mut`

* `free_statement` takes just `StmtHandle`, not `&mut`

This can be changed without problem with the current implementation, i will do that

The goals where:
Use borrowed handles, instead of copied ones.
Remove the stmt_data_map
Remove RefCells uses
It is also a preparation to make the statement cache a wrapper around the cliend, as @afsmi suggested.

Pull Request Test Coverage Report for Build 323090453

-46 of 204 (77.45%)  changed or added relevant lines in 10 files are covered.
6 unchanged lines in 3 files lost coverage.
Overall coverage decreased (-11.8%) to 66.722%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

src/connection/pool.rs
0
1
0.0%

src/connection/mod.rs
15
17
88.24%

src/statement.rs
29
32
90.63%

examples/insert.rs
0
4
0.0%

src/transaction.rs
18
22
81.82%

rsfbclient-native/src/connection.rs
30
43
69.77%

rsfbclient-rust/src/client.rs
51
70
72.86%

Files with Coverage Reduction
New Missed Lines
%

src/transaction.rs
1
62.07%

examples/insert.rs
2
0%

rsfbclient-native/src/connection.rs
3
73.71%

Totals

Change from base Build 321977024:
-11.8%

Covered Lines:
2009

Relevant Lines:
3011

💛  - Coveralls

Edit: About the last point, now that i though better, i think it will be better to see in another PR, as it will not be so easy to do because of the types that implement Drop in which we can only take a mutable reference to the fields.

The goals where:
Use borrowed handles, instead of copied ones.
Remove the stmt_data_map
Remove RefCells uses
It is also a preparation to make the statement cache a wrapper around the cliend, as @afsmi suggested.

I  think we should just keep working on the PR and solve the problems rather than merge things we know we will have to undo. But if you feel strongly about it, i will click the approve button :grin:
Since you eliminated the RefCells  I have started working on some more radical changes from this PR. I hope to simplify the main crate enough so that it becomes easy to keep the core crate signatures as we want them and also start implementing other more interesting things like cache-as-middleware
You can preview here:
https://github.com/fernandobatels/rsfbclient/compare/fernandobatels:f086b76...afsmi:0687dfb
note that It doesn't compile right now, I just wanted to keep you updated. I'll probably have something ready for a PR in a couple more days.

I think we should just keep working on the PR and solve the problems rather than merge things to master that we know we will have to undo later. But if you feel strongly about it, i will click the approve button grin Besides the core API stuff I think these goals and changes are good

I can't really think of a good way to make the functions take only DbHandle instead of &mut, other than make the handles in Connection and Statement be wrapped in Option to allow taking them out. Do you have any ideas @afsmi?

I can't really think of a good way to make the functions take only DbHandle instead of &mut, other than make the handles in Connection and Statement be wrapped in Option to allow taking them out. Do you have any ideas @afsmi?

Since in this PR the borrows in Transaction and Statement were made mutable (here and here)
it's pretty clear that there's no way to really use more than one simultaneous Transaction or Statement on a single connection any more (I don't know if it was even possible before. I don't remember if I ever tried.)
But if we want those while keeping our nice high level interface, we will most likely have to reintroduce some kind of inner mutability, smart pointer, or replace handles by indices into a fixed-sized set of slots or memory pool.
Personally I'm interested to try the last of those ideas, as I think it will make async easy to do in a clean way, ie one struct which is responsible for all database activity on a thread, across possibly multiple connections, and possibly communicating with other threads via channels. I think we could combine this with the pool module as well.
I'm also curious about experimenting with using Statements across multiple Transactions or Connections just to see what happens.. apparently the API allows  one to choose whether to reset statements or not on detach?
At first I will put just 1 Transaction and 1 Statement inside  Option, almost as you say, except all in Connection.
Then Transaction and Statement don't borrow anything, they just wrap each other like
Statement( Transaction ( Connection (... FirebirdClient ) ) ) and each time you wrap, it turns a corresponding None into a Some in the Connection.
No more lifetime parameters.

Since in this PR the borrows in Transaction and Statement were made mutable (here and here), it's pretty clear that there's no way to really use more than one simultaneous Transaction or Statement on a single connection any more (I don't know if it was even possible before. I don't think I tried.)
But if we want those while keeping our nice high level interface, we will most likely have to reintroduce some kind of inner mutability, smart pointer, or replace handles by indices into a fixed-sized set of slots or memory pool.

I don't think there is a reason to allow a single connection to have more than one active Transaction / Statement at a time, but to allow this we would need to use Cells and RefCells to change the handles from mutable references to just references.

Personally I'm interested to try the last of those ideas, as I think it will make async easy to do in a clean way, ie one struct which is responsible for all database activity on a thread, across possibly multiple connections, and possibly communicating with other threads via channels. I think we could combine this with the pool module as well.

I don't think there is much reason to make an async version, as the libfbclient functions are blocking.

I'm also curious about experimenting with using Statements across multiple Transactions or Connections just to see what happens.. apparently the API allows one to choose whether to reset statements or not on detach?

Statements can (and are being, because of the statement cache) used in different Transactions, but cannot be used between Connections (All handles are exclusive to their connections).
About the resetting of the isc_dsql_alloc_statement2 i think it is just an implementation difference, not a different behavior of the allocated Statements. As a note, we cannot use this function, as the code could try to set the handles to null but the handles are on Rust side and are moved from the original position in memory, that would cause invalid writes (The way we are currently storing the handles).

At first I will put just 1 Transaction and 1 Statement inside Option, almost as you say, except all in Connection.
Then Transaction and Statement don't borrow anything, they just wrap each other like
Statement( Transaction ( Connection (... FirebirdClient ) ) ) and each time you wrap, it turns a corresponding None into a Some in the Connection.
No more lifetime parameters.

That could be done, however crating a Transaction  would consume the Connection, so it could not be used in the pool, as you can only get a mutable reference to the Connection (As it needs to go back to the pool).

@jairinhohw Thanks for your insights. I see your points.
as it turns out there's also another reason why the newtype wrappers don't really make sense: creating a transaction/statement can fail, and returning Result<... , (Self, FbError)> is ugly.
I find the situation in the main crate a sort of unsatisfactory, I will see if I can come up with some alternative. I do feel that I've made some progress in slimming down the main crate.


Testcafe doesn't finish running after opening a new page in an iframe

THIS BUG IS STILL HAPPENING: https://github.com/DevExpress/testcafe/issues/2515
Are you requesting a feature or reporting a bug?
Bug
What is the current behavior?
Testcafe keeps hanging idle during a test after clicking a link that opens a new tab with javascript
What is the expected behavior?
Testcafe should exit and report tests.
How would you reproduce the current behavior (if this is a bug)?
Have a button in an iframe that redirects or opens a new page.
This is the iframe.html file:

Google link
Then have testcafe click it. It will stop working (without throwing any errors).
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://horsetoast.github.io/testcafe-button-problem/
Test code
import { ClientFunction, Selector } from 'testcafe';
fixtureTestcafe redirect bug.page(
https://horsetoast.github.io/testcafe-button-problem/
);
test('Click a button in iframe and redirect', async t => {
const iframe = Selector('#iframe');
const button = Selector('#button');
await t
.switchToIframe(iframe)
.click(button)
});
here is my github repo with the problem
https://github.com/Horsetoast/testcafe-button-problem

Hello @MatiasFB,
Thank you for your report. I've reproduced this issue with TestCafe version 0.20.3 included in the example repo. However, the example works as expected with TestCafe 1.9.1.
To fix this issue, you can update TestCafe to the latest version. The fix involves the new multi-windows feature which is currently in beta.

I am having the same exactly issue with with TestCafe 1.9.1.
Try to switch to the main windows after click on the button, and the test will be paused unexpectedly.
await t
.switchToIframe(iframe)
.click(button)
.switchToMainWindow();

@MatiasFB, I've modified the example as you suggested, but I still can't reproduce the issue on TestCafe 1.9.1.
Please delete the node_modules folder and the package-lock.json file and then run npm remove testcafe and npm install testcafe to verify the installation.
If this does not resolve the issue, please share the following details:

OS name and version
Node version (run node -v)
TestCafe version (run testcafe -v)
Browser name and version
Your tested page in case you've modified the page from the example repo
Your test code
Command-line arguments you pass to run the test

The bug is still happening, we were dealing with a lot of iframes but here is happening something weird.
1-macOs Catalina - version 10.15.6
2- v12.18.1
3- 1.9.1
4-Chrome Version 84.0.4147.105 (64-bit)
6-  async selectAssetFromAssetAndWarrantySection() {         await t         .switchToIframe(this.iFrameCaseDetails)         .click(this.assetSelectLink)         .switchToMainWindow();     }
The click is done but it is paused when it try  .switchToMainWindow();
7- node ./Runners/caferun.js
`const createTestCafe = require('gherkin-testcafe');
let testcafe = null;
createTestCafe()
.then(tc => {
testcafe = tc;
const runner = testcafe.createRunner();
    return runner
        .src(['./StepDefinitions/login.js', './FeatureFiles/login.feature'])
        .browsers(['chrome'])
        .run({
            debugMode: true,
             assertionTimeout: 20000,
             selectorTimeout: 20000,
             pageLoadTimeout: 20000
        });
})
.then(failedCount => {
    console.log('Tests failed: ' + failedCount);
    testcafe.close();
});`

@MatiasFB, Thank you for sharing additional details. This code is different from that in the example you previously shared. Does the example from the repository you shared work for you after TestCafe was updated to v1.9.1?
We need a complete example that we can run on our side to reproduce this issue. If the example you initially shared works as expected, please share another repository that demonstrates this issue.


WebView2 control now throwing exception when application is closed

Describe the bug
Note that this may have been introduced in a recent update as this once worked properly.
Running an application with WebView2 control will throw an exception when the application is closed.

Steps to reproduce the bug

Create a new project in VS using the Blank App (WinUI 3 in Desktop) template.
In MainWindow.xaml, replace the contents of StackPanel with the contents shown in screen grab below

Start app and ensure the web page is displayed
Close the application

At this point exception will occur.
Expected behavior
Exception should not occur on shutdown.
Screenshots
As shown above, following exception occurs upon closing app:

NuGet package version
Windows App SDK 1.4.3: 1.4.231115000
Packaging type
No response
Windows version
Windows 10 version 22H2 (19045, 2022 Update)
IDE
Visual Studio 2022
Additional context
Project files:
WebView.zip

Try this
https://github.com/microsoft/microsoft-ui-xaml/issues/6872

Thanks for the link!
Calling Close on WebView2 now prevents exception upon close


Single source for resource and column names

A first step towards fixing #8 and #3, but it does not address everything because #14 needs to be discussed first.
Note that:

The dpkg.py has been moved to an external script (scripts/create_dpkg.py). It's not part of the library and it had the same name as the package, which would have messed up absolute imports. This means that the package now has to be installed.

writeConfigFile.py is gone. The user can create the .ini file directly, that should be easier and less error-prone than modifying Python code (which would have been installed anyway).

"objects.csv" and "links.csv" are still hardwired in readfile.py and createdp.py. We should define these in the library as well at some point. There is more hardwired stuff, see #14.

I would follow @JaimePrilusky's suggestion to prepend rather than append cmso, e.g., cmso_x_coord.

For consistency, we might want to use cmso_frame_id instead of cmso_frame.

Before this is merged can someone please double check that at least one example runs correctly (e.g., python3 create_dpkg.py bloboverlap15_spots.csv), since current test coverage is pretty low.

@simleo I have tested this for the CellProfiler and the TrackMate examples, all good.
Obviously did not test on ICY, because broken as for #12.
One last thing before merging. The README should be updated in the line:
step 1: install the library (I did python setup.py install on a Windows 10 machine, worked like charm)
step 2: make sure you have a .ini file (as already explained)
step 3: run "python create_dpkg.py your-tracking-file" (instead of "run python dpkg.py your-tracking-file").
Do you mind committing these edits before proceeding to the merging? Thanks.

Thanks! For me this is good to go.


SOLR-15007: Adding ability to provide aggregated node level metrics for request handlers

This is more effective for metrics when there are a large number of cores per node, especially since some metrics like histograms cannot be aggregated after the fact.
https://issues.apache.org/jira/browse/SOLR-15007

Description
Currently request handlers provide metrics (request count, times, rate) at the core level so each core gets distinct metrics for each handler. For use cases where there are a large number of cores per node this creates a large number of metrics which can make the /admin/metrics endpoint unwieldy and provide a lot of metrics that aren't easy to use for comparisons.
As an example, at FullStory we were more interested in per node performance for /select and /update than per core performance. Due to the challenge of many cores per node and difficulty in aggregating Meter or Histogram metrics after the fact, this was essentially impossible using core level metrics. By introducing this change, we are able to view metrics for those request handlers on a per node basis by just getting the metrics for the solr.node group. This means less metrics data to process and the ability to compare across nodes.
Solution
This solution implements a new type of each metric (Counter, Timer, Meter, Histogram) allowing for both a primary and delegate metric to be updated. If aggregateNodeLevelMetricsEnabled is true for a given request handler then a delegate type of metric will be created instead of a normal Counter, Timer, Meter or Histogram. This will update both primary and delegate when called.
In this case, the primary metric is still the core level metric as part of the core level registry and the delegate is a node level metric as part of the node level registry.
This ensure that core level metrics are still provided as is, but we can additionally provide node level metrics for specific request handlers if configured.
As an example of configuration, this can be configured for the select handler via:
<requestHandler name="/select" class="solr.SearchHandler">
    <!-- default values for query parameters can be specified, these
         will be overridden by parameters in the request
      -->
    <lst name="defaults">
        <str name="echoParams">explicit</str>
        <int name="rows">10</int>
    </lst>

    <bool name="aggregateNodeLevelMetricsEnabled">true</bool>
</requestHandler>

Tests
The main test developed is the RequestHandlerMetricsTests which tests that the proper metrics are provided based on configuration of request handlers.
Checklist
Please review the following and check all that apply:

[x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
[x] I have created a Jira issue and added the issue ID to my pull request title.
[x] I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
[x] I have developed this patch against the main branch.
[x] I have run ./gradlew check.
[x] I have added tests for my changes.
[x] I have added documentation for the Reference Guide

BTW, not saying there's a bug here, but take care to ensure that metrics are unregistered properly as it could be a nasty memory leak if not -- https://issues.apache.org/jira/browse/SOLR-13677

@madrob @dsmiley Just wanted to check in with you both on this PR, is my explanation above sufficient for why this approach is taken? Are there any other concerns to sort out before merging this?

I checked out the branch and applied some edits to the techproducts config and gave it a whirl. It seemed to work, even though I was only using one core so it wasn't some bigger comparison.  I also tried it with the prometheus exporter to ensure that the default config wasn't confused by this double-reporting.  AFAICT it was fine.
Can you add something in the Solr Ref Guide so users know about this new nifty thing?  metrics-reporting.adoc in "Core (SolrCore) Registry" would be a decent place to include a little solrconfig code snippet of, say, the /select handler set up this way.  It could be added to requesthandlers-searchcomponents.adoc too but it would maybe be distracting there because metrics is a side concern and cross-cutting.
This could go into CHANGES.txt under New Feature or Improvements; I tend to think the former here because there's a toggle/action to take.  Can you add that entry to?  Merge up with main first.

I checked out the branch and applied some edits to the techproducts config and gave it a whirl. It seemed to work, even though I was only using one core so it wasn't some bigger comparison. I also tried it with the prometheus exporter to ensure that the default config wasn't confused by this double-reporting. AFAICT it was fine.
Can you add something in the Solr Ref Guide so users know about this new nifty thing? metrics-reporting.adoc in "Core (SolrCore) Registry" would be a decent place to include a little solrconfig code snippet of, say, the /select handler set up this way. It could be added to requesthandlers-searchcomponents.adoc too but it would maybe be distracting there because metrics is a side concern and cross-cutting.
This could go into CHANGES.txt under New Feature or Improvements; I tend to think the former here because there's a toggle/action to take. Can you add that entry to? Merge up with main first.

Thanks for helping to guide through this process. I've made those changes as well. I included it as a new feature in the 9.1.0 section of CHANGES.txt. Let me know if there are any other changes needed.

Looks like there was a markup / link error in the ref guide


[feat] : create a new over all color theme for the web site.

As I was searching for a new issue today. I felt like there was not much context for the web page theme as the new light mode (#58) {with all due respect, great work!!!} lacked some contrast and made the site look dull. So I thought considering a new color scheme for the site from free tools like Coolors would be nice.
plus adding new designs for all buttons and divs according to new trends would also be great.

@nepalivai Seems good, I'm assigning the issue to you, Go Ahead.


Implementing examples

I need help implementing examples of the API client in the /example folder.
As I build the API client and write tests; it will be nice to have examples of logic that can be done with the crate.
Some examples off the top of my head:

A CLI app to create a transaction in your Paystack integration, the app can return the payment link generated, and you can also check the status of the transaction on the CLI using the transaction reference.
A CLI to give the number of transactions in your integration, it can further group the transactions based on status or any other criteria you like.

These are just examples, feel free to be creative with your examples. The goal is to show what can be built with the crate.
If you create an example, please name the file after your example, this will make it intuitive for other users. It will also be nice if you comment on the code.
This is a non-ending issue, so it is opened to as many contributors as possible.

I would like to work on this

Yeah please feel free to handle it;

I have been trying to create an example for split transaction but I keep on getting this error.
RequestNotSuccessful("400 Bad Request", "{\"status\":false,\"message\":\"Bearer subaccount must be part of split group\"}")

It seems that we have to create a split group first. Can you look into this?

Is the split group not what transaction splits create endpoint is doing

@kinglighthill I am not sure, I will give it a look and get back to you. I will update this issue thread.

Ok

Ok, thank you


Fix discord.js breaking due to nullish operator

Description
Bumps NodeJS version. This really only needs to be 14 but 16 should be fine

Still broken :/


[ALLUXIO-2308]Remove the unnecessary description of the isLeader method. Only the @returns clause is necessary.

https://alluxio.atlassian.net/browse/ALLUXIO-2308

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/12053/
Test PASSed.

LGTM


Bug - No longer can reload Livemarks

The feature that permits Livemarks to be reloaded from the context menu has disappeared.  There is simply no option any longer to reload or refresh the live bookmarks.  Running LiveMarks 3.6 and Firefox 120.0

This still works for me, I wonder if your bookmarks folder is no longer detected as Livemark for whatever reason.


Delete record not working

Describe the bug
Everything seems to work out of the box except for deleting resource.
It prompts with a confirmation dialog to delete, and then confirming doesn't do anything, not firing any network requests.
Installed libraries and their versions
"@adminjs/express": "^4.1.3",
"@adminjs/mongoose": "^2.0.3",
"adminjs": "^5.10.4",
"express": "^4.18.1",
"express-formidable": "^1.2.0",
"mongoose": "^6.2.2",
"normalize-mongoose": "^1.0.0",

To Reproduce
Steps to reproduce the behavior:

create resource
initialize adminjs
npm run start
create resource record through adminjs (works)
press delete button on the record
press confirm in the dialog
nothing happens 🤷♀

Expected behavior
record should be deleted (or at least make a network call)
Screenshots

AdminJSOptions with schema
import { Express } from "express"

import db from "./db"

const AdminJS = require("adminjs")
const AdminJSExpress = require("@adminjs/express")
const AdminJSMongoose = require("@adminjs/mongoose")
AdminJS.registerAdapter(AdminJSMongoose)

const adminJs = new AdminJS({
  // databases: [],
  rootPath: "/admin",
  resources: [db.User, db.Entry, db.Photo],
})
const router = AdminJSExpress.buildRouter(adminJs)

export default function registerAdmin(app: Express) {
  // this is the first thing being registered on the app, right after const app = express()
  app.use(adminJs.options.rootPath, router)
}

Desktop (please complete the following information if relevant):

OS: Mac Monterei M1 chip
Browser chrome 102

Additional context
Project seems awesome! I just need that delete button to work :)
Happy to submit a PR with some guidance, you guys ROCK 🚀

@goldylucks I tried to reproduce your issue but couldn't.
Can you either:
a) create an example repository where your problem appears?
b) clone https://github.com/dziraf/repro-delete-adminjs and make changes necessary to reproduce this
https://user-images.githubusercontent.com/16668924/174783969-f3e88a24-0b47-4b3d-8ce8-1448d78fbbca.mov

Closing because no response from original poster


Help menu

Related to #54, as that should probably be displayed in the same location. Perhaps the contribute page should be moved here too.

There should be a help menu that has documentation on how the site works, how to perform typical actions required to get up and glowficcing and continue glowficcing well. It should also include smaller bits of information, like the fact that tag emails will only be sent for the first reply in a batch, and probably also links to the forum and maybe guides to what glowfic is (see here and here and here) as well as perhaps the IRC and inspirations such as Effulgence (on dreamwidth?) plus maybe HollowArt.

Also this.

"How to use the Constellation" and "What is Glowfic" should be distinguished.

Some added in caf21cdcbc74c02edc6a55bdd271058cde787e7f.

Ongoing in the help doc. Here is the help doc.

There is also (as of 8880eee9976da17beda68446434694d6afea06b8) some of a help menu on the post editor.


Add Humidifier project (AWS Cloudformation using C#)

Misc/Humidifier - https://github.com/jakejscott/Humidifier
Humidifier allows you to build AWS CloudFormation templates programmatically. Stacks and resources are represented as C# objects with accessors for all their supported properties.
The code is automatically generated by parsing the official Cloudformation specification, and using the Roslyn compiler to generate the code!

Sorry, @jakejscott,
This entry isn't going to make the list for the following reason(s):

Possibly too new
Project is missing tests
No of response from the community suggested the previous statements were false
No of response from the community suggested the previous statement is false

Don't let this setback cause you to lose heart, and we look forward to your next contribution.
Thanks, Pleb


item_contentsize for PDF

Latest build has no item_contentsize for PDF. Word documents do have item_contentsize.
https://groups.google.com/forum/#!topic/crawl-anywhere/pH1WdolX7uo

Apparantly something in webserver changed. Can close this issue.


Export as named module

🚀 Feature request
Current Behavior
Currently, you have to use a namespace import to use Schema.
Desired Behavior
If I were to use this in a larger organization, being able to use a named import would make this easier for others to grok (and also easier to use with intellisense):
import { S } from "@effect/schema/Schema"

Both Effect and zod support this pattern currently.

(using current version 0.64.x)
import { Schema } from "@effect/schema"
// or
import { Schema as S } from "@effect/schema"


spotify dowload error msg

Traceback (most recent call last):
File "spotdl.py", line 3, in
from core import const
File "/home/peter/spotify-downloader/core/const.py", line 1, in
import logzero
ImportError: No module named 'logzero'

Follow the instructions on the Readme and install all the necessary dependencies.


Fix for reading "options" property from backend in manage dashboard

This PR fixes #
Fix for reading "options" property from backend when translating to show Cluster/DB properties on manage dashboard in ADS

Coverage increased (+0.06%) to 37.88% when pulling 621b953128e78a6cd35c36a927acaaa2caee2f8a on dashboard_property_options into 2b2c912135ae2ab668a0900728da6e4aefee7c23 on main.


fix(app): Use container from createViewer as mountpoint

:tada: This PR is included in version 2.6.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


what connection (if any) with parallelism & places?

The small amount of event programming I've done so far uses events to manage jobs being handled in parallel by multiple Racket places. The event-lang docs show examples of multi-threaded operation, though of course in Racket threads are not actually parallel. Is there a natural way of integrating place-based parallelism into event-lang, or is it more a matter of personal taste?

Thanks for the question!
Events are a general-purpose synchronous programming model for concurrency. Threads are just an easy source of self-contained examples because they provide concurrency. Events can be used for reactive programming, co-routines, and the kinds of things Python or Javascript does with async/await or that C does with select. I've used events as streams and in promises, lazy language constructs, actor models, multi-party messaging primitives, and generic message routing infrastructure.
 Wow. So let's look at channels first.
Channels can also be used as synchronizable events. They're unbuffered, which means either side of a channel-mediated exchange will block until both sides are ready. Place channels are buffered, so they behave more like an async-channel (or thread mailbox) than a channel because the sender usually doesn't block.
With threads and channels, the "thread pool" or worker-supervisor technique is straight forward:
#lang racket/base

(define num-workers 10)
(define num-orders  100)
(define num-batches (/ num-orders num-workers))

(define  in-ch (make-channel))
(define out-ch (make-channel))

(define (worker-thread)
  (define num (channel-get in-ch))
  (sleep (random))  ; for up to 1 full second
  (channel-put out-ch num)
  (worker-thread))

(define workers (build-list num-workers (λ _ (thread worker-thread))))

(for ([j num-batches])
  (for ([i num-workers]) (channel-put in-ch (+ i (* j num-workers))))
  (for ([_ num-workers]) (channel-get out-ch)))

First, the supervisor makes a pair of channels: in-ch and out-ch. Then, it spawns a few workers with the channels in scope. Each worker takes an order from in-ch, does some work, then puts its result into out-ch. The supervisor gets everything started by putting an order for each worker into in-ch. While the workers are working, the supervisor waits for results to arrive through out-ch and then handles them one at a time.
Each worker will be busy (sleeping) for up to 1 second and I'm running them in batches of 10, so I expect the run time to be around 10 seconds. Sure enough, the time to process all 100 orders with 10 workers is around 9 seconds on my computer.
Every thread comes with a thread mailbox, which is pretty much a built-in async-channel with a different API. If I use thread mailboxes instead of in-ch, I can lean on them to buffer orders instead of having to split them into batches myself.
#lang racket/base

(require racket/async-channel)

(define num-workers 10)
(define num-orders  100)

(define out-ch (make-channel))

(define (worker-thread)
  (define num (thread-receive))
  (sleep (random))  ; for up to 1 full second
  (channel-put out-ch num)
  (worker-thread))

(define workers
  (build-list num-workers (λ _ (thread worker-thread))))

(for ([i num-orders]
      [worker (apply append (build-list 10 (λ _ workers)))])
  (thread-send worker i))
(for ([_ num-orders]) (channel-get out-ch))

In the previous version, splitting the orders into 10 batches meant the whole thread pool had to be fully synchronized 10 times. This version takes around 7 seconds to process 100 orders on my computer with 10 threads. It never tries to synchronize the whole pool at once, but the way it assigns orders to workers is arbitrary. If I want everything to wait as little as possible, I can re-introduce in-ch as an async-channel and make out-ch an async-channel as well.
#lang racket/base

(require racket/async-channel)

(define num-workers 10)
(define num-orders  100)

(define  in-ch (make-async-channel))
(define out-ch (make-channel))

(define (worker-thread)
  (define num (async-channel-get in-ch))
  (sleep (random))  ; for up to 1 full second
  (channel-put out-ch num)
  (worker-thread))

(define workers (build-list num-workers (λ _ (thread worker-thread))))

(for ([i num-orders]) (async-channel-put in-ch i))
(for ([_ num-orders]) (channel-get out-ch))

From the first order to the last, the workers never have to wait to get orders or put results. This one takes around 6 seconds on my computer.
What does any of this have to with events?
If I replace sleep with alarm-evt inside worker-thread, Racket knows it can ignore the thread until the alarm-evt becomes ready for synchronization.
(define (worker-thread)
  (define num (async-channel-get in-ch))
  (sync (alarm-evt (+ (current-inexact-milliseconds) (random))))
  (async-channel-put out-ch num)
  (worker-thread))

With this version of worker-thread, my computer takes around 0.5 seconds to handle all 100 orders with 10 threads. Racket seems to get away with this sort of precise scheduling around events that either wait on other events or do heavy I/O.
How can Event-lang help?
Say I wanted to handle results in small batches. One way I could do it is with Event-lang's list-evt combinator.
#lang racket/base

(require event
         racket/async-channel)

(define num-workers 10)
(define num-orders  100)

(define  in-ch (make-async-channel))
(define out-ch (make-async-channel))

(define (worker-thread)
  (define num (async-channel-get in-ch))
  (sync (alarm-evt (+ (current-inexact-milliseconds) (random))))
  (async-channel-put out-ch num)
  (worker-thread))

(define workers (build-list num-workers (λ _ (thread worker-thread))))

(for ([i num-orders]) (async-channel-put in-ch i))

(define num-batches 10)
(define batch-size (/ num-orders num-batches))

(for ([_ num-batches])
  (writeln (sync (apply list-evt (build-list batch-size (λ _ out-ch))))))

This one still uses async-channels and alarm-evt to keep everything fast, but at the bottom it builds a list-evt with 10 copies of out-ch as its arguments. Each successful sync returns a list of 10 results instead of just one at a time. This version takes 0.75 seconds to handle 100 orders with 10 threads, but the extra 250 milliseconds is just the fixed cost of loading Algebraic Racket (which Event-lang uses internally).
And since I'm already loading Algebraic Racket, I might as well take advantage of it, too.
How can Algebraic Racket help?
Since every action in worker-thread involves actions with equivalent synchronizable events, I can use the event-monad and Algebraic Racket's do-notation to express worker-thread as a single event.
#lang algebraic/racket/base

(require algebraic/class/monad
         algebraic/data/event
         event
         racket/async-channel)

(instantiate event-monad)

(define num-workers 10)
(define num-orders  100)

(define  in-ch (make-async-channel))
(define out-ch (make-async-channel))

(define (worker-thread)
  (sync (do (num) <- in-ch
            (alarm-evt (+ (current-inexact-milliseconds) (random)))
            (async-channel-put-evt out-ch num)))
  (worker-thread))

(define workers (build-list num-workers (λ _ (thread worker-thread))))

(for ([i num-orders]) (async-channel-put in-ch i))

(define num-batches 10)
(define batch-size (/ num-orders num-batches))

(for ([_ num-batches])
  (sync (apply list-evt (build-list batch-size (λ _ out-ch)))))

Here, I've changed the top line to #lang algebraic/racket/base, imported Algebraic Racket's event-monad and do-notation, and instantiated the monad for the duration of the module. The worker-thread function body first synchronizes in-ch and binds the synchronization result to num. Then, it synchronizes the alarm-evt and discards its synchronization result. Finally, it puts num into out-ch. Not only is this version easier to read, but it's just as fast as the last one.
But what about place channels?!?
Most of what I've said about async-channels applies to places and place channels, with one wrinkle. Here's a places adaptation of the version with async-channels and sleep:
#lang racket/base

(require racket/place)

(provide main)

(define num-places 2)
(define num-workers 10)
(define num-orders 100)

(define (main)
  (define (make-workers-place)
    (place pch
      (define (worker-thread)
        (define num (place-channel-get pch))
        (sleep (random))
        (place-channel-put pch num)
        (worker-thread))
      (apply sync (build-list num-workers (λ _ (thread worker-thread))))))

  (define places (build-list num-places (λ _ (make-workers-place))))

  (for ([i num-orders])
    (if (even? i)
        (place-channel-put (car places) i)
        (place-channel-put (cadr places) i)))

  (for ([_ num-orders]) (apply sync places)))

The wrinkle is that I can't actually use async-channels anymore. They can't traverse place boundaries or place channels. Instead, the supervisor chooses an element of places for each order with a simple round-robin scheduler, and inside the places, workers get orders from the place channel pch.
This computer has 2 cores, so I start a place for each core. The places spawn 10 workers each, so that's 20 workers total. At 100 orders, this version takes around 4.5 seconds on my computer
. That's a full 1.5 seconds (35%) faster than its async-channels counterpart.
But can we do better? If I replace sleep with alarm-evt again, my computer takes around 1.45 seconds. That's a big improvement over the sleep version, but it's also a full second slower than the async-channels version with alarm-evt.
Here's a version with all the bells and whistles:
#lang algebraic/racket/base

(require algebraic/class/monad
         algebraic/data/event
         event
         racket/place)

(provide main)

(instantiate event-monad)

(define num-places 2)
(define num-workers 10)
(define num-orders 50000)

(define (main)
  (define (make-workers-place)
    (place ch
      (define (worker-thread)
        (sync (do (num) <- ch
                  (alarm-evt (+ (current-inexact-milliseconds) (random)))
                  (thread (λ () (place-channel-put ch num)))))
        (worker-thread))
      (apply sync (build-list num-workers (λ _ (thread worker-thread))))))

  (define places (build-list num-places (λ _ (make-workers-place))))

  (for ([i num-orders])
    (if (even? i)
        (place-channel-put (car places) i)
        (place-channel-put (cadr places) i)))

  (define num-batches 10)
  (define batch-size (/ num-orders num-batches))

  (for ([_ num-batches])
    (sync (apply list-evt (build-list batch-size (λ _ (apply choice-evt places)))))))

At 100 orders, the cost of starting two places and communicating through place channels outweighs the benefit. But at 50,000 orders, async-channels + alarm-evt + Event-lang + event-monad takes 31.5 seconds, while places + all the other stuff takes 28.5 seconds, so places are around 3 seconds (9.5%) faster under the heavier load.
In closing...
If your application relies heavily on interrupt-driven data sources like network sockets or user input devices, it migh perform better with judicious application of events. Event-lang provides combinators to make working with events and their synchronization results as simple as possible, and the event-monad provides a framework for composing events and event combinators.

Sorry, I realize I forgot to convert (random) from secon ds to milliseconds in the alarm-evt examples and am updating my response now.

Updated. This is the conclusion I was expecting.

Thanks for the detailed examples! I will study.


Tint object on hover

Find a consistent way of creating objects that tint on ray hover.

Solved by updating Interaction Manager reference


docs: 📚 add a form demo comprising of all available form elements

Story
As a maintainer of Synergy I want to make sure that all input elements work properly in a Form-Field context.
Acceptance criteria

[ ] Use all available input fields in all meaningful expressions
[ ] Form validation works
[ ] On success: show ok-alert
[ ] On fail: show nok-alert
[ ] Send submit data
[ ] Reset action with default values

blocks:
#142
#143
#209


feat: Create Tooltip component

Summary
This story creates a react component modeled after the USWDS Tooltip
Related Issues or PRs
https://github.com/trussworks/react-uswds/issues/342
How To Test
In storybook see Components > Tooltips
yarn test
yarn storybook

Screenshots (optional)

Warnings

:warning:
It looks like there are new component (JSX/TSX) files, but the entrypoint (index.ts) has not changed. - Did you forget to export new components from the library entrypoint?

  Generated by :no_entry_sign: dangerJS against 86ed9068759cc61d17123cf371f2570f91a9f9c5

I think the button element with the title attribute should be generated by this component, since the USWDS component follows a strict convention (must be a button element and tooltip body is populated with the value of the title attribute) instead of using props.children. This would mean usage would look more like: <Tooltip position="top" title="Top" /> and I think intrinsic props should be for the button element (since the wrapper span in USWDS is not customizable other than adding classes, so we could expose a wrapperClasses prop for that)

@suzubara I advised to follow a flexible approach here. While all the uswds examples are buttons, they make a specific mention of using it on more than just buttons in the docs:

I could definitely see people wanting to wrap a custom link in a tooltip, which I thought we might want to allow.

I think the button element with the title attribute should be generated by this component, since the USWDS component follows a strict convention (must be a button element and tooltip body is populated with the value of the title attribute) instead of using props.children. This would mean usage would look more like: <Tooltip position="top" title="Top" /> and I think intrinsic props should be for the button element (since the wrapper span in USWDS is not customizable other than adding classes, so we could expose a wrapperClasses prop for that)

@suzubara I advised to follow a flexible approach here. While all the uswds examples are buttons, they make a specific mention of using it on more than just buttons in the docs:

I could definitely see people wanting to wrap a custom link in a tooltip, which I thought we might want to allow.

Huh okay, I missed that!! What if we exposed a custom component prop (like we do for the Link component) in that case? I'm mostly trying to avoid the possibility of the title attribute not being the same value as the Tooltip label, and also not require the user to manually add the CSS classes to the child component

Anyone have experience testing tooltips in storybook? All I found was using this pseudo state Addon, but I don't know if it even works as advertised.

Huh okay, I missed that!! What if we exposed a custom component prop (like we do for the Link component) in that case? I'm mostly trying to avoid the possibility of the title attribute not being the same value as the Tooltip label, and also not require the user to manually add the CSS classes to the child component

With Link as an example to follow, that will work! I'm personally a bigger fan of the syntax of just wrapping an element with a tooltip (seems to be common in FE component libraries like material-ui), and the syntax is familiar to use. That may be because I don't think of a tooltip as a standalone component that should be responsible for creating anything internally, but rather something that exists as an enhancement to other components.
Internally we'll be doing React.cloneElement or React.createElement either way, right?. Both should allow us to set the 'usa-tooltip__trigger' class internally though. Is that the class you were talking about with the child component?

With Link as an example to follow, that will work! I'm personally a bigger fan of the syntax of just wrapping an element with a tooltip (seems to be common in FE component libraries like material-ui),, and the implementation syntax is familiar to use. That may be because I don't think of a tooltip as a standalone component that should be responsible for creating anything internally, but rather something that exists as an enhancement to other components.

Yeah I am not solidly on one side or the other here. if we were building a super generic & flexible Tooltip component I would definitely agree with you about using props.children and just wrapping, but that can sometimes introduce its own set of complexities. Since the USWDS Tooltip is very basic, and strictly just populates the Tooltip contents with plain text from the title attribute, I was focusing on the ideal implementation of just that.

Internally we'll be doing React.cloneElement or React.createElement either way, right?. Both should allow us to set the 'usa-tooltip__trigger' class internally though. Is that the class you were talking about with the child component?

Yup that's the class I meant, agreed.

awesome, I think this is a great first pass at the Tooltip! I will create a followup issue for refactoring some of the code to use more React and use less of the JS DOM API

gotcha, when you do please add me as a reviewer!


Sync Community Team to CODEOWNERS

This automated PR updates your CODEOWNERS file to mention all GitHub teams associated with Community Team roles.

@all-contributors please add @kgodey for projectManagement


Fix escaping some classes

Before this PR,
[ { name: 'class'
  , val: 'foo'
  , escaped: true
  }
, { name: 'class',
  , val: '"<str>"'
  , escaped: true
  }
]

was rendered as (assuming foo === '<foo>'):
' class="<foo> <str>"'

After this PR, the output will be
' class="<foo> <str>"'

Great spot


[TextInput] iOS Keyboard next/prev Buttons & tab Support

I have been unable to find throughout the documentation, UIExplorer, or my own experiments a way to enable iOS keyboard navigation and submit elements. I feel like this is important and expected from users to be able to navigate between input elements and submit from the iOS keyboard.
This behavior is present/expected even on vanilla HTML forms accessed via iOS on the web.
If somebody already has a solution for this, please let me know :smile:
Request

Activate iOS next/prev buttons on the TextInput and other user input elements
Enable grouping of input elements together as a "form"

Screen shot showing "next"/"prev" elements

Update :expressionless: should have updated before submitting, but updating react-native from 0.3.1 -> 0.3.4 resolved the returnKeyType issue.
Before update: returnKeyType property had no effect on the iOS keyboard.
Now: it does :smile:
          <TextInput
            // ...
            returnKeyType='go'
          />

How to focus on the second TextInput?
I have set the first TextInput with property returnKeyType="next"
and second TextInput with property returnKeyType="go"
But when I click the "next" button, it just hide the keyboard and unfocus the first TextInput
How can I focus on the second TextInput?
Thanks!

bump

Discussed with @vjeux and @auser in irc, this is indeed an issue and if anyone is up for tackling it a PR would be very welcome. Just post in here if you are getting started on it. Otherwise I may look at it later this week.

I would love to take a stab at it, but I'm not convinced I'm quite up to the task of a PR into react-native core :sweat_smile:
I'll be very interested to check out your work if you get a PR submitted @brentvatne :smile:

For single-line text fields, the onSubmitText handler (or similar) should suffice. What is missing from it to let you solve this use case?

The back/forward form navigation buttons are a iOS browser feature, not a native iOS app feature. These buttons will show up automatically if you display  an HTML form inside a WebView, but there is no API for displaying these buttons in native iOS apps, and any app that you have seen using them is either using a WebView, or has re-created the same feature natively using custom code (presumably for the purpose of making their native form behave more like a web form - a somewhat dubious UX decision IMHO).
It would certainly be possible to implement a facsimile of this feature right now as a native module, and if the demand is high enough then I expect someone will build it (maybe even us), but for the record, if I was developing a native iOS app and the designer asked for this, I would push back and suggest that they try to implement forms using native iOS app design patterns rather than iOS mobile web patterns.
You'll notice that the iOS Settings app never once uses this pattern, despite having pages and pages of form fields.
That said, we are currently investigating the best way to implement inputAccessory views (the docked bar that appears above the keyboard that can be used for adding additional application-specific controls), and once that is in place, it should be relatively simple to implement this feature in JS code.

Can the "return" key move to next text input field? Looking around the documentation, it seems like we can display the "return" key as a "next", but it won't actually move to the next input field -- it'll just dismiss the keyboard. At least, that's what I've
As @nicklockwood says, back/forward form navigation buttons aren't a native iOS app feature. Moving to the next field is, though. It'd probably be more important to implement that.

@dvdhsu unlike web forms, iOS has no natural concept of tabbing order, or the "next field", so we cannot easily replicate that automatically. If you register an event handler for onSubmitEditing, it should fire when the return key is pressed, and you can then call focus() on the next field in the form.

@dvdhsu I've not actually tried building a form like this in practice, so if you find that it doesn't work, or if you have some ideas for how to make it simpler to implement, I'd be keen to hear them.

@nicklockwood - thank you the detailed response, your expertise is much appreciated.
@ide - you're right, that will work just fine for the most part. If you have a username and password field, you can just focus the password in the onSubmitEditing callback, easy. If you have several inputs, it seems preferable to have a more generalized "focusNextField(currentField)" function so that you don't have to hardcode the order of fields. This becomes a bit awkward because the event target is a node id number that refers to the node. So you have to set a ref on all of the inputs, then search through the refs until you find the one with the matching id, and then use the TextInput following that. Tabbing through inputs seems like a common enough use case that it would be worth simplifying a bit, can't say I have a good API in mind at the moment though.

@dvdhsu - there are a good number of cases where you might want the Next button to do something other than go to the next text field. For example you might want to transition to the next screen, or focus the next text field that doesn't yet have valid input (ex: if the user filled them out out-of-order).
For the use case you mentioned: if I understand it correctly, to move to the next field you could get refs to all of the text fields and then call this.refs[desiredTextField].focus(). This is pretty lightweight and opens the opportunity for custom logic like skipping over certain fields, etc.

@ide - yep, that's the use case I was referring to. Your solution is fine, but like @brentvatne notes, it'd be better to have some sort of function s.t. we didn't need to hardcode it in for longer forms.
Also -- onSubmitEditing forces the keyboard to "jump" when moving between fields, since the keyboard is being dismissed and brought up again on every "submit".
If I have time over the next week, I'll have a think about this, and implement something.
Thanks!

@dvdhsu Having the keyboard dismissed automatically onSubmitEditing is probably a bug - it doesn't match the native iOS behaviour.
I think it would make sense if we kept this as default behavior if onSubmitEditing isn't set (to avoid breaking existing code), but if onSubmitEditing is set then we disable it and leave it up to the JS to dismiss the keyboard.

Now that I think about it, we could probably implement select-next field automatically as well by making the following changes:

If the field's returnKey type is set to "next", the default behaviour of onSubmitEditing will be to focus() on the next field inside the parent. We can also support tabbing with the actual tab key for external keyboards.
Next field would be determined by the order of textfields inside their parent view. It could then be manually overridden either by adding a tabindex property to TextField (which matches the web convention) or with an explicit nextField attribute (although then we'd have to decide if that should be a ref or a reactID)

@vjeux would you be in favour of something like this? And if so, @ide, @dvdhsu, do you feel like creating a pull request to implement some or all of the above? (I'll be happy to finish the job if you can at least make a start with it)

@nicklockwood - that sounds fantastic to me

@nicklockwood that works with me.

@nicklockwood late to the party here - but that sounds like a happy balance. Any ETA on this?

@admmasters - @auser mentioned in irc that he was interested in doing this. @auser - is that still the case? If you're too busy I can have a look at it soon

@brentvatne Yes, I hope to get to it this weekend.
I've had a bit of personal junk going on lately. I'll check in with you on irc.

+1 any update on this?

I don't think that it's a good idea to implement this in an "automatic" way.
It will probably prevent developers of having non linear behavior. For instance, you can focus an empty mandatory field when the user press "next" at the last field.
Furthermore, the "next" label is just a label. Technically, you can put whatever you want, it should not influence the button's behavior.
I think that we just have two problems here:

Firstly, the next button should not hide the keyboard. The normal behavior in the Apple SDK is that: as long as an input is focused, the keyboard is visible. To hide the keyboard, the input has to release the focus in his Primary Action Triggered (onSubmitEditing in react-native). If the focus jumps from an input to another, the keyboard doesn't move but his type can change.
Secondly, we should have a simpler way to focus another input from the onSubmitEditing. I have to admit that I'm not a react-native expert (neither react) but I tried to set the focus of the next element and I didn't find any other solution that to refer the next TextInput element instance in a global variable. I didn't find any way to focus the next input using the ReactElement instance.

I've implemented a blurOnSubmit prop for TextInput that I think solves this problem. PR here: https://github.com/facebook/react-native/pull/2149
Basically, it allows for backward compatibility by defaulting to true, however, the main idea goes with the normal iOS convention that the keyboard should technically stay there even on submit. One day the default value of true could be deprecated.
In the case of switching to different fields...the user would set blurOnSubmit to false (currently) and the keyboard would not dismiss. However, the onSubmitEditing callback would still fire and they would be able to programmatically do what @ide described earlier, by simply calling focus() on the ref of their choice. No keyboard "jumping" to deal with. :)
It's not an automated way to manage all of this as way mentioned above, but it's a simple solution that works.

Thank you for reporting this issue and appreciate your patience. We've  notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

+1 Major bug. Thanks for looking into this.

Great work @dsibiski - would love to see #2149 get merged, the keyboard flashing has been bothering me a lot.
Side note: is it possible to use this as a module that I can import before a fix gets merged? Would love to publish my app soon and I have no idea how long it'll take to get merged.

Thanks @mfkp, the only way to use it in your app would be to use my fork instead of the official React Native. Although that's risky as we don't know if they will merge my PR at all. Plus, my fork isnt always kept up to date with the latest commits. If your need outweighs the risk then it might be worth it for you.
There really isn't a way to make this a 3rd party module either because the TextField and keyboard interactions are a core part of RN. Not something that you can really "override" or "wrap" afaik.

Thanks for the quick reply @dsibiski. Guess I'll just stick with the jumpy keyboard for now, although it also has the unintended side-effect of making my ScrollView scroll position wrong as well (I am centering the scroll view on the focused TextInput, but when the keyboard hides, the coordinates are calculated with the keyboard hidden and a larger view).
Maybe I'll have to add a setTimeout and hope for the best :smile:

Typically in iOS you would observe something like textFieldShouldReturn, and dismiss your keyboard there. onSubmitEditing feels to me like just a different name for this function (which doesn't exist in UITextView afaik, which fits the current multi-line condition). It's never been an automatic behavior, so this feels like a real bug. For now, I guess I'll try to move to observing onChangeText for \n.
:+1: I'm in favor of @dsibiski's fix, as it seems to be a solid compromise.

cc @boourns

:+1: for @dsibiski's fix

A quick fix you can do in the react-native libraries for iOS is:
Add this to RCTTextFieldManager.m
- (BOOL)textFieldShouldReturn:(RCTTextField *)textField
{
  [textField textFieldSubmitEditing];
  return NO;
}

Add this to RCTTextField.h
- (void)textFieldSubmitEditing;

With this in place you'll need to manually blur text inputs.

I see onSubmitEditing fired for every TextInput on the screen at render time.
I think it should fire when you tap the "next/done" button on the virtual keyboard, no?

My PR got merged for blurOnSubmit so this can perhaps be closed out if it is viewed as a solution to the problem. https://github.com/facebook/react-native/commit/7af752403eb58a1ca8081040f8010a4d28ee764e#diff-838a2a1d334bb98a3e409275cc26effb

@dsibiski I think blurOnSubmit is more of a workaround. I'd still like to pursue the solution I suggested above at some point.

@nicklockwood Makes sense. What you explain above is better for this particular use-case.

@nicklockwood Agreed. blurOnSubmit is great because there's at least now a way. But we should keep this task open.

+1 would love to see progress on the original issue raised here--I would love to see a built-in "next" feature for TextInput, as well as support for tabs for hardware keyboards

+1, any news or workaround ways, guys? how did you solve it in your projects?

This works reasonably well as a workaround: http://stackoverflow.com/questions/32748718/react-native-how-to-select-the-next-textinput-after-pressing-the-next-keyboar
With this system, if using an attached keyboard, hitting enter works, but hitting tab doesn't

I think this is a very important issue because it's a common requirement -- pretty much every app has forms and it sucks that everyone needs to come up with a one-off solution for how to handle this. We need tabindex. This is a significant undertaking, we should look at building it on a separate project and if it becomes mature enough then maybe integrating it back into core.

I am using react native with clojurescript and reagent.
I just had a really hard time implementing this to focus the next text input after submit the previous one.
I would not like to have an automatic behaviour for this.
What I am missing is a simple "focus" property. If a value is set for this property this text input field should have focus as long as this property is true and should not have focus when the property is false.
In this way I can easily just save in my state object which field has the focus.
On submit I would just update my state with the information that the current input should not have focus but the next one should have the focus.

@Knotschi see http://stackoverflow.com/a/35070812/2397068 for one implementation of this

yeah, I saw this and just added an answer for reagent. I still think there should be a focus prop in react native

@Knotschi - what would you expect the framework to do if two or more TextInputs have focus set to true at the same time?

@brentvatne would it be possible for the focus prop's true value to work similarly to StatusBar?
(The most recently mounted TextInput w/ focus === true becomes focused.)

Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/textinput-ios-keyboard-nextprev-buttons-tab-support
ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub. GitHub issues have voting too, nevertheless
Product Pains has been very useful in highlighting the top bugs and feature requests:
https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

This worked fine for me.  Tab from UN to Password, then to login by just swallowing the tabs.  Not the finest solution but it will work for someone :)
  handleChangeEmail = (text) => {
    // capture tabs
    if (text.match(/.+\t/)) {
      this.refs.password.focus()
    } else {
      this.setState({ email: text })
    }
  }

  handleChangePassword = (text) => {
    // capture tabs
    if (text.match(/.+\t/)) {
      this.handleLogin()
    } else {
      this.setState({ password: text })
    }
  }

@lrettig that solution was perfect - thanks!

So I'm trying to shift focus from my username field to my password field and refs are deprecated while everything else doesn't seem to work in the most recent version of RN, any updates on this?

@danstepanov same here... :(

I don't see any way to capture physical keyboard tab keys. They don't trigger a onChangeText so I can't sniff for them. On 39.02.

Any update on this?

Bump.

If anyone has an interest, take a look at https://github.com/douglasjunior/react-native-keyboard-manager

@danstepanov if you want to move on enter to the next fields, check this out: https://github.com/zackify/react-native-autofocus

@douglasjunior's answer helped me. Thank you, Douglas

How is this discussion dead? Seems like a necessary tool to have a sort of tabindex for fields. Without it and with multiple TextInput within a component visually has a keyboard on iOS feels non-native.


Version 15

Please provide enough information so that others can review your pull request:

Explain the details for making this change. What existing problem does the pull request solve?

Screenshots/GIFs

jhihihi


Visual Studio can't suggest my prop types

Is this a bug report?
Yes

Did you try recovering your dependencies?

Yes
Which terms did you search for in User Guide?

Props, PropTypes, VS Code
Environment

VS Code: 1.33.1
System:
    OS: Windows 10 - 10.0.17763.437
    CPU: (4) x64 Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
  Binaries:
    Node: 10.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.17763.1.0
    Internet Explorer: 11.0.17763.1
    I have Chrome and Firefox too
  npmPackages:
    react: ^16.8.6 => 16.8.6
    react-dom: ^16.8.6 => 16.8.6
    react-scripts: 3.0.0 => 3.0.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce
jsconfig.json places in my global folder (not in src):
{
  "compilerOptions": {
    "jsx": "react",
    "baseUrl": "."
  }
}

I installed React PropTypes Intellisense extension into VS Code

Write propTypes
In your component, type this.props. and hit [Ctrl] + [Space] to show suggestions

Expected Behavior

My PropTypes should be in suggestion window
Actual Behavior

It's also didn't work outside of component - I only have ref, children and key suggestions from React
Reproducible Demo

Not needed - it's default CRA setup 3.0.0

I'm practically sure only static props can be set for defaultProps and a babel configuration.
https://reactjs.org/docs/typechecking-with-proptypes.html
Try this instead:
class Greeting extends React.Component {
  render() {
    return (

Hello, {this.props.name}

    );
  }
}

// Specifies the default values for props:
Greeting.defaultProps = {
  name: PropTypes.string
};

@semoal Thanks for your answer. It's a typo in your quick-code - should be Greeting.propTypes = {
Anyway. Changing static propTypes into ColumnChart.propTypes and this same for defaultProps (and of course moving it outside class) didn't work - both for this same class file suggestions and suggestions in other components that are calling my <ColumnChart someOfMyProp=... />

a

a

I've read these topics and tried this extensions... but nothing. I just want intellisense for the defined propTypes when the component is used from other components.

https://marketplace.visualstudio.com/items?itemName=OfHumanBondage.react-proptypes-intellisense
https://marketplace.visualstudio.com/items?itemName=cuneyt-aliustaoglu.vscode-react-proptypes-intellisense
https://stackoverflow.com/questions/49703015/exposing-react-component-proptypes
https://stackoverflow.com/questions/35950385/react-intellisense-in-visual-studio-code
https://github.com/Microsoft/vscode/issues/24926#issuecomment-294992766

This one works --> https://marketplace.visualstudio.com/items?itemName=cuneyt-aliustaoglu.vscode-react-proptypes-intellisense
But after creating the Component.propTypes you have to call this one from command platte. cmd+shift+p and search for proptype intellisense and hit enter. It will automatically create augments for the given proptypes ;)

Removing stale**

u

I suggest filing an issue with the plugin, I don't there is anything we can do from our side here.


changes made from the theia lab enviroment

Here is all the changes that was required for this task

All the changes have been done


Feature request : add a way to translate labels

Hi,
First of all, thanks for this tool!
As I am using your widgets for a non-english web site, would it be possible to add a way to translate labels like "Read more" "Read less" and relative time display like "1month ago"
An easy way would be to provide the labels and for the date to provide a custom "getRelativeDate()" method ?
Thanks !
Eric

Hey Eric,
Thanks for the suggestion! I've added some basic props for overriding the labels and date formatting.
You can now use these props on the ReactGoogleReviews component on the latest release<EMAIL_ADDRESS>
badgeLabel?: string
badgeSubheadingFormatter?: (totalReviewCount: number) => string
readMoreLabel?: string
readLessLabel?: string
getRelativeDate?: (date: Date) => string
getAbsoluteDate?: (date: Date) => string
loadingMessage?: React.ReactNode
errorMessage?: React.ReactNode

The README has documentation on these props now too. If there's any props that I missed, please feel free to let me know. Thanks for the suggestion!

Hey Ryan,
Thanks a lot for providing a version as fast as that !
readLessLabel and readMoreLabel works well but, I cannot manage to have either getRelativeDate or getAbsoluteDate  working.
Here is my test code :
<ReactGoogleReviews layout="carousel"
                                    reviews={reviews}
                                    getRelativeDate={(date)=>{return "TEST"}}
                                    readMoreLabel={"Voir plus"}
                                    readLessLabel={"Voir moins"} />

Thanks !

Ah thanks for pointing this out. I've fixed the issue and getRelativeDate and getAbsoluteDate should be working correclty now on<EMAIL_ADDRESS>Thanks!

Hi Ryan,
I works now.
Thanks a lot!


Fehler bei Gebäuden

Hi zusammen,
ich habe ein Gebäude aus der Schleife gelöscht und bekommen nun folgenden Fehler:
Message: DateTime::setTimestamp() expects parameter 1 to be integer, float given
File: /includes/GeneralFunctions.php
Line: 143
URL: https://www.domain.de/game.php?page=buildings
PHP-Version: 7.0.16-1~dotdeb+8.1
PHP-API: cgi-fcgi
2Moons Version: 1.8.git
Debug Backtrace:
#0 [internal function]: errorHandler(2, 'DateTime::setTi...', 'FILEPATH ...', 143, Array)
#1 /includes/GeneralFunctions.php(143): DateTime->setTimestamp(6.2544273027261E+173)
#2 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 6.2544273027261E+173, 'Europe/Berlin')
#3 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
#4 /game.php(57): ShowBuildingsPage->show()
#5 {main}

Can we have the code of that line ?
File: /includes/GeneralFunctions.php
Line: 143

Why is setTimestamp() trying to set a time stamp of "6.2544273027261E+173"? that number is not a valid unix timestamp that function uses.
its starting from this line ShowBuildingsPage.class.php and thats called from line 272 in the same file as you can see in the backtrace and this line in GeneralFunctions.php does not like the invalid timestamp
a valid time stamp would be "1504016378"

Good Question, source isn't modified. I only deleted a running building process in the gui.
Nothing in DB nor source changed.

I got the same problem.
Message: DateTime::setTimestamp() expects parameter 1 to be integer, float given
File: /includes/GeneralFunctions.php
Line: 143
URL: https://www.lugon.de/space/uni2/game.php?page=buildings
PHP-Version: 7.1.11-1+0~20171027135525.10+stretch~1.gbp2e638d
PHP-API: cgi-fcgi
2Moons Version: 1.8.git
Debug Backtrace:
#0 [internal function]: errorHandler(2, 'DateTime::setTi...', 'FILEPATH ...', 143, Array)
#1 /includes/GeneralFunctions.php(143): DateTime->setTimestamp(5.1721724504224E+53)
#2 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 5.1721724504224E+53, 'Europe/London')
#3 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
#4 /game.php(57): ShowBuildingsPage->show()
#5 {main}

@Lugon89 How to reproduce?

Just delete an building out the build queue ;)

Okay. I do follow steps:

Build metalmine 1

build crystalmine 1

delete metalmine 1

or -

delete crystalmine1

work fine without the error.
Its unable to reproduce for me. With you steps.


Add Finnish translations (first set after master rebase)

References
Add references/links to any related tickets or PRs. These may include:

Link to Angular issue or PR related to this PR, if any
Link to JIRA ticket(s), if any

Description
This includes Finnish translations after rebasing our fork from dspace master. There remains some keys to be translated.
Instructions for Reviewers
Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers.
List of changes in this PR:

First, ...
Second, ...

Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

[ ] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
[ ] My PR passes TSLint validation using yarn run lint
[ ] My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
[ ] My PR passes all specs/tests and includes new/updated specs for any bug fixes, improvements or new features. A few reminders about what constitutes good tests:

Include tests for different user types (if behavior differs), including: (1) Anonymous user, (2) Logged in user (non-admin), and (3) Administrator.
Include tests for error scenarios, e.g. when errors/warnings should appear (or buttons should be disabled).
For bug fixes, include a test that reproduces the bug and proves it is fixed. For clarity, it may be useful to provide the test in a separate commit from the bug fix.

[ ] If my PR includes new, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

@artlowel confirmed that the issue with broken tests from earlier this week was addressed and that pull requests again can be merged.
Merging! Thanks again @reetagithub for your contribution and hope you can continue the contribution as more keys are still being added into the catalogs.


Fix type annotation for type arg

fixes #2062

Checklist:

[x] Add an entry in CHANGES.rst summarizing the change and linking to the issue.
[x] Run pre-commit hooks and fix any issues.
[ ]  Run pytest and tox, no tests failed.

True don't know how i can fix typing error. May be # type:ignore or no?


Document the supported AWS regions.

Currently the only AWS Regions that are supported are

af-south-1
ap-southeast-2
eu-west-1
eu-west-2
us-east-1
us-east-2
us-west-1
us-west-2

It is because our S3 buckets which hold the lamda function are only available in those AWS regions currently.  Reference:  the senzing-public-XX-YYYY-N buckets seen at https://s3.console.aws.amazon.com/s3/home
In our AWS Marketplace documentation, we should list the supported regions and have a "Contact Us" button for a customer to request another AWS region.

Note that the name of the S3 Bucket matters because the way it is access is programmatically in this manner:
https://github.com/Senzing/aws-cloudformation-ecs-poc-simple/blob/e33cccaa295d5ca4a0eae645687d2b933e4867f0/cloudformation.yaml#L2061

The README should point to https://github.com/Senzing/knowledge-base/blob/main/lists/aws-supported-regions.md

Pull requests:

https://github.com/Senzing/aws-marketplace-evaluation/pull/102