how to reload a route?

How do i tell react-router to reload current route?

The Router has a refresh method. It might be what you need

That's 0.13 API, @andrefarzat.
Can you be more specific about what you need, @pdeva? For example, when you say "reload current route" do you want all onEnter hooks to fire? Or do you just want to re-render?
The easiest way to reload the entire page is to just window.location.reload().

I want the components to re-initialize.
That way they can re-fetch their data that they do on init.
calling window.location.reload() will cause all the scripts to load again,
producing a much larger delay than just refetching all the component's data
On Sunday, September 20, 2015, Michael Jackson<EMAIL_ADDRESS>wrote:

That's 0.13 API, @andrefarzat https://github.com/andrefarzat.
Can you be more specific about what you need, @pdeva
https://github.com/pdeva? For example, when you say "reload current
route" do you want all onEnter hooks to fire? Or do you just want to
re-render?
The easiest way to reload the entire page is to just
window.location.reload().
—
Reply to this email directly or view it on GitHub
https://github.com/rackt/react-router/issues/1982#issuecomment-141786267
.

--
Prashant

I want the components to re-initialize. That way they can re-fetch their data that they do on init.

This sounds like your responsibility, not ours. We don't prescribe a way for you to load your data.

@mjackson Managing state changes can be quite complex sometimes and we just want to reload the whole page. But window.location.reload is bad solution for SPA, router could handle that easily. For example ui-router (most popular router for angular) has this feature. From ui-router docs: "reload -  If true will force transition even if the state or params have not changed, aka a reload of the same state."
For now I use workaround to make 2 history.pushState one after another.
// I just wanted to reload a /messages page
history.pushState(null, '/');
history.pushState(null, '/messages');

You probably want to just respond to prop changes with componentDidUpdate to refetch data when the same route is active but with different parameters

Or, if you really want to refresh data at the same location, you should have a different mechanism than the router. For example, you might do this.fetch inside of comopnentDidMount, which sets state with data. Just call this.fetch again.

I can't think of a use-case where you really want the router to "refresh" at that location.

You probably want to just respond to prop changes with componentDidUpdate to refetch data when the same route is active but with different parameters

Or, if you really want to refresh data at the same location, you should have a different mechanism than the router. For example, you might do this.fetch inside of comopnentDidMount, which sets state with data. Just call this.fetch again.

I can't think of a use-case where you really want the router to "refresh" at that location.

@ryanflorence Sorry Ryan but you're doing wrong assertions about page I want to reload. It's not even React. Of course it's possible to fetch data again programmatically but that's not easy. There are complex situations where it's much easier to simply render the whole page again and let it fetch it's data.
I gave you example of same functionality exist in angular routers (ui-router, ng-route). And I see I'm not the first one who is asking about reload. #2097 #2038 #2243 #1982

Is that's actually possible to implement in react-router? As I understand I need native dom to re-render, even when virtual dom isn't changed.

Sure it's possible, but our policy is to not answer "how do I do X with React" questions on our issue tracker – please try Stack Overflow or Reactiflux.

If we implemented a "refresh" feature there's nothing we could do except call this.forceUpdate() in Router. So you can just do it yourself.
const Root = React.createClass({
  childContextTypes: {
    refresh: React.PropTypes.func
  },

  getChildContext() {
    return {
      refresh: () => this.forceUpdate()
    }
  },

  render() {
    return <Router .../>
  }
})

// then in any component
contextTypes: {
  refresh: React.PropTypes.func
}

// and then
this.context.refresh()

Note that the lifecycle hooks that are going to be called probably won't trigger your data to reload anyway. Angular blows everything away and reinitializes all of it. React will do a virtual DOM diff. None of your willMount, didMount etc. hooks will be called. But you'll get "already mounted" hooks like componentWillReceiveProps and componentDidUpdate.
There could be 2,000 people asking for this feature to try to reload their data, but React (not React Router) just doesn't work that way.

@taion I meant if that's possible to implement in react-router library, not how can I do that in React.
@ryanflorence thanks for clarification. Now I understand that React simply won't trigger native dom re-render even on forceUpdate() call, because virtual dom isn't changed in my case.

We have set an onClick in every Link that we want to refresh. We check if the to="/???" === the current route, and if so, we just trigger the actions (Redux) we need for each case. It works but it is a bit cumbersome and we are not happy with the solution at all, so we'd be glad to hear if someone came up with a better and more universal solution. In this case, we have to make sure we do the checks for each and every single Link, which is tedious.

@mezod  I can completely relate to everything you just mentioned.

@mezod I can completely relate to everything you just mentioned too.
Because of exact explanation of requested feature - could be this issue re-opened?

It might not classify as an issue. probably a feature that would be awesome to have.

I can't think of a use-case where you really want the router to "refresh" at that location.

When you have onEnter hooks and don't want to duplicate business logic, for example.

+1 Need to reload active Route after interface lang was changed..

I also need this feature to ensure that when a user logs out, if they are on a page they shouldn't see, they get redirected to the login page. So, I need the onEnter to be evaluated again.
export default (store) => {
  const requireLogin = (nextState, replace, cb) => {
    const { auth: { user } } = store.getState();
    if (!user) {
      // oops, not logged in, so can't be here!
      replace('/login?returnUrl=' +
        encodeURIComponent(nextState.location.pathname + nextState.location.search));
    }
    cb();
  };
  return (
    <Route path="/" component={App}>
      { /* Home (main) route */ }
      <IndexRoute component={Home} />

      { /* Routes */ }
      <Route path="about" component={About} />
      <Route path="contact" component={Contact} />
      <Route path="register" components={Register} />
      <Route path="login" components={Login} />
      <Route path="forgotpassword" components={ForgotPassword} />
      <Route path="resetpassword" components={ResetPassword} />
      <Route path="confirmemail" components={ConfirmEmail} />

      <Route path="manage" component={Manage} onEnter={requireLogin}>
        <IndexRoute component={ManageIndex} />
        <Route path="changepassword" component={ManageChangePassword} />
        <Route path="logins" component={ManageLogins} />
      </Route>

      { /* Catch all route */ }
      <Route path="*" component={NotFound} status={404} />
    </Route>
  );
};

<Link to={{pathname: this.myCurrentPath(), query: {'newState': 'something'}}}>

When clicking this link, the router doesn't call onEnter for the current route again. In my humble opinion this is an potential issue with how react-router is built, and here's why:

in pure HTML if you click on a link pointing to the current page, the current page gets reloaded
with react-router it looks like a decision was made to not reload the current page, maybe for performance reasons or otherwise. This to me makes sense in some cases, don't get me wrong. But forcing all links to the current page to not reload the current Route and therefore not call onEnter makes it unnecessarily harder to reload the current route.

There are a number of ways to get around this issue, but it seems like this behaviour should be supported by the react router

Use onChange

I guess I was missing something, I feel so silly now, I should've used onChange. Thanks @taion!

It's new as of 2.1.0.

@taion So I was missing something! Thanks @taion! I'll use this.

So the function definition for onChange was different and I was using the previousState instead of the nextState. It works now.
@taion :boom:

@Kosmin can you post an example of how you reload component in onChange hook?

@pdeva  what I did was just provide a unique key on the parent element of the component and it will refresh the data everytime. Hope this helps.
example:
render() {  return
anything here
; }

@nvartolomei sorry I'm late with the reply, but here it is:
function initBulkPageData(currentState) {
  // My action creators will pick up the query from here. I'm putting this on the window, because otherwise things'll get really messy really fast.
  window.currentQuery = Qs.parse(currentState.location.query) || {};

  // store the current search params for concatenating new searches, e.g. if you have pagination on a filtered search, you'll still want to keep the filters when going to a new page
  store.dispatch(dispatch => dispatch(updateSearchParams(window.currentQuery)));

  // this actually reloads all elements via a JSON request
  store.dispatch(dispatch => dispatch(fetchSelectedRows(window.currentPathname, window.currentQuery)));
}

<Provider store={store}>
      <Router history={history}>
        <Route
          path="/cards"
          component={CardsLayout}
          onEnter={initPageData}
          onChange={loadPageData}
        />
     </Router>
</Provider

@Kosmin how would you do this without redux? namely, without being able to dispatch a global action? i just need my component to be remounted for my componentDidMount hook to fire

I'm not sure I understand the question: you want to load server-side data without using redux ? Why not just use the componentWillReceiveProps function on your component ? That should fire whenever a route is changed...

ah, nevermind i had a separate issue! thanks though :D

You guys can use unmountComponentAtNode
ReactDOM.unmountComponentAtNode(node)

I have a use case for this feature. Currently when I hot reload a module in the browser I change the data that getComponent method of a route depends on to return the relevant component. But after changing the data I need to either 1) make react-router somehow call getComponent again and renders newly generated component or 2) somehow simply reload the page (but ofc without window.location.reload as it wouldn't be hot reload then.).
Currently I'm doing this with a dirty hack that I don't like and is a bit time consuming:
    const location = this.context.store.getState().get('routing').get('locationBeforeTransitions').toJS();
    this.props.dispatch(push('/'));
    this.props.dispatch(push(location));

I should add that as you know neither forceUpdate nor refetching data manually nor other solutions noted above work in this situation as none of these makes react-router to call getComponent on that route.

This sounds like your responsibility, not ours.

The responsibility of users is to fetch its own data.
The responsibility of react-router is the rendering of routes, but also providing a solution when a user needs a route to be rendered from scratch without implementing tedious and ugly hacks.

There could be 2,000 people asking for this feature to try to reload their data, but React (not React Router) just doesn't work that way.

I think if 2,000 people (which is a major number considering the size of whole community.) ask for something, react, react-router or whatever it is should change itself to satisfy their needs too.
Meanwhile I solved the problem for myself and I described my solution here: https://github.com/reactjs/react-router/issues/3770#issuecomment-243493806

It only takes one PR to implement a feature.

Come on @taion , the problem is not the pr. Honestly I'd stop my work and spend 3 working days if required to solve this and provide a pr if I was sure core developers accept it.

This sounds like your responsibility, not ours.

Core developers think it's not react-router's responsibility and they think even if 2000 people ask for it "it's not the way react works." no matter how many people need it and no matter how much trouble it introduces for them, we just don't care period, new line.
No one expects core developers of a repository on github to spend their time implementing features community needs. Everyone is thankful for every second a developer works on an open source project even if he's paid for it. But on the other side no one likes being ignored or being told he should change the requirements of his project to make it compatible to the library or he should just do things the way core developers like following their paradigms. Closing issues without explanation or explanations like "it's just not how it works" or "It's not our responsibility" is just like ignoring people's problems.

It only takes one PR to implement a feature

And a repo owner to accept the PR.

But on the other side no one likes being ignored or being told he should change the requirements of his project to make it compatible to the library or he should just do things the way core developers like following their paradigms. Closing issues without explanation or explanations like "it's just not how it works" or "It's not our responsibility" is just like ignoring people's problems.

Indeed.
react-router is one of the reasons we are ditching React for Vue. We are tired of having to implement convoluted solutions for stuff that should be really simple or having to deal with the Soviet Politburo.

seriously ReactDOM.unmountComponentAtNode(node) works, why do you guys need more?

OK, just to clarify some things here before this totally gets out of hand: This already exists in React.  You can call this.forceUpdate() to achieve the same results. It doesn't makes sense for the Router to try and duplicate a function of the underlying framework.
Also, our behavior of not re-creating an element if the URL params change is related here. That is founded in basic React behavior: If the render function of a component provides the same set of elements back but with different props, this will not create a new component, but will call componentWillRecieveProps on the existing instance instead. This is all idiomatic React behavior.
To change or wrap this behavior in the library doesn't really make sense. It's built-in. No PR is needed here :smile:

seriously ReactDOM.unmountComponentAtNode(node) works, why do you guys need more?

Doesn't work server-side, which is why forceUpdate() would be better.

You can call this.forceUpdate() to achieve the same results. It doesn't makes sense for the Router to try and duplicate a function of the underlying framework.

What if you want to refresh from outside the component?

The easiest way to rerun the route matching and "reload" the route/page is to just call:
router.replace(location);

Pull the router and/or location from context or a route component as appropriate.
You can alternatively unmount and remount the <Router> instance, I think replacing the current history location is the easiest way to do this.

I think replacing the current history location is the easiest way to do this.

Could you please let me know how? A code sample or a reference in docs would help.

Pull the router and/or location from context or a route component as appropriate.

Again, how do you do that outside of a component without context, withRouter(), or the <Route>?

Again, how do you do that outside of a component without context, withRouter(), or the ?

I guess "You can alternatively unmount and remount the  instance, I think replacing the current history location is the easiest way to do this." is the solution but I don't know how we can do this.

I guess "You can alternatively unmount and remount the instance, I think replacing the current history location is the easiest way to do this." is the solution but I don't know how we can do this.

If that is the "best" solution it's clear why react-router needs a method to refresh the current route.

Outside the router component is history.replace(location).
Note that forceUpdate actually won't work.

Outside the router component is history.replace(location).

history as in window.history?

No, as in the history object you pass into the router.
More broadly, the router itself is, in this context, just a React component. If you want to fully re-render it, then just do so! Change the key, unmount-then-remount, whatever.
What you seem to be asking for is a way to re-run the route matching, which is just replacing with the current location using the router context object or history object, but otherwise, as a React component, React already gives you ways to remount it, and it's bad API design to have a separate API for something where the upstream already offers an API.

No, as in the history object you pass into the router.

So if the code that needs to refresh the router is outside of a component, say in MyClass, we need to pass a reference of that history object to MyClass, listen to history changes to be able to get the latest location, and implement a method in MyClass to be able to do history.replace(location).
Is that it?

The built-in history instances are singletons, so just import { browserHistory } from 'react-router' anywhere to have access to the same instance.

It's impossible to say what the best approach here is without going into the details of your use case. The Redux integrations give you a number of ways the accomplish this. Otherwise, you're invariably going to need to save off some reference to something.
How you choose to abstract these concepts is out-of-scope here. Any sort of API or instance method on the router object itself actually presents the same challenges as just remounting the component (e.g. by changing the key), as you need to get a reference to the router object.
You're free to use other media to complain. However, we ask that we focus the issue tracker on discussing bugs and feature requests. You're also free to make PRs, to the extent that those PRs integrate with the existing API and that the features added are sufficiently valuable to pay for the increased API surface area, which creates a burden on all users of this library.

@timdorr

The built-in history instances are singletons, so just import { browserHistory } from 'react-router' anywhere to have access to the same instance.

That doesn't work since you first need to figure out if you passed browserHistory or hashHistory to the router.
@taion

You're free to use other media to complain. However, we ask that we focus the issue tracker on discussing bugs and feature requests

I thought we were discussing the feature request of implementing a refresh method to the router. I'm presenting a use case were such method would solve the problem without doing acrobatics but if you think what I'm doing is simply complaining then it's clear what the problem really is.
Don't worry, I won't complaint anymore.
Take care.

That doesn't work since you first need to figure out if you passed browserHistory or hashHistory to the router.

Then create your own singleton.

@timdorr @taion thanks for help guys, browserHistory.replace(location) did the job, now I can get rid of my reRender action.
Btw, I strongly believe this issue should've been open till this very moment.

For those who use react-router-redux, you can dispatch a replace action, you can import the replace action from react-router-redux.

@sassanh
I tried with react-router-redux
When app is on /posts url, I signin via modal window then I want the components to refresh
dispatch(replace('/posts'))

but it does not refresh the component, so for now I resort to a similar technique of yours but not convinced
dispatch(replace('/loading'))
dispatch(replace('/posts'))

@rohandey What do you expect from a refresh? What I expected as described above was to call getComponent of the Route and it does it, I could handle it only with a utility in react-router as it was related to routes and couldn't be solved with bare react solutions.
Can you tell us what do you mean by a refresh? Do you want the render method of your component to get executed or your component to be mounted again (componentDidMount gets called) ? or do you want the componentDidUpdate to get called? Each has its own solution. First needs forceUpdate, second can be achieved by

dispatch(replace('/loading'))
dispatch(replace('/posts'))

as you mentioned, though I guess you should consider reviewing your app's logic if it needs it. (there are other dirty methods to achieve this without changing location, the most straight forward one is to manually unmount and remount the component, or if it's a child component, you can replace it with null and then bring it back. But I don't know a clean method for it and don't know a use-case for it neither.) The third can be done by calling setState and changing a dummy variable in state. (I'd try to design the logic of the app in a way that doesn't need such things though.)

@sassanh  On url /posts we have many widgets like latest posts, top posts. After signin we want to refresh all the content, one way is to dispatch various actions which would refresh these widgets.
But similar to /posts we have other urls /dashboard etc which again have many widgets and after signin from modal window we want to close the modal and refresh all the content.
In the code below in else part we currently replace url which eventually calls various dispatch actions for that url and refreshes data via ajax
const mapDispatchToProps = (dispatch) => {
  return {

    signin_user: (data, location_path) => {
      dispatch(signin_user(data)).then((response) => {
        if(response.error){
          dispatch(signin_user_failure(response.payload));
        }else{
          //in real apps auth token to be set in place of user id
          localStorage.setItem('auth_token', response.payload.data.token);
          dispatch(signin_user_success(response.payload));
          dispatch(replace('/loading'))
          dispatch(replace(location_path))
        }

      });
    }

  }
}

Other way we can think of is check the current location_path and on case basis dispatch various actions
switch(location_path) {

    case '/posts':
      dispatch(latest_posts());
      dispatch(tops_posts());

    case '/dashboard':
      dispatch(my_posts());
      dispatch(my_tops_posts());

   } );

But this would mean for every url we have to create a new case and can become error prone in case we forget to list all dispatch actions.

I had same situation for my app too (re-rendering things with new data after user signs in.) You can have a prop/some props that goes through all components hierarchy which have different values if user is signed in or not. A single action changes the value of these props (and the change goes through all hierarchy.) and components handle it either implicitly or explicitly via componentDidUpdate (if for example the widget needs to call an rest endpoint and get new data for example.) I think the nature of change you're talking about (changing what renders after user signs in.) should be handled via changing props when user logs in. To summarize you can make widgets update themselves via a prop that goes through hierarchy instead of dispatching actions to them. Generally I found it cleaner to let the communication from parent to children happen via props and communication in other direction happen via actions.

I just had a similar requirements. Why not simply add a method reload to the router which basically does something like @props.router.replace(window.location).

@pauldotknopf I have the same issue here. Have any solution yet?

for fuks sake guys please make a PR!

My issue is the same as @Kosmin pointed out above, and which nobody has addressed is: if you only change the query params react-router changes the URL but NOT the props passed to the component so this.props.location.query is unchanged thus if your using Redux's connect and pass it in as a prop you don't get a reload.
The problem is that react-router is not updating its props when the URL changes. This is a BUG unless for some reason it's reasonable to have the location state not represent the location, or is that a "feature"?

@dktan, Nope.

@pauldotknopf I tried @rohandey 's solution, replace to a empty loading page and replace back, works for now...

@dktan Only problem to this solution is if someone clicks browser back button, it will show them a loading page.

@rohandey if you use replace it shouldn't, only push leaves a history according to doc.

Typical react-router issue. A lot of inquiry and demand for a very basic feature; after reading for over 15 mins, I still have no clue to solve the problem.

@sassanh can you please explain how you solved using browserHistory.replace(location)?
I put browserHistory.replace(location) in the onClick handler but I'm not sure where to put the fetch call. In the routing onEnter handler?

@uccio83 Sorry I'm not in the context. what fetch call? Can you explain your exact problem after using browserHistory.replace(location)?

@sassanh You talked formerly about a fetch call, so I hooked to your topic. Sorry but I don't have the time to further explain the context. I solved in another ugly way in the onclick handler: if the clicked route is different from the current route I update the routing using browserHistory.replace(location), else I force the update of the component dispatching a fetch request action. Thanks anyway for your reply

@uccio83 I searched this page for word "fetch" and didn't find any comment by me that contains word "fetch". I'm glad you solved your issue and sorry you solved it in an ugly way. I'm willing to help if you got the time to explain more :-)

@ryanflorence

There could be 2,000 people asking for this feature to try to reload their data, but React (not React Router) just doesn't work that way.

Nope, you're wrong.
Not unmounting a component is a broken behaviour of react-router.
Handling state mutation is exactly what React was meant to avoid so react-router is contradicting the whole React philosophy by doing such a lame thing (not remounting routes).
For those Googling for a solution: I'm forcing it to remount the page using key.

@taion

The easiest way to rerun the route matching and "reload" the route/page is to just call:
router.replace(location);

Yeah, and this way no browser history for a user, so that's not a solution

@timdorr

seriously ReactDOM.unmountComponentAtNode(node) works, why do you guys need more?

You wrote about it two times subsequently yet failed to provide a simplest example of how it might even work.

Okay, everybody, I managed to find a fix for this bug.
See the full commit for reference:
https://github.com/halt-hammerzeit/react-isomorphic-render/commit/d3d7f3aa0f771a8b1fb22c3c5324e3f249a01d15
The idea:
<Router createElement={ (component, props) =>
{
  const { location } = props
  const key = `${location.pathname}${location.search}`
  props = { ...props, key }
  return React.createElement(component, props)
} }/>

@halt-hammerzeit
Could you explain why the route component added key it will force remount when the router tried to mount? thanks.

@sevenLee When a URL changes then the key changes and different keys force React component remount

@halt-hammerzeit thanks, the idea really works for me :)

@halt-hammerzeit
if use this way, I found it will remount when location change any time. But I use query string in the same url path after submission. e.g. '/portal/reportByPlayer" => "/portal/reportByPlayer?gameKey=12345', I don't need to remount when this scenario, that means I need to check if the location path if they are the same, if the same, it should not give the new key on component. But react-router seem didn't give previous path in location property...do you have any idea?

Give a concrete step-by-step description
On Wed 8 Mar 2017 at 11:23 seven<EMAIL_ADDRESS>wrote:

@halt-hammerzeit https://github.com/halt-hammerzeit
if use this way, I found it will remount when location change any time.
But I use query string in the same url path after submission. e.g.
'/portal/reportByPlayer" => "/portal/reportByPlayer?gameKey=12345', I don't
need to remount when this scenario, that means I need to check if the
location path if they are the same, if the same, it should not give the new
key on component. But react-router seem didn't give previous path in
location property...do you have any idea?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ReactTraining/react-router/issues/1982#issuecomment-284977187,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdH77WaHjUo4x5eqaC96ocv1v0Mbk7jks5rjmVmgaJpZM4F-lat
.

@halt-hammerzeit
Sorry for the previous question. I have another question encountered, below:
scenario: I am in /portal/reportByPlayer, it handled by ReportByPlayer.jsx. I would like to click h3 in ReportByPlayer component for remounting ReportByPlayer component. because in FormByPlayerCT(ReportByPlayer's children),  it fetch datas in componentDidMount, that's why I need to remount ReportByPlayer, that will trigger fetch datas in componentDidMount. However, the route path is the same, the key is the same, too, it means it won't remount any more. How I trigger remount in this situation? Thanks !
Routes.jsx
export default (

        <Route path="/" component={Login} />
        <Route path="login" component={Login} />
        <Route path="portal" component={Layout} >
            <IndexRoute component={Welcome}></IndexRoute>
            <Route path="reportByPlayer" component={ReportByPlayer}></Route>
        </Route>

)

Root.jsx
class Root extends Component {
    render() {
        const { store } = this.props
        const history = syncHistoryWithStore(browserHistory, store)
        return (
            <Provider store={store}>
                    <Router
                        history={history}
                        routes={Routes}
                        createElement = { (component, props) => {
                            const { location } = props
                            const key = `${location.pathname}${location.search}`
                            props = { ...props, key }
                            return React.createElement(component, props)
                        }}
                    />
            </Provider>
        )
    }
}

ReportByPlayer.jsx
class ReportByPlayer extends Component {
    render() {
        const  { resetDisplayStates } = this.props

        return (
            <ContentWrapper>

                     {
                        browserHistory.replace(`/portal/reportByPlayer`)
                    }}>P&L Report by Player

                <FormByPlayerCT />
            </ContentWrapper>
        )
    }
}

So you basically want to refresh the page.
No need to remount then, just refresh the data manually (via a redux action or something).

Then you can trigger whatever is inside componentDidMount manually like this.refs. FormByPlayerCT.load()

Where is FormByPlayerCT.load() come from? I didn't have this function on FormByPlayerCT  component...

Move the contents of componentDidMount to load

@halt-hammerzeit
Sorry, I still can't get it..if I call browserHistory.replace(/portal/reportByPlayer) on ReportByPlayer , that will re-render ReportByPlayer and FormByPlayerCT .  I put manually load function in ReportByPlayer render....but Where I can put this.formPlayerCT.load in ReportByPlayer?
ReportByPlayer.jsx
class ReportByPlayer extends Component {

    render() {
        const  { resetDisplayStates } = this.props

        return (
            <ContentWrapper>

                     {
                        browserHistory.replace(`/portal/reportByPlayer`)
                    }}>P&L Report by Player

                <FormByPlayerCT ref={(comp) => this.formPlayerCT = comp} />
            </ContentWrapper>
        )
    }
}

if I call browserHistory.replace('/portal/reportByPlayer') on ReportByPlayer, that will re-render ReportByPlayer and FormByPlayerCT

You don't need rerendering. You said what you needed was remounting. Remounting can't be done while preserving the same URL, so the only option is to move loading code somewhere out of componentDidMount

if I call browserHistory.replace('/portal/reportByPlayer') on ReportByPlayer, that will re-render ReportByPlayer and FormByPlayerCT

You don't need rerendering. You said what you needed was remounting. Remounting can't be done while preserving the same URL, so the only option is to move loading code somewhere out of componentDidMount and call it manually

@halt-hammerzeit
Thanks! I got it now, but I don't know where place can put loading code in ReportByPlayer  to replace child component componentDidMount place, I can't put this.formPlayerCT.load in  ReportByPlayer  render function....could you teach me the actual implementation? or suggestion, thanks again!

Actually I don't just want load data, I need to remount whole ReportByPlayer  component. If I only call this.formPlayerCT.load is not enough. How I remounting under the same URL, then trigger child to fetch data with the key  remounting mechanism?

I worked around use browserHistory.replace('/portal/reportByPlayer?key=${Math.random()}'), that make me remount component in the same route, but not actually the same path....

Oh, that's a viable solution
On Tue 14 Mar 2017 at 10:50 seven<EMAIL_ADDRESS>wrote:

I worked around use
browserHistory.replace('/portal/reportByPlayer?key=${Math.random()}'),
that make me remount component in the same route, but not actually the same
path....
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ReactTraining/react-router/issues/1982#issuecomment-286346237,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdH7xbZXPndco5h36_KFBxpl4--cp9qks5rlkbDgaJpZM4F-lat
.

I'm using v3 of the API.
None of the above solutions seem to work. I don't want to pollute the URL with randomised data in order to prompt a refresh.
How should we trigger the onEnter callbacks to re-run for the current route?
The use case I have is to re-run the onEnter logic for the current route after the user logs in using an inline login box. Some pages it will be OK for the user to remain where they are, but for example, should be redirected to a default route if they are on a registration page - since the registration page is only intended for non-authenticated users.
Chris

I'm using v3 of the API.
None of the above solutions seem to work.

My solution works on v3

@halt-hammerzeit - I would like a non random path generation solution. I was referring to the above-mentioned refresh methods, which don't seem to be on the context router object.

Well, I came up with yet another idea for such cases:
Say, create a special <Redirector/> component in which inside componentDidMount() add history.replace('/the/original/page').
This way the user, after loggin in, will first be redirected (via history.replace()) to /redirect?to=/the/original/page, and then, after the original page is unmounted, it will be redirected to the original page once again, therefore remounting it.

My solution works on v3

What about v4?

What about v4?

v4 is still an immature library and lacks a lot of the features v3 had therefore I'm not using v4 and not planning to switch to it since v3 has everything one could need.

If you are using react-router you can use history.go(n). if n=0 then reload current page.
this.props.history.go(0)
You can access history import { withRouter } from 'react-router-dom' with this.

Solved the problem by creating "empty" route.
      <Router history={hashHistory}>
            <Route path="/">
                 ... my routes ...
                <Route path="empty" component={null} key="empty"/>
            </Route>
        </Router>

When I need refresh, I go to the empty route first, then setTimeout, and replace state to current route:
    if (routesEqual && forceRefresh) {
        router.push({ pathname: "/empty" });
        setTimeout(() => {
            router.replace({ pathname: route, query: query });
        });
    }

By making replace I keep my browser history clear from empty route.
p.s. Hello to core developers, very nice from him.

Mates. SetTimeout always makes me unsure. What about just to put timestamp in route definition:
<Route path="/asd" component={() => <Asd hash={Date.now()} />} />

And then reload it when it changes:
componentWillReceiveProps = (props) => {
        if(props.hash !== this.props.hash){
            console.log('route reload');
        }
    }

BUT of course - if there can't be connect function or other props - because it may cause issues with useless rerendering.

Solution for v4 (I am still playing with React/Redux, so I am not yet aware of some potential breaking):
<RouteChanged>
  <Switch>
    <Route
      exact path={RoutePaths.home}
      component={LoginRequired(Entries)}/>

And then in my RouteChanged:
class _RouteChanged extends React.Component {
    ...

    render() {
        const childrenWithProps = React.Children.map(this.props.children,
            (child) => React.cloneElement(child, {
                key: this.props.location.key
            })
        );
        return (

{childrenWithProps}

        )
    }
...
}

@PFight A awesome solution! Think you very much!  ∩_∩

We had a similiar question while developing a quite complex app. We needed to reload a complex view (and reset it to its initial state, we use Redux) when its corresponding <Route> was triggered (by a <Link>) no matter whether its corresponding <Route> was already active. Whenever the route was triggered, linked view should reload.
The solution I came up with is very simple and does not play with routes, only with components. I call it reloadable components. It's a simple HOC that makes the wrapped component kind of aware of the app's location (location property must be passed to it somehow, <Route> component does this automatically) so that when browser location does not change but location's key property changes the component is reloaded. A location's key should change when a route is requested/triggered, even when that route has not changed. That's the behavior I'm exploiting to reload a component, meaning, unmounting a "reloadable" component and mounting it right afterwards.
This approach does not depend on a react-router specific version but, please note it does depend on a proper implementation of browser history/location. If you are using history package, you cannot use createHashHistory since it does not support location.key.
Another benefit of this approach is you can reload just the components you want to.
Without further ado, here you're the HOC:
import PropTypes from 'prop-types'
import React, { Component } from 'react'

const reloadable = WrappedComponent => {
  class Reloadable extends Component {
    constructor (props) {
      super(props)
      this.state = {
        reload: false
      }
    }

    componentWillReceiveProps (nextProps) {
      const { location } = this.props
      const { location: nextLocation } = nextProps

      if (nextLocation.pathname === location.pathname &&
          nextLocation.search === location.search &&
          nextLocation.hash === location.hash &&
          nextLocation.key !== location.key) {
        this.setState({ reload: true }, () => this.setState({ reload: false }))
      }
    }

    render () {
      return this.state.reload ? null : <WrappedComponent {...this.props} />
    }
  }

  Reloadable.propTypes = {
    location: PropTypes.object
  }

  return Reloadable
}

export default reloadable

How to use it
// This is pretty much pseudo-code so you get the idea

// Connect a route so it renders ComponentA reloadable component
// Trigger this route to load ComponentA for the first time.
// Afterwards, trigger this same route again to reload ComponentA: A different random number should be displayed.
<Route path='/test' component={ComponentA} />

// Content of ComponentA.js
import React from 'react'
import reloadable from '[path-to]/reloadable'
export default reloadable(() =>
`A random number: ${Math.random()}`
)

How to reload only some child components linked to a Route?
This scenario assumes a <Route> that renders a non-reloadable parent component composed of some (but not all) reloadable child components.
To solve this, pass location property down from the non-reloadable parent component to those reloadable child components.
It's working great for us in our app. Hope it works fine for yours too ;)

@tubalmartin as a follow up and to kind of state the obvious if any of these properties in the react-router library are changed this will probably break... I've been looking for a good way to do this, and so far this looks like it may work best as a general solution.
      if (nextLocation.pathname === location.pathname &&
          nextLocation.search === location.search &&
          nextLocation.hash === location.hash &&
          nextLocation.key !== location.key) {

We found a way around it using a two different ways
In our router  we have
<Route
   path="/u/:handle"
   pageName="Profile"
   pageDescription="Manage your profile"
   getComponent={(location, cb) => { System.import('./Profile').then((component) => { cb(null, component.default || component); }); }}
/>

to view your own profile it calls:
/u/myprofile
to call another users profile it is:
/u/usershandle
we had an issue where if you are in /u/usershandle and you click on “My Profile” /u/myprofile it wouldn’t change the page content. Vice versa.
Dirty Old skool method for the pages we don’t mind doing a full reload we replaced the 'Link to' tag with a standard 'a href' pointing to the url.

This works fine.
Another method where we wanted only part of the page reloaded we shimmied it by using reducers.
On the actual page we add:
componentWillReceiveProps(nextProps) {
    if (nextProps.general && nextProps.general.reload === ‘profile’) {
      this.reloadProfile(); // call a function that does all needed to be done
    }
}

On the menu item instead of using Link with ‘to’ (can also use a href or a button) we use onClick which calls a function that compares the url with location > pathname in the props.
if this.props.location.pathname === this.props.link (/u/myprofile etc)
call reducer:
this.props.setGeneral({ prop: 'reload', value: 'profile' });
once the componentWillReceiveProps catches the request it calls the function that does what we want to reload.
There is prob better ways to do this but this is the only way got it to work constantly across all platforms and browsers.

I just did it by setting target="_self" on the link tag

try this its work fine :) :+1:
constructor(route:ActivatedRoute) {
route.params.subscribe(val => {
// put the code from ngOnInit here
});
}


Fix for email attachment names in iOS, applying “df:” parameter to at…

In iOS email attachments didn't parse "df:" parameter to apply as filename as Android did.
Parsed "df:" parameter when "data:" parameter was found so as to apply attachment name when it exists.
This is part of a requirement in a project I'm in that uses this plugin.

Thank you!


Start to fill gaps as defined in the backlog

Progress on this backlog described in #32. The PR got larger than I wanted, sorry.

added a folder with manual tests
added several settings, support to disable work around to disable the NoUnusedVariableRule

                "alwaysShowRuleFailuresAsWarnings": false,
                "ignoreDefinitionFiles": true
                "configFile": "../tslint.json",
                "disableNoUnusedVariableRule": false

enabled tslint
add some stricter TS settings like noImplicit any
clean-up code to remove the left over tslint 3 support
documented dev setup

Thanks @egamma !


Make exceptions optional

It would be nice to have either a preprocessor option or a separate set of functions (unsafe_value()?) to disable throws in expected and invoke undefined behavior instead because this fails to compile with gcc and the -fno-exceptions flag. This makes it impossible to use in constrained environments like microcontrollers and other freestanding implementations where exceptions are either too expensive or simply not implemented.
This can be implemented in standard C++ with the noreturn attribute which gcc and clang can take advantage of:
template<typename E>
[[noreturn]] constexpr void throw_exception(E &&e) {
#ifndef DISABLE_EXCEPTIONS
    throw std::forward<E>(e);
#endif
}

throw statements are legal in [[noreturn]] functions.

@mmha how does that fix look?

It should detect whether you have exceptions turned on or not automatically, so doesn't need another preprocessor option.

Thank you for adding this. Looks good, but you missed the try/catch blocks that don't work with -fno-exceptions either

How about now?

@mmha have you had a try with the new updates?


Improve the getting started / installation instructions?

I came across this in the chat:

I pieced together a few different answers from stack overflow to get it working. Ended up having to install node, npm and jasmine. Then use brew to install npm and then install jasmine globally to get it to work.

I also watched a JavaScript (and programming in general) newbie trying to get started, and I had to tell them to go to the /languages/javascript page, click on "installing javascript" and follow the instructions there.

As the PR was merged, I'm going to close this issue.


Cross host networking is broken for "vxlan" networking mode.

Rancher Version: v1.2.0-pre4-rc11
Steps to reproduce the problem:
Created a "cattle" default environment.
Deleted healthcheck and scheduler stacks and then deleted ipsec stack.
Deployed vxlan.
After this added healthcheck and scheduler stacks.
healthcheck and scheduler container are stuck in "Initializing" state forever.
Cross host networking is broken between containers.

Must use vxlan using rancher/net:v0.7.2 for testing.

Tested with rancher/net:v0.7.3 and rancher/plugin-manager:v0.2.9 with  rancher-server version - v1.2.0-pre4-rc14
Infra stack comes up successfully (including healthcheck and scheduler). Able to start health check enabled services successfully.


[RTL] Add optional push_meta argument to disable underline for specific meta item.

Adds extra argument to disable underline for specific meta, previously it was possible to do it only for the whole RTL (set_meta_underline).
Useful for something like https://github.com/godotengine/godot/pull/87363

That would be extremely cool. I feel like that's way more important to have than always disabling the underline, which feels more like a workaround.
In fact, it would be a workaround. As is, https://github.com/godotengine/godot/pull/87363 cannot exist with the image icon because the meta underline is drawn underneath the image, even though it doesn't have to be.

Superseded by https://github.com/godotengine/godot/pull/89024


Make carousel indicators actual buttons (backport to v4)

Manual backport of #32661

Need another approval just in case @rohit2sharma95.

I marked it as draft; I'm not 100% sure about the CSS changes and specificity since people might override the selectors.

Setting this to ready for review, but worth deciding if we're going ahead with this backport or scrapping it.

@mdo @XhmikosR your call if this is too much of a breaking change or not. if we feel it is, suggest just closing the PR and not backporting.

Revisiting this, I think we will have to skip it for the breaking changes in those selectors. So sorry for the wasted effort so long ago! 😓

no worries, 5 is where it's at now anyway


Feature/need help

Overview:
Implement functionality for this feature
Highlights

write Cucumber Feature, Scenarios`, Step definitions, and helper functions for user story cases
implement partials for Need help? links
implement layout for Need help? modal dialog

[Finishes #90017830]

@barnabyalter
Hi Barnaby,
I'd love feedback on this PR when you get a chance.
I didn't use the Blacklight ajax_modal, rather I wrote up a layout
that is reused for both modals.  I had trouble getting the Blacklight modal
to work and I wanted to deliver the feature, so I proceeded with the layout
approach.
Also, since the feature is all view related, I didn't write up any RSpec examples,
rather all testing is done in Cucumber.
Thanks for your time!
Best-
Joe

Coverage remained the same at 97.13% when pulling a5981baa55e2f06c8c8308ccdbda00e542f42db3 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.

Coverage remained the same at 97.13% when pulling a7bdcd9f3069c370f2225378da8b4956fdb25357 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.

Coverage remained the same at 97.13% when pulling a7bdcd9f3069c370f2225378da8b4956fdb25357 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.

Coverage remained the same at 97.13% when pulling 8d265aa5e4e50322ee5513e24f7b61dbb1936ec0 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.

@jgpawletko This is good but I think it would be better if it was unobtrusive JS which would involve creating links to actual pages for search_tips and contact_information and then you can add the rails :remote => true option to link_to and then get some universal coffee to do the rest.

Change need_help to help and shorten to contact_information and search_tips
Create a PagesController and some routes, the controller could be empty and just for routing static pages:

class PagesController < ApplicationController
end

get 'help/search_tips', as: :search_tips
get 'help/contact_information', as: :contact_information

Then the _links partial could just link like the following:

<%= link_to 'Search Tips', search_tips_path, remote: true %>

Check out what those static pages look like and change the CSS accordingly.

Delete the custom ajax_modal and just reuse the default blacklight one (for reference, you can find this in blacklight/app/views/shared/_ajax_modal) and then add the following coffeescript to the coffee asset:

$ ->
  $('a[data-remote=true]').click ->
    $('#ajax-modal .modal-content').append($('
').addClass('modal-header').append($('
').addClass('modal-title').html($(this).html())))
    $('#ajax-modal .modal-header').prepend($('<button />').attr({type: 'button', class: 'close'}).data({dismiss: 'modal'}).html('×'))
    $('#ajax-modal .modal-content').append($('
').addClass('modal-body').load($(this).attr('href')))
    $('#ajax-modal').modal()

This mimics the existing markup that existing stylesheets will look for so it will save some cleanup of css time. It should also DRY things up.
Let me know if this makes sense and is helpful.

@barnabyalter
Many thanks for the guidance, Barnaby.
I'll move forward with your suggestions.

@barnabyalter
Hi Barnaby,
Per your suggestion, I changed the implementation to use the Blacklight ajax_modal.  However, I decided to follow the Rails "golden path" and generated a HelpController with search_tips and contact_information actions instead of a PagesController. I can still change the name to PagesController if you'd prefer.
I looked through the Blacklight links you provided earlier and followed the guidance here and here which was easy to implement once I had dedicated URLs for the modal bodies.  The links partial is quite straightforward now.
One other thing to note:
My initial request specs were failing due to login redirects. I added user login  borrowed from the Cucumber setup.
Please let me know if you have any comments or concerns on the revised code.
Thanks!
Best-
Joe

Coverage increased (+0.15%) to 97.28% when pulling 56ed230affd202d4b3f5dd3edb1bb782ca683cd5 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.

@jgpawletko Refactor looks good. You can remove the empty functions in the HelpController since they don't do anything and the route will look for the view regardless of an empty action.
 I find it cleaner if the html pages can exist on their own. Since the modal is a pure javascript implementation you can abstract it into pure javascript at the global level per my coffeescript example above. It also future proofs new links that we'll want to have be modals.
I notice that my coffeescript example doesn't clear the previous modal content, that can be easily fixed by using html() instead of append():
  $('a[data-remote=true]').click ->
    $('#ajax-modal .modal-content').html($('
').addClass('modal-header').append($('
').addClass('modal-title').html($(this).html())))
    $('#ajax-modal .modal-header').prepend($('<button />').attr({type: 'button', class: 'close'}).data({dismiss: 'modal'}).html('×'))
    $('#ajax-modal .modal-content').append($('
').addClass('modal-body').load($(this).attr('href')))
    $('#ajax-modal').modal()

It also doesn't need to key off the link title to make the modal header, it can easily key off a header within the html page and then hide that in the modal. This function can be abstracted out and made to accept params if future cases lean that way.
Let me know if you specifically don't want to implement this as coffeescript and we can discuss.

@barnabyalter
Thank you for your feedback. I understand your point about obtrusive markup.
I'll implement the functionality as coffeescript, but I may have questions for you as I proceed.

Coverage increased (+0.14%) to 97.27% when pulling 6909e0f6054a6dff1141a74adee03303bb2b3513 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.

@barnabyalter
Hi Barnaby,
Please let me know what you think of this revision.
I had to change one thing in the Coffeescript you provided as the modal wasn't closing.
I found that the data-dismiss="modal" attribute was not being inserted into the <button> tag.
so I changed this:
...  .attr({type: 'button', class: 'close'}).data({dismiss: 'modal'}).html('×'))
to this:
... .attr({type: 'button', class: 'close', 'data-dismiss': 'modal'}).html('×'))
Thank you for your time!

@jgpawletko Looks great Joe! And passed all tests. Please make the one change I mentioned to the coffeescript and this is ready to merge.

@barnabyalter
Thank you, Barnaby.
Requested change made.

Coverage increased (+0.14%) to 97.27% when pulling b06fd3bf7e3a9d429c2c8a2f9dcdfb8274accf72 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.

Coverage increased (+0.14%) to 97.27% when pulling b06fd3bf7e3a9d429c2c8a2f9dcdfb8274accf72 on feature/need-help into 8bdc8be6668799c9dc2801f0553f3708cd10379b on development.


[8.0.0] Bump swift-tools-version to 5.6.

Fixed via https://github.com/google/GoogleUtilities/pull/172
Ended up bumping to 5.9


Broken URL for Dundee City Council

Broken URL: #https://data.dundeecity.gov.uk/

Automatically closed due to URL now working.


Added code editor in Cpp modules and fixed not rendering decision module

🛠 Fixes Issue

Closes part of #391

👨💻 Changes proposed
Added code editor in Cpp Course and fixed not rendering decision module

✔ Check List (Check all the applicable boxes)

[x] My code follows the code style of this project.
[x] This PR does not contain plagiarized content.
[x] The title of my pull request is a short description of the requested changes.

📷 Screenshots
The same way added for all the modules

review @arpit456jain @singhmansi25 @KKhushhalR2405

@Jayanth-MKV merge conflicts


Editing a roletemplate to add new rules does not grant expected permissions to users with that role

On 2.4.5 create a project scoped role cloned-project-owner by cloning project-owner
Add a user testuser with this cloned-project-owner role to a project
The testuser can enable project monitoring and edit project resource quota
Upgrade to 2.4-head.
The builtin project-owner role will have a new rule for the resource "project" with verb "own" that gives it ownership. The cloned role cloned-project-owner will not have this rule upon upgrade.
Edit cloned-project-owner through API to add the same rule as the project-owner for "own" verb on "project" resource.
On editing the roletemplate, its corresponding k8s role in the project's namespace also gets updated to have this new rule
Login as testuser.

Result
testuser cannot enable monitoring or edit project resource quota
Expected
testuser should be able to perform everything a project-owner can, including monitoring actions and editing project quota
Other details that may be helpful:
The corresponding kubernetes role in the project's namespace gets updated as expected. And the rolebinding for this user binding it to the k8s role is intact upon upgrade. So this should have given the testuser expected permissions

This issue has been hard to track down. I am still actively working on it, and wanted to provide an update with my findings so far. The issue is not related to the changes that @mrajashree made having to do with project owner permissions. I was able to reproduce the same issue in Rancher v2.4.5 by adding and removing the inherited Project Owner role template to the cloned-project-owner role template. I also ran the same test in Rancher v2.3.8 and did not find this issue happening. We were not using the membershipBindingOwnerIndex in that version and were directly retrieving RoleBindings from the api-server as opposed to using Kubernetes caching mechanisms as we have from v2.4.0 onward.
These findings along with debugging I have done point to interactions with the membershipBindingOwnerIndex being the issue. In the steps to reproduce found above, prior to upgrade the user has a projectowner RoleBinding. After the upgrade is completed, the projectowner RoleBinding is deleted and a projectmember RoleBinding is created. This is due to the difference in project owner logic between the two versions. To grant the user project owner permissions, the project+own permissions need to be added to the cloned-project-owner role template after upgrading (via the API). However, this doesn't have the desired effect and the user is still unable to administer the project. The reason for this has to do with a stale key in the membershipBindingOwnerIndex. The projectowner RoleBinding is deleted at this point, but the indexer still maintains a key for that RoleBinding in the membershipBindingOwnerIndex. The RoleBinding returned for this key is nil and the controller errors out attempting to process it. The error happens on this line: https://github.com/rancher/rancher/blob/v2.4.6-rc1/pkg/controllers/management/auth/manager.go#L337
I have implemented a workaround that allows for the correct user experience, but does not fix the stale key issue. I will be opening a PR for this workaround as I have not found the root cause at this point.

Verified on an upgrade from 2.4.5 to 2.4-head - commit id: ``
Scenario#1

On 2.4.5 create a project scoped role cloned-project-owner by cloning project-owner
Add a user user1 with this cloned-project-owner role to a project
The user1 can enable project monitoring and edit project resource quota
Upgrade to 2.4-head.
The builtin project-owner role will have a new rule for the resource "project" with verb "own" that gives it ownership. The cloned role cloned-project-owner will not have this rule upon upgrade.
Edit cloned-project-owner through API to add the same rule as the project-owner for "own" verb on "project" resource.
Login as user1.
user1 is able to enable monitoring and edit project resource quota

@sowmyav27 thank you for the feedback. I've ran further tests and have noticed some issues with Scenario 2. Specifically, when you clone the cluster-owner role to create cloned-cluster-owner, and use that to associate a user to a cluster, the user/rbac controller is not treating the cloned role as an owner role. What ends up happening is an error like this:
2020/08/17 16:17:20 [ERROR] ClusterRoleTemplateBindingController c-l9gcq/crtb-784n6 [cluster-crtb-sync] failed with : couldn't ensure roles: couldn't update role rt-ph5d5: couldn't update role rt-ph5d5 in c-l9gcq: Role.rbac.authorization.k8s.io "rt-ph5d5" is invalid: rules[0].nonResourceURLs: Invalid value: []string{"*"}: namespaced rules cannot apply to non-resource URLs

The cloned role has a rule:
- nonResourceURLs:
  - '*'
  verbs:
  - '*'

which can't be applied to namespaced roles. Since the cloned-cluster-owner is not detected as an owner role, Rancher attempts to create/update namespaced roles with the rule above, which is invalid.
I have not yet determined whether the logic in the user/rbac controller for detecting the cluster owner role needs to change, or if this is more of a user error, where we are providing invalid rules to role templates that will result in the creation of namespaced roles. In either case, this problem is unrelated to the original issue. From my testing, the original issue appears to be solved as the behavior is correct now. I think we can close this issue and handle this problem with the cloned-cluster-owner in a separate issue. Let me know if you agree.

Verified on 2.4-head - commit id: 546423c42
Steps:

On 2.4.5 create a cluster scoped role cloned-cluster-owner by cloning cluster-owner
Add a user user2 with this cloned-cluster-owner role to a cluster
The user2 can enable cluster level monitoring
Upgrade to 2.4-head.
The builtin cluster-owner role will have a new rule for the resource "clusters" with verb "own"
Edit cloned-cluster-owner through API to add the same rule as the cluster-owner for "own" verb on "clusters" resource.
Login as user2.
user2 is able to enable cluster level monitoring but it took sometime for the update of "own" verb to propagate to the user2. It took > 3 minutes for the user to perform cluster level actions like - Run CIS scan/Enable cluster level monitoring
Rancher Logs still shows error

2020/08/19 22:57:41 [ERROR] ClusterRoleTemplateBindingController c-cqwt4/crtb-j572z [cluster-crtb-sync] failed with : couldn't ensure roles: couldn't update role rt-4pwmn: couldn't update role rt-4pwmn in c-cqwt4: Role.rbac.authorization.k8s.io "rt-4pwmn" is invalid: rules[0].nonResourceURLs: Invalid value: []string{"*"}: namespaced rules cannot apply to non-resource URLs

Verified using 2.4-head - commit id: 03ce40e37

On 2.4.5 create a cluster scoped role cloned-cluster-owner by cloning cluster-owner
Add a user user2 with this cloned-cluster-owner role to a cluster
The user2 can enable cluster level monitoring
Upgrade to 2.4-head.
The builtin cluster-owner role will have a new rule for the resource "clusters" with verb "own"
Edit cloned-cluster-owner through API to add the same rule as the cluster-owner for "own" verb on "clusters" resource.
Login as user2.
User 2 is able to enable cluster monitoring and run CIS scan on the cluster (immediately with no delay)

Master fix for the latest PR will be validated in this issue -  https://github.com/rancher/rancher/issues/28056


question: can this example be done more cleanly?

In the data structure I wanted to compare, there was a field of type I, where I is an interface. Types A and B both implemented I and nothing else did. I wanted to convert As to Bs to facilitate comparison. (A is a deprecated version of B, and I wanted to treat them equivalently for comparisons.)
My first thought was a transformer from A to B. This failed, because cmp.Equal first checks that its two arguments have identical type before transforming.
I ended up writing a comparer func(x, y I) bool that had to convert each of x and y before comparing them. (Original code).
Is there a better way?

func (I, I) bool seems to be the best approach, since you can't have a transformer occur on just one of the elements and not the other. The rationale for that was to ensure the path to each element was identical for both sides being compared. Otherwise, it would be very confusing how to print differences to the user.


OTEL_LOG_LEVEL accepts case insensitive values

Fixes https://github.com/signalfx/splunk-otel-go/issues/1373

Codecov Report
Base: 78.69% // Head: 74.51% // Decreases project coverage by -4.18% :warning:

Coverage data is based on head (75a6774) compared to base (703ae1c).
Patch coverage: 100.00% of modified lines in pull request are covered.

:exclamation: Current head 75a6774 differs from pull request most recent head 470036a. Consider uploading reports for the commit 470036a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1374      +/-   ##
==========================================
- Coverage   78.69%   74.51%   -4.19%
==========================================
  Files          55       55
  Lines        2723     2723
==========================================
- Hits         2143     2029     -114
- Misses        532      640     +108
- Partials       48       54       +6

Flag
Coverage Δ

Linux
?

Windows
?

macOS
74.51% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

distro/logger.go
100.00% <100.00%> (ø)

....com/gomodule/redigo/splunkredigo/option/option.go
50.00% <0.00%> (-50.00%)
:arrow_down:

...hub.com/gomodule/redigo/splunkredigo/redis/conn.go
64.15% <0.00%> (-35.85%)
:arrow_down:

...n/gopkg.in/olivere/elastic/splunkelastic/option.go
66.66% <0.00%> (-33.34%)
:arrow_down:

...c/confluent-kafka-go/kafka/splunkkafka/producer.go
68.00% <0.00%> (-19.00%)
:arrow_down:

...hub.com/gomodule/redigo/splunkredigo/redis/dial.go
86.88% <0.00%> (-13.12%)
:arrow_down:

...c/confluent-kafka-go/kafka/splunkkafka/consumer.go
75.80% <0.00%> (-12.91%)
:arrow_down:

...n/github.com/lib/pq/splunkpq/internal/connector.go
50.25% <0.00%> (-6.54%)
:arrow_down:

.../gopkg.in/olivere/elastic/splunkelastic/elastic.go
94.91% <0.00%> (-5.09%)
:arrow_down:

instrumentation/database/sql/splunksql/config.go
80.67% <0.00%> (-2.53%)
:arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


Groovy9981

It looks like this means that a "naïve" use of 0.0f == -0.0f is still true, and that otherwise it is advisable to deliberately select the method that is intended for use. Good!


feat(avm-mini): call and return opcodes

closes: https://github.com/AztecProtocol/aztec-packages/issues/3697
Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

[ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
[ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
[ ] Every change is related to the PR description.
[ ] I have linked this pull request to relevant issues (if any exist).

Benchmark results
Metrics with a significant change:

node_database_size_in_bytes (10): 5,822,335 (+48%)
note_trial_decrypting_time_in_ms (8): 25.7 (-31%)
note_trial_decrypting_time_in_ms (32): 80.2 (+64%)

Detailed results
All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call  to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.
This benchmark source data is available in JSON format on S3 here.
Values are compared against data from master at commit 379b5adc and shown if the difference exceeds 1%.
L2 block published to L1
Each column represents the number of txs on an L2 block published to L1.

Metric
8 txs
32 txs
128 txs

l1_rollup_calldata_size_in_bytes
45,444
179,588
716,132

l1_rollup_calldata_gas
222,960
868,124
3,449,396

l1_rollup_execution_gas
842,047
3,595,232
22,204,765

l2_block_processing_time_in_ms
2,228 (-4%)
8,566 (+1%)
35,222 (-1%)

note_successful_decrypting_time_in_ms
316 (-3%)
954 (+3%)
3,336 (-4%)

note_trial_decrypting_time_in_ms
:warning: 25.7 (-31%)
:warning: 80.2 (+64%)
198 (-2%)

l2_block_building_time_in_ms
20,207
81,197 (+1%)
321,659

l2_block_rollup_simulation_time_in_ms
16,659
67,190 (+1%)
266,006

l2_block_public_tx_process_time_in_ms
3,515
13,935
55,410

L2 chain processing
Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric
5 blocks
10 blocks

node_history_sync_time_in_ms
24,918
47,989 (+1%)

note_history_successful_decrypting_time_in_ms
2,187 (+1%)
4,267 (+2%)

note_history_trial_decrypting_time_in_ms
162 (-1%)
227 (-3%)

node_database_size_in_bytes
3,630,549
:warning: 5,822,335 (+48%)

pxe_database_size_in_bytes
29,748
59,307

Circuits stats
Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit
circuit_simulation_time_in_ms
circuit_input_size_in_bytes
circuit_output_size_in_bytes

private-kernel-init
200 (+1%)
43,109
20,441

private-kernel-ordering
115
25,833
9,689

base-rollup
2,961
667,692
873

root-rollup
90.5 (+7%)
4,072
881

private-kernel-inner
261
64,516
20,441

public-kernel-private-input
171
25,203
20,441

public-kernel-non-first-iteration
168 (-1%)
25,245
20,441

merge-rollup
10.8 (-1%)
2,592
873

Miscellaneous
Transaction sizes based on how many contracts are deployed in the tx.

Metric
0 deployed contracts
1 deployed contracts

tx_size_in_bytes
10,323
25,938

@reviewer note this is on top of an unmerged pr, once avm-main is up to date this pr can be pointed at it.


Add a max-width to Banner

Description
This adds a max-width to the .Banner-message to make sure that lots of content starts to wrap onto multiple lines.
👀  Lookbook preview

Before
After

Closes https://github.com/github/primer/issues/1697
Integration

Does this change require any updates to code in production?

No
Concerns/Alternatives
A side effect of this PR is that all Banner with full: true will be centered. This causes alignment issues when multiple Banner are stacked on top of each other. An alternative would be to keep them left aligned and only make the content have a max-width:

Hmm.. not sure. It also feels a bit weird, but open to change it to this if others think it's the better fix. Here a Loom with a short walk-through.
Merge checklist

[ ] Added/updated tests
[ ] Added/updated documentation
[x] Added/updated previews

@simurai based on what you show in your Loom, I really like the solution described here https://github.com/github/primer/issues/1524. I'm curious how feasible it is though, since it depends on the updated header design.

I really like the solution described here github/primer#1524. I'm curious how feasible it is though, since it depends on the updated header design.

Yeah, maybe it needs a few more explorations, to see how it feels. Also with multiple Banner stacked on top of each other.

Gonna close this as wontfix. As a workaround, using <br> should be ok too, see https://github.com/primer/view_components/pull/1773#discussion_r1132639345.
We can re-open it if it comes up more often.


CodeCop Warning AA0008: Warning doesn't show up for standard procedure calls without any parameters (e.g. .IsEmpty, .RecordId, .Count)

Please include the following with each issue:
1. Describe the bug
As the CodeCop is activated no warnings are shown for AA0008 for procedure calls which doesn't require any parameters. On calls like FindSet which has optional parameters it's working.

But the tooltip of the commands show that those are procedures having parenthesis:

This would go against the rule of AA0008

2. To Reproduce
Activate Code analysis for the workspace and add "CodeCop" as cop
Add following lines:

Go to '...'

codeunit 50000 "AA0008 GitHub"
{
    local procedure AA0008()
    var
        SalesLine: Record "Sales Line";
        RecordIdTemp: RecordId;
    begin
        // Works
        SalesLine.FindSet;
        // Works
        HelloWorld;

        // Doesn't work
        Message(Format(SalesLine.IsEmpty));
        if SalesLine.IsEmpty then;

        Message(Format(SalesLine.Count));
        if SalesLine.Count > 0 then;

        Message(Format(SalesLine.RecordId));
        if SalesLine.RecordId = RecordIdTemp then;
    end;

    local procedure HelloWorld()
    begin
        Message('Hello World');
    end;
}

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
3. Expected behavior
Show a warning for standard procedure calls with no parameters
4. Actual behavior
Show no warning for standard procedure calls with no parameters
5. Versions:

AL Language: 11.0.748446
Visual Studio Code: 1.75.0
Business Central: sandbox/21.4.52563.52989/w1
List of Visual Studio Code extensions that you have installed:
AL CodeActions
AL Language
AL Toolbox
AL Variable Helper
AZ AL Dev Tools / AL Code Outline
waldo's CRS AL Language Extension
NAB AL Tools
Git Tree Compare
Git Lens
Xliff Sync
Project Manager
Error Lens

Final Checklist
Please remember to do the following:

[x] Search the issue repository to ensure you are reporting a new issue

[x] Reproduce the issue after disabling all extensions except the AL Language extension

[x] Simplify your code around the issue to better isolate the problem

IsEmpty, Count, etc. are Properties which can be accessed using the property access syntax. (see https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-count-method) This does not require parentheses.
This is by-design, see https://github.com/microsoft/AL/issues/6908#issuecomment-1028644117

This is a little bit confusing even in the Docs (For IsEmpty and Count) the Example uses the ().

But thanks for the Information!


(add-time ) overflow =>  unexpected results (copied from Pact Legacy)

Hey,
I'm sorry to insist... I copied this issue from Pact Legacy... Because in my opinion, this one is the most critical "not already fixed" issue in Pact legacy. It's not a nice to have, neither an edge case: it's definitively a security issue. I can easily write a vulnerable contract. (can show an example if requested).
Maybe the release of Pact core is the good timing to fix it.
FYI: I created a "a la Solidty" workaround: (not published and only very  quickly tested):  https://github.com/CryptoPascal31/pact-util-lib/blob/ac97feca2dcf1176d9bcc55510a2964dd9d663f6/pact/contracts/util-time.pact#L46
But IMHO, it should be definitively been fixed in Haskell. Because having a workarond in Pact is not an acceptable solution.
Issue description
The add-time function can overflow and give unexpected results.
Steps to reproduce
Some examples:
pact> (add-time (time "2016-07-22T12:00:00Z")<PHONE_NUMBER>0000000000000000000000000)
"-157918-10-27T19:13:49Z"

pact> (add-time (time "2016-07-22T12:00:00Z")<PHONE_NUMBER>000000000000000000000000000000000000000000000000000000000000000)
"2016-07-22T12:00:00Z"

As you can see in some cases:

The time wraps around
The function doesn't work at all and returns the original time.

Expected Behavior
Either:

The function should trigger a transaction failure when an overflow is expected.
In the documentation, flag the add-time  as "unsafe" without prior boundaries check.

Thank you so much for the report.
We've actually raised this issue internally before, and the fix is on the roadmap. Thanks for bringing it to the forefront.
Indeed, pact-5 doesn't have it fixed because we're using the exact same library as pact (pact-time), so unfortunately, we have to fix it in the library or alternatively add a runtime check directly in the new compiler.

Thank you so much for the report.
We've actually raised this issue internally before, and the fix is on the roadmap. Thanks for bringing it to the forefront.
Indeed, pact-5 doesn't have it fixed because we're using the exact same library as pact (pact-time), so unfortunately, we have to fix it in the library or alternatively add a runtime check directly in the new compiler.

IMHO, the fix is relatively easy... It's just a matter of enforcing safe boundaries for dates and deltas, for unrealistic dates... (year 147997)
See my solution I did in Pact (I added some useful comments) . but need to be carefully reviewed and evaluated


Compatibility with shiro annotations

Do not work access control annotations from the framework "Shiro" https://shiro.apache.org/java-authorization-guide.html (used shiro and guice).
Example:
    @RequiresRoles("admin") // This is shiro annotations
    @RequestMethod("GET")
    @ResourcePath("/example")
    public Map<String, Object> getExample() {
        Map<String, Object> jsonMap = new LinkedHashMap<>();
        jsonMap.put("Hello", "World");
        return jsonMap;
    }

Response:
405 HTTP method GET is not supported by this URL

Response without annotation @RequiresRoles("admin") :
{
  "Hello": "World"
}

In the default servlet, annotations work fine.
Example:
@Singleton
@WebServlet(name="HelloServlet")
public class HelloServlet extends HttpServlet {

    @RequiresRoles("admin")
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html");
        response.setStatus(HttpServletResponse.SC_OK);
        response.getWriter().println("
 HelloServlet !
");
    }
}

Response:

 HelloServlet !

Thanks for the suggestion. This is a reasonable request, but it would require a dependency on Shiro. One of the project's goals is to depend only on the JDK and servlet API.
Instead, I have prototyped an enhancement that will allow a service to authorize a request by overriding a new method in WebService:
protected boolean isAuthorized(HttpServletRequest request, Method method) {
    ...
}

This method returns true by default. However, you should be able to override it in your service to check for the presence and value of the RequiresRoles annotation. I haven't used Shiro myself, but I would imagine that it provides an API you can use to programmatically (rather than declaratively) validate access.
This update is currently available on the "development" branch.

Yes, in Shiro programmatically access check is performed as follows:
Subject currentUser = SecurityUtils.getSubject();
if (currentUser.hasRole("admin") == false) {
    response.sendError(HttpServletResponse.SC_FORBIDDEN);
    return;
}

If I understand everything correctly, then in your implementation it will look like this:
@Override
protected boolean isAuthorized(HttpServletRequest request, Method method) {
    Subject currentUser = SecurityUtils.getSubject();
    if (currentUser.hasRole("admin") == false) {
        return false;
    }
    return true;
}

In this case, we can also use Shiro (or other) annotations:
@Override
protected boolean isAuthorized(HttpServletRequest request, Method method) {
    // Shiro annotations @RequiresRoles("admin")
    RequiresRoles requiresRoles = method.getAnnotation(RequiresRoles.class);
    if (requiresRoles != null) {
        String role = requiresRoles.value();
        Subject currentUser = SecurityUtils.getSubject();
        if (currentUser.hasRole(role) == false) {
            getResponse().sendError(HttpServletResponse.SC_FORBIDDEN);
            return false;
        }
    }
    return true;
}

Looks great :+1:

Sorry, I accidentally closed the ticket. Tell me, please, when will the new version be released in Maven repository?

I'll try to publish it sometime later today.

I noticed that the method "isAuthorized" is executed before saving the request and response. see rows . This means that the method "getResponse()" returns null. HttpServletResponse may be needed, for example, to present a custom error message:
@Override
protected boolean isAuthorized(HttpServletRequest request, Method method) throws IOException {
    Subject currentUser = SecurityUtils.getSubject();
    if (currentUser.hasRole("admin") == false) {
       String customError = "Subject does not have role [admin]";
       getResponse().sendError(HttpServletResponse.SC_FORBIDDEN, customError);
        return false;
    }
    return true;
}

but in this case we will have to catch "IOException". I propose to make this method more universal, for example:
protected boolean isAuthorized(HttpServletRequest request, HttpServletResponse response, Method method)
    throws IOException, ServletException {
    return true;
}

That's intentional. The thread-local variables are only intended for use by the service method, so they are only set once we know the method will be invoked.
Additionally, isAuthorized() is intended to be an idempotent operation - it should not modify the state of the response. WebService will automatically return an HTTP 403 if isAuthorized() returns false.

Ok, I understand you. Thank.

This is done.


support different horizontal axises for different scalar summaries

Is it possible to have different horizontal axises for different scalar summaries?
For example, I want to have a scalar summary of loss for each global step, and a scalar summary of network outputs for each epoch.
Currently, I have the same horizontal axis showing the global step for both like the following image.
Is it possible to have the global step (0 ... 8.0k) for loss and the epoch (0 ... 2.0k) for output_[0,0]?

If I set the epoch for output_[0,0], I get this:

I'm a bit confused by your request. Can you explain what you mean by "If I set the epoch for output_[0,0]"? What is an epoch in this context, and how does it relate to the data that TensorBoard is recieving from TensorFlow?

"setting the epoch" means using the epoch in place of the global step like
summary_writer.add_summary(sess.run(merge_epoch, feed_dict={}), epoch)

For example, change this line to epoch:
https://github.com/ninotoshi/playground/blob/master/tensorflow/xor/main.py#L142
I expect loss has 0.0 to 8.0k in the horizontal axis while output_[0,0] has 0.0 to 2.0k in the 2nd screen shot above.

Sorry for the slow response. It isn't possible to have different x-scales on different charts by default (although you could zoom by hand). I'm marking this contributions welcome; if you want to work on this let me know and I can provide some guidance on how to implement it.

Closing due to inactivity. That said, if you have a PR, please feel free to submit it to our new repository at https://github.com/tensorflow/tensorboard/pulls!


Cannot add a link to a remote project to the iPhone home screen

I cannot add a link to a remote project (e.g., https://insiders.vscode.dev/tunnel/my-server/home/username/projects/project-name) to my iPhone home screen.

Use iPhone Safari on iOS 16.1.1
Connect to a remote server
Open a remote folder
Press the Safari share button just next to the address bar
Choose Add to Home Screen
Note that the uneditable URL is missing everything after the domain name, and so you cannot get a nice icon on your home screen that very quickly opens a particular remote project

Version: 1.74.0-insider
Commit: fef85ea792f6627c83024d1df726ca729d8c9cb3
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15
Embedder: vscode.dev

We need to do a little work on vscode.dev to make start_url in the webmanifest reflect the current route.


ROX-13841,ROX-13190,ROX-7026: Preparatory changes for troubleshooting AdmissionControllerTest issues.

Description

introduce a podReady method with a common definition of a ready pod (all containers ready and deletion timestamp not set)
use this method in waitForPodsReady and ChaosMonkey
debug-log names of allegedly ready pods just before returning from waitForPodsReady
add a basic repro script that uses orchestrator.waitForAllPodsToBeRemoved and orchestrator.waitForPodsReady for convenient running as ./gradlew runSampleScript -PrunScript=reproROX13841
minor refactorings of ChaosMonkey: extract a constant, info-log pod deletions and initial ready pods, warn about pod count underruns, sleep after checks, not before in waitForReady
remove rotten grace period value from a comment in admission control mainCmd

Checklist

[ ] Investigated and inspected CI test results
[ ] Unit test and regression tests added
[x] ~Evaluated and added CHANGELOG entry if required~
[x] ~Determined and documented upgrade steps~
[x] ~Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)~

Testing Performed
Ran the repro script manually and made sure it still works as expected.
Planning to re-run the QA tests in CI a few times.

@gavin-stackrox how do I run CI against this PR on more cluster types? :thinking:

/test all

/test help

/test aro-qa-e2e-tests
/test eks-qa-e2e-tests
/test gke-kernel-qa-e2e-tests
-test gke-postgres-qa-e2e-tests
-test gke-qa-e2e-tests
/test gke-race-condition-qa-e2e-tests
/test openshift-newest-qa-e2e-tests
/test openshift-oldest-qa-e2e-tests
/test openshift-penultimate-qa-e2e-tests
/test osd-aws-qa-e2e-tests
/test osd-gcp-qa-e2e-tests
/test rosa-qa-e2e-tests

@gavin-stackrox how do I run CI against this PR on more cluster types? thinking

Ah, now I remember :-)

First cohort passed apart from the OSD one which failed to provision with Error: Failed to create cluster: unable to create cluster: status is 400, identifier is '400', code is 'CLUSTERS-MGMT-400' and operation identifier is 'fb249852-fda3-48f8-84b7-82f85d964b0b': The provided AWS credentials are not valid
Running second time:
/test aro-qa-e2e-tests
/test eks-qa-e2e-tests
/test gke-kernel-qa-e2e-tests
/test gke-postgres-qa-e2e-tests
/test gke-qa-e2e-tests
/test gke-race-condition-qa-e2e-tests
/test openshift-newest-qa-e2e-tests
/test openshift-oldest-qa-e2e-tests
/test openshift-penultimate-qa-e2e-tests
/test osd-aws-qa-e2e-tests
/test osd-gcp-qa-e2e-tests
/test rosa-qa-e2e-tests

These look unrelated, retrying
INFO[2023-01-13T14:32:03Z] Step rosa-qa-e2e-tests-rosa-create failed after 1h40m30s.

/test rosa-qa-e2e-tests
7309:/tmp/k8s-service-logs/stackrox/pods/central-64754cdf8d-ssnpc-central.log:pkg/images/enricher: 2023/01/13 14:25:47.803988 enricher_impl.go:645: Error: Error fetching image signatures for image "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:4cfb563a7c7f19d4898874eed207248c11513efaea3e2952c987a31381ca84c9": Get "https://quay.io/v2/openshift-release-dev/ocp-v4.0-art-dev/manifests/sha256:4cfb563a7c7f19d4898874eed207248c11513efaea3e2952c987a31381ca84c9": GET https://quay.io/v2/auth?scope=repository%3Aopenshift-release-dev%2Focp-v4.0-art-dev%3Apull&service=quay.io: unexpected status code 502 Bad Gateway:
ERROR: Found at least one suspicious log file entry.
Exception raised in ['tests/e2e/lib.sh', 'check_stackrox_logs', '/tmp/k8s-service-logs'], Command '['tests/e2e/lib.sh', 'check_stackrox_logs', '/tmp/k8s-service-logs']' returned non-zero exit status 1.

/test openshift-newest-qa-e2e-tests


Move to latest App Services MSI API version

Move Azure.Identity to the latest App Services MSI API version.
Update /sdk/e2e Azure Functions date parsing tests

Duplicate of #11346


Place label on top of prefixIcon

Is there a way to place label on top of prefixIcon in TextFormField?

Here is a sample code
Center(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: TextFormField(
          decoration: InputDecoration(
            labelText: "Label",
            prefixIcon: Icon(Icons.photo_camera_front),
          ),
        ),
      ),
    )

I can somehow achieve that by using prefix instead of prefixIcon (see code below)
Center(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: TextFormField(
          decoration: InputDecoration(
            labelText: "Label",
            prefix: Container(
              constraints: BoxConstraints(
                minWidth: 48.0,
                maxWidth: 48.0,
              ),
              child: Icon(Icons.photo_camera_front),
            ),
          ),
        ),
      ),
    )

but the issue here is that label replaced icon when focus is lost. see video here
Is there a way to combine these two behaviors? i.e,
1 - show label on top of icon.
2 - make sure the icon doesn't disappear when text field is empty and has no focus.
Here is my flutter doctor
[✓] Flutter (Channel beta, 1.24.0-10.2.pre, on macOS 11.2 20D64 darwin-x64, locale en-TR)
    • Flutter version 1.24.0-10.2.pre at /Users/bisma/Desktop/Flutter/flutter
    • Framework revision 022b333a08 (3 months ago), 2020-11-18 11:35:09 -0800
    • Engine revision 07c1eed46b
    • Dart version 2.12.0 (build 2.12.0-29.10.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/bisma/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio/Android Studio 4.1 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.10.0

[✓] Android Studio
    • Android Studio at /Applications/Android Studio/Android Studio 4.1 Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • iPhone 11 Pro Max (mobile) • D2DDFE8A-E9DE-4FEC-A31B-D5BA54D0111F • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-4 (simulator)

• No issues found!

Is there a way to place label on top of prefixIcon in TextFormField?

@bismarabia
if you need assistance with your code please follow the link I want help writing my application in the new issue menu

Hi @bismarabia
What you want is currently possible, see the code bellow.

1 - show label on top of icon.

For this issue, see https://github.com/flutter/flutter/issues/67707.

code sample
import 'package:flutter/material.dart';

void main() => runApp(MyAppLogin());

class MyAppLogin extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Login Demo',
      theme: ThemeData(
        primarySwatch: Colors.deepPurple,
        accentColor: Colors.orange,
      ),
      home: Scaffold(
        body: Center(
          child: Padding(
            padding: const EdgeInsets.symmetric(horizontal: 40),
            child: TextFormField(
              decoration: InputDecoration(
                labelText: 'Label',
                floatingLabelBehavior: FloatingLabelBehavior.auto,
                prefixIcon: Icon(Icons.person),
                border: OutlineInputBorder()
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Hi @pedromassangocode
that's not what I wanted.
what I wanted is to place the label right above the icon. I mean removing the left padding from the label.

@bismarabia
it's supposed a implement material design not to anyone's wish list

what I wanted is to place the label right above the icon. I mean removing the left padding from the label.

Isn't it what the mentioned issue is about?


First-class IHaskell support

Hi! I was hoping we could work out how to support IHaskell as a first-class citizen on mybinder.org. The Dockerfile in that repo works, as well as this one, and I think that's a good start. What would the next step be?

I am not sure I understand what "first class" would mean in this context.
Are you thinking of adding a file to specify haskell package manager packages that get installed by default like http://repo2docker.readthedocs.io/en/latest/samples.html#r-environment-install-r is for R? So this would be adding a new build pack to repo2docker.

Yes, that's it exactly. Thanks, I will look into build packs.

@vaibhavsagar mind if we move this over to repo2docker, now that we know the addition would need to happen there?

Sure!


ClusterEnsembles does not seem available anymore

ClusterEnsembles seems to not be available to download/install anymore. Find different package.

Consensus clustering was removed in PR #2. A new package should be found.


Why not zoom_x and zoom_y for each camera ?

Why you didnt use zoom_x and zoom_y for each camera that will allow us to flip a walking animation for example and not to load it twice  by making zoom_x nagative before bliting and then restore it ..... , if you have another solution for that ,like  a simulation for zoom_x/zoom_y , let me know plz , thanks
Edit  :

i used ( and developed for ) allegro  library for years and they have this option
i added it on my local version of sdl_gpu

This would be a good thing to have.  If your version is all set, you can go ahead and make a pull request.

@grimfang4 i have downloaded the last version from the git , i have added this feature , but then you have added something in the sourse so i don't want to update and loose your changes , i know it is not how it works , but by the way , adding this feature now is sooo easy ,  because now sdl gpu uses matrix manipulation everywhere  , i did it in 1 minut

Bump This feature would add to the awesomeness.
Any working examples of using the Camera? I'm still in school so I'm struggling to use the camera. If there was a working example I could look at it would be incredibly helpful.

examples

Not really , i have been using this for my game engine , so it was a feature impleimentation


Fix private DNS in GCP after merge and other fixes

This PR fixes the private DNS setup in GCP that was missing this from the original PR.
It also removes some unneeded access to additional cloud providers and makes the eshop deploy a bit more resilient.

@smarunich friendly reminder :) Is there anything left here, or I can merge this one?

I did not forget, I was waiting your feedback on accessbindings https://github.com/smarunich/tetrate-service-bridge-sandbox/pull/133#discussion_r1002783115

Hmmm I can't find that conversation anywhere?

Hmmm I can't find that conversation anywhere?

Indeed I dont see it, if i am checking over browser (not logged in)
Reposting
interesting though... that the change was accepted ,but translated to
tsbadmin@r153d6-1-jumpbox:~$ tctl get AccessBindings admin/rbac -o yaml
apiVersion: rbac.tsb.tetrate.io/v2
kind: AccessBindings
metadata:
  fqn: admin/rbac
spec:
  allow:
  - role: rbac/admin
    subjects:
    - serviceAccount: organizations/tetrate/serviceaccounts/cluster-gke-r153d6-us-east1-1

However there is a problem, as we overwrite the list here, so for multi-cluster deployment... rbac/admin will be overwritten by the latest provisioned cluster, i.e. by the latest apply, we need to patch the list here, instead of apply.
I have done something similar before like this
tsbadmin@r153d6-0-jumpbox:~$ export ORG="tetrate"
tsbadmin@r153d6-0-jumpbox:~$ export cluster="test"
tsbadmin@r153d6-0-jumpbox:~$ tctl get accessbindings admin/rbac -o json | jq --arg cluster organizations/$ORG/serviceaccounts/cluster-$CLUSTER  '. | select(.spec.allow[].role=="rbac/admin").spec.allow[].subjects +=[{"serviceAccount":$cluster}]'
{
  "apiVersion": "rbac.tsb.tetrate.io/v2",
  "kind": "AccessBindings",
  "metadata": {
    "fqn": "admin/rbac"
  },
  "spec": {
    "allow": [
      {
        "role": "rbac/admin",
        "subjects": [
          {
            "serviceAccount": "organizations/tetrate/serviceaccounts/cluster-gke-r153d6-us-west1-0"
          },
          {
            "serviceAccount": "organizations/tetrate/serviceaccounts/cluster-test"
          }
        ]
      }
    ]
  }
}

wdyt?

Tested it and seemed to work. Once 2 CPs were deployed:
tsbadmin@nacx-test-0-jumpbox:~$ tctl get ab admin/rbac -o yaml
apiVersion: rbac.tsb.tetrate.io/v2
kind: AccessBindings
metadata:
  fqn: admin/rbac
spec:
  allow:
  - role: rbac/admin
    subjects:
    - serviceAccount: organizations/tetrate/serviceaccounts/cluster-gke-nacx-test-europe-southwest1-0
    - serviceAccount: organizations/tetrate/serviceaccounts/cluster-gke-nacx-test-europe-west1-1


Contours are sometimes closed when stroked by CWS.

Doesn't seem to happen with all inputs, but it happens with Noto Hand's E. Will investigate at the start of the next work week.

This issue has been located as an MFEK issue, closing this here.