File tree Expand file tree Collapse file tree 20 files changed +432
-6
lines changed
Expand file tree Collapse file tree 20 files changed +432
-6
lines changed Original file line number Diff line number Diff line change 1+ import Component from '@ember/component' ;
2+
3+ export default Component . extend ( {
4+ classNames : [ 'project-switcher-menu' ]
5+ } ) ;
Original file line number Diff line number Diff line change 1+ import Component from '@ember/component' ;
2+ import { set } from '@ember/object' ;
3+
4+ export default Component . extend ( {
5+ classNames : [ 'project-switcher' , 'dropdown' ] ,
6+ classNameBindings : [ 'hidden:menu-hidden:menu-visible' ] ,
7+ hidden : true ,
8+
9+ actions : {
10+ hide ( ) {
11+ document . body . setAttribute ( 'style' , null ) ;
12+ set ( this , 'hidden' , true ) ;
13+ } ,
14+
15+ show ( ) {
16+ document . body . setAttribute ( 'style' , 'overflow: hidden;' ) ;
17+ set ( this , 'hidden' , false ) ;
18+ }
19+ }
20+ } ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export default Model.extend({
2929
3030 categories : hasMany ( 'category' , { async : true } ) ,
3131 githubAppInstallations : hasMany ( 'github-app-installation' , { async : true } ) ,
32+ organizations : hasMany ( 'organization' , { async : true } ) ,
3233 projectUsers : hasMany ( 'project-user' , { async : true } ) ,
3334 stripeConnectSubscriptions : hasMany ( 'stripe-connect-subscription' , { async : true } ) ,
3435 stripePlatformCard : belongsTo ( 'stripe-platform-card' , { async : true } ) ,
Original file line number Diff line number Diff line change 149149@import " components/project-join-modal" ;
150150@import " components/project-list" ;
151151@import " components/project-long-description" ;
152- @import " components/project-users" ;
153152@import " components/project-menu" ;
153+ @import " components/project-switcher-menu" ;
154+ @import " components/project-users" ;
154155
155156//
156157// COMPONENTS - PROJECT CARDS
Original file line number Diff line number Diff line change 1+ .sheet {
2+ background : none ;
3+ border-radius : none ;
4+ box-shadow : none ;
5+ padding : 0 ;
6+ }
7+
8+ .project-menu {
9+ animation : slide 0.25s forwards ;
10+ position : fixed ;
11+ top : 0 ;
12+ right : -1000px ;
13+ bottom : 0 ;
14+ left : 0 ;
15+ z-index : 999999 ;
16+ right : -1000px ;
17+ }
18+
19+ .project-menu-wrapper {
20+ background : white ;
21+ position : absolute ;
22+ top : 0 ; right : 0 ; bottom : 0 ;
23+ }
24+
25+ .project-menu-content {
26+ height : 100% ;
27+ overflow : scroll ;
28+ width : 280px ;
29+ }
30+
31+ .project-switcher-menu {
32+ padding : 5px 0 ;
33+ text-align : left ;
34+
35+ ul {
36+ border-bottom : 1px solid $border-gray ;
37+ padding-bottom : 5px ;
38+ margin-bottom : 3px ;
39+
40+ & :last-child {
41+ border-bottom : none ;
42+ padding-bottom : 0 ;
43+ margin-bottom : 0 ;
44+ }
45+ }
46+
47+ li {
48+ display : block ;
49+ float : none ;
50+ padding : 1px 5px ;
51+ }
52+
53+ a {
54+ align-items : center ;
55+ border : none ;
56+ color : $gray ;
57+ display : flex ;
58+ font-weight : 500 ;
59+ padding : 2px ;
60+
61+ & :hover , & .active {
62+ background : $blue--background ;
63+ color : $blue ;
64+
65+ .project-switcher-menu__new__icon {
66+ border-color : $blue ;
67+ color : $blue ;
68+ }
69+ }
70+ }
71+
72+ img {
73+ margin-right : 5px ;
74+ }
75+
76+ & __new {
77+ & __icon {
78+ align-items : center ;
79+ border : 1px dashed $gray--lighter ;
80+ border-radius : 2px ;
81+ color : $gray--lighter ;
82+ display : inline-flex ;
83+ height : 25px ;
84+ justify-content : center ;
85+ margin-right : 5px ;
86+ width : 25px ;
87+ }
88+ }
89+ }
90+
91+ li .project-switcher-menu__option--title {
92+ color : $text--lighter ;
93+ font-size : $body-font-size-small ;
94+ font-weight : 600 ;
95+ padding : 5px ;
96+ }
97+
98+ @keyframes slide {
99+ 100% { right : 0 ; }
100+ }
Original file line number Diff line number Diff line change 2424}
2525
2626.user-menu a {
27- padding : 5px 0 2px 0 ;
27+ padding : 5px 10 px 2px 10 px ;
2828}
2929
3030.user-menu__avatar {
Original file line number Diff line number Diff line change 8080 & .header-navigation__icon-link {
8181 color : $gray ;
8282 font-size : 24px ;
83- margin : 0 5px ;
8483 padding : 4px 10px ;
8584 }
8685
Original file line number Diff line number Diff line change 44
55{{ svg/sprite-map }}
66
7+ <div id =" project-menu" ></div >
8+
79{{! do we have to wrap the whole app with #drag-zone?
810isn't this here mainly for updating a user's image? }}
911{{ #drag-zone }}
Original file line number Diff line number Diff line change 2626 {{ #if session.isAuthenticated }}
2727 <nav class =" header-navigation--right" >
2828 <ul class =" header-navigation__options" >
29+ {{ #if currentUser.user.organizations }}
30+ <li >
31+ {{ project-switcher
32+ user =currentUser.user
33+ }}
34+ </li >
35+ {{ /if }}
2936 <li >{{ #link-to " conversations" data-test-conversations-link class =" header-navigation__icon-link" }} {{ fa-icon " comments" }} {{ /link-to }} </li >
3037 </ul >
31- {{ user-menu user =currentUser.user class =" header-navigation__options" }}
38+ {{ user-menu
39+ user =currentUser.user
40+ class =" header-navigation__options"
41+ }}
3242 </nav >
3343 {{ else }}
3444 <nav class =" header-navigation--right" >
Original file line number Diff line number Diff line change 1+ {{ #modal-dialog
2+ containerClassNames =" sheet"
3+ targetAttachment =" none"
4+ translucentOverlay =true
5+ }}
6+ <div data-test-project-menu class =" project-menu" >
7+ <div class =" project-menu-wrapper" >
8+ <div class =" project-menu-content" >
9+ <div class =" project-switcher-menu" >
10+ {{ #each user.organizations as |organization |}}
11+ <ul >
12+ <li data-test-organization class =" project-switcher-menu__option--title" >{{ organization.name }} </li >
13+ {{ #each organization.projects as |project |}}
14+ {{ #unless project.isNew }}
15+ <li data-test-project>
16+ {{ #link-to ' project' project.organization.slug project.slug }}
17+ <img data-test-icon class =" icon icon--tiny" width =" 25" height =" 25" src =" {{ project.iconThumbUrl }} " /> {{ project.title }}
18+ {{ /link-to }}
19+ </li >
20+ {{ /unless }}
21+ {{ /each }}
22+ {{ #if (can ' manage organization' organization )}}
23+ <li data-test-new-project class =" project-switcher-menu__new" >
24+ {{ #link-to ' projects.new' organization.slug }} <span class =" project-switcher-menu__new__icon" >{{ fa-icon " plus" }} </span > New project{{ /link-to }}
25+ </li >
26+ {{ /if }}
27+ </ul >
28+ {{ /each }}
29+ </div >
30+ </div >
31+ </div >
32+ </div >
33+ {{ /modal-dialog }}
You can’t perform that action at this time.
0 commit comments