diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/assets/javascripts/set_status_modal | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/set_status_modal')
-rw-r--r-- | app/assets/javascripts/set_status_modal/set_status_modal_wrapper.vue | 9 | ||||
-rw-r--r-- | app/assets/javascripts/set_status_modal/utils.js | 4 |
2 files changed, 5 insertions, 8 deletions
diff --git a/app/assets/javascripts/set_status_modal/set_status_modal_wrapper.vue b/app/assets/javascripts/set_status_modal/set_status_modal_wrapper.vue index f2685dfbcdb..c8efbd73b48 100644 --- a/app/assets/javascripts/set_status_modal/set_status_modal_wrapper.vue +++ b/app/assets/javascripts/set_status_modal/set_status_modal_wrapper.vue @@ -6,7 +6,7 @@ import GfmAutoComplete from 'ee_else_ce/gfm_auto_complete'; import { GlToast, GlModal, GlTooltipDirective, GlIcon, GlFormCheckbox } from '@gitlab/ui'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import { __, s__ } from '~/locale'; -import Api from '~/api'; +import { updateUserStatus } from '~/rest_api'; import EmojiMenuInModal from './emoji_menu_in_modal'; import { isUserBusy, isValidAvailibility } from './utils'; import * as Emoji from '~/emoji'; @@ -163,7 +163,7 @@ export default { setStatus() { const { emoji, message, availability } = this; - Api.postUserStatus({ + updateUserStatus({ emoji, message, availability: availability ? AVAILABILITY_STATUS.BUSY : AVAILABILITY_STATUS.NOT_SET, @@ -172,10 +172,7 @@ export default { .catch(this.onUpdateFail); }, onUpdateSuccess() { - this.$toast.show(s__('SetStatusModal|Status updated'), { - type: 'success', - position: 'top-center', - }); + this.$toast.show(s__('SetStatusModal|Status updated')); this.closeModal(); window.location.reload(); }, diff --git a/app/assets/javascripts/set_status_modal/utils.js b/app/assets/javascripts/set_status_modal/utils.js index dccb66be11f..faee4012ef4 100644 --- a/app/assets/javascripts/set_status_modal/utils.js +++ b/app/assets/javascripts/set_status_modal/utils.js @@ -3,7 +3,7 @@ export const AVAILABILITY_STATUS = { NOT_SET: 'not_set', }; -export const isUserBusy = status => status === AVAILABILITY_STATUS.BUSY; +export const isUserBusy = (status) => status === AVAILABILITY_STATUS.BUSY; -export const isValidAvailibility = availability => +export const isValidAvailibility = (availability) => availability.length ? Object.values(AVAILABILITY_STATUS).includes(availability) : true; |