diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/awards_handler.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/vue_shared/components/registry/registry_search.vue | 20 | ||||
-rw-r--r-- | app/finders/namespaces/projects_finder.rb | 8 | ||||
-rw-r--r-- | app/graphql/types/notes/note_type.rb | 2 | ||||
-rw-r--r-- | app/views/award_emoji/_awards_block.html.haml | 14 | ||||
-rw-r--r-- | app/views/users/unsubscribes/show.html.haml | 5 |
6 files changed, 28 insertions, 29 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index de67e01d650..d587964f961 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -294,7 +294,7 @@ export class AwardsHandler { } const normalizedEmoji = this.emoji.normalizeEmojiName(emoji); - const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).parent(); + const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).closest('button'); this.postEmoji($emojiButton, awardUrl, normalizedEmoji, () => { this.addAwardToEmojiBar(votesBlock, normalizedEmoji, checkMutuality); @@ -312,7 +312,7 @@ export class AwardsHandler { } this.addEmojiToFrequentlyUsedList(emoji); const normalizedEmoji = this.emoji.normalizeEmojiName(emoji); - const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).parent(); + const $emojiButton = this.findEmojiIcon(votesBlock, normalizedEmoji).closest('button'); if ($emojiButton.length > 0) { if (this.isActive($emojiButton)) { this.decrementCounter($emojiButton, normalizedEmoji); @@ -355,7 +355,7 @@ export class AwardsHandler { const awardUrl = this.getAwardUrl(); if (emoji === 'thumbsup' || emoji === 'thumbsdown') { const mutualVote = emoji === 'thumbsup' ? 'thumbsdown' : 'thumbsup'; - const $emojiButton = votesBlock.find(`[data-name="${mutualVote}"]`).parent(); + const $emojiButton = votesBlock.find(`[data-name="${mutualVote}"]`).closest('button'); const isAlreadyVoted = $emojiButton.hasClass('active'); if (isAlreadyVoted) { this.addAward(votesBlock, awardUrl, mutualVote, false); @@ -430,7 +430,7 @@ export class AwardsHandler { } addYouToUserList(votesBlock, emoji) { - const awardBlock = this.findEmojiIcon(votesBlock, emoji).parent(); + const awardBlock = this.findEmojiIcon(votesBlock, emoji).closest('button'); const origTitle = this.getAwardTooltip(awardBlock); let users = []; if (origTitle) { diff --git a/app/assets/javascripts/vue_shared/components/registry/registry_search.vue b/app/assets/javascripts/vue_shared/components/registry/registry_search.vue index e41cd344b3f..e42bf405784 100644 --- a/app/assets/javascripts/vue_shared/components/registry/registry_search.vue +++ b/app/assets/javascripts/vue_shared/components/registry/registry_search.vue @@ -1,5 +1,5 @@ <script> -import { GlSorting, GlSortingItem, GlFilteredSearch } from '@gitlab/ui'; +import { GlSorting, GlFilteredSearch } from '@gitlab/ui'; import { SORT_DIRECTION_UI } from '~/search/sort/constants'; import { FILTERED_SEARCH_TERM } from '~/vue_shared/components/filtered_search_bar/constants'; @@ -9,7 +9,6 @@ const DESCENDING_ORDER = 'desc'; export default { components: { GlSorting, - GlSortingItem, GlFilteredSearch, }, props: { @@ -56,6 +55,9 @@ export default { sortDirectionData() { return this.isSortAscending ? SORT_DIRECTION_UI.asc : SORT_DIRECTION_UI.desc; }, + sortOptions() { + return this.sortableFields.map(({ orderBy, label }) => ({ text: label, value: orderBy })); + }, }, methods: { generateQueryData({ sorting = {}, filter = [] } = {}) { @@ -138,16 +140,10 @@ export default { :text="sortText" :is-ascending="isSortAscending" :sort-direction-tool-tip="sortDirectionData.tooltip" + :sort-options="sortOptions" + :sort-by="sorting.orderBy" @sortDirectionChange="onDirectionChange" - > - <gl-sorting-item - v-for="item in sortableFields" - ref="packageListSortItem" - :key="item.orderBy" - @click="onSortItemClick(item.orderBy)" - > - {{ item.label }} - </gl-sorting-item> - </gl-sorting> + @sortByChange="onSortItemClick" + /> </div> </template> diff --git a/app/finders/namespaces/projects_finder.rb b/app/finders/namespaces/projects_finder.rb index 0194ee40801..6547d41dcdd 100644 --- a/app/finders/namespaces/projects_finder.rb +++ b/app/finders/namespaces/projects_finder.rb @@ -11,6 +11,7 @@ # sort: string # search: string # include_subgroups: boolean +# include_archived: boolean # ids: int[] # with_issues_enabled: boolean # with_merge_requests_enabled: boolean @@ -45,6 +46,7 @@ module Namespaces def filter_projects(collection) collection = by_ids(collection) + collection = by_archived(collection) collection = by_similarity(collection) by_feature_availability(collection) end @@ -55,6 +57,12 @@ module Namespaces items.id_in(params[:ids]) end + def by_archived(items) + return items if Gitlab::Utils.to_boolean(params[:include_archived], default: true) + + items.non_archived + end + def by_similarity(items) return items unless params[:search].present? diff --git a/app/graphql/types/notes/note_type.rb b/app/graphql/types/notes/note_type.rb index ffdaab0a5f6..0f2a01d7390 100644 --- a/app/graphql/types/notes/note_type.rb +++ b/app/graphql/types/notes/note_type.rb @@ -27,7 +27,7 @@ module Types description: 'Project associated with the note.' field :author, Types::UserType, - null: false, + null: true, description: 'User who wrote this note.' field :system, GraphQL::Types::Boolean, diff --git a/app/views/award_emoji/_awards_block.html.haml b/app/views/award_emoji/_awards_block.html.haml index fd4801b7941..870d1af4d54 100644 --- a/app/views/award_emoji/_awards_block.html.haml +++ b/app/views/award_emoji/_awards_block.html.haml @@ -9,19 +9,15 @@ - grouped_emojis = awardable.grouped_awards(with_thumbs: inline) .awards.js-awards-block{ class: ("hidden" if !inline && grouped_emojis.empty?), data: { award_url: toggle_award_url(awardable) } } - awards_sort(grouped_emojis).each do |emoji, awards| - %button.gl-button.btn.btn-default.award-control.js-emoji-btn.has-tooltip{ type: "button", - class: [award_state_class(awardable, awards, current_user)], - data: { title: award_user_list(awards, current_user) } } + = render Pajamas::ButtonComponent.new(button_options: { class: (award_state_class(awardable, awards, current_user) + ' award-control js-emoji-btn has-tooltip'), data: { title: award_user_list(awards, current_user) } }) do = emoji_icon(emoji) %span.award-control-text.js-counter = awards.count - if can?(current_user, :award_emoji, awardable) .award-menu-holder.js-award-holder - %button.gl-button.btn.btn-default.award-control.has-tooltip.js-add-award{ type: 'button', - 'aria-label': _('Add reaction'), - data: { title: _('Add reaction') } } - %span{ class: "award-control-icon award-control-icon-neutral gl-icon" }= sprite_icon('slight-smile') - %span{ class: "award-control-icon award-control-icon-positive gl-icon" }= sprite_icon('smiley') - %span{ class: "award-control-icon award-control-icon-super-positive gl-icon" }= sprite_icon('smile') + = render Pajamas::ButtonComponent.new(button_options: { class: 'award-control has-tooltip js-add-award btn-icon gl-relative', data: { title: _('Add reaction') }, aria: { label: _('Add reaction') } }) do + = sprite_icon('slight-smile', css_class: 'award-control-icon-neutral gl-button-icon gl-icon') + = sprite_icon('smiley', css_class: 'award-control-icon-positive gl-button-icon gl-icon gl-left-3!') + = sprite_icon('smile', css_class: 'award-control-icon-super-positive gl-button-icon gl-icon gl-left-3!') = yield diff --git a/app/views/users/unsubscribes/show.html.haml b/app/views/users/unsubscribes/show.html.haml index df8989ad979..d06c98955c8 100644 --- a/app/views/users/unsubscribes/show.html.haml +++ b/app/views/users/unsubscribes/show.html.haml @@ -1,11 +1,10 @@ - page_title _("Unsubscribe"), _("Admin Notifications") %h1.page-title.gl-font-size-h-display Unsubscribe from Admin notifications -%hr = form_tag unsubscribe_path(Base64.urlsafe_encode64(@email)) do %p Yes, I want to unsubscribe %strong= @email from any further admin emails. - .form-actions - = submit_tag 'Unsubscribe', class: 'gl-button btn btn-confirm' + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm) do + = _('Unsubscribe') |