This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Fix health container numbers and pagination numbers #725
Merged
arbulu89
merged 7 commits into
trento-project:main
from
arbulu89:hotfix/fix-pagination-numbers-health
Jan 24, 2022
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c8c5678
Visualize the health container and pagination number properly
arbulu89 e222e35
Filter the hosts properly by health
arbulu89 b1ad59a
Filter the clusters properly by health
arbulu89 288eca0
Update the tests to use the new filters
arbulu89 730fd83
Rename paginated lists variable names
arbulu89 1c80b6e
Move last checks result query to checks service
arbulu89 e69fbba
Improve hosts filtering and pagination e2e tests
arbulu89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,34 +32,35 @@ func NewSAPSystemListHandler(sapSystemsService services.SAPSystemsService) gin.H | |
Size: pageSize, | ||
} | ||
|
||
sapSystems, err := sapSystemsService.GetAllApplications(tagsFilter, page) | ||
paginatedSapSystems, err := sapSystemsService.GetAllApplications(tagsFilter, page) | ||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
|
||
filterSIDs, err := sapSystemsService.GetAllApplicationsSIDs() | ||
sapSystems, err := sapSystemsService.GetAllApplications(tagsFilter, nil) | ||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
|
||
filterTags, err := sapSystemsService.GetAllApplicationsTags() | ||
filterSIDs, err := sapSystemsService.GetAllApplicationsSIDs() | ||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
|
||
count, err := sapSystemsService.GetApplicationsCount() | ||
filterTags, err := sapSystemsService.GetAllApplicationsTags() | ||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
pagination := NewPagination(count, pageNumber, pageSize) | ||
|
||
pagination := NewPagination(len(sapSystems), pageNumber, pageSize) | ||
|
||
c.HTML(http.StatusOK, "sap_systems.html.tmpl", gin.H{ | ||
"Type": models.SAPSystemTypeApplication, | ||
"SAPSystems": sapSystems, | ||
"SAPSystems": paginatedSapSystems, | ||
"AppliedFilters": query, | ||
"FilterSIDs": filterSIDs, | ||
"FilterTags": filterTags, | ||
|
@@ -91,34 +92,35 @@ func NewHANADatabaseListHandler(sapSystemsService services.SAPSystemsService) gi | |
Size: pageSize, | ||
} | ||
|
||
databases, err := sapSystemsService.GetAllDatabases(tagsFilter, page) | ||
paginatedDatabases, err := sapSystemsService.GetAllDatabases(tagsFilter, page) | ||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
|
||
filterSIDs, err := sapSystemsService.GetAllDatabasesSIDs() | ||
databases, err := sapSystemsService.GetAllDatabases(tagsFilter, nil) | ||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
|
||
filterTags, err := sapSystemsService.GetAllDatabasesTags() | ||
filterSIDs, err := sapSystemsService.GetAllDatabasesSIDs() | ||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
|
||
count, err := sapSystemsService.GetDatabasesCount() | ||
filterTags, err := sapSystemsService.GetAllDatabasesTags() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, I don't think we need to do the whole table fetching. |
||
if err != nil { | ||
_ = c.Error(err) | ||
return | ||
} | ||
pagination := NewPagination(count, pageNumber, pageSize) | ||
|
||
pagination := NewPagination(len(databases), pageNumber, pageSize) | ||
|
||
c.HTML(http.StatusOK, "sap_systems.html.tmpl", gin.H{ | ||
"Type": models.SAPSystemTypeDatabase, | ||
"SAPSystems": databases, | ||
"SAPSystems": paginatedDatabases, | ||
"AppliedFilters": query, | ||
"FilterSIDs": filterSIDs, | ||
"FilterTags": filterTags, | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As a suggestion for the future:
This could be a custom
cy
command https://docs.cypress.io/api/cypress-api/custom-commands, and we can think of it as a custom assertion for pagination.Something along these lines:
which then becomes accessible as
in the different variants.
Look, don't bother changing it now, as I understand it wouldn't add much value right now 😄
Just wanted to share the cypress concept of custom command that might become more and more useful as we go.