diff options
author | Phil Hughes <me@iamphill.com> | 2018-06-01 19:30:50 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-06-06 13:19:03 +0300 |
commit | 0b278a93f96ca4dd760c069e42d5485460d7b738 (patch) | |
tree | b213332e4add7a0328d4ba8b417f98cc722acc3b /app/assets/javascripts | |
parent | 524ebff5d17fd9111f2277843b384d204ff87a47 (diff) |
style updates
[ci skip]
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/ide/components/merge_requests/dropdown.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/ide/components/merge_requests/list.vue | 52 |
2 files changed, 48 insertions, 10 deletions
diff --git a/app/assets/javascripts/ide/components/merge_requests/dropdown.vue b/app/assets/javascripts/ide/components/merge_requests/dropdown.vue index 106f66b764a..1bcd550c713 100644 --- a/app/assets/javascripts/ide/components/merge_requests/dropdown.vue +++ b/app/assets/javascripts/ide/components/merge_requests/dropdown.vue @@ -39,7 +39,7 @@ export default { </script> <template> - <div class="dropdown-menu"> + <div class="dropdown-menu ide-merge-requests-dropdown"> <tabs stop-propagation @changed="updateActiveTab" @@ -53,6 +53,7 @@ export default { :is-loading="isLoading" :items="mergeRequests" :current-id="currentMergeRequestId" + :empty-text="__('You have not created any merge requests')" @search="fetchMergeRequests" /> </tab> @@ -62,6 +63,7 @@ export default { :is-loading="isLoading" :items="mergeRequests" :current-id="currentMergeRequestId" + :empty-text="__('You do not have any assigned merge requests')" @search="fetchMergeRequests" /> </tab> @@ -71,7 +73,7 @@ export default { <style scoped> .dropdown-menu { - width: 400px; + width: 350px; padding: 0; max-height: initial !important; } diff --git a/app/assets/javascripts/ide/components/merge_requests/list.vue b/app/assets/javascripts/ide/components/merge_requests/list.vue index 04b3848f3e2..0d81da12246 100644 --- a/app/assets/javascripts/ide/components/merge_requests/list.vue +++ b/app/assets/javascripts/ide/components/merge_requests/list.vue @@ -21,12 +21,24 @@ export default { type: String, required: true, }, + emptyText: { + type: String, + required: true, + }, }, data() { return { search: '', }; }, + computed: { + hasMergeRequests() { + return this.items.length !== 0; + }, + hasNoSearchResults() { + return this.search !== '' && !this.hasMergeRequests; + }, + }, watch: { isLoading() { this.focusSearch(); @@ -72,20 +84,44 @@ export default { class="fa fa-search dropdown-input-search" ></i> </div> - <div class="dropdown-content"> + <div class="dropdown-content ide-merge-requests-dropdown-content"> <ul class="mb-3"> + <template v-if="hasMergeRequests"> + <li + v-for="item in items" + :key="item.id" + > + <item + :item="item" + :current-id="currentId" + @click="viewMergeRequest" + /> + </li> + </template> <li - v-for="item in items" - :key="item.id" + v-else + class="ide-merge-requests-empty d-flex align-items-center justify-content-center" > - <item - :item="item" - :current-id="currentId" - @click="viewMergeRequest" - /> + <template v-if="hasNoSearchResults"> + No merge requests found + </template> + <template v-else> + {{ emptyText }} + </template> </li> </ul> </div> </template> </div> </template> + +<style scoped> +.ide-merge-requests-empty { + height: 230px; +} + +.ide-merge-requests-dropdown-content { + min-height: 230px; + max-height: 470px; +} +</style> |