Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fix repeater collapsible on push #1724

Merged
merged 29 commits into from
Jun 13, 2018

Conversation

blackbaud-conorwright
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Jun 6, 2018

Codecov Report

Merging #1724 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1724   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         409      409           
  Lines        8486     8488    +2     
  Branches     1241     1242    +1     
=======================================
+ Hits         8485     8487    +2     
  Misses          1        1
Impacted Files Coverage Δ
...s/repeater/repeater-item-context-menu.component.ts 100% <100%> (ø) ⬆️
...odules/repeater/repeater-item-content.component.ts 100% <100%> (ø) ⬆️
.../modules/repeater/repeater-item-title.component.ts 100% <100%> (ø) ⬆️
src/modules/repeater/repeater-item.component.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91b858e...b4b1437. Read the comment docs.

@Blackbaud-SteveBrush Blackbaud-SteveBrush self-assigned this Jun 7, 2018
@@ -1,8 +1,9 @@
import { Component } from '@angular/core';
import { Component, ChangeDetectionStrategy } from '@angular/core';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here (and elsewhere), imports need to be in alphabetical order, and on a new line.
See: #1647 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -8,6 +8,7 @@ import { skyAnimationSlide } from '../animation/slide';
import { SkyRepeaterService } from './repeater.service';
import { SkyLogService } from '../log/log.service';
import { SkyCheckboxChange } from '../checkbox/checkbox.component';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third-party imports should be listed before "local" imports.
#1647 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -62,6 +53,17 @@ export class SkyRepeaterItemComponent {
this.slideForExpanded(false);
}

public setIsCollapsible(value: boolean) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid a breaking change, we need to maintain the setter format. What's the reasoning behind the change?

public set isCollapsible(value: boolean) {
  // ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue with the setter/getter was that they couldn't be different types. I wanted the getter to return an Observable but the setter would have to take in a boolean to set that. I could make the Observable property public or surface a separate getter for the observable version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now I'm changing it to the latter

@@ -34,22 +47,25 @@ export class SkyRepeaterItemComponent {

public slideDirection: string;

public get isCollapsible(): boolean {
return this._isCollapsible;
public get isCollapsibleObservable(): Observable<boolean> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've been trying to avoid Observables whenever we can because they add a layer of complexity that's difficult to debug later on. I was able to get this working without Observables, if I changed this component's change detection strategy to OnPush and used this.changeDetector.markForCheck() in the updateForExpanded() method.

Curious if that works on your end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that does work. That is a cleaner implementation

@Blackbaud-SteveBrush Blackbaud-SteveBrush removed their assignment Jun 11, 2018
Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great! Just a few code style comments...

})
export class SkyRepeaterDemoComponent {
public items: any[];
public expandMode = 'single';
public expandMode = 'none';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably keep this as 'single' to demonstrate the collapsible feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -1,13 +1,25 @@
import {
Component,
Input
Input,
ChangeDetectorRef

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind ordering these imports alphabetically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import {
skyAnimationSlide
} from '../animation/slide';
import {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know these imports were incorrectly formatted to begin with, but could we order them from external to local files? Also, each import needs a newline after it:
#1647 (comment)

import {
  skyAnimationSlide
} from '../animation/slide';

import {
  SkyCheckboxChange
} from '../checkbox/checkbox.component';

import {
  SkyLogService
} from '../log/log.service';

import {
  SkyRepeaterService
} from './repeater.service';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit 8feb111 into master Jun 13, 2018
@Blackbaud-SteveBrush Blackbaud-SteveBrush deleted the fix-repeater-collapsible-on-push branch June 13, 2018 12:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants