web/satellite: project members sorting fixed (#3231)

This commit is contained in:
Vitalii Shpital 2019-10-15 15:24:53 +03:00 committed by GitHub
parent a34730a60b
commit f1867a954b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 13 deletions

View File

@ -205,7 +205,7 @@ func sanitizedOrderColumnName(pmo console.ProjectMemberOrder) string {
case 2:
return "u.email"
case 3:
return "u.created_at"
return "pm.created_at"
default:
return "u.full_name"
}

View File

@ -19,7 +19,7 @@ func TestSanitizedOrderColumnName(t *testing.T) {
0: {0, "u.full_name"},
1: {1, "u.full_name"},
2: {2, "u.email"},
3: {3, "u.created_at"},
3: {3, "pm.created_at"},
4: {4, "u.full_name"},
}

View File

@ -6,14 +6,14 @@
<div class="sort-header-container__name-item" @click="onHeaderItemClick(ApiKeyOrderBy.NAME)">
<p class="sort-header-container__name-item__title">Key Name</p>
<VerticalArrows
:isActive="areApiKeysSortedByName"
:is-active="areApiKeysSortedByName"
:direction="getSortDirection"
/>
</div>
<div class="sort-header-container__date-item" @click="onHeaderItemClick(ApiKeyOrderBy.CREATED_AT)">
<p class="sort-header-container__date-item__title">Created</p>
<VerticalArrows
:isActive="areApiKeysSortedByDate"
:is-active="areApiKeysSortedByDate"
:direction="getSortDirection"
/>
</div>

View File

@ -151,12 +151,12 @@ export default class ProjectMembersArea extends Vue {
}
public async onHeaderSectionClickCallback(sortBy: ProjectMemberOrderBy, sortDirection: SortDirection): Promise<void> {
this.$store.dispatch(PM_ACTIONS.SET_SORT_BY, sortBy);
this.$store.dispatch(PM_ACTIONS.SET_SORT_DIRECTION, sortDirection);
await this.$store.dispatch(PM_ACTIONS.SET_SORT_BY, sortBy);
await this.$store.dispatch(PM_ACTIONS.SET_SORT_DIRECTION, sortDirection);
try {
await this.$store.dispatch(PM_ACTIONS.FETCH, this.FIRST_PAGE);
} catch (error) {
this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, `Unable to fetch project members. ${error.message}`);
await this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, `Unable to fetch project members. ${error.message}`);
}
if (this.totalPageCount > 1) {

View File

@ -49,7 +49,7 @@ export default class SortingListHeader extends Vue {
public sortBy: ProjectMemberOrderBy = ProjectMemberOrderBy.NAME;
public sortDirection: SortDirection = SortDirection.ASCENDING;
public get getSortDirection() {
public get getSortDirection(): SortDirection {
if (this.sortDirection === SortDirection.DESCENDING) {
return SortDirection.ASCENDING;
}
@ -57,15 +57,15 @@ export default class SortingListHeader extends Vue {
return SortDirection.DESCENDING;
}
public areProjectMembersSortedByName(): boolean {
public get areProjectMembersSortedByName(): boolean {
return this.sortBy === ProjectMemberOrderBy.NAME;
}
public areProjectMembersSortedByDate(): boolean {
public get areProjectMembersSortedByDate(): boolean {
return this.sortBy === ProjectMemberOrderBy.CREATED_AT;
}
public areProjectMembersSortedByEmail(): boolean {
public get areProjectMembersSortedByEmail(): boolean {
return this.sortBy === ProjectMemberOrderBy.EMAIL;
}

View File

@ -14,7 +14,7 @@ exports[`SortingListHeader.vue should render correctly 1`] = `
<p class="sort-header-container__added-container__title">Added</p>
<div class="container"><svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg" class="">
<path d="M4.73684 5.70565e-07L9 6L-9.53674e-07 6L4.73684 5.70565e-07Z" fill="#354049" class="arrow-svg-path"></path>
</svg> <svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg" class="active">
</svg> <svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg" class="">
<path d="M4.26316 6L1.90735e-06 0L9 1.59559e-06L4.26316 6Z" fill="#354049" class="arrow-svg-path"></path>
</svg></div>
</div>
@ -22,7 +22,7 @@ exports[`SortingListHeader.vue should render correctly 1`] = `
<p class="sort-header-container__email-container__title">Email</p>
<div class="container"><svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg" class="">
<path d="M4.73684 5.70565e-07L9 6L-9.53674e-07 6L4.73684 5.70565e-07Z" fill="#354049" class="arrow-svg-path"></path>
</svg> <svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg" class="active">
</svg> <svg width="9" height="6" viewBox="0 0 9 6" fill="none" xmlns="http://www.w3.org/2000/svg" class="">
<path d="M4.26316 6L1.90735e-06 0L9 1.59559e-06L4.26316 6Z" fill="#354049" class="arrow-svg-path"></path>
</svg></div>
</div>