Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

feat(vm-snapshots): implement vm snapshots details sidebar #1454

Merged
merged 4 commits into from
Dec 4, 2018

Conversation

tamazlykar
Copy link
Collaborator

Implements #1332

@coveralls
Copy link

coveralls commented Nov 30, 2018

Pull Request Test Coverage Report for Build 1426

  • 80 of 136 (58.82%) changed or added relevant lines in 24 files are covered.
  • 62 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.07%) to 53.665%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/app/account/account/account-item.component.ts 2 3 66.67%
src/app/snapshot/components/vm-snapshot-card-view/vm-snapshot-card-view.component.ts 5 6 83.33%
src/app/snapshot/components/vm-snapshot-list-view/vm-snapshot-list-view.component.ts 5 6 83.33%
src/app/snapshot/store/snapshot-page.reducer.ts 0 1 0.0%
src/app/template/template/template.component.ts 1 2 50.0%
src/app/vm/vm-list-item/vm-list-item.component.ts 2 3 66.67%
src/app/snapshot/containers/snapshots-page/snapshots-page.container.ts 1 3 33.33%
src/app/snapshot/snapshots-page/snapshot-list-item/snapshot-item.component.ts 1 3 33.33%
src/app/snapshot/store/snapshot-page.actions.ts 3 5 60.0%
src/app/shared/models/vm-snapshot.model.ts 2 5 40.0%
Files with Coverage Reduction New Missed Lines %
src/app/shared/components/day-period/day-period.component.ts 7 45.45%
src/app/vm-logs/redux/vm-logs.reducers.ts 11 71.76%
src/app/vm-logs/redux/vm-logs.actions.ts 44 64.8%
Totals Coverage Status
Change from base Build 1414: 0.07%
Covered Lines: 8505
Relevant Lines: 13966

💛 - Coveralls

@wowshakhov
Copy link
Collaborator

wowshakhov commented Dec 3, 2018

Consider fixing in this PR:

<button mat-menu-item *ngIf="false" (click)="onCreateVolumeSnapshot()">

@@ -25,7 +25,7 @@ import { snapshotPageSelectors, vmSnapshotsSelectors } from '../../store';
></cs-snapshots-page>`,
})
export class SnapshotsPageContainerComponent implements OnInit, AfterViewInit {
readonly snapshots$ = this.store.pipe(select(fromSnapshots.selectFilteredSnapshots));
readonly snapshots$ = this.store.pipe(select(snapshotPageSelectors.getFilteredSnapshots));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you rename select -> get? I think we should keep "select", because it's the default prefix in NgRx Entity:
export const { selectIds, selectEntities, selectAll, selectTotal } = adapter.getSelectors(state);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To discuss

src/app/snapshot/store/snapshot-page.selectors.ts Outdated Show resolved Hide resolved
src/app/snapshot/store/snapshot-page.selectors.ts Outdated Show resolved Hide resolved
src/app/snapshot/store/snapshot-page.selectors.ts Outdated Show resolved Hide resolved
@tamazlykar
Copy link
Collaborator Author

Consider fixing in this PR:
cloudstack-ui/src/app/snapshot/components/vm-snapshot-action-menu/vm-snapshot-action-menu.component.html

Line 1 in 1b59e0c

<button mat-menu-item *ngIf="false" (click)="onCreateVolumeSnapshot()">

This function is not working on the server now, we enable it after it starts working.

@Output()
public clicked = new EventEmitter<VmSnapshotViewModel>();
@ViewChild(MatMenuTrigger)
public matMenuTrigger: MatMenuTrigger;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove matMenuTrigger if it is not used

@Output()
public clicked = new EventEmitter<VmSnapshotViewModel>();
@ViewChild(MatMenuTrigger)
public matMenuTrigger: MatMenuTrigger;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove matMenuTrigger if it is not used

@Output()
public onClick = new EventEmitter<Snapshot>();
public clicked = new EventEmitter<Snapshot>();
@ViewChild(MatMenuTrigger)
public matMenuTrigger: MatMenuTrigger;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove matMenuTrigger if it is not used

@@ -11,7 +11,7 @@ export class SnapshotItemComponent {
public virtualMachines: Dictionary<VirtualMachine>;
public isSelected: (snapshot: Snapshot) => boolean;
public query: string;
public onClick = new EventEmitter<Snapshot>();
public clicked = new EventEmitter<Snapshot>();
public matMenuTrigger: MatMenuTrigger;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove matMenuTrigger if it is not used

state: snapshot.state,
name: snapshot.displayname,
created: moment(snapshot.created).toDate(),
// account and domain necessary for grouping
Copy link
Collaborator

Choose a reason for hiding this comment

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

account and domain are necessary for grouping

filter.volumeSnapshotTypes.includes(snapshot.snapshottype);

const filterByAccount = (snapshot: Snapshot) =>
!filter.accounts.length || !!filter.accounts.find(id => id === snapshot.account);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Replace !!find by includes

if (!this.matMenuTrigger.menuOpen) {
this.onClick.emit(this.item);
}
public handleClick(): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove matMenuTrigger in this component if it's not used

if (!this.matMenuTrigger || !this.matMenuTrigger.menuOpen) {
this.onClick.emit(this.item);
}
public handleClick(): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove matMenuTrigger in this component if it's not used.

if (!this.matMenuTrigger.menuOpen) {
this.onClick.emit(this.item);
}
public handleClick(): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove matMenuTrigger in this component if it's not used.

@tamazlykar tamazlykar merged commit c040801 into bwsw:master Dec 4, 2018
@tamazlykar tamazlykar deleted the 1332-vm-snapshot-sidebar branch December 4, 2018 06:53
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.

None yet

3 participants