Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7044 Rev 7045
Línea 60... Línea 60...
60
  const [category, setCategory] = useState('')
60
  const [category, setCategory] = useState('')
61
  const [currentPage, setCurrentPage] = useState(1)
61
  const [currentPage, setCurrentPage] = useState(1)
62
  const [totalPages, setTotalPages] = useState(1)
62
  const [totalPages, setTotalPages] = useState(1)
63
  const [allowAdd, setAllowAdd] = useState(false)
63
  const [allowAdd, setAllowAdd] = useState(false)
64
  const [modalShow, setModalShow] = useState(null)
64
  const [modalShow, setModalShow] = useState(null)
-
 
65
  const addUrl = useRef('')
65
  const actionUrl = useRef('')
66
  const actionUrl = useRef('')
66
  const labels = useSelector(({ intl }) => intl.labels)
67
  const labels = useSelector(({ intl }) => intl.labels)
67
  const dispatch = useDispatch()
68
  const dispatch = useDispatch()
Línea 68... Línea 69...
68
 
69
 
Línea 90... Línea 91...
90
        setKnowledges(data.items)
91
        setKnowledges(data.items)
91
        setKnowledgesCategories(data.categories)
92
        setKnowledgesCategories(data.categories)
92
        setCurrentPage(data.page)
93
        setCurrentPage(data.page)
93
        setTotalPages(data.total_pages)
94
        setTotalPages(data.total_pages)
94
        setAllowAdd(Boolean(data.link_add))
95
        setAllowAdd(Boolean(data.link_add))
-
 
96
        addUrl.current = data.link_add
95
      })
97
      })
96
      .catch((error) => {
98
      .catch((error) => {
97
        dispatch(
99
        dispatch(
98
          addNotification({
100
          addNotification({
99
            style: 'danger',
101
            style: 'danger',
Línea 133... Línea 135...
133
        )
135
        )
134
        throw new Error(error)
136
        throw new Error(error)
135
      })
137
      })
136
  }
138
  }
Línea -... Línea 139...
-
 
139
 
-
 
140
  const addKnowledge = (url) => {
-
 
141
    actionUrl.current = url
-
 
142
    setModalShow('add')
-
 
143
  }
137
 
144
 
138
  const editKnowledge = (url) => {
145
  const editKnowledge = (url) => {
139
    actionUrl.current = url
146
    actionUrl.current = url
140
    setModalShow('edit')
147
    setModalShow('edit')
Línea 160... Línea 167...
160
    <>
167
    <>
161
      <Container as="section" className="companies-info px-0">
168
      <Container as="section" className="companies-info px-0">
162
        <div className="company-title">
169
        <div className="company-title">
163
          <h1 className="title mx-auto">{labels.knowledge_area_title}</h1>
170
          <h1 className="title mx-auto">{labels.knowledge_area_title}</h1>
164
          {allowAdd && (
171
          {allowAdd && (
-
 
172
            <h2
165
            <h2 className="title cursor-pointer">
173
              className="title cursor-pointer"
-
 
174
              onClick={() => addKnowledge(addUrl.current)}
-
 
175
            >
166
              {labels.knowledge_area_add}
176
              {labels.knowledge_area_add}
167
            </h2>
177
            </h2>
168
          )}
178
          )}
169
        </div>
179
        </div>
Línea 237... Línea 247...
237
        show={modalShow === 'edit'}
247
        show={modalShow === 'edit'}
238
        url={actionUrl.current}
248
        url={actionUrl.current}
239
        categories={knowledgesCategories}
249
        categories={knowledgesCategories}
240
        onComplete={getKnowledgesInfo}
250
        onComplete={getKnowledgesInfo}
241
        onClose={closeModal}
251
        onClose={closeModal}
-
 
252
        isEdit
-
 
253
      />
-
 
254
      <KnowledgeEditModal
-
 
255
        show={modalShow === 'add'}
-
 
256
        url={actionUrl.current}
-
 
257
        categories={knowledgesCategories}
-
 
258
        onComplete={getKnowledgesInfo}
-
 
259
        onClose={closeModal}
242
      />
260
      />
243
      <ConfirmModal
261
      <ConfirmModal
244
        show={modalShow === 'delete'}
262
        show={modalShow === 'delete'}
245
        onClose={closeModal}
263
        onClose={closeModal}
246
        onAccept={confirmDelete}
264
        onAccept={confirmDelete}