@samitouri / QOS-React / commits / ebb5a33ec2

Tweak attribute whitelist table (#10559)

* Move null and undefined to the end * Highlight attributes with changes

Dan Abramov committed Aug 28, 2017 at 15:13 UTC ebb5a33ec20b73681fb7698cfc8090ac5c41e684
1 file changed +16 -9
fixtures/attribute-behavior/src/App.js
+16 -9
@@ -21,14 +21,6 @@ const types = [
21 testValue: 'a string',
22 testDisplayValue: "'a string'",
23 },
24 - {
25 - name: 'null',
26 - testValue: null,
27 - },
28 - {
29 - name: 'undefined',
30 - testValue: undefined,
31 - },
24 {
25 name: 'empty string',
26 testValue: '',
@@ -115,6 +107,14 @@ const types = [
107 name: 'function',
108 testValue: function f() {},
109 },
110 + {
111 + name: 'null',
112 + testValue: null,
113 + },
114 + {
115 + name: 'undefined',
116 + testValue: undefined,
117 + },
118 ];
119
120 function getProperty(propertyName) {
@@ -2841,7 +2841,14 @@ function CellContent(props) {
2841 if (rowIndex === 0) {
2842 return null;
2843 }
2844 - return <RowHeader>{attribute.name}</RowHeader>;
2844 + const hasSameBehaviorForAll = types.every(
2845 + type => table.get(attribute).get(type.name).hasSameBehavior
2846 + );
2847 + return (
2848 + <RowHeader>
2849 + {hasSameBehaviorForAll ? attribute.name : <b>{attribute.name}</b>}
2850 + </RowHeader>
2851 + );
2852 }
2853
2854 if (rowIndex === 0) {