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

Board components #2729

Merged
merged 52 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
24fe9c7
fix(navigation): board side panel navigation added
sanbornsen Jul 6, 2018
a474d16
feat(card): add planner card component
vikram-raj Jul 5, 2018
066ae4f
feat(column): add column component
vikram-raj Jul 6, 2018
c5c7577
fix(board): use action to update board
sahil143 Jul 8, 2018
8d3c202
fix(actions): add action for BoardView
sahil143 Jul 4, 2018
67cdf35
fix(actions): add actions for to get Board api
sahil143 Jul 5, 2018
4bc8d82
fix(effects): call boardApi in getBoards Effect
sahil143 Jul 6, 2018
cb8bf5d
fix(board): add mapper in workitem and Board
sahil143 Jul 8, 2018
22e2dde
fix(board): add reducer for boardColumn
sahil143 Jul 9, 2018
e8dd86d
fix(board): add states and reducer to board module
sahil143 Jul 9, 2018
7434484
fix(board): add column-workItem reducer
sahil143 Jul 9, 2018
9672dc4
fix(board): fix tests for board service, reducer, model
sahil143 Jul 9, 2018
a8b624b
fix(reducer): add unit test for column-workitem reducer
sahil143 Jul 9, 2018
1cd90e4
fix(board): remove board-api-url action from boardAction
sahil143 Jul 9, 2018
b2af391
fix(workitem): add getWorkItemWithIds query to WorItemQuery
sahil143 Jul 9, 2018
530aefa
fix(board): integrate board components with action, effects and model
sahil143 Jul 9, 2018
58bb049
fix(board): assign value in board effects, change type of columnIds, …
sahil143 Jul 10, 2018
ed9d4ce
fix(type): using proper type for side panel context
sanbornsen Jul 9, 2018
10e0b9c
fix(board):add drag and drop
vikram-raj Jul 9, 2018
05a01d6
fix(board): change structure of column component
vikram-raj Jul 10, 2018
ca30aca
fix(css): fix linter error for css
sahil143 Jul 12, 2018
e6a3280
fix(board): get workitems for each column in board query
sahil143 Jul 16, 2018
e3c01f8
fix(columnWorkitem/board): use switchMap, add dafault to reducer swit…
sahil143 Jul 17, 2018
37c2152
fix(board-ngrx): Board State, Actions, Effects, Reducers (#2708)
sahil143 Jul 17, 2018
8b0caa0
fix(card): add assignee component
vikram-raj Jul 18, 2018
4e6edc1
fix(board): preparing board model to fetch work items
sanbornsen Jul 19, 2018
c1401d5
fix(board): fetch work item for board
sanbornsen Jul 19, 2018
27dd331
fix(board): fetch work item bug fixed
sanbornsen Jul 19, 2018
5abdf4b
fix(board): send patch and reorder requests
sahil143 Jul 22, 2018
7958f40
fix(board): initialize column on updateSuccess if not created
sahil143 Jul 23, 2018
21f39bc
fix(tests): unit test for column workItem reducer
sahil143 Jul 23, 2018
3b35496
fix(workItem): fix workItemMapper test
sahil143 Jul 23, 2018
b12367d
fix(board): use array instead of set, update unit tests
sahil143 Jul 24, 2018
17ade0e
fix(board): send array of column ids in column workitem Update action
sahil143 Jul 24, 2018
9e16210
fix(column-workitem): handled column update fail
sanbornsen Jul 24, 2018
108a77d
fix(board): add quick preview to board view
sahil143 Jul 24, 2018
f6b185c
fix(board): add unit test for columnWorkitem actions and reduces
sahil143 Jul 25, 2018
3d4b1f6
fix(workitem-effect): unnecessary code is removed for column change
sanbornsen Jul 25, 2018
a2b43b8
fix(board): board ui state added with board lockdown feature
sanbornsen Jul 25, 2018
abcfee6
fix(quick-preview): add condition to check if request coming from boa…
sahil143 Jul 26, 2018
521b389
fix(quick preview): add context input to correctly redirect to detail…
sahil143 Jul 26, 2018
01ff322
fix(card): fix child iteration name
sahil143 Jul 26, 2018
c522663
fix(board): fix 404 error on redirect to profile
sahil143 Jul 26, 2018
e692db8
fix(customQuery): add modal component to board for custom query delete
sahil143 Jul 26, 2018
6feb54a
fix(board): disable drag n drop for non-collaborators
sahil143 Jul 27, 2018
a22b82f
fix(board): change username to full name
sahil143 Jul 27, 2018
1de03c3
fix(field): meta state field is removed from the detail page
sanbornsen Jul 30, 2018
db92724
fix(board): add board view For iterations
sahil143 Jul 30, 2018
fd176da
fix(card): fix workitem type icon
sahil143 Jul 30, 2018
940e2aa
fix(grouptype): select the default group type on load
sahil143 Jul 30, 2018
1726a8f
fix(workItemUtil): check if query is present in current route or not
sahil143 Jul 30, 2018
50e2412
fix(package-lock): update package-lock.json
sahil143 Jul 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25,279 changes: 19,667 additions & 5,612 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/app/actions/board-ui.actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Action } from '@ngrx/store';
import { BoardState } from '../states/board.state';

export const LOCK_BOARD = '[board-ui] Lock';
export const UNLOCK_BOARD = '[board-ui] Unlock';


export class LockBoard implements Action {
readonly type = LOCK_BOARD;
}

export class UnlockBoard implements Action {
readonly type = UNLOCK_BOARD;
}


export type All
= LockBoard
| UnlockBoard;
1 change: 0 additions & 1 deletion src/app/actions/board.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ export type All
= Get
| GetSuccess
| GetError;

46 changes: 46 additions & 0 deletions src/app/actions/column-workitem.action.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { WorkItemUI } from '../models/work-item';
import * as ColumnWorkItemActions from './column-workitem.action';

describe('Unit Test :: ColumnWorkItem Actions', () => {
it('UpdateColumnWorkItem :: should create update action', () => {
const payload = {
workItem: {} as WorkItemUI,
reorder: {
workitem: {} as WorkItemUI,
destinationWorkitemID: '',
direction: 'above'
},
prevColumnId: ''
};
const action = new ColumnWorkItemActions.Update(payload);
expect({...action}).toEqual({
type: ColumnWorkItemActions.UPDATE,
payload: payload
});
});

it('UpdateColumnWorkitemSuccess :: should create UpdateSuccess action', () => {
const payload = {
workItemId: '',
prevColumnId: '',
newColumnIds: ['', '']
};
const action = new ColumnWorkItemActions.UpdateSuccess(payload);
expect({...action}).toEqual({
type: ColumnWorkItemActions.UPDATE_SUCCESS,
payload: payload
});
});

it('UpdateColumnWorkitemError :: should create UpdateError action', () => {
const payload = {
prevColumnId: '',
newColumnIds: ['', '']
};
const action = new ColumnWorkItemActions.UpdateError(payload);
expect({...action}).toEqual({
type: ColumnWorkItemActions.UPDATE_ERROR,
payload: payload
});
});
});
68 changes: 68 additions & 0 deletions src/app/actions/column-workitem.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { Action } from '@ngrx/store';
import { WorkItemService, WorkItemUI } from './../models/work-item';

export const UPDATE = '[column workitem] Update';
export const UPDATE_SUCCESS = '[column workitem] UpdateSuccess';
export const UPDATE_ERROR = '[column workitem] UpdateError';

export class Update implements Action {
payload: {
workItem: WorkItemUI,
reorder: {
workitem: WorkItemUI,
destinationWorkitemID: string,
direction: string
},
prevColumnId: string
};

constructor(payload: {
workItem: WorkItemUI,
reorder: {
workitem: WorkItemUI,
destinationWorkitemID: string,
direction: string
},
prevColumnId: string
}) {
this.payload = payload;
}
readonly type = UPDATE;
}

export class UpdateSuccess implements Action {
payload: {
workItemId: string,
prevColumnId: string,
newColumnIds: string[]
};

constructor(payload: {
workItemId: string,
prevColumnId: string,
newColumnIds: string[]
}) {
this.payload = payload;
}
readonly type = UPDATE_SUCCESS;
}

export class UpdateError implements Action {
payload: {
prevColumnId: string,
newColumnIds: string[]
};

constructor(payload: {
prevColumnId: string,
newColumnIds: string[]
}) {
this.payload = payload;
}
readonly type = UPDATE_ERROR;
}

export type All
= Update
| UpdateSuccess
| UpdateError;
1 change: 1 addition & 0 deletions src/app/actions/index.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export { All as WITypeActions } from './work-item-type.actions';
export { All as WorkItemActions } from './work-item.actions';
export { All as EventActions } from './event.action';
export { All as BoardActions } from './board.actions';
export { All as BoardUIActions } from './board-ui.actions';
4 changes: 2 additions & 2 deletions src/app/actions/work-item.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class UpdateError implements Action {
readonly type = UPDATE_ERROR;
}

export class Reoder implements Action {
export class Reorder implements Action {
readonly type = REORDER;
payload: {
workitem: WorkItemUI,
Expand Down Expand Up @@ -184,7 +184,7 @@ export type All
| GetChildren
| GetChildrenSuccess
| GetChildrenError
| Reoder
| Reorder
| UpdateWorkitemIteration
| CreateLink
| DeleteLink;
4 changes: 2 additions & 2 deletions src/app/components_ngrx/assignee/assignee.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ng-container *ngIf="assignees.length < 1">
<span class="dib fa fa-user-plus user-assign-icon margin-right-5"></span>
<small class="dib">Unassigned</small>
<small *ngIf="!overlapAvatar" class="dib">Unassigned</small>
</ng-container>
<ng-container *ngIf="showFullName">
<div class="f8-assignees dib margin-right-15 margin-bottom-7"
Expand All @@ -17,7 +17,7 @@
</ng-container>
<ng-container *ngIf="!showFullName">
<div class="f8-assignees dib margin-bottom-7">
<user-avatar
<user-avatar
*ngFor="let assignee of assignees | slice:0:truncateAfter"
[imgTooltip]="assignee?.name"
[imgPlacement]="'left'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class="fab-planner-iteration"
[takeFromInput]="false"
[collection]="item.typeList"
[witGroup]="item.name"
[witGroup]="item"
[showTree]="showTree"
[showCompleted]="showCompleted"
[sidePanelOpen]="sidePanelOpen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,21 @@ export class GroupTypesComponent implements OnInit, OnDestroy {
//reverse function jsonToQuery(second_join);
}

fnBuildQueryParamForBoard(witGroup) {
const type_query = this.filterService.queryBuilder(
'boardContextId', this.filterService.equal_notation, witGroup.id
);
// join query with typeQuery
const second_join = this.filterService.queryJoiner(
{}, this.filterService.and_notation, type_query
);
return this.filterService.jsonToQuery(second_join);
}

addRemoveQueryParams(witGroup) {
// If it's a board view then quoery should only have the board id
if (this.context === 'board') {
return {boardContextId: witGroup.id};
return {q: this.fnBuildQueryParamForBoard(witGroup)};
}

// For list view it works differently
Expand Down Expand Up @@ -134,11 +145,23 @@ export class GroupTypesComponent implements OnInit, OnDestroy {
this.route.queryParams.subscribe(val => {
if (val.hasOwnProperty('q')) {
let selectedTypeGroup: GroupTypeUI;
const selectedTypeGroupName =
this.filterService.getConditionFromQuery(val.q, 'typegroup.name');
if (selectedTypeGroupName) {
selectedTypeGroup =
this.groupTypes.find(g => g.name === selectedTypeGroupName);
if (val['q'].includes('boardContextId')) {
//filter service getConditionFromQuery returns undefined for non AND operations
let selectedTypeGroupId = this.filterService.getConditionFromQuery(val.q, 'boardContextId');
if (selectedTypeGroupId === undefined) {
selectedTypeGroupId = this.filterService.queryToFlat(val.q)[0].value;
}
if (selectedTypeGroupId) {
selectedTypeGroup =
this.groupTypes.find(g => g.id === selectedTypeGroupId);
}
} else {
const selectedTypeGroupName =
this.filterService.getConditionFromQuery(val.q, 'typegroup.name');
if (selectedTypeGroupName) {
selectedTypeGroup =
this.groupTypes.find(g => g.name === selectedTypeGroupName);
}
}
if (selectedTypeGroup && !selectedTypeGroup.selected) {
this.store.dispatch(new GroupTypeActions.SelectType(selectedTypeGroup));
Expand All @@ -154,15 +177,6 @@ export class GroupTypesComponent implements OnInit, OnDestroy {
} else {
this.showCompleted = '';
}

// If it's a board view then check for board context ID
if (val.hasOwnProperty('boardContextId')) {
const selectedTypeGroup: GroupTypeUI =
this.groupTypes.find(g => g.id === val.boardContextId);
if (selectedTypeGroup) {
this.store.dispatch(new GroupTypeActions.SelectType(selectedTypeGroup));
}
}
})
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</div>
<a
class="f8-itr__header"
[routerLink]="getRouterLink()"
[routerLink]="[]"
[queryParams]="addRemoveQueryParams(iteration.id)"
title="{{iteration.name}}">
<div class="truncate padding-right-15">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { AuthenticationService } from 'ngx-login-client';
import { Dialog } from 'ngx-widgets';
import { Subscription } from 'rxjs/Subscription';

import { GroupTypeUI } from '../../models/group-types.model';
import { IterationUI } from '../../models/iteration.model';
import { FilterService } from '../../services/filter.service';
import { GroupTypesService } from '../../services/group-types.service';
Expand All @@ -40,7 +41,7 @@ export class IterationListEntryComponent implements OnInit, OnDestroy {
@Input() iteration: IterationUI;
@Input() selected: boolean = false;
@Input() collection = [];
@Input() witGroup: string = '';
@Input() witGroup: GroupTypeUI;
@Input() showTree: string = '';
@Input() showCompleted: string = '';
@Input() context: 'list' | 'board'; // 'list' or 'board'
Expand Down Expand Up @@ -86,7 +87,7 @@ export class IterationListEntryComponent implements OnInit, OnDestroy {

constructURL(iterationId: string) {
//Query for work item type group
const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, this.witGroup);
const type_query = this.filterService.queryBuilder('typegroup.name', this.filterService.equal_notation, this.witGroup.name);
//Query for space
const space_query = this.filterService.queryBuilder('space', this.filterService.equal_notation, this.spaceId);
//Query for iteration
Expand All @@ -100,7 +101,23 @@ export class IterationListEntryComponent implements OnInit, OnDestroy {
return this.filterService.jsonToQuery(third_join);
}

constructURLforBoard(iterationId: string) {
//Query for work item type group
const type_query = this.filterService.queryBuilder('boardContextId', this.filterService.equal_notation, this.witGroup.id);
//Query for iteration
const iteration_query = this.filterService.queryBuilder('iteration', this.filterService.equal_notation, iterationId);
// join type and iteration query
const first_join = this.filterService.queryJoiner({}, this.filterService.and_notation, type_query);
const second_join = this.filterService.queryJoiner(first_join, this.filterService.and_notation, iteration_query);
return this.filterService.jsonToQuery(second_join);
}

addRemoveQueryParams(iterationId: string) {
if (this.context === 'board') {
return {
q: this.constructURLforBoard(iterationId)
};
}
if (this.showCompleted && this.showTree) {
return {
q: this.constructURL(iterationId),
Expand All @@ -124,10 +141,6 @@ export class IterationListEntryComponent implements OnInit, OnDestroy {
}
}

getRouterLink() {
return this.context === 'board' ? ['..'] : [];
}

toggleChildrenDisplay(iteration) {
// TODO: Dispatch an action to this
iteration.showChildren = !iteration.showChildren;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
SimpleChange,
SimpleChanges
} from '@angular/core';
import { GroupTypeUI } from '../../models/group-types.model';
import { IterationUI } from '../../models/iteration.model';
import { IterationListEntryComponent } from '../iteration-list-entry/iteration-list-entry.component';

Expand All @@ -18,7 +19,7 @@ export class IterationTreeComponent {

@Input() iterationList: IterationUI[] = [];
@Input() collection: any;
@Input() witGroup: string = '';
@Input() witGroup: GroupTypeUI;
@Input() showTree: string = '';
@Input() showCompleted: string = '';
@Input() context: 'list' | 'board'; // 'list' or 'board'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[class.hide]="!sidePanelOpen">
Iterations
</p>
<infotip
<infotip
[infotipText]="infotipText"
[class.dib]="sidePanelOpen"
[class.hide]="!sidePanelOpen">
Expand All @@ -36,7 +36,7 @@
*ngFor="let iteration of activeIterations | async">
<a
[routerLinkActive]="'f8-itr--selected'"
[routerLink]="getRouterLink()" [attr.data-id]="iteration.id"
[routerLink]="[]" [attr.data-id]="iteration.id"
[queryParams]="addRemoveQueryParams(iteration.id)"
title="{{ iteration.resolvedParentPath +
'/' + iteration.name }}">
Expand Down
Loading