Jelajahi Sumber

Merge pull request #478 from smiclea/hide-password

Cover password fields in Replica Details body
Nashwan Azhari 6 tahun lalu
induk
melakukan
ff9dc548f4
1 mengubah file dengan 10 tambahan dan 8 penghapusan
  1. 10 8
      src/components/organisms/MainDetails/MainDetails.jsx

+ 10 - 8
src/components/organisms/MainDetails/MainDetails.jsx

@@ -25,6 +25,7 @@ import StatusIcon from '../../atoms/StatusIcon'
 import StatusImage from '../../atoms/StatusImage'
 import StatusImage from '../../atoms/StatusImage'
 import MainDetailsTable from '../../molecules/MainDetailsTable'
 import MainDetailsTable from '../../molecules/MainDetailsTable'
 import CopyMultilineValue from '../../atoms/CopyMultilineValue'
 import CopyMultilineValue from '../../atoms/CopyMultilineValue'
+import PasswordValue from '../../atoms/PasswordValue'
 
 
 import type { Instance } from '../../../types/Instance'
 import type { Instance } from '../../../types/Instance'
 import type { MainItem } from '../../../types/MainItem'
 import type { MainItem } from '../../../types/MainItem'
@@ -242,14 +243,15 @@ class MainDetails extends React.Component<Props> {
 
 
     return (
     return (
       <PropertiesTable>
       <PropertiesTable>
-        {properties.filter(Boolean).filter(p => p.value != null && p.value !== '').map(prop => {
-          return (
-            <PropertyRow key={prop.label}>
-              <PropertyName>{prop.label}</PropertyName>
-              <PropertyValue><CopyValue value={prop.value} /></PropertyValue>
-            </PropertyRow>
-          )
-        })}
+        {properties.filter(Boolean).filter(p => p.value != null && p.value !== '').map(prop => (
+          <PropertyRow key={prop.label}>
+            <PropertyName>{prop.label}</PropertyName>
+            <PropertyValue>
+              {prop.label.toLowerCase().indexOf('password') > -1
+                ? <PasswordValue value={prop.value} /> : <CopyValue value={prop.value} />}
+            </PropertyValue>
+          </PropertyRow>
+        ))}
       </PropertiesTable>
       </PropertiesTable>
     )
     )
   }
   }