From 119cd06bd58289e93208f739a2c4dea1dec91196 Mon Sep 17 00:00:00 2001 From: Ayush Thakur <100013900+ayusht2810@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:08:37 +0530 Subject: [PATCH 01/10] [MM-583] Add feature to sort subscriptions on the basis of name (#1101) --- server/subscribe.go | 21 ++++- webapp/.gitignore | 1 + webapp/junit.xml | 187 -------------------------------------------- 3 files changed, 18 insertions(+), 191 deletions(-) delete mode 100644 webapp/junit.xml diff --git a/server/subscribe.go b/server/subscribe.go index ce6ee2960..2a1351613 100644 --- a/server/subscribe.go +++ b/server/subscribe.go @@ -237,6 +237,10 @@ func (p *Plugin) getSubscriptionsForChannel(instanceID types.ID, channelID strin channelSubscriptions = append(channelSubscriptions, subs.Channel.ByID[channelSubscriptionID]) } + sort.Slice(channelSubscriptions, func(i, j int) bool { + return channelSubscriptions[i].Name < channelSubscriptions[j].Name + }) + return channelSubscriptions, nil } @@ -501,13 +505,22 @@ func (p *Plugin) listChannelSubscriptions(instanceID types.ID, teamID string) (s } rows = append(rows, fmt.Sprintf("\t* (%d) %s", len(subsIDs), instanceID)) + channelSubscriptions := []ChannelSubscription{} for _, subID := range subsIDs { sub := subs.Channel.ByID[subID] - subName := "(No Name)" - if sub.Name != "" { - subName = sub.Name + if sub.Name == "" { + sub.Name = "(No Name)" } - rows = append(rows, fmt.Sprintf("\t\t* %s - %s", sub.Filters.Projects.Elems()[0], subName)) + + channelSubscriptions = append(channelSubscriptions, sub) + } + + sort.Slice(channelSubscriptions, func(i, j int) bool { + return channelSubscriptions[i].Name < channelSubscriptions[j].Name + }) + + for _, channelSubscription := range channelSubscriptions { + rows = append(rows, fmt.Sprintf("\t\t* %s - %s", channelSubscription.Filters.Projects.Elems()[0], channelSubscription.Name)) } } } diff --git a/webapp/.gitignore b/webapp/.gitignore index 4894cdba6..b8a3eca3c 100644 --- a/webapp/.gitignore +++ b/webapp/.gitignore @@ -1,3 +1,4 @@ build node_modules .npminstall +junit.xml diff --git a/webapp/junit.xml b/webapp/junit.xml deleted file mode 100644 index fa4bc0090..000000000 --- a/webapp/junit.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 5b762da33da8b41abaa51d82fd99d525db9eca8d Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal Date: Fri, 6 Sep 2024 15:53:33 +0530 Subject: [PATCH 02/10] [GH-1011] Added conditional to avoid posting multiple notifications in case of duplicate subscriptions (#1103) * [GH-1011] Added conditional to avoid posting multiple notifications in case of duplicate subscriptions. * [MM-1011]: used map in place of traversing array for getChannelsSubscribed * [MM-1011]: Update the map on every iteration --------- Co-authored-by: kshitij katiyar --- server/subscribe.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/subscribe.go b/server/subscribe.go index 2a1351613..59fd81037 100644 --- a/server/subscribe.go +++ b/server/subscribe.go @@ -206,10 +206,14 @@ func (p *Plugin) getChannelsSubscribed(wh *webhook, instanceID types.ID) ([]Chan } var channelSubscriptions []ChannelSubscription + subscriptionMap := make(map[string]bool) subIds := subs.Channel.ByID for _, sub := range subIds { if p.matchesSubsciptionFilters(wh, sub.Filters) { - channelSubscriptions = append(channelSubscriptions, sub) + if !subscriptionMap[sub.ChannelID] { + subscriptionMap[sub.ChannelID] = true + channelSubscriptions = append(channelSubscriptions, sub) + } } } From 9fef9b103428757f4ff3549767f1e37ed57ac3fb Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal Date: Fri, 6 Sep 2024 19:43:30 +0530 Subject: [PATCH 03/10] [MM-60323] Updated doc links in system console settings (#1117) * [MM-60323] Updated doc links in system console settings * [MM-60323] Updated Jira webhook link --- plugin.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.json b/plugin.json index 6b317646a..c8d184af1 100644 --- a/plugin.json +++ b/plugin.json @@ -20,8 +20,8 @@ "bundle_path": "webapp/dist/main.js" }, "settings_schema": { - "header": "Please refer to the '/jira' command [**documentation**](https://docs.mattermost.com/integrate/jira-interoperability.html#setup) to further configure the Jira plugin.", - "footer": "Please refer to the '/jira' command [**documentation**](https://docs.mattermost.com/integrate/jira-interoperability.html#setup) to further configure the Jira plugin. Specifically, ['/jira instance [un-]install'](https://docs.mattermost.com/integrate/jira-interoperability.html#setup) and ['/jira webhook'](https://docs.mattermost.com/integrate/jira-interoperability.html#configure-webhooks-in-jira).", + "header": "Please refer to the '/jira' command [**documentation**](https://mattermost.com/pl/integrate/jira-admin-setup) to further configure the Jira plugin.", + "footer": "Please refer to the '/jira' command [**documentation**](https://mattermost.com/pl/integrate/jira-admin-setup) to further configure the Jira plugin. Specifically, ['/jira instance [un-]install'](https://mattermost.com/pl/integrate/jira-admin-setup) and ['/jira webhook'](https://mattermost.com/pl/integrate/configure-webhooks-in-jira).", "settings": [ { "key": "EnableJiraUI", From 1c92ba8af8c0b9a4f4903d8e3558bc990e7f4cea Mon Sep 17 00:00:00 2001 From: kshitij katiyar <90389917+Kshitij-Katiyar@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:01:22 +0530 Subject: [PATCH 04/10] [MM-673]: Updated the instance connect autocomplete data to show alias and url both (#1109) * [MM-673]: Updated the instance connect autocomplete data to show alias and url both * [MM-673]: Added jira instance URL to helpText * [MM-673]: Added alias based autocomplete in uninstall command --- server/command.go | 4 ++-- server/instances.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server/command.go b/server/command.go index d82cc6272..9f877e96b 100644 --- a/server/command.go +++ b/server/command.go @@ -188,7 +188,7 @@ func createInstanceCommand(optInstance bool) *model.AutocompleteData { uninstall := model.NewAutocompleteData( "uninstall", "[server|cloud-oauth] [URL]", "Disconnect Mattermost from a Jira instance") uninstall.AddStaticListArgument("Jira type: server, cloud or cloud-oauth", true, jiraTypes) - uninstall.AddDynamicListArgument("Jira instance", makeAutocompleteRoute(routeAutocompleteInstalledInstance), true) + uninstall.AddDynamicListArgument("Jira instance", makeAutocompleteRoute(routeAutocompleteInstalledInstanceWithAlias), true) uninstall.RoleID = model.SystemAdminRoleId list := model.NewAutocompleteData( @@ -229,7 +229,7 @@ func withParamIssueKey(cmd *model.AutocompleteData) { func createConnectCommand() *model.AutocompleteData { connect := model.NewAutocompleteData( "connect", "", "Connect your Mattermost account to your Jira account") - connect.AddDynamicListArgument("Jira URL", makeAutocompleteRoute(routeAutocompleteConnect), false) + connect.AddDynamicListArgument("Jira URL", makeAutocompleteRoute(routeAutocompleteInstalledInstanceWithAlias), false) return connect } diff --git a/server/instances.go b/server/instances.go index c85e669a8..d41efa03b 100644 --- a/server/instances.go +++ b/server/instances.go @@ -418,11 +418,14 @@ func (p *Plugin) httpAutocompleteInstalledInstanceWithAlias(w http.ResponseWrite for _, instanceID := range info.Instances.IDs() { item := instances.getAlias(instanceID) + helpText := string(instanceID) if item == "" { item = string(instanceID) + helpText = "" } out = append(out, model.AutocompleteListItem{ - Item: item, + Item: item, + HelpText: helpText, }) } return respondJSON(w, out) From 3f7e52bcc42c7695364d12bb58019afcc9338dfc Mon Sep 17 00:00:00 2001 From: kshitij katiyar <90389917+Kshitij-Katiyar@users.noreply.github.com> Date: Mon, 9 Sep 2024 22:26:52 +0530 Subject: [PATCH 05/10] [MI-3501]: Fixed issue of Jira bot DM when you mention yourself in a comment (#973) Co-authored-by: raghavaggarwal2308 --- server/webhook_parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/webhook_parser.go b/server/webhook_parser.go index 6263a6069..7bc78cfd4 100644 --- a/server/webhook_parser.go +++ b/server/webhook_parser.go @@ -270,7 +270,7 @@ func appendCommentNotifications(wh *webhook, verb string) { } // don't mention the author of the comment - if u == jwh.User.Name || u == jwh.User.AccountID { + if u == jwh.User.Name || u == jwh.User.AccountID || u == jwh.Comment.Author.AccountID { continue } From 9ad45c06aff2f0a94a2d60f2a5cd1d3f4c81e0b7 Mon Sep 17 00:00:00 2001 From: kshitij katiyar <90389917+Kshitij-Katiyar@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:46:23 +0530 Subject: [PATCH 06/10] [MM-1096]: Fixed improper markdown for Jira comments received as a subscription in mattermost (#1115) * [MM-1096]: added additional handling for comment markdown from jira * [MM-1096]: review fixes * [MM-1096]: added preProcessing for issueDescription notification * [MM-1096]: review fixes * Update server/webhook_parser.go Co-authored-by: Raghav Aggarwal * [MM-1096]: review fixes * [MM-1096]: Added testcase for preProcessText function in webhook_parser.go file * [MM-1096]: Fixed the markdown for quotes * [MM-1096]: added testcase for quoted text * [MM-1096]: Added handling non-language specific code blocks * [MM-1096]: Fixed lint --------- Co-authored-by: Raghav Aggarwal --- server/webhook_parser.go | 96 +++++++++++++++++++++++++++++- server/webhook_parser_misc_test.go | 77 ++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 3 deletions(-) diff --git a/server/webhook_parser.go b/server/webhook_parser.go index 7bc78cfd4..9cb7e1c95 100644 --- a/server/webhook_parser.go +++ b/server/webhook_parser.go @@ -7,6 +7,8 @@ import ( "encoding/json" "fmt" "os" + "regexp" + "strconv" "strings" "time" @@ -245,7 +247,7 @@ func parseWebhookCommentCreated(jwh *JiraWebhook) (Webhook, error) { JiraWebhook: jwh, eventTypes: NewStringSet(eventCreatedComment), headline: fmt.Sprintf("%s **commented** on %s", commentAuthor, jwh.mdKeySummaryLink()), - text: truncate(quoteIssueComment(jwh.Comment.Body), 3000), + text: truncate(quoteIssueComment(preProcessText(jwh.Comment.Body)), 3000), } appendCommentNotifications(wh, "**mentioned** you in a new comment on") @@ -316,6 +318,94 @@ func quoteIssueComment(comment string) string { return "> " + strings.ReplaceAll(comment, "\n", "\n> ") } +// preProcessText processes the given string to apply various formatting transformations. +// The purpose of the function is to convert the formatting provided by JIRA into the corresponding formatting supported by Mattermost. +// This includes converting asterisks to bold, hyphens to strikethrough, JIRA-style headings to Markdown headings, +// JIRA code blocks to inline code, numbered lists to Markdown lists, colored text to plain text, and JIRA links to Markdown links. +// For more reference, please visit https://github.com/mattermost/mattermost-plugin-jira/issues/1096 +func preProcessText(jiraMarkdownString string) string { + asteriskRegex := regexp.MustCompile(`\*(\w+)\*`) + hyphenRegex := regexp.MustCompile(`-(\w+)-`) + headingRegex := regexp.MustCompile(`(?m)^(h[1-6]\.)\s+`) + langSpecificCodeBlockRegex := regexp.MustCompile(`\{code:[^}]+\}(.+?)\{code\}`) + numberedListRegex := regexp.MustCompile(`^#\s+`) + colouredTextRegex := regexp.MustCompile(`\{color:[^}]+\}(.*?)\{color\}`) + linkRegex := regexp.MustCompile(`\[(.*?)\|([^|\]]+)(?:\|([^|\]]+))?\]`) + quoteRegex := regexp.MustCompile(`\{quote\}(.*?)\{quote\}`) + codeBlockRegex := regexp.MustCompile(`\{\{(.+?)\}\}`) + + // the below code converts lines starting with "#" into a numbered list. It increments the counter if consecutive lines are numbered, + // otherwise resets it to 1. The "#" is replaced with the corresponding number and period. Non-numbered lines are added unchanged. + var counter int + var lastLineWasNumberedList bool + var result []string + lines := strings.Split(jiraMarkdownString, "\n") + for _, line := range lines { + if numberedListRegex.MatchString(line) { + if !lastLineWasNumberedList { + counter = 1 + } else { + counter++ + } + line = strconv.Itoa(counter) + ". " + strings.TrimPrefix(line, "# ") + lastLineWasNumberedList = true + } else { + lastLineWasNumberedList = false + } + result = append(result, line) + } + processedString := strings.Join(result, "\n") + + // the below code converts links in the format "[text|url]" or "[text|url|optional]" to Markdown links. If the text is empty, + // the URL is used for both the text and link. If the optional part is present, it's ignored. Unrecognized patterns remain unchanged. + processedString = linkRegex.ReplaceAllStringFunc(processedString, func(link string) string { + parts := linkRegex.FindStringSubmatch(link) + if len(parts) == 4 { + if parts[1] == "" { + return "[" + parts[2] + "](" + parts[2] + ")" + } + if parts[3] != "" { + return "[" + parts[1] + "](" + parts[2] + ")" + } + return "[" + parts[1] + "](" + parts[2] + ")" + } + return link + }) + + processedString = asteriskRegex.ReplaceAllStringFunc(processedString, func(word string) string { + return "**" + strings.Trim(word, "*") + "**" + }) + + processedString = hyphenRegex.ReplaceAllStringFunc(processedString, func(word string) string { + return "~~" + strings.Trim(word, "-") + "~~" + }) + + processedString = headingRegex.ReplaceAllStringFunc(processedString, func(heading string) string { + level := heading[1] + hashes := strings.Repeat("#", int(level-'0')) + return hashes + " " + }) + + processedString = langSpecificCodeBlockRegex.ReplaceAllStringFunc(processedString, func(codeBlock string) string { + codeContent := codeBlock[strings.Index(codeBlock, "}")+1 : strings.LastIndex(codeBlock, "{code}")] + return "`" + codeContent + "`" + }) + + processedString = codeBlockRegex.ReplaceAllStringFunc(processedString, func(match string) string { + curlyContent := codeBlockRegex.FindStringSubmatch(match)[1] + return "`" + curlyContent + "`" + }) + + processedString = colouredTextRegex.ReplaceAllString(processedString, "$1") + + processedString = quoteRegex.ReplaceAllStringFunc(processedString, func(quote string) string { + quotedText := quote[strings.Index(quote, "}")+1 : strings.LastIndex(quote, "{quote}")] + return "> " + quotedText + }) + + return processedString +} + func parseWebhookCommentDeleted(jwh *JiraWebhook) (Webhook, error) { if jwh.Issue.ID == "" { return nil, ErrWebhookIgnored @@ -348,7 +438,7 @@ func parseWebhookCommentUpdated(jwh *JiraWebhook) (Webhook, error) { JiraWebhook: jwh, eventTypes: NewStringSet(eventUpdatedComment), headline: fmt.Sprintf("%s **edited comment** in %s", mdUser(&jwh.Comment.UpdateAuthor), jwh.mdKeySummaryLink()), - text: truncate(quoteIssueComment(jwh.Comment.Body), 3000), + text: truncate(quoteIssueComment(preProcessText(jwh.Comment.Body)), 3000), } return wh, nil @@ -414,7 +504,7 @@ func parseWebhookUpdatedDescription(jwh *JiraWebhook, from, to string) *webhook fromFmttd := "\n**From:** " + truncate(from, 500) toFmttd := "\n**To:** " + truncate(to, 500) wh.fieldInfo = webhookField{descriptionField, descriptionField, fromFmttd, toFmttd} - wh.text = jwh.mdIssueDescription() + wh.text = preProcessText(jwh.mdIssueDescription()) return wh } diff --git a/server/webhook_parser_misc_test.go b/server/webhook_parser_misc_test.go index 24cc3f208..926451389 100644 --- a/server/webhook_parser_misc_test.go +++ b/server/webhook_parser_misc_test.go @@ -136,3 +136,80 @@ func TestWebhookQuotedComment(t *testing.T) { assert.True(t, strings.HasPrefix(w.text, ">")) } } + +func TestPreProcessText(t *testing.T) { + tests := map[string]struct { + input string + expectedOutput string + }{ + "BOLD formatting": { + input: "*BOLD*", + expectedOutput: "**BOLD**", + }, + "STRIKETHROUGH formatting": { + input: "-STRIKETHROUGH-", + expectedOutput: "~~STRIKETHROUGH~~", + }, + "Colored text formatting": { + input: "{color:#ff5630}RED{color} {color:#4c9aff}BLUE{color} {color:#36b37e}GREEN{color}", + expectedOutput: "RED BLUE GREEN", + }, + "Numbered list with mixed content formatting": { + input: `# NUMBERED LIST ROW 1 +# NUMBERED LIST ROW 2 +non-numbered list text +# NUMBERED LIST ROW 1`, + expectedOutput: `1. NUMBERED LIST ROW 1 +2. NUMBERED LIST ROW 2 +non-numbered list text +1. NUMBERED LIST ROW 1`, + }, + "Code block formatting": { + input: "{code:go}fruit := \"APPLE\"{code}", + expectedOutput: "`fruit := \"APPLE\"`", + }, + "Bullet list formatting": { + input: `* BULLET LIST ROW 1 +* BULLET LIST ROW 2`, + expectedOutput: `* BULLET LIST ROW 1 +* BULLET LIST ROW 2`, + }, + "Heading formatting": { + input: `h1. HEADING 1 +h2. HEADING 2 +h3. HEADING 3 +h4. HEADING 4 +h5. HEADING 5 +h6. HEADING 6`, + expectedOutput: `# HEADING 1 +## HEADING 2 +### HEADING 3 +#### HEADING 4 +##### HEADING 5 +###### HEADING 6`, + }, + "Link formatting with text": { + input: "[www.googlesd.com|http://www.googlesd.com]", + expectedOutput: "[www.googlesd.com](http://www.googlesd.com)", + }, + "Link formatting with smart-link": { + input: "[http://www.google.com|http://www.google.com|smart-link]", + expectedOutput: "[http://www.google.com](http://www.google.com)", + }, + "Link formatting with title": { + input: "[google|http://www.google.com]", + expectedOutput: "[google](http://www.google.com)", + }, + "Quote formatting": { + input: "{quote}This is a quote{quote}", + expectedOutput: "> This is a quote", + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + actualOutput := preProcessText(tc.input) + assert.Equal(t, tc.expectedOutput, actualOutput) + }) + } +} From f7facb2f46ce60d1c2e96ec5c19324c7b7d4f5f1 Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal Date: Tue, 10 Sep 2024 18:53:06 +0530 Subject: [PATCH 07/10] [GH-975] Added conditional on "pluginSettings" data (#1104) * [GH-975] Added conditional on "pluginSettings" data * Remove junit file --- .../channel_subscriptions/channel_subscription_filter.tsx | 2 +- .../channel_subscriptions/channel_subscription_filters.tsx | 2 +- webapp/src/components/modals/channel_subscriptions/index.ts | 2 +- .../src/components/modals/channel_subscriptions/shared_props.ts | 2 +- webapp/src/utils/jira_issue_metadata.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx b/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx index 4be9485b4..5423b2aa7 100644 --- a/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx +++ b/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx @@ -35,7 +35,7 @@ export type Props = { addValidate: (isValid: () => boolean) => void; removeValidate: (isValid: () => boolean) => void; instanceID: string; - securityLevelEmptyForJiraSubscriptions: boolean; + securityLevelEmptyForJiraSubscriptions?: boolean; }; export type State = { diff --git a/webapp/src/components/modals/channel_subscriptions/channel_subscription_filters.tsx b/webapp/src/components/modals/channel_subscriptions/channel_subscription_filters.tsx index 1641017ad..fd17afac3 100644 --- a/webapp/src/components/modals/channel_subscriptions/channel_subscription_filters.tsx +++ b/webapp/src/components/modals/channel_subscriptions/channel_subscription_filters.tsx @@ -21,7 +21,7 @@ export type Props = { removeValidate: (isValid: () => boolean) => void; onChange: (f: FilterValue[]) => void; instanceID: string; - securityLevelEmptyForJiraSubscriptions: boolean; + securityLevelEmptyForJiraSubscriptions?: boolean; }; type State = { diff --git a/webapp/src/components/modals/channel_subscriptions/index.ts b/webapp/src/components/modals/channel_subscriptions/index.ts index 0ec59642f..8e3ddce03 100644 --- a/webapp/src/components/modals/channel_subscriptions/index.ts +++ b/webapp/src/components/modals/channel_subscriptions/index.ts @@ -45,7 +45,7 @@ const mapStateToProps = (state) => { const installedInstances = getInstalledInstances(state); const connectedInstances = getUserConnectedInstances(state); const pluginSettings = getPluginSettings(state); - const securityLevelEmptyForJiraSubscriptions = pluginSettings.security_level_empty_for_jira_subscriptions; + const securityLevelEmptyForJiraSubscriptions = pluginSettings?.security_level_empty_for_jira_subscriptions; return { omitDisplayName, diff --git a/webapp/src/components/modals/channel_subscriptions/shared_props.ts b/webapp/src/components/modals/channel_subscriptions/shared_props.ts index 3a16a4192..aca654c90 100644 --- a/webapp/src/components/modals/channel_subscriptions/shared_props.ts +++ b/webapp/src/components/modals/channel_subscriptions/shared_props.ts @@ -29,5 +29,5 @@ export type SharedProps = { getConnected: () => Promise; close: () => void; sendEphemeralPost: (message: string) => void; - securityLevelEmptyForJiraSubscriptions: boolean; + securityLevelEmptyForJiraSubscriptions?: boolean; }; diff --git a/webapp/src/utils/jira_issue_metadata.tsx b/webapp/src/utils/jira_issue_metadata.tsx index badb4a781..2b66cde8a 100644 --- a/webapp/src/utils/jira_issue_metadata.tsx +++ b/webapp/src/utils/jira_issue_metadata.tsx @@ -365,7 +365,7 @@ function quoteGuard(s: string) { return s; } -export function generateJQLStringFromSubscriptionFilters(issueMetadata: IssueMetadata, fields: FilterField[], filters: ChannelSubscriptionFilters, securityLevelEmptyForJiraSubscriptions: boolean) { +export function generateJQLStringFromSubscriptionFilters(issueMetadata: IssueMetadata, fields: FilterField[], filters: ChannelSubscriptionFilters, securityLevelEmptyForJiraSubscriptions?: boolean) { const projectJQL = `Project = ${quoteGuard(filters.projects[0]) || '?'}`; let issueTypeValueString = '?'; From 90b65c59779814f89c81c739b1d3abb52d397a38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 10:30:23 -0400 Subject: [PATCH 08/10] Bump webpack from 5.76.0 to 5.94.0 in /webapp (#1116) Bumps [webpack](https://github.com/webpack/webpack) from 5.76.0 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.76.0...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- webapp/package-lock.json | 234 +++++++++++++++++++++------------------ webapp/package.json | 2 +- 2 files changed, 125 insertions(+), 111 deletions(-) diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 8f1d2eb19..8217c7d61 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -67,7 +67,7 @@ "sass": "1.60.0", "sass-loader": "12.2.0", "style-loader": "3.3.1", - "webpack": "5.76.0", + "webpack": "5.94.0", "webpack-cli": "4.9.1" } }, @@ -5532,19 +5532,11 @@ "@types/json-schema": "*" } }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { - "version": "0.0.51", - "dev": true, - "license": "MIT" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true }, "node_modules/@types/graceful-fs": { "version": "4.1.9", @@ -6163,133 +6155,148 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "dev": true, - "license": "MIT" + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "dev": true, - "license": "MIT" + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "dev": true, - "license": "MIT" + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.1", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "dev": true, - "license": "MIT" + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.1", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "dev": true, - "license": "MIT", "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.1", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.1", - "dev": true, - "license": "MIT" + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.1", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.1", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.1", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.1", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.1", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, - "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -6328,13 +6335,15 @@ }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true }, "node_modules/@xtuc/long": { "version": "4.2.2", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true }, "node_modules/abab": { "version": "2.0.6", @@ -8553,9 +8562,10 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.16.0", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -8803,9 +8813,10 @@ } }, "node_modules/es-module-lexer": { - "version": "0.9.3", - "dev": true, - "license": "MIT" + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "dev": true }, "node_modules/es-object-atoms": { "version": "1.0.0", @@ -20834,8 +20845,9 @@ }, "node_modules/tapable": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -21610,33 +21622,33 @@ } }, "node_modules/webpack": { - "version": "5.76.0", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, - "license": "MIT", "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -21740,9 +21752,10 @@ } }, "node_modules/webpack/node_modules/acorn": { - "version": "8.11.3", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -21750,10 +21763,11 @@ "node": ">=0.4.0" } }, - "node_modules/webpack/node_modules/acorn-import-assertions": { - "version": "1.9.0", + "node_modules/webpack/node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, - "license": "MIT", "peerDependencies": { "acorn": "^8" } diff --git a/webapp/package.json b/webapp/package.json index 67f09c758..51a6eb5a7 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -63,7 +63,7 @@ "sass": "1.60.0", "sass-loader": "12.2.0", "style-loader": "3.3.1", - "webpack": "5.76.0", + "webpack": "5.94.0", "webpack-cli": "4.9.1" }, "dependencies": { From d6456991e24999b8be5aea8183b0231fb51a97e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 10:39:46 -0400 Subject: [PATCH 09/10] Bump serve-static from 1.15.0 to 1.16.2 in /webapp (#1120) Bumps [serve-static](https://github.com/expressjs/serve-static) from 1.15.0 to 1.16.2. - [Release notes](https://github.com/expressjs/serve-static/releases) - [Changelog](https://github.com/expressjs/serve-static/blob/v1.16.2/HISTORY.md) - [Commits](https://github.com/expressjs/serve-static/compare/v1.15.0...v1.16.2) --- updated-dependencies: - dependency-name: serve-static dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- webapp/package-lock.json | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 8217c7d61..8e603ba48 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -20019,9 +20019,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "peer": true, "dependencies": { "debug": "2.6.9", @@ -20090,20 +20090,29 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "peer": true, "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", From ac41da48836eb6094fcd68c86d62955824c5a5dd Mon Sep 17 00:00:00 2001 From: kshitij katiyar <90389917+Kshitij-Katiyar@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:52:37 +0530 Subject: [PATCH 10/10] [MI-3457]: Added a `Include or Empty` filter for subscription (#66) (#968) * [MI-3457]: Added include_or_empty filter to subscription * [MI-3457]: Removed a extra line from subscribe.go * [MI-3457]: Formatted the code in subscribe.go * [MI-3457]: Fixed the testcases for channel_subscription_filter * [MI-3457]: Fixed the formatting of server/subscribe.go * [MI-3457]: Improved the message in dropdown --- server/subscribe.go | 12 +++++++----- .../channel_subscription_filter.test.tsx.snap | 4 ++++ .../channel_subscription_filter.tsx | 4 ++++ webapp/src/types/model.ts | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/server/subscribe.go b/server/subscribe.go index 59fd81037..caf743888 100644 --- a/server/subscribe.go +++ b/server/subscribe.go @@ -26,10 +26,11 @@ import ( const ( JiraSubscriptionsKey = "jirasub" - FilterIncludeAny = "include_any" - FilterIncludeAll = "include_all" - FilterExcludeAny = "exclude_any" - FilterEmpty = "empty" + FilterIncludeAny = "include_any" + FilterIncludeAll = "include_all" + FilterExcludeAny = "exclude_any" + FilterEmpty = "empty" + FilterIncludeOrEmpty = "include_or_empty" MaxSubscriptionNameLength = 100 ) @@ -192,7 +193,8 @@ func isValidFieldInclusion(field FieldFilter, value StringSet, inclusion string) if (inclusion == FilterIncludeAny && !containsAny) || (inclusion == FilterIncludeAll && !containsAll) || (inclusion == FilterExcludeAny && containsAny) || - (inclusion == FilterEmpty && value.Len() > 0) { + (inclusion == FilterEmpty && value.Len() > 0) || + (inclusion == FilterIncludeOrEmpty && !containsAny && value.Len() > 0) { return false } diff --git a/webapp/src/components/modals/channel_subscriptions/__snapshots__/channel_subscription_filter.test.tsx.snap b/webapp/src/components/modals/channel_subscriptions/__snapshots__/channel_subscription_filter.test.tsx.snap index 57171bb58..1306e2444 100644 --- a/webapp/src/components/modals/channel_subscriptions/__snapshots__/channel_subscription_filter.test.tsx.snap +++ b/webapp/src/components/modals/channel_subscriptions/__snapshots__/channel_subscription_filter.test.tsx.snap @@ -140,6 +140,10 @@ exports[`components/ChannelSubscriptionFilter should match snapshot 1`] = ` "label": "Empty", "value": "empty", }, + Object { + "label": "Include or Empty", + "value": "include_or_empty", + }, ] } removeValidate={[MockFunction]} diff --git a/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx b/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx index 5423b2aa7..20ab5dffe 100644 --- a/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx +++ b/webapp/src/components/modals/channel_subscriptions/channel_subscription_filter.tsx @@ -174,6 +174,9 @@ export default class ChannelSubscriptionFilter extends React.PureComponent