-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AlertComponent for displaying alerts in the GUI (#1975)
* Add AlertComponent for displaying alerts in the GUI * Add AlertComponent in index.ts * Refactor AlertComponent to handle dynamic message and update dependencies * Renamed AlertComponent to Notification and updated dependencies * updated dependencies * updated viselements.json * Refactor Notification component to handle dynamic message and add defaultMessage property * Apply suggestions from code review Co-authored-by: Fabien Lelaquais <[email protected]> * Refactor Notification component and add dynamic message handling - Refactor the Notification component in Taipy to improve code readability and maintainability. - Add support for dynamic message handling using the useDynamicProperty hook. - Remove the variant and defaultMessage properties from the Notification component, as they are no longer needed. Closes #693 * Renamed Notification component to Alert and vice versa and updated dependencies * Refactor Alert component and update dependencies * Refactor Alert component to add dynamic rendering capability * feat: Enhance TaipyAlert with dynamic classNames and dispatch actions - Added dynamic className handling to TaipyAlert component. - Implemented dispatching of update actions. - Fixed issues with severity and variant properties. - Added unit tests to validate the new behavior, with all tests passing successfully. * Add Alert.py example with dynamic properties and button to update alert * Refactor Alert.py example and add package.json - Refactor Alert.py example to remove unused code and simplify the page structure. - Add package.json file for frontend/taipy directory from develop branch. * refactor package.json to match it with develop branch * Add license headers to Alert components * Fixed linter issue using ruff * Refactor Notification component and fix merge issue * Refactor Notification component and fix issue due to other PR * Refactor Notification test component to include notificationId in alerts --------- Co-authored-by: Fabien Lelaquais <[email protected]> Co-authored-by: Fred Lefévère-Laoide <[email protected]>
- Loading branch information
1 parent
31a4629
commit 3621961
Showing
9 changed files
with
424 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2021-2024 Avaiga Private Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations under the License. | ||
# ----------------------------------------------------------------------------------------- | ||
# To execute this script, make sure that the taipy-gui package is installed in your | ||
# Python environment and run: | ||
# python <script> | ||
# ----------------------------------------------------------------------------------------- | ||
from taipy.gui import Gui | ||
|
||
severity = "error" | ||
variant = "filled" | ||
message = "This is an error message." | ||
|
||
page = """ | ||
<|{message}|alert|severity={severity}|variant={variant}|> | ||
""" | ||
|
||
if __name__ == "__main__": | ||
gui = Gui(page) | ||
gui.run(title="Test Alert") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.