-
-
Notifications
You must be signed in to change notification settings - Fork 42
feat(repositories): #1533 repositories will show in descending order #1537
Conversation
'repositories', | ||
(ref: firebase.firestore.Query) => ref | ||
.orderBy('updatedOn', 'desc') | ||
).doc<IRepository>(uid).valueChanges()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is finding a single repository, ordering it doesn't make sense when there is only always 1 result?
I think we need to sort it here
<div class="repository" *ngFor="let uid of project.repositories">
<dashboard-repository [uid]="uid" [isAdmin]="isAdmin()"></dashboard-repository>
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here only uid of repositories are coming so we can't sort it here . Here we are just passing the uid of repository and showing it using another component.
Either We need all repositories with the updatedOn date too or we have to create function to fetch all repositories then sort the uid and pass them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can sort with a pipe on the array? https://angular.io/guide/pipes#custom-pipes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we are not getting the updatedOn field in the array . How we will sort ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that is a problem 😂🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this one needs some thought. May be we can update the array to be an array of objects with uid and updatedAt dates? I am not sure the knock on effect though, so would need looking into further
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets park this ticket for now, I moved to blocked column as its not urgent
Closing PR as the work is not simple and requires more data available |
closes #1533
Notes
A summary of what was achieved in this PR