Skip to content
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

Feature: Angular page browser connectivity result selection #186

Conversation

Projects
None yet
4 participants
@finnmartens
Copy link
Contributor

commented May 6, 2019

  • Rewritten the Page/Browser/Connectivity selection card in Angular.

finnmartens and others added some commits Mar 4, 2019

[IT-2647] Added models for the result selection service and methods f…
…or communication with the ResultSelectionController.
[IT-2647] Only include used parameters in the service and added model…
…s for charts and jobgroups with pages.
Merge develop into feature/angularModuleForResultSelection
# Conflicts:
#	frontend/src/app/modules/result-selection/result-selection.module.ts
#	frontend/src/app/modules/result-selection/services/result-selection.service.spec.ts
#	frontend/src/app/modules/result-selection/services/result-selection.service.ts
#	grails-app/i18n/messages.properties
#	grails-app/i18n/messages_de.properties
[IT-2651] Added ng-select dependency for having a searchable and modi…
…fiable dropdown menu and upgraded other dependencies to resolve some security issues.
Finn Martens
[IT-2651] Added filter mechanism so that the selectable sub-category …
…items are correctly related to their parent.
Merge remote-tracking branch 'origin/develop' into feature/angularPag…
…eBrowserConnectivityResultSelection

# Conflicts:
#	grails-app/i18n/messages.properties
#	grails-app/i18n/messages_de.properties
@sburnicki
Copy link
Member

left a comment

The templates and logic of the page and browser selections seem to be pretty much the same. You may want to extract them as a component.

@@ -0,0 +1,111 @@
<div class="card">
<ng-container *ngIf="showOnlyPageSelection || showOnlyBrowserSelection">
<h2 *ngIf="showOnlyBrowserSelection">Browser</h2>

This comment has been minimized.

Copy link
@sburnicki

sburnicki May 15, 2019

Member

Why is 'Browser' not translated?

<ul class="nav nav-tabs result-selection-tabs" *ngIf="!showOnlyPageSelection && !showOnlyBrowserSelection">
<li id="pageAndEventTab"
(click)="pageAndEventSelectionActive = true; browserAndLocationSelectionActive = connectivitySelectionActive = false"
[className]="pageAndEventSelectionActive ? 'active' : ''">

This comment has been minimized.

Copy link
@sburnicki

sburnicki May 15, 2019

Member

This can be simplified:

        [class.active]="pageAndEventSelectionActive">
}
}

private getUniqueElements(items) {

This comment has been minimized.

Copy link
@sburnicki

sburnicki May 15, 2019

Member

defining an argument type would be helpful to understand the code below

this.locations$ = of(this.sortAlphabetically(filteredItems));
}
} else {
if (children === 'events') {

This comment has been minimized.

Copy link
@sburnicki

sburnicki May 15, 2019

Member

to save all the if/elses, you could extract a method and pass this.resultSelectionService.eventsAndPages$, this.selectedEvents, this.measuredEvents$ or this.resultSelectionService.locationsAndBrowsers$, this.selectedLocations, this.locations$ to avoid logic duplication


uniquePages$: Observable<Page[]>;
uniqueBrowsers$: Observable<Browser[]>;
locations$: Observable<Location[]>;

This comment has been minimized.

Copy link
@sburnicki

sburnicki May 15, 2019

Member

You actually replace the value of these observables by new values instead of using them as observables.
You could

  • use plain objects instead of obersvables and stay with your current implementation
  • use pipes instead of subscriptions, so these are actually used as observables

sburnicki added a commit that referenced this pull request May 16, 2019

Merge pull request #196 from iteratec/feature/angularResultSelection
Feature: Angular result selection (merged)
This includes #179, #184, #186 and #191
@sburnicki

This comment has been minimized.

Copy link
Member

commented May 16, 2019

Most of the commits were merge in #196. Please open a separate pull request for the refactoring.

@sburnicki sburnicki closed this May 16, 2019

@sburnicki sburnicki deleted the feature/angularPageBrowserConnectivityResultSelection branch May 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.