Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(datatable): move datatable-config from component to ngrx (#2614)
Browse files Browse the repository at this point in the history
* fix(datatable): move datatable-config from component to ngrx,  increase width of type column

* fix(datatable): update the version of column cookie
  • Loading branch information
sahil143 authored and nimishamukherjee committed May 21, 2018
1 parent 9184140 commit cf9f768
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
12 changes: 0 additions & 12 deletions src/app/components/planner-list/planner-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ import { Space, Spaces } from 'ngx-fabric8-wit';

import { EmptyStateConfig } from 'patternfly-ng/empty-state';

// import for column
import { datatableColumn } from './datatable-config';

import { WorkItemCellComponent } from '../work-item-cell/work-item-cell.component'
import { WorkItem } from '../../models/work-item';
import { WorkItemDetailComponent } from './../work-item-detail/work-item-detail.component';
Expand Down Expand Up @@ -195,15 +192,6 @@ export class PlannerListComponent implements OnInit, AfterViewChecked, OnDestroy
this.listenToEvents();
this.loggedIn = this.auth.isLoggedIn();

// Cookie for datatableColumn config
if(!this.cookieService.getCookie(datatableColumn.length).status) {
this.cookieService.setCookie('datatableColumn', datatableColumn);
this.columns = datatableColumn;
} else {
let temp = this.cookieService.getCookie(datatableColumn.length)
this.columns = temp.array;
}

this.emptyStateConfig = {
info: 'There are no Work Items for your selected criteria',
title: 'No Work Items Available'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const datatableColumn = [{
showInDiplay: false,
maxWidth: undefined,
minWidth: undefined,
width: 160,
width: 180,
}, {
name: 'Title',
prop: 'title',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { cloneDeep, sortBy, isEqual } from 'lodash';
import { EmptyStateConfig } from 'patternfly-ng/empty-state';

// import for column
import { datatableColumn } from './../../components/planner-list/datatable-config';
import { datatableColumn } from './datatable-config';

// ngrx stuff
import { Store } from '@ngrx/store';
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/cookie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Injectable } from '@angular/core';
@Injectable()
export class CookieService {
// Increase this by one everytime
// a change id made in the table columns
datatableColumnVersion = 1;
// a change is made in the table columns
datatableColumnVersion = 2;

constructor() { }

Expand Down

0 comments on commit cf9f768

Please sign in to comment.