-
Notifications
You must be signed in to change notification settings - Fork 0
05 Add a delete dialog
Yirica edited this page Feb 12, 2021
·
6 revisions
With the edit page completed we can now move on to the creation of a delete dialog.
The delete dialog should meet the following requirements:
- Should be placed in pages/list/dialogs folder
- Should consist at least of the following files: confirm-delete.dialog.html, confirm-delete.dialog.ts and maybe confirm-delete.dialog.scss.
- The dialog should be opened via a delete button, which must be added to the pokemon-list
- It should be possible to either delete a single Pokémon or an selection of them at once.
- The dialog should display the sprites (
https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/<pokemon_id>.png
) of the Pokémon to delete using the ps-dialog-wrapper. - You can use
DemoDialogWrapperDataSource
from the shared folder as the datasource for your ps-dialog-wrapper. - httpDeletePokemon(...) from the shared/http folder and the corresponding dtos should be used to delete the data. Note: As of now, the delete function does not really delete the Pokémon but instead returns an error "You no delete Pokémon!".
- The button "Cancel" should close the dialog without further actions while the button "OK" should try to delete the Pokémon and reload the list on success. In case of an error, the dialog should stay open and display the error of the http call.
- The dialog should have a caption.
- The dialog should not be wider than the list itself.
- Choose a percentage at which the sprite becomes shiny (i.e. 1 in a 100)
- Check for every Sprite if it is shiny (
https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/<pokemon_id>.png
)
In the end your solution should look similar to our provided example in this commit.
This concludes the creation of the delete dialog. The tutorial continues with Step 6.