Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5397 | Rev 6004 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 5397 Rev 5996
Línea 9... Línea 9...
9
import Profile from '../../../../components/Profile'
9
import Profile from '../../../../components/Profile'
10
import SearchList from '../../../../components/SearchList'
10
import SearchList from '../../../../components/SearchList'
11
import TitleSection from '../../../../components/TitleSection'
11
import TitleSection from '../../../../components/TitleSection'
12
import EmptySection from '../../../../shared/empty-section/EmptySection'
12
import EmptySection from '../../../../shared/empty-section/EmptySection'
13
import AddGroupModal from './add-group-modal/AddGroupModal'
13
import AddGroupModal from './add-group-modal/AddGroupModal'
-
 
14
import { setIntlLabels } from '../../../../redux/intl/intl.action'
Línea 14... Línea 15...
14
 
15
 
15
const MyGroups = ({ groupTypes, industries, addNotification, LABELS }) => {
16
const MyGroups = ({ groupTypes, industries, addNotification, labels }) => {
16
  const [groups, setGroups] = useState([])
17
  const [groups, setGroups] = useState([])
17
  const [loading, setLoading] = useState(true)
18
  const [loading, setLoading] = useState(true)
Línea 18... Línea 19...
18
  const [showAddGroupModal, setShowAddGroupModal] = useState(false)
19
  const [showAddGroupModal, setShowAddGroupModal] = useState(false)
19
 
20
 
-
 
21
  useEffect(() => {
20
  useEffect(() => {
22
    getGroups()
Línea 21... Línea 23...
21
    getGroups()
23
    setIntlLabels(labels)
22
  }, [])
24
  }, [])
23
 
25
 
Línea 41... Línea 43...
41
 
43
 
Línea 42... Línea 44...
42
  const handleSearch = debounce((value) => getGroups(value), 500)
44
  const handleSearch = debounce((value) => getGroups(value), 500)
43
 
45
 
-
 
46
  return (
-
 
47
    <section className="companies-info container">
-
 
48
      <TitleSection
44
  return (
49
        title={labels.MY_GROUPS}
-
 
50
        allowAdd
45
    <section className="companies-info container">
51
        onAdd={handleShowAddGroupModal}
46
      <TitleSection title={LABELS.MY_GROUPS} allowAdd onAdd={handleShowAddGroupModal} />
52
      />
47
      <SearchList onChange={handleSearch} />
53
      <SearchList onChange={handleSearch} />
-
 
54
      <div className="companies-list">
48
      <div className="companies-list">
55
        {loading && <Spinner />}
-
 
56
        {!loading && Boolean(!groups.length) && (
-
 
57
          <EmptySection align="left" message={labels.DATATABLE_SZERORECORDS} />
49
        {loading && <Spinner />}
58
        )}
50
        {(!loading && Boolean(!groups.length)) && <EmptySection align='left' message={LABELS.DATATABLE_SZERORECORDS} />}
59
        {!loading &&
-
 
60
          Boolean(groups.length) &&
51
        {(!loading && Boolean(groups.length)) &&
61
          groups.map(
-
 
62
            (
-
 
63
              { image, link_delete, link_edit, link_view, name, privacy },
52
          groups.map(
64
              id
53
            ({ image, link_delete, link_edit, link_view, name, privacy }, id) =>
65
            ) => (
54
              <Profile
66
              <Profile
55
                image={image}
67
                image={image}
56
                name={name}
68
                name={name}
57
                status={privacy}
69
                status={privacy}
58
                link_view={link_view}
70
                link_view={link_view}
59
                link_edit={link_edit}
71
                link_edit={link_edit}
60
                link_delete={link_delete}
72
                link_delete={link_delete}
61
                key={id}
73
                key={id}
62
                fetchCallback={getGroups}
74
                fetchCallback={getGroups}
-
 
75
                btnAcceptTitle={labels.GROUP_VIEW}
-
 
76
                btnEditTitle={`${labels.EDIT} ${labels.GROUP.toLowerCase()}`}
63
                btnAcceptTitle={LABELS.GROUP_VIEW}
77
                btnCancelTitle={`${
64
                btnEditTitle={`${LABELS.EDIT} ${LABELS.GROUP.toLowerCase()}`}
78
                  labels.DELETE
-
 
79
                } ${labels.GROUP.toLowerCase()}`}
65
                btnCancelTitle={`${LABELS.DELETE} ${LABELS.GROUP.toLowerCase()}`}
80
              />
66
              />
81
            )
67
          )}
82
          )}
68
      </div>
83
      </div>
69
      <AddGroupModal
84
      <AddGroupModal
Línea 76... Línea 91...
76
    </section>
91
    </section>
77
  )
92
  )
78
}
93
}
Línea 79... Línea 94...
79
 
94
 
80
const mapDispatchToProps = {
95
const mapDispatchToProps = {
81
  addNotification: (notification) => addNotification(notification)
96
  addNotification: (notification) => addNotification(notification),
Línea 82... Línea 97...
82
}
97
}