Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hdJerry committed Aug 25, 2023
1 parent b84cbb8 commit 31fb8c3
Show file tree
Hide file tree
Showing 13 changed files with 239 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
</q-list>
</q-btn-dropdown>
<q-btn-dropdown
v-if="milestoneOpt.length"
label="Milestones"
flat
class="text-capitalize q-px-xs dropdown-label dropdown-label--milestones text-caption row justify-center items-center bg-transparent no-border cursor-pointer"
Expand Down
34 changes: 34 additions & 0 deletions vue3-apollo-quasar/src/components/IssueTabView/IssueTabView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<template>
<div class="wrapper">
<div
v-if="isFiltered"
class="row items-center text-caption q-my-sm q-ml-2 cursor-pointer clear_wrapper"
@click="resetFilter"
>
<span class="q-mr-sm close_icon row just0fy-center items-center">
<q-icon name="close" size="xs" />
</span>
Clear filter
</div>
<div class="tab_view">
<IssuePullRequestTab
@changeTab="changeTab"
Expand All @@ -21,6 +31,12 @@
:createdAt="data.createdAt"
>
</IssuesPullRequestsCard>
<div
v-if="openIssuesList.length === 0 && !isLoading"
class="row justify-center items-center q-pa-md text-subtitle1 text-weight-medium text-uppercase"
>
No Content found
</div>
</q-list>
<q-list class="closed-issue" separator v-else>
Expand All @@ -38,7 +54,16 @@
:closedAt="data.closedAt"
>
</IssuesPullRequestsCard>
<div
v-if="closedIssuesList.length === 0 && !isLoading"
class="row justify-center items-center q-pa-md text-subtitle1 text-weight-medium text-uppercase"
>
No Content found
</div>
</q-list>
<div v-if="isLoading" class="row justify-center items-center q-pa-md">
<q-spinner-ios color="primary" size="2em" />
</div>
</div>
<PaginationButtons v-if="showPagination(tabRef)" @paginate="paginate" />
</div>
Expand All @@ -47,6 +72,7 @@
<script lang="ts">
import { defineComponent, ref, defineProps, computed } from 'vue';
import { IIssueParse } from '@/helpers/parseIssue';
import { useRepoStore } from '@/store/respoStore';
export default defineComponent({
name: 'IssueTabView',
Expand All @@ -71,9 +97,17 @@ const props = defineProps({
},
});
const repoStore = useRepoStore();
const tabRef = ref(TABS.OPEN);
const card_type = 'issue';
const resetFilter = () => repoStore.resetFilter();
const isFiltered = computed(
() =>
repoStore.selectedLabel || repoStore.selectedMilestone || repoStore.sortBy,
);
const isLoading = computed(() => repoStore.loading);
const openIssuesList = computed(() => {
return props.openIssues?.issues || [];
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<template>
<div class="wrapper">
<div
v-if="isFiltered"
class="row items-center text-caption q-my-sm q-ml-2 cursor-pointer clear_wrapper"
@click="resetFilter"
>
<span class="q-mr-sm close_icon row just0fy-center items-center">
<q-icon name="close" size="xs" />
</span>
Clear filter
</div>
<div class="tab_view">
<IssuePullRequestTab
@changeTab="changeTab"
Expand All @@ -21,6 +31,13 @@
:createdAt="data.createdAt"
>
</IssuesPullRequestsCard>
<div
v-if="openPullRequestsData.length === 0 && !isLoading"
class="row justify-center items-center q-pa-md text-subtitle1 text-weight-medium text-uppercase"
>
No Content found
</div>
</q-list>
<q-list class="closed-pr" separator v-else>
Expand All @@ -37,10 +54,19 @@
:createdAt="data.createdAt"
>
</IssuesPullRequestsCard>
<div
v-if="closedPullRequestsData.length === 0 && !isLoading"
class="row justify-center items-center q-pa-md text-subtitle1 text-weight-medium text-uppercase"
>
No Content found
</div>
</q-list>
<div v-if="isLoading" class="row justify-center items-center q-pa-md">
<q-spinner-ios color="primary" size="2em" />
</div>
</div>
<PaginationButtons v-if="showPagination(tabRef)" @paginate="paginate" />
</div>
</div> -->
</template>
<script lang="ts">
Expand All @@ -58,6 +84,7 @@ import {
PaginationButtons,
} from '@/components';
import { TABS } from './data';
import { useRepoStore } from '@/store/respoStore';
const props = defineProps({
openPullRequests: {
Expand All @@ -70,9 +97,18 @@ const props = defineProps({
},
});
const repoStore = useRepoStore();
const tabRef = ref(TABS.OPEN);
const card_type = 'pullrequest';
const resetFilter = () => repoStore.resetFilter();
const isFiltered = computed(
() =>
repoStore.selectedLabel || repoStore.selectedMilestone || repoStore.sortBy,
);
const isLoading = computed(() => repoStore.loading);
const openPullRequestsData = computed(() => {
return props.openPullRequests.pullRequests || [];
});
Expand Down Expand Up @@ -102,4 +138,16 @@ const showPagination = (tab) => {
border: 1px solid $secondary-100;
min-height: 10rem;
}
.clear_wrapper {
&:hover {
.close_icon {
background-color: rgb(46, 94, 190);
}
}
}
.close_icon {
background-color: rgb(107 114 128);
color: white;
border-radius: 0.375rem;
}
</style>
Loading

0 comments on commit 31fb8c3

Please sign in to comment.