Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Switch to projected sapsystems list #538

Conversation

fabriziosestito
Copy link
Member

@fabriziosestito fabriziosestito commented Dec 2, 2021

Switches to projected sapsystems list and fixes some quirks in the tags methods of clusters and hosts handlers (#

The tag api will use the new service in a follow up PR

Fixes #544, #545

@fabriziosestito fabriziosestito force-pushed the switch_to_projected_sapsystems_list branch 2 times, most recently from 60868fa to 52a69a7 Compare December 6, 2021 14:52
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to say, I like it

Comment on lines +57 to +62
err := s.db.
Model(&entities.SAPSystemInstance{}).
Group("type").
Having("type = ?", models.SAPSystemTypeApplication).
Count(&count).
Error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOOOOH

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You rock 💪

@@ -164,7 +164,8 @@ func (s *clustersService) GetAllTags() ([]string, error) {
var tags []string

err := s.db.
Model(&models.Tag{ResourceType: models.TagClusterResourceType}).
Model(&models.Tag{}).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me to understand: is the behaviour the same as before with
Model(&models.Tag{ResourceType: models.TagClusterResourceType})?

Copy link
Member Author

@fabriziosestito fabriziosestito Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something slipped in the various refactors, this is not working since Model only infers the type from the passed struct and ignores conditions. Fixes: #544

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Filters tags added at page of Hosts shows up on page Peacemake Clusters
3 participants