Commit 811426d5 authored by Coung Ngo's avatar Coung Ngo Committed by Mark Florian

Add issue header mobile dropdown loading state

- Add loading state to give user feedback that the action is in progress
- Update error message to be more specific
- Move some specs to more appropriate locations
parent fa85a714
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
// Dispatch event which updates open/close state, shared among the issue show page // Dispatch event which updates open/close state, shared among the issue show page
document.dispatchEvent(new CustomEvent('issuable_vue_app:change', payload)); document.dispatchEvent(new CustomEvent('issuable_vue_app:change', payload));
}) })
.catch(() => createFlash({ message: __('Update failed. Please try again.') })) .catch(() => createFlash({ message: __('Error occurred while updating the issue status') }))
.finally(() => { .finally(() => {
this.toggleStateButtonLoading(false); this.toggleStateButtonLoading(false);
}); });
...@@ -192,22 +192,19 @@ export default { ...@@ -192,22 +192,19 @@ export default {
<template> <template>
<div class="detail-page-header-actions"> <div class="detail-page-header-actions">
<gl-dropdown class="gl-display-block gl-display-sm-none!" block :text="dropdownText"> <gl-dropdown
<gl-dropdown-item class="gl-display-block gl-display-sm-none!"
v-if="showToggleIssueStateButton" block
:disabled="isToggleStateButtonLoading" :text="dropdownText"
@click="toggleIssueState" :loading="isToggleStateButtonLoading"
> >
<gl-dropdown-item v-if="showToggleIssueStateButton" @click="toggleIssueState">
{{ buttonText }} {{ buttonText }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-dropdown-item v-if="canCreateIssue" :href="newIssuePath"> <gl-dropdown-item v-if="canCreateIssue" :href="newIssuePath">
{{ newIssueTypeText }} {{ newIssueTypeText }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-dropdown-item <gl-dropdown-item v-if="canPromoteToEpic" @click="promoteToEpic">
v-if="canPromoteToEpic"
:disabled="isToggleStateButtonLoading"
@click="promoteToEpic"
>
{{ __('Promote to epic') }} {{ __('Promote to epic') }}
</gl-dropdown-item> </gl-dropdown-item>
<gl-dropdown-item v-if="!isIssueAuthor" :href="reportAbusePath"> <gl-dropdown-item v-if="!isIssueAuthor" :href="reportAbusePath">
......
---
title: Add issue header mobile dropdown loading state
merge_request: 49734
author:
type: added
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment