Просмотр исходного кода

Adjusts ProjectList to new MainList filtering

George Vrancianu 8 лет назад
Родитель
Сommit
d25c107b1d

+ 7 - 1
src/components/MainList/MainList.scss

@@ -106,7 +106,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
         }
       }
     }
-
     :global(.item) {
       position: relative;
       span:global(.cell):nth-child(1) {
@@ -168,3 +167,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
   }
 
 }
+.refreshBtn {
+  float: left;
+  padding: 5px 5px;
+  margin-top: 6px;
+  margin-left: 11px;
+  cursor: pointer;
+}

+ 24 - 3
src/components/ProjectList/ProjectList.js

@@ -30,7 +30,8 @@ import MainList from '../MainList';
 
 const title = 'Projects';
 
-const connectionActions = {
+const projectActions = null
+/* {
   delete_action: {
     label: "Delete",
     action: (item) => {
@@ -39,8 +40,27 @@ const connectionActions = {
     confirm: true
   }
 }
-
+*/
 class ProjectList extends Reflux.Component {
+  filters = [
+    {
+      field: "enabled",
+      options: [
+        { value: null, label: "All"},
+        { value: true, label: "Enabled"},
+        { value: false, label: "Disabled"}
+      ]
+    },
+    {
+      field: "is_domain",
+      options: [
+        { value: null, label: "All"},
+        { value: true, label: "Is Domain"},
+        { value: false, label: "Is Not Domain"}
+      ]
+    }
+  ]
+
   constructor(props) {
     super(props)
 
@@ -123,9 +143,10 @@ class ProjectList extends Reflux.Component {
           </div>
           <MainList
             items={this.state.currentUser.projects}
-            actions={connectionActions}
+            actions={projectActions}
             itemName="project"
             renderItem={this.renderItem}
+            filters={this.filters}
           />
         </div>
       </div>

+ 0 - 20
src/components/ProjectList/ProjectList.scss

@@ -112,7 +112,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
   flex-direction: column;
   :global(.items-list) {
     :global(.item) {
-      position: relative;
       padding-right: 16px;
       span:global(.cell):nth-child(2) {
         flex: 3;
@@ -127,18 +126,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
       span:global(.cell):nth-child(5) {
         flex: 3;
       }
-      :global(.checkbox-container) {
-        position: absolute;
-        left: -32px;
-        top: 21px;
-        opacity: 0;
-        transition: opacity $animation-swift-out;
-      }
-      &:hover, &:global(.selected) {
-        :global(.checkbox-container) {
-          opacity: 1;
-        }
-      }
       .description {
         display: block;
         color: $gray-dark;
@@ -164,12 +151,5 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
       }
     }
   }
-  .chevronRight {
-    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOHB4IiBoZWlnaHQ9IjEzcHgiIHZpZXdCb3g9IjQgMiA4IDEzIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwb2x5Z29uIGlkPSJDb21iaW5lZC1TaGFwZSIgc3Ryb2tlPSJub25lIiBmaWxsPSIjNjE2NzcwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDguMDAwMDAwLCA4LjM2Mzk2MSkgcm90YXRlKC05MC4wMDAwMDApIHRyYW5zbGF0ZSgtOC4wMDAwMDAsIC04LjM2Mzk2MSkgIiBwb2ludHM9IjggMTAuMzgyMzM3NiAyLjUwMjYwNzAyIDUgMS44MTU0MzI4OSA1LjY3Mjc5MjIxIDggMTEuNzI3OTIyMSAxNC4xODQ1NjcxIDUuNjcyNzkyMjEgMTMuNDk3MzkzIDUgOCAxMC4zODIzMzc2Ij48L3BvbHlnb24+PC9zdmc+');
-    width: 8px;
-    height: 13px;
-    display: inline-block;
-    margin: 0 16px;
-  }
 
 }