Skip to content
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

[MI-2410] Updated subscription card to display run event filters and filter popover for pipelines #123

Merged
merged 14 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions server/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ const (
QueryParamPerPage = "per_page"

// Filters
FilterCreatedByMe = "me"
FilterCreatedByAnyone = "anyone"
FilterAllChannels = "all_channels"
FilterAll = "all"
FilterBoards = "boards"
FilterRepos = "repos"
FilterPipelines = "pipelines"
EventTypeRelease = "release"
FilterIDReleaseDefinitionID = "releaseDefinitionId"
FilterIDReleaseEnvironmentID = "releaseEnvironmentId"
FilterCreatedByMe = "me"
FilterCreatedByAnyone = "anyone"
FilterAllChannels = "all_channels"
FilterAll = "all"
FilterBoards = "boards"
FilterRepos = "repos"
FilterPipelines = "pipelines"
FilterReleaseDefinitionID = "releaseDefinitionId"
FilterReleaseEnvironmentID = "releaseEnvironmentId"

EventOfTypeRelease = "release"
ayusht2810 marked this conversation as resolved.
Show resolved Hide resolved

DefaultPage = 0
DefaultPerPageLimit = 50
Expand Down
8 changes: 4 additions & 4 deletions server/plugin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ func (c *client) GetSubscriptionFilterPossibleValues(request *serializers.GetSub

var subscriptionFilters []*serializers.SubscriptionFilter
for _, filter := range request.Filters {
if strings.Contains(request.EventType, constants.EventTypeRelease) && (filter == constants.FilterReleaseDefinitionID || filter == constants.FilterReleaseEnvironmentID) {
if strings.Contains(request.EventType, constants.EventOfTypeRelease) && (filter == constants.FilterReleaseDefinitionID || filter == constants.FilterReleaseEnvironmentID) {
subscriptionFilters = append(subscriptionFilters, &serializers.SubscriptionFilter{InputID: filter})
} else if !strings.Contains(request.EventType, constants.EventTypeRelease) {
} else if !strings.Contains(request.EventType, constants.EventOfTypeRelease) {
subscriptionFilters = append(subscriptionFilters, &serializers.SubscriptionFilter{InputID: filter})
}
}
Expand All @@ -297,7 +297,7 @@ func (c *client) GetSubscriptionFilterPossibleValues(request *serializers.GetSub
}
}

if strings.Contains(request.EventType, constants.EventTypeRelease) {
if strings.Contains(request.EventType, constants.EventOfTypeRelease) {
subscriptionFiltersRequest.Subscription.PublisherInputs = serializers.PublisherInputsGeneric{
ProjectID: request.ProjectID,
ReleaseDefinitionID: request.ReleasePipelineID,
Expand All @@ -312,7 +312,7 @@ func (c *client) GetSubscriptionFilterPossibleValues(request *serializers.GetSub
}

baseURL := c.plugin.getConfiguration().AzureDevopsAPIBaseURL
if strings.Contains(request.EventType, constants.EventTypeRelease) {
if strings.Contains(request.EventType, constants.EventOfTypeRelease) {
baseURL = strings.Replace(baseURL, "://", "://vsrm.", 1)
}

Expand Down