-
Notifications
You must be signed in to change notification settings - Fork 131
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
Add "reporter" and "assignee" fields in subscription filters #890
Changes from all commits
9479110
3db15e2
2760aef
11da293
84e36ed
dbda93f
8e0f2aa
189c5e6
f1fe428
f21ec64
d9aaba5
9735700
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// This file is automatically generated. Do not modify it manually. | ||
|
||
export const id = 'jira'; | ||
export const version = '3.2.0'; | ||
export const version = '3.2.1'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,7 +179,7 @@ function isValidFieldForFilter(field: JiraField): boolean { | |
} | ||
|
||
return allowedTypes.includes(type) || (custom && acceptedCustomTypesForFilters.includes(custom)) || | ||
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. I find this part a bit difficult to follow and understand, but this would be a future refactor. 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. also But as I said, this is for the future. 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. @javaguirre Yeah I too think |
||
type === 'option' || // single select | ||
type === 'option' || type === 'user' || | ||
(type === 'array' && allowedArrayTypes.includes(items)); | ||
} | ||
|
||
|
@@ -199,6 +199,18 @@ export function getCustomFieldFiltersForProjects(metadata: IssueMetadata | null, | |
} as FilterField; | ||
}); | ||
|
||
const userFields = fields.filter((field) => field.schema.type === 'user' && !field.allowedValues) as (StringArrayField & FieldWithInfo)[]; | ||
const populatedUserFields = userFields.map((field) => { | ||
return { | ||
key: field.key, | ||
name: field.name, | ||
schema: field.schema, | ||
issueTypes: field.validIssueTypes, | ||
} as FilterField; | ||
}); | ||
|
||
const userResult = populatedFields.concat(populatedUserFields); | ||
|
||
const stringArrayFields = fields.filter((field) => field.schema.type === 'array' && field.schema.items === 'string' && !field.allowedValues) as (StringArrayField & FieldWithInfo)[]; | ||
const userDefinedFields = stringArrayFields.map((field) => { | ||
return { | ||
|
@@ -210,7 +222,7 @@ export function getCustomFieldFiltersForProjects(metadata: IssueMetadata | null, | |
} as FilterField; | ||
}); | ||
|
||
const result = populatedFields.concat(userDefinedFields); | ||
const result = userResult.concat(userDefinedFields); | ||
const epicLinkField = fields.find(isEpicLinkField); | ||
if (epicLinkField) { | ||
result.unshift({ | ||
|
@@ -264,6 +276,10 @@ export function isLabelField(field: JiraField | FilterField): boolean { | |
return field.schema.system === 'labels' || field.schema.custom === 'com.atlassian.jira.plugin.system.customfieldtypes:labels'; | ||
} | ||
|
||
export function isUserField(field: JiraField | FilterField): boolean { | ||
return field.schema.type === 'user' || field.schema.custom === 'com.atlassian.jira.plugin.system.customfieldtypes:userpicker'; | ||
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. Could the string 'com.atlassian.....' be a constant more to the top of the file? It seems some kind of "magic string". |
||
} | ||
|
||
export function isEpicIssueType(issueType: IssueType): boolean { | ||
return issueType.name === 'Epic'; | ||
} | ||
|
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.
Unrelated change?
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.
This is not resolved