Преглед на файлове

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

Skylsmoi преди 5 години
родител
ревизия
451b5fdc39
променени са 6 файла, в които са добавени 14 реда и са изтрити 16 реда
  1. 0 6
      dist/index.html
  2. 1 1
      src/component/Header/MenuActionListItem/MenuProfil.jsx
  3. 5 4
      src/container/Header.jsx
  4. 1 1
      src/container/Tracim.jsx
  5. 3 3
      src/helper.js
  6. 4 1
      src/reducer/user.js

+ 0 - 6
dist/index.html Целия файл

20
     <script src='/tracim.vendor.bundle.js'></script>
20
     <script src='/tracim.vendor.bundle.js'></script>
21
     <script src='/tracim.app.entry.js'></script>
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
     <script src='/app/html-documents.app.js'></script>
23
     <script src='/app/html-documents.app.js'></script>
30
     <!-- <script src='/app/thread.app.js'></script>
24
     <!-- <script src='/app/thread.app.js'></script>
31
     <script src='/app/file.app.js'></script> -->
25
     <script src='/app/file.app.js'></script> -->

+ 1 - 1
src/component/Header/MenuActionListItem/MenuProfil.jsx Целия файл

9
       <li className='header__menu__rightside__itemprofil'>
9
       <li className='header__menu__rightside__itemprofil'>
10
         <div className='profilgroup dropdown'>
10
         <div className='profilgroup dropdown'>
11
           <button className='profilgroup__name btn btn-secondary dropdown-toggle' type='button' id='dropdownMenuButton' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
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
             <div className='profilgroup__name__text'>
13
             <div className='profilgroup__name__text'>
14
               {props.user.name}
14
               {props.user.name}
15
             </div>
15
             </div>

+ 5 - 4
src/container/Header.jsx Целия файл

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

+ 1 - 1
src/container/Tracim.jsx Целия файл

52
         { user.logged === undefined
52
         { user.logged === undefined
53
           ? (<div />) // while we dont know if user is connected, display nothing but the header @TODO show loader
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
               <Route path={PAGE.LOGIN} component={Login} />
56
               <Route path={PAGE.LOGIN} component={Login} />
57
 
57
 
58
               <Switch>
58
               <Switch>

+ 3 - 3
src/helper.js Целия файл

16
     CALENDAR: (idws = ':idws') => `/workspaces/${idws}/calendar`,
16
     CALENDAR: (idws = ':idws') => `/workspaces/${idws}/calendar`,
17
     CONTENT_LIST: (idws = ':idws') => `/workspaces/${idws}/contents`,
17
     CONTENT_LIST: (idws = ':idws') => `/workspaces/${idws}/contents`,
18
     CONTENT: (idws = ':idws', type = ':type?', idcts = ':idcts?') => `/workspaces/${idws}/${type}/${idcts}`,
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
     ADMIN: (idws = ':idws') => `/workspaces/${idws}/admin`
22
     ADMIN: (idws = ':idws') => `/workspaces/${idws}/admin`
23
   },
23
   },
24
   LOGIN: '/login',
24
   LOGIN: '/login',

+ 4 - 1
src/reducer/user.js Целия файл

23
 export default function user (state = defaultUser, action) {
23
 export default function user (state = defaultUser, action) {
24
   switch (action.type) {
24
   switch (action.type) {
25
     case `Set/${USER_CONNECTED}`:
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
     case `Set/${USER_DISCONNECTED}`:
31
     case `Set/${USER_DISCONNECTED}`:
29
       return defaultUser
32
       return defaultUser