TSK-674: now displaying workbasked when opening a task using a deep link

This commit is contained in:
Mustapha Zorgati 2018-09-03 15:59:38 +02:00 committed by Martin Rojas Miguel Angel
parent f050296c8c
commit 542e66284b
7 changed files with 159 additions and 121 deletions

243
web/package-lock.json generated
View File

@ -640,12 +640,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -660,17 +662,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -787,7 +792,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -799,6 +805,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -813,6 +820,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -924,7 +932,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -936,6 +945,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -1057,6 +1067,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -5201,6 +5212,7 @@
"version": "0.0.9", "version": "0.0.9",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"inherits": "~2.0.0" "inherits": "~2.0.0"
} }
@ -5226,7 +5238,8 @@
"buffer-shims": { "buffer-shims": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"caseless": { "caseless": {
"version": "0.12.0", "version": "0.12.0",
@ -5243,7 +5256,8 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"combined-stream": { "combined-stream": {
"version": "1.0.5", "version": "1.0.5",
@ -5263,17 +5277,20 @@
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"cryptiles": { "cryptiles": {
"version": "2.0.5", "version": "2.0.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"boom": "2.x.x" "boom": "2.x.x"
} }
@ -5346,7 +5363,8 @@
"extsprintf": { "extsprintf": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"forever-agent": { "forever-agent": {
"version": "0.6.1", "version": "0.6.1",
@ -5469,6 +5487,7 @@
"version": "3.1.3", "version": "3.1.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"boom": "2.x.x", "boom": "2.x.x",
"cryptiles": "2.x.x", "cryptiles": "2.x.x",
@ -5516,6 +5535,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "1.0.1" "number-is-nan": "1.0.1"
} }
@ -5529,7 +5549,8 @@
"isarray": { "isarray": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"isstream": { "isstream": {
"version": "0.1.2", "version": "0.1.2",
@ -5745,7 +5766,8 @@
"process-nextick-args": { "process-nextick-args": {
"version": "1.0.7", "version": "1.0.7",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"punycode": { "punycode": {
"version": "1.4.1", "version": "1.4.1",
@ -5783,6 +5805,7 @@
"version": "2.2.9", "version": "2.2.9",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"buffer-shims": "~1.0.0", "buffer-shims": "~1.0.0",
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
@ -5834,7 +5857,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.0.1", "version": "5.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"semver": { "semver": {
"version": "5.3.0", "version": "5.3.0",
@ -5858,6 +5882,7 @@
"version": "1.0.9", "version": "1.0.9",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"hoek": "2.x.x" "hoek": "2.x.x"
} }
@ -5891,6 +5916,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -5901,6 +5927,7 @@
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
@ -5929,6 +5956,7 @@
"version": "2.2.1", "version": "2.2.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"block-stream": "*", "block-stream": "*",
"fstream": "^1.0.2", "fstream": "^1.0.2",
@ -5984,7 +6012,8 @@
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"uuid": { "uuid": {
"version": "3.0.1", "version": "3.0.1",
@ -8331,12 +8360,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -8356,7 +8387,8 @@
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
@ -8504,6 +8536,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -14277,8 +14310,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -14292,8 +14324,8 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"delegates": "1.0.0", "delegates": "^1.0.0",
"readable-stream": "2.3.6" "readable-stream": "^2.0.6"
} }
}, },
"balanced-match": { "balanced-match": {
@ -14321,8 +14353,7 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
@ -14333,8 +14364,7 @@
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -14375,7 +14405,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"minipass": "2.2.4" "minipass": "^2.2.1"
} }
}, },
"fs.realpath": { "fs.realpath": {
@ -14390,14 +14420,14 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"aproba": "1.2.0", "aproba": "^1.0.3",
"console-control-strings": "1.1.0", "console-control-strings": "^1.0.0",
"has-unicode": "2.0.1", "has-unicode": "^2.0.0",
"object-assign": "4.1.1", "object-assign": "^4.1.0",
"signal-exit": "3.0.2", "signal-exit": "^3.0.0",
"string-width": "1.0.2", "string-width": "^1.0.1",
"strip-ansi": "3.0.1", "strip-ansi": "^3.0.1",
"wide-align": "1.1.2" "wide-align": "^1.1.0"
} }
}, },
"glob": { "glob": {
@ -14406,12 +14436,12 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"fs.realpath": "1.0.0", "fs.realpath": "^1.0.0",
"inflight": "1.0.6", "inflight": "^1.0.4",
"inherits": "2.0.3", "inherits": "2",
"minimatch": "3.0.4", "minimatch": "^3.0.4",
"once": "1.4.0", "once": "^1.3.0",
"path-is-absolute": "1.0.1" "path-is-absolute": "^1.0.0"
} }
}, },
"has-unicode": { "has-unicode": {
@ -14426,7 +14456,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"safer-buffer": "2.1.2" "safer-buffer": "^2.1.0"
} }
}, },
"ignore-walk": { "ignore-walk": {
@ -14444,15 +14474,14 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"once": "1.4.0", "once": "^1.3.0",
"wrappy": "1.0.2" "wrappy": "1"
} }
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -14464,9 +14493,8 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "1.0.1" "number-is-nan": "^1.0.0"
} }
}, },
"isarray": { "isarray": {
@ -14494,10 +14522,9 @@
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "5.1.1", "safe-buffer": "^5.1.1",
"yallist": "3.0.2" "yallist": "^3.0.0"
} }
}, },
"minizlib": { "minizlib": {
@ -14506,14 +14533,13 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"minipass": "2.2.4" "minipass": "^2.2.1"
} }
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -14530,9 +14556,9 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"debug": "2.6.9", "debug": "^2.1.2",
"iconv-lite": "0.4.21", "iconv-lite": "^0.4.4",
"sax": "1.2.4" "sax": "^1.2.4"
} }
}, },
"node-pre-gyp": { "node-pre-gyp": {
@ -14541,16 +14567,16 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"detect-libc": "1.0.3", "detect-libc": "^1.0.2",
"mkdirp": "0.5.1", "mkdirp": "^0.5.1",
"needle": "2.2.0", "needle": "^2.2.0",
"nopt": "4.0.1", "nopt": "^4.0.1",
"npm-packlist": "1.1.10", "npm-packlist": "^1.1.6",
"npmlog": "4.1.2", "npmlog": "^4.0.2",
"rc": "1.2.7", "rc": "^1.1.7",
"rimraf": "2.6.2", "rimraf": "^2.6.1",
"semver": "5.5.0", "semver": "^5.3.0",
"tar": "4.4.1" "tar": "^4"
} }
}, },
"nopt": { "nopt": {
@ -14559,8 +14585,8 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"abbrev": "1.1.1", "abbrev": "1",
"osenv": "0.1.5" "osenv": "^0.1.4"
} }
}, },
"npm-bundled": { "npm-bundled": {
@ -14575,8 +14601,8 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"ignore-walk": "3.0.1", "ignore-walk": "^3.0.1",
"npm-bundled": "1.0.3" "npm-bundled": "^1.0.1"
} }
}, },
"npmlog": { "npmlog": {
@ -14585,17 +14611,16 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"are-we-there-yet": "1.1.4", "are-we-there-yet": "~1.1.2",
"console-control-strings": "1.1.0", "console-control-strings": "~1.1.0",
"gauge": "2.7.4", "gauge": "~2.7.3",
"set-blocking": "2.0.0" "set-blocking": "~2.0.0"
} }
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -14607,9 +14632,8 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1.0.2" "wrappy": "1"
} }
}, },
"os-homedir": { "os-homedir": {
@ -14630,8 +14654,8 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"os-homedir": "1.0.2", "os-homedir": "^1.0.0",
"os-tmpdir": "1.0.2" "os-tmpdir": "^1.0.0"
} }
}, },
"path-is-absolute": { "path-is-absolute": {
@ -14652,10 +14676,10 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"deep-extend": "0.5.1", "deep-extend": "^0.5.1",
"ini": "1.3.5", "ini": "~1.3.0",
"minimist": "1.2.0", "minimist": "^1.2.0",
"strip-json-comments": "2.0.1" "strip-json-comments": "~2.0.1"
}, },
"dependencies": { "dependencies": {
"minimist": { "minimist": {
@ -14672,13 +14696,13 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"core-util-is": "1.0.2", "core-util-is": "~1.0.0",
"inherits": "2.0.3", "inherits": "~2.0.3",
"isarray": "1.0.0", "isarray": "~1.0.0",
"process-nextick-args": "2.0.0", "process-nextick-args": "~2.0.0",
"safe-buffer": "5.1.1", "safe-buffer": "~5.1.1",
"string_decoder": "1.1.1", "string_decoder": "~1.1.1",
"util-deprecate": "1.0.2" "util-deprecate": "~1.0.1"
} }
}, },
"rimraf": { "rimraf": {
@ -14687,14 +14711,13 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"glob": "7.1.2" "glob": "^7.0.5"
} }
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -14730,11 +14753,10 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "1.1.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "1.0.0", "is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "3.0.1" "strip-ansi": "^3.0.0"
} }
}, },
"string_decoder": { "string_decoder": {
@ -14743,16 +14765,15 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"safe-buffer": "5.1.1" "safe-buffer": "~5.1.0"
} }
}, },
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "2.1.1" "ansi-regex": "^2.0.0"
} }
}, },
"strip-json-comments": { "strip-json-comments": {
@ -14767,13 +14788,13 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"chownr": "1.0.1", "chownr": "^1.0.1",
"fs-minipass": "1.2.5", "fs-minipass": "^1.2.5",
"minipass": "2.2.4", "minipass": "^2.2.4",
"minizlib": "1.1.0", "minizlib": "^1.1.0",
"mkdirp": "0.5.1", "mkdirp": "^0.5.0",
"safe-buffer": "5.1.1", "safe-buffer": "^5.1.1",
"yallist": "3.0.2" "yallist": "^3.0.2"
} }
}, },
"util-deprecate": { "util-deprecate": {
@ -14788,20 +14809,18 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"string-width": "1.0.2" "string-width": "^1.0.2"
} }
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },

View File

@ -87,7 +87,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.categoryService.getClassificationTypes().subscribe((classificationTypes: Array<string>) => { this.categoryService.getClassificationTypes().subscribe((classificationTypes: Array<string>) => {
this.classificationTypes = classificationTypes; this.classificationTypes = classificationTypes;
}) });
this.classificationSelectedSubscription = this.classificationsService.getSelectedClassification() this.classificationSelectedSubscription = this.classificationsService.getSelectedClassification()
.subscribe(classificationSelected => { .subscribe(classificationSelected => {
if (this.classification && this.classification.classificationId === classificationSelected.classificationId) { return; } if (this.classification && this.classification.classificationId === classificationSelected.classificationId) { return; }

View File

@ -27,7 +27,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
requestInProgress = false; requestInProgress = false;
initialized = false; initialized = false;
inputValue: string; inputValue: string;
categories = new Array<string>(); categories: Array<string> = [];
classifications: Array<Classification> = []; classifications: Array<Classification> = [];
classificationsTypes: Array<string> = []; classificationsTypes: Array<string> = [];
classificationTypeSelected: string; classificationTypeSelected: string;
@ -50,11 +50,11 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
.classificationSavedTriggered() .classificationSavedTriggered()
.subscribe(value => { .subscribe(value => {
this.performRequest(true); this.performRequest(true);
}) });
this.selectedClassificationSubscription = this.categoryService.getSelectedClassificationType().subscribe(value => { this.selectedClassificationSubscription = this.categoryService.getSelectedClassificationType().subscribe(value => {
this.classificationTypeSelected = value; this.classificationTypeSelected = value;
this.performRequest(); this.performRequest();
}) });
this.categoriesSubscription = this.categoriesSubscription =
this.categoryService.getCategories(this.classificationTypeSelected).subscribe((categories: Array<string>) => { this.categoryService.getCategories(this.classificationTypeSelected).subscribe((categories: Array<string>) => {

View File

@ -15,18 +15,18 @@ export class MasterAndDetailComponent implements OnInit {
private detailRoutes: Array<string> = ['/workbaskets/(detail', 'classifications/(detail', 'tasks/(detail']; private detailRoutes: Array<string> = ['/workbaskets/(detail', 'classifications/(detail', 'tasks/(detail'];
private sub: any; private sub: any;
showDetail: Boolean = false; showDetail = false;
currentRoute = ''; currentRoute = '';
constructor(private route: ActivatedRoute, private router: Router, private masterAndDetailService: MasterAndDetailService) { constructor(private route: ActivatedRoute, private router: Router, private masterAndDetailService: MasterAndDetailService) {
} }
ngOnInit(): void { ngOnInit(): void {
this.showDetail = this.showDetails(); this.showDetail = this.showDetails();
this.masterAndDetailService.setShowDetail(this.showDetail ? true : false); this.masterAndDetailService.setShowDetail(this.showDetail);
this.router.events.subscribe(event => { this.router.events.subscribe(event => {
if (event instanceof NavigationStart) { if (event instanceof NavigationStart) {
this.showDetail = this.showDetails(event); this.showDetail = this.showDetails(event);
this.masterAndDetailService.setShowDetail(this.showDetail ? true : false); this.masterAndDetailService.setShowDetail(this.showDetail);
} }
}); });
} }
@ -35,14 +35,14 @@ export class MasterAndDetailComponent implements OnInit {
this.router.navigate(['../'], { relativeTo: this.route }); this.router.navigate(['../'], { relativeTo: this.route });
} }
private showDetails(event?: RouterEvent): Boolean { private showDetails(event?: RouterEvent): boolean {
if (event === undefined) { if (event === undefined) {
return this.checkUrl(this.router.url); return this.checkUrl(this.router.url);
} }
return this.checkUrl(event.url) return this.checkUrl(event.url)
} }
private checkUrl(url: string): Boolean { private checkUrl(url: string): boolean {
this.checkRoute(url); this.checkRoute(url);
for (const routeDetail of this.detailRoutes) { for (const routeDetail of this.detailRoutes) {
if (url.indexOf(routeDetail) !== -1) { if (url.indexOf(routeDetail) !== -1) {

View File

@ -18,6 +18,8 @@ export class TaskService {
url = `${environment.taskanaRestUrl}/v1/tasks`; url = `${environment.taskanaRestUrl}/v1/tasks`;
private taskSelected = new Subject<Task>();
taskChangedSource = new Subject<Task>(); taskChangedSource = new Subject<Task>();
taskChangedStream = this.taskChangedSource.asObservable(); taskChangedStream = this.taskChangedSource.asObservable();
@ -32,6 +34,14 @@ export class TaskService {
this.taskDeletedSource.next(task); this.taskDeletedSource.next(task);
} }
selectTask(task: Task) {
this.taskSelected.next(task);
}
getSelectedTask(): Observable<Task> {
return this.taskSelected.asObservable();
}
constructor(private httpClient: HttpClient) { constructor(private httpClient: HttpClient) {
} }

View File

@ -40,6 +40,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
this.taskService.getTask(id).subscribe(task => { this.taskService.getTask(id).subscribe(task => {
this.requestInProgress = false; this.requestInProgress = false;
this.task = task; this.task = task;
this.taskService.selectTask(task);
}, err => { }, err => {
this.errorModalService.triggerError( this.errorModalService.triggerError(
new ErrorModel('An error occurred while fetching the task', err)); new ErrorModel('An error occurred while fetching the task', err));

View File

@ -53,6 +53,14 @@ export class TasklistComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.taskService.getSelectedTask().subscribe(
task => {
if (!this.currentBasket) {
this.selectedId = task.taskId;
this.currentBasket = task.workbasketSummaryResource;
this.getTasks();
}
});
} }
loadTasks(tasks: Task[]) { loadTasks(tasks: Task[]) {