-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsaved changes modal #252
Conversation
…nsaved-changes-modal # Conflicts: # core/src/services/routing.js
…nsaved-changes-modal
…nsaved-changes-modal
…nsaved-changes-modal
…nsaved-changes-modal # Conflicts: # core/src/services/routing.js
It does not work properly in preserveView/goBack scenario: when you are on a page where there is a go back possibility with preserved view and you try to go back using linkManager().goBack() and the current page is dirty the content goes back to the preserved view, the URL stays the same, and the unsaved changes modal pops up. Independent of what you choose (Yes or No) the situation won't get better. |
Don't we want to have a backdrop for the unsaved changes modal? |
Good point. This was not requested as part of this ticket, if needed I would do it in a separate task. |
done |
done |
…hanges-modal # Conflicts: # core/src/App.html # core/src/Authorization.html # core/src/navigation/LeftNav.html # core/src/navigation/TopNav.html # core/src/services/routing.js # core/src/utilities/helpers/generic-helpers.js
docs/luigi-client-api.md
Outdated
|
||
### navigate | ||
|
||
Navigates to the given path in the hosting Luigi application. Contains either a full absolute path or a relative path without a leading slash that uses the active route as a base. This is a standard navigation. | ||
Navigates to the given path in application hosted by Luigi. It contains either a full absolute path or a relative path without a leading slash that uses the active route as a base. This is the standard navigation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Navigates to the given path in application hosted by Luigi. It contains either a full absolute path or a relative path without a leading slash that uses the active route as a base. This is the standard navigation. | |
Navigates to the given path in the application hosted by Luigi. It contains either a full absolute path or a relative path without a leading slash that uses the active route as a base. This is the standard navigation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/luigi-client-api.md
Outdated
LuigiClient.linkManager.fromContext("currentTeam").withParams({foo: "bar"}).navigate("path") | ||
``` | ||
|
||
Returns **[linkManager](#linkmanager)** link manager instance. | ||
|
||
### pathExists | ||
|
||
Checks if a path you can navigate to exists in the main application. You can use this helper method to perform actions such as conditional display of a DOM element like a button. | ||
Checks if the path you can navigate to exists in the main application. For example, you can use this helper method conditionally display a DOM element like a button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checks if the path you can navigate to exists in the main application. For example, you can use this helper method conditionally display a DOM element like a button. | |
Checks if the path you can navigate to exists in the main application. For example, you can use this helper method conditionally to display a DOM element like a button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/luigi-client-api.md
Outdated
|
||
### setDirtyStatus | ||
|
||
Makes current page dirty or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes current page dirty or not | |
Makes the current page dirty or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain in more details what is meant in this sentence? As for the periods at the end of the sentence and starting it with the verb without a subject I am against but added it here to keep the consistency in the whole text as I can see the rest starts and end similarly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method informs the main application that the current page or component in the iframe is dirty, which means it has unsaved changes, like for example a page with form fields which has been modified from their original values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/luigi-client-api.md
Outdated
|
||
#### Parameters | ||
|
||
- `isDirty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** tells if current page/component has any unsaved changes at the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `isDirty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** tells if current page/component has any unsaved changes at the moment | |
- `isDirty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** tells if the current page or component has any unsaved changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
docs/luigi-client-api.md
Outdated
|
||
### setDirtyStatus | ||
|
||
This method informs the main application that the current view in the iframe has unsaved changes, like for example a view with form fields which have been edited but not yet submitted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method informs the main application that the current view in the iframe has unsaved changes, like for example a view with form fields which have been edited but not yet submitted. | |
This method informs the main application that there are unsaved changes in the current view in the iframe. For example, that can be a view with form fields which were edited but not submitted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
#### Parameters | ||
|
||
- `isDirty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** tells if the current page or component has any unsaved changes at the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `isDirty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** tells if the current page or component has any unsaved changes at the moment | |
- `isDirty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** tells if there are any unsaved changes on the current page or component |
This change definitely needs a backdrop support which should be provided with #352.
I left some comments with my suggestions about how Core's backdrop can be handled.
Changes proposed in this pull request:
ConfirmationModal
App.js
and return a promise with the resultrouting.js::handleRouteChange()
if current page is dirty, then wait for resultRelated issue(s)
Resolves #210
Don't forget to swap your Console repo to the branch from this PR: