diff --git a/app/assets/javascripts/issues/list/components/issues_list_app.vue b/app/assets/javascripts/issues/list/components/issues_list_app.vue index 2da6a049703..e5c557ce769 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -30,9 +30,11 @@ import { TOKEN_TITLE_ASSIGNEE, TOKEN_TITLE_AUTHOR, TOKEN_TITLE_CONFIDENTIAL, + TOKEN_TITLE_CONTACT, TOKEN_TITLE_LABEL, TOKEN_TITLE_MILESTONE, TOKEN_TITLE_MY_REACTION, + TOKEN_TITLE_ORGANIZATION, TOKEN_TITLE_RELEASE, TOKEN_TITLE_TYPE, } from '~/vue_shared/components/filtered_search_bar/constants'; @@ -54,9 +56,11 @@ import { TOKEN_TYPE_ASSIGNEE, TOKEN_TYPE_AUTHOR, TOKEN_TYPE_CONFIDENTIAL, + TOKEN_TYPE_CONTACT, TOKEN_TYPE_LABEL, TOKEN_TYPE_MILESTONE, TOKEN_TYPE_MY_REACTION, + TOKEN_TYPE_ORGANIZATION, TOKEN_TYPE_RELEASE, TOKEN_TYPE_TYPE, UPDATED_DESC, @@ -113,6 +117,8 @@ export default { 'autocompleteAwardEmojisPath', 'calendarPath', 'canBulkUpdate', + 'canReadCrmContact', + 'canReadCrmOrganization', 'emptyStateSvgPath', 'exportCsvPath', 'fullPath', @@ -360,6 +366,28 @@ export default { }); } + if (this.canReadCrmContact) { + tokens.push({ + type: TOKEN_TYPE_CONTACT, + title: TOKEN_TITLE_CONTACT, + icon: 'user', + token: GlFilteredSearchToken, + operators: OPERATOR_IS_ONLY, + unique: true, + }); + } + + if (this.canReadCrmOrganization) { + tokens.push({ + type: TOKEN_TYPE_ORGANIZATION, + title: TOKEN_TITLE_ORGANIZATION, + icon: 'users', + token: GlFilteredSearchToken, + operators: OPERATOR_IS_ONLY, + unique: true, + }); + } + if (this.eeSearchTokens.length) { tokens.push(...this.eeSearchTokens); } diff --git a/app/assets/javascripts/issues/list/index.js b/app/assets/javascripts/issues/list/index.js index f5cb160e344..7cfd8badf48 100644 --- a/app/assets/javascripts/issues/list/index.js +++ b/app/assets/javascripts/issues/list/index.js @@ -82,6 +82,8 @@ export function mountIssuesListApp() { canBulkUpdate, canEdit, canImportIssues, + canReadCrmContact, + canReadCrmOrganization, email, emailsHelpPagePath, emptyStateSvgPath, @@ -131,6 +133,8 @@ export function mountIssuesListApp() { autocompleteAwardEmojisPath, calendarPath, canBulkUpdate: parseBoolean(canBulkUpdate), + canReadCrmContact: parseBoolean(canReadCrmContact), + canReadCrmOrganization: parseBoolean(canReadCrmOrganization), emptyStateSvgPath, fullPath, groupPath, diff --git a/app/assets/javascripts/lib/graphql.js b/app/assets/javascripts/lib/graphql.js index 451950346b0..4ad979be6e6 100644 --- a/app/assets/javascripts/lib/graphql.js +++ b/app/assets/javascripts/lib/graphql.js @@ -105,7 +105,7 @@ export default (resolvers = {}, config = {}) => { const { baseUrl, batchMax = 10, - cacheConfig, + cacheConfig = { typePolicies: {}, possibleTypes: {} }, fetchPolicy = fetchPolicies.CACHE_FIRST, typeDefs, path = '/api/graphql', @@ -221,9 +221,15 @@ export default (resolvers = {}, config = {}) => { typeDefs, link: appLink, cache: new InMemoryCache({ - typePolicies, - possibleTypes, ...cacheConfig, + typePolicies: { + ...typePolicies, + ...cacheConfig.typePolicies, + }, + possibleTypes: { + ...possibleTypes, + ...cacheConfig.possibleTypes, + }, }), resolvers, defaultOptions: { diff --git a/app/assets/javascripts/notes/components/diff_with_note.vue b/app/assets/javascripts/notes/components/diff_with_note.vue index e2b0c7fee32..ec2095c91f2 100644 --- a/app/assets/javascripts/notes/components/diff_with_note.vue +++ b/app/assets/javascripts/notes/components/diff_with_note.vue @@ -107,7 +107,7 @@ export default { {{ __('Unable to load the diff') }}