44 <!-- <router-view></router-view>-->
55
66 <!-- Top Navbar -->
7- <Navbar v-bind:username =" user.username" v-bind:selectedWsName =" selectedWsName" ></Navbar >
7+ <Navbar v-bind:username =" user.username" v-bind:selectedWs =" selectedWs" v-bind:enrolledWorkspaces =" enrolledWorkspaces"
8+ v-on:select-ws =" selectWorkspace" ></Navbar >
89
910 <!-- Projects in Sidebar -->
1011 <Sidebar v-bind:selectedWs =" selectedWs" v-on:select-proj =" selectProj" ></Sidebar >
1819 <!-- Panel 1 -->
1920 <div class =" col-md-6" >
2021 <Tasks v-bind:tasks =" tasks" v-bind:selectedWsId =" selectedWs._id" v-bind:selectedProj =" selectedProj"
21- v-bind:username =" user.username" v-on:select-task =" selectTask" >
22+ v-bind:username =" user.username" v-on:select-task =" selectTask" >
2223 </Tasks >
2324 </div >
2425
@@ -62,7 +63,6 @@ export default {
6263 user: api .user ,
6364 enrolledWorkspaces: [],
6465 selectedWorkspaceIndex: - 1 ,
65- selectedWsName: ' ' ,
6666 selectedWs: {},
6767 selectedProj: {},
6868 tasks: {},
@@ -91,7 +91,6 @@ export default {
9191 });
9292
9393 Promise .all (promise1).then ((results )=> {
94- this .selectedWsName = this .enrolledWorkspaces [this .selectedWorkspaceIndex ].name ;
9594 this .selectedWs = this .enrolledWorkspaces [this .selectedWorkspaceIndex ];
9695 var selectedProjIndex = this .enrolledWorkspaces [this .selectedWorkspaceIndex ].projects .findIndex ((proj )=> {
9796 return proj .selected ;
@@ -118,13 +117,19 @@ export default {
118117 },
119118 selectProj (index ){
120119 // console.log('selectProj called with index = ' + index);
121- this .selectedProj = this .enrolledWorkspaces [this .selectedWorkspaceIndex ].projects [index];
122- api .getTasks (this .selectedWs ._id ,this .selectedProj ._id , this .user .username )
123- .then ((resp )=> {
124- // console.log('getTasks resp::- ' + JSON.stringify(resp.data));
125- this .tasks = resp .data ;
126- this .taskComments = {};
127- });
120+ this .selectedProj = this .selectedWs .projects [index];
121+ if (this .selectedProj ){
122+ api .getTasks (this .selectedWs ._id ,this .selectedProj ._id , this .user .username )
123+ .then ((resp )=> {
124+ // console.log('getTasks resp::- ' + JSON.stringify(resp.data));
125+ this .tasks = resp .data ;
126+ this .taskComments = {};
127+ });
128+ }
129+ else {
130+ this .tasks = {};
131+ this .taskComments = {};
132+ }
128133 },
129134 selectTask (task ){
130135 console .log (' showcom called' + JSON .stringify (task));
@@ -134,6 +139,12 @@ export default {
134139 console .log (' getComments resp:- ' + JSON .stringify (resp));
135140 this .taskComments = resp .data ;
136141 });
142+ },
143+
144+ selectWorkspace (ws ){
145+ console .log (' selectWorkspace called in dashboard' + JSON .stringify (ws));
146+ this .selectedWs = ws;
147+ this .selectProj (0 );
137148 }
138149 },
139150
@@ -142,22 +153,11 @@ export default {
142153
143154<style >
144155#wrapper {
145- padding-left : 250 px ;
156+ padding-left : 170 px ;
146157 transition : all 0.4s ease 0s ;
147158}
148159
149- #sidebar-wrapper {
150- margin-left : -250px ;
151- top : 51px ;
152- left : 250px ;
153- width : 250px ;
154- background : #000 ;
155- position : fixed ;
156- height : 100% ;
157- overflow-y : auto ;
158- z-index : 1000 ;
159- transition : all 0.4s ease 0s ;
160- }
160+
161161
162162#wrapper .active {
163163 padding-left : 0 ;
@@ -169,66 +169,11 @@ export default {
169169
170170#page-content-wrapper {
171171 width : 100% ;
172- padding-top : 70 px ;
172+ padding-top : 10 px ;
173173 transition : all 0.4s ease 0s ;
174174}
175175
176- .sidebar-nav {
177- position : absolute ;
178- top : 0 ;
179- width : 250px ;
180- list-style : none ;
181- margin : 0 ;
182- padding : 0 ;
183- }
184-
185- .sidebar-nav li {
186- line-height : 40px ;
187- text-indent : 20px ;
188- }
189-
190- .sidebar-nav li a {
191- color : #999999 ;
192- display : block ;
193- text-decoration : none ;
194- padding-left : 60px ;
195- }
196-
197- .sidebar-nav li a span :before {
198- position : absolute ;
199- left : 0 ;
200- color : #41484c ;
201- text-align : center ;
202- width : 20px ;
203- line-height : 18px ;
204- }
205-
206- .sidebar-nav li a :hover ,
207- .sidebar-nav li .active {
208- color : #fff ;
209- background : rgba (255 ,255 ,255 ,0.2 );
210- text-decoration : none ;
211- }
212-
213- .sidebar-nav li a :active ,
214- .sidebar-nav li a :focus {
215- text-decoration : none ;
216- }
217-
218- .sidebar-nav > .sidebar-brand {
219- height : 65px ;
220- line-height : 60px ;
221- font-size : 18px ;
222- }
223-
224- .sidebar-nav > .sidebar-brand a {
225- color : #999999 ;
226- }
227176
228- .sidebar-nav > .sidebar-brand a :hover {
229- color : #fff ;
230- background : none ;
231- }
232177
233178
234179
0 commit comments