-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated most dropdowns/lists to sort by name #129
Conversation
} | ||
|
||
ngAfterViewInit() { | ||
console.log(this.sort.active); |
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.
Remove console.log
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.
Removed
@@ -1,4 +1,14 @@ | |||
import { AfterViewInit, Component, ComponentFactoryResolver, OnDestroy, OnInit, QueryList, Type, ViewChild, ViewChildren } from '@angular/core'; | |||
import { | |||
AfterViewInit, |
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.
AfterViewInit, QueryList and ViewChildren are unused, maybe just remove them :-)
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.
Removed them
} | ||
|
||
public deSelectAllDevices(index: number) { | ||
this.payloadDeviceDatatarget[index].iotDeviceIds = []; | ||
} | ||
|
||
getPayloadDecoders() { | ||
this.payloadDecoderSubscription = this.payloadDecoderService.getMultiple(1000, 0, 'id', 'ASC') | ||
this.payloadDecoderSubscription = this.payloadDecoderService | ||
.getMultiple(1000, 0, 'name', 'ASC') |
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.
The dropdown is still not sorted by name even with this implementation..
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.
Changed sort to frontend based sort
getDevices(): void { | ||
this.applicationSubscription = this.applicationService.getApplication(this.applicationId) | ||
this.applicationSubscription = this.applicationService | ||
.getApplication(this.applicationId) | ||
.subscribe((application: Application) => { | ||
this.devices = application.iotDevices; |
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.
Should devices also be sorted by name?
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.
Added sort on device
@@ -6,7 +6,10 @@ import { Observable, Subscription } from 'rxjs'; | |||
import { Application } from '@applications/application.model'; |
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.
"Observable" in line 5 is unused. Now that we are editting, we could just as well remove it :-)
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 agree, maybe we should suggest a full run-through of cleanup of this
@@ -295,7 +299,7 @@ export class HttppushEditComponent | |||
|
|||
getPayloadDecoders() { | |||
this.payloadDecoderSubscription = this.payloadDecoderService | |||
.getMultiple(1000, 0, 'id', 'ASC') | |||
.getMultiple(1000, 0, 'name', 'ASC') |
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.
Same comments from fiware-edit.component.ts.
This is sadly not sorting the dropdown, and should devices also be sorted? :)
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.
Fixed ( see first comment)
@@ -84,7 +84,7 @@ export class MqttEditComponent implements DatatargetEdit, OnInit, OnDestroy { | |||
|
|||
private getPayloadDecoders() { | |||
this.payloadDecoderSubscription = this.payloadDecoderService | |||
.getMultiple(1000, 0, 'id', 'ASC') | |||
.getMultiple(1000, 0, 'name', 'ASC') |
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.
Same comments from fiware-edit.component.ts.
This is sadly not sorting the dropdown, and should devices also be sorted? :)
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.
Fixed (see first comment)
this.iotDevices = application.iotDevices; | ||
|
||
this.iotDevices = application.iotDevices.sort((a, b) => | ||
a.name.localeCompare(b.name, 'en', { numeric: true }) |
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.
We are using this way of sorting a lot - could it be a better solution to make a util method that wil make det localeCompare? If it somehow in the future should be sorted by id instead, there will be a lot of edits instead of one :-)
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.
True, howerver due to time constraints it wont be made in this pass
Following have been updated:
Organization dropdown in app bar
List of sigfox unit types
Device models list
User list
Create/edit user group dropdowns
Edit data target
Create/edit payload decoder
Organization filter dropdown on