Browse Source

code cleaning + bugfix + force static avatar url since api dont handle it yet

Skylsmoi 5 years ago
parent
commit
451b5fdc39

+ 0 - 6
dist/index.html View File

@@ -20,12 +20,6 @@
20 20
     <script src='/tracim.vendor.bundle.js'></script>
21 21
     <script src='/tracim.app.entry.js'></script>
22 22
 
23
-    <!--
24
-    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
25
-    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
26
-    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
27
-    -->
28
-
29 23
     <script src='/app/html-documents.app.js'></script>
30 24
     <!-- <script src='/app/thread.app.js'></script>
31 25
     <script src='/app/file.app.js'></script> -->

+ 1 - 1
src/component/Header/MenuActionListItem/MenuProfil.jsx View File

@@ -9,7 +9,7 @@ const MenuProfil = props => {
9 9
       <li className='header__menu__rightside__itemprofil'>
10 10
         <div className='profilgroup dropdown'>
11 11
           <button className='profilgroup__name btn btn-secondary dropdown-toggle' type='button' id='dropdownMenuButton' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
12
-            <img className='profilgroup__name__imgprofil' src={props.user.avatar} />
12
+            <img className='profilgroup__name__imgprofil' src={props.user.avatar_url} />
13 13
             <div className='profilgroup__name__text'>
14 14
               {props.user.name}
15 15
             </div>

+ 5 - 4
src/container/Header.jsx View File

@@ -61,7 +61,6 @@ class Header extends React.Component {
61 61
           <NavbarToggler />
62 62
 
63 63
           <div className='header__menu collapse navbar-collapse justify-content-end' id='navbarSupportedContent'>
64
-
65 64
             <MenuLinkList
66 65
               onClickFeature={this.handleClickFeature}
67 66
               onClickExplore={this.handleClickExplore}
@@ -73,21 +72,23 @@ class Header extends React.Component {
73 72
                 onChangeInput={this.handleChangeInput}
74 73
                 onClickSubmit={this.handleClickSubmit}
75 74
               />
75
+
76 76
               <MenuActionListItemDropdownLang
77 77
                 langList={lang}
78 78
                 onChangeLang={this.handleChangeLang}
79 79
               />
80
+
80 81
               <MenuActionListItemHelp
81 82
                 onClickHelp={this.handleClickHelp}
82 83
               />
84
+
85
+              <MenuActionListItemNotification />
86
+
83 87
               <MenuActionListItemMenuProfil
84 88
                 user={user}
85 89
                 onClickLogout={this.handleClickLogout}
86 90
               />
87
-
88
-              <MenuActionListItemNotification />
89 91
             </ul>
90
-
91 92
           </div>
92 93
         </nav>
93 94
       </header>

+ 1 - 1
src/container/Tracim.jsx View File

@@ -52,7 +52,7 @@ class Tracim extends React.Component {
52 52
         { user.logged === undefined
53 53
           ? (<div />) // while we dont know if user is connected, display nothing but the header @TODO show loader
54 54
           : (
55
-            <div className='tracim__content'> {/* uses of <Switch> component in react router ? */}
55
+            <div className='tracim__content'>
56 56
               <Route path={PAGE.LOGIN} component={Login} />
57 57
 
58 58
               <Switch>

+ 3 - 3
src/helper.js View File

@@ -16,9 +16,9 @@ export const PAGE = {
16 16
     CALENDAR: (idws = ':idws') => `/workspaces/${idws}/calendar`,
17 17
     CONTENT_LIST: (idws = ':idws') => `/workspaces/${idws}/contents`,
18 18
     CONTENT: (idws = ':idws', type = ':type?', idcts = ':idcts?') => `/workspaces/${idws}/${type}/${idcts}`,
19
-    CONTENT_NEW: (idws = ':idws', ctstype = ':ctstype') => `/workspaces/${idws}/contents/${ctstype}/new`,
20
-    CONTENT_EDIT: (idws = ':idws', idcts = ':idcts') => `/workspaces/${idws}/contents/${idcts}/edit`,
21
-    CONTENT_TITLE_EDIT: (idws = ':idws', idcts = ':idcts') => `/workspaces/${idws}/contents/${idcts}/title/edit`,
19
+    // CONTENT_NEW: (idws = ':idws', ctstype = ':ctstype') => `/workspaces/${idws}/contents/${ctstype}/new`,
20
+    // CONTENT_EDIT: (idws = ':idws', idcts = ':idcts') => `/workspaces/${idws}/contents/${idcts}/edit`,
21
+    // CONTENT_TITLE_EDIT: (idws = ':idws', idcts = ':idcts') => `/workspaces/${idws}/contents/${idcts}/title/edit`,
22 22
     ADMIN: (idws = ':idws') => `/workspaces/${idws}/admin`
23 23
   },
24 24
   LOGIN: '/login',

+ 4 - 1
src/reducer/user.js View File

@@ -23,7 +23,10 @@ const defaultUser = {
23 23
 export default function user (state = defaultUser, action) {
24 24
   switch (action.type) {
25 25
     case `Set/${USER_CONNECTED}`:
26
-      return action.user
26
+      return {
27
+        ...action.user,
28
+        avatar_url: 'https://www.algoo.fr/static/images/people_images/PERSO_SEUL.png' // @FIXME use avatar from api when db handles it
29
+      }
27 30
 
28 31
     case `Set/${USER_DISCONNECTED}`:
29 32
       return defaultUser