Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 11483 Rev 11484
Línea 100... Línea 100...
100
					</div>
100
					</div>
101
				</div>
101
				</div>
102
				<div className="col-sm-12 mt-3">
102
				<div className="col-sm-12 mt-3">
103
					<a href="/planning-objectives-and-goals/objectives" className="btn btn-primary">
103
					<a href="/planning-objectives-and-goals/objectives" className="btn btn-primary">
104
						<i className="fa fa-arrow-left mr-1" />
104
						<i className="fa fa-arrow-left mr-1" />
105
                        Ir atras
105
						Ir atras
106
					</a>
106
					</a>
107
				</div>
107
				</div>
108
			</div>
108
			</div>
109
			<section className="content">
109
			<section className="content">
110
				<div className="container-fluid">
110
				<div className="container-fluid">
Línea 113... Línea 113...
113
							<Card>
113
							<Card>
114
								<Card.Header>
114
								<Card.Header>
115
									<div className="row justify-content-end" style={{ gap: '10px' }}>
115
									<div className="row justify-content-end" style={{ gap: '10px' }}>
116
										{
116
										{
117
											permisions.allowAdd
117
											permisions.allowAdd
118
                                            &&
118
											&&
119
                                            <label
119
											<label
120
                                            	className='d-flex align-items-center'
120
												className='d-flex align-items-center'
121
                                            	onClick={() => {
121
												onClick={() => {
122
                                            		setActionLink(add_link)
122
													setActionLink(add_link)
123
                                            		setModalToShow('add')
123
													setModalToShow('add')
124
                                            	}}
124
												}}
125
                                            	style={{ cursor: 'pointer' }}
125
												style={{ cursor: 'pointer' }}
126
                                            >
126
											>
127
                                            	<i className="fa fa-plus mr-2" />
127
												<i className="fa fa-plus mr-2" />
128
                                                Agregar
128
												Agregar
129
                                            </label>
129
											</label>
130
										}
130
										}
131
										<label
131
										<label
132
											className='d-flex align-items-center'
132
											className='d-flex align-items-center'
133
											onClick={() => getData({
133
											onClick={() => getData({
134
												url: table_link,
134
												url: table_link,
Línea 139... Línea 139...
139
												}
139
												}
140
											})}
140
											})}
141
											style={{ cursor: 'pointer' }}
141
											style={{ cursor: 'pointer' }}
142
										>
142
										>
143
											<i className='fa fa-refresh mr-2' />
143
											<i className='fa fa-refresh mr-2' />
144
                                            Actualizar
144
											Actualizar
145
										</label>
145
										</label>
146
									</div>
146
									</div>
147
									<div className="row justify-content-between align-items-center">
147
									<div className="row justify-content-between align-items-center">
148
										<LengthFilter onChange={(e) => setDataLength(e.target.value)} />
148
										<LengthFilter onChange={(e) => setDataLength(e.target.value)} />
149
										<SearchInput onChange={(e) => setSearch(e.target.value)} />
149
										<SearchInput onChange={(e) => setSearch(e.target.value)} />
Línea 152... Línea 152...
152
								<Card.Body>
152
								<Card.Body>
153
									<div className="table-responsive">
153
									<div className="table-responsive">
154
										<Table data={items} headers={headers} setData={setItems}>
154
										<Table data={items} headers={headers} setData={setItems}>
155
											{
155
											{
156
												items.length
156
												items.length
157
                                                &&
157
												&&
158
                                                items.map((item, index) => (
158
												items.map((item, index) => (
159
                                                	<tr key={index}>
159
													<tr key={index}>
160
                                                		<td className='text-vertical-middle'>{item.title}</td>
160
														<td className='text-vertical-middle'>{item.title}</td>
161
                                                		<td className='text-vertical-middle'>{item.description}</td>
161
														<td className='text-vertical-middle'>{item.description}</td>
162
                                                		<td className='d-flex align-items-center'>
162
														<td className='d-flex align-items-center'>
163
                                                			{
163
															{
164
                                                				item.progress > 0
164
																item.progress > 0
165
                                                					?
165
																	?
166
                                                					<>
166
																	<>
167
                                                						<progress value={item.progress} max='100' />
167
																		<progress value={item.progress} max='100' />
168
                                                						<span className='ml-2'>{item.progress}</span>
168
																		<span className='ml-2'>{item.progress}</span>
169
                                                					</>
169
																	</>
170
                                                					:
170
																	:
171
                                                					'Sin metas'
171
																	'Sin metas'
172
                                                			}
172
															}
173
                                                		</td>
173
														</td>
174
                                                		<td className='text-vertical-middle'>{item.cost}</td>
174
														<td className='text-vertical-middle'>{item.cost}</td>
175
                                                		<td className='text-vertical-middle'>
175
														<td className='text-vertical-middle'>
176
                                                			{
176
															{
177
                                                				item.status === 'a'
177
																item.status === 'a'
178
                                                					? 'Activo'
178
																	? 'Activo'
179
                                                					: 'Inactivo'
179
																	: 'Inactivo'
180
                                                			}
180
															}
181
                                                		</td>
181
														</td>
182
                                                		<td>
182
														<td>
183
                                                			<div className="d-flex align-items-center" style={{ gap: '5px' }}>
183
															<div className="d-flex align-items-center" style={{ gap: '5px' }}>
184
                                                				{
184
																{
185
                                                					permisions.allowGoals
185
																	permisions.allowGoals
186
                                                                    &&
186
																	&&
187
                                                                    <a href={item.actions.link_goals} style={{ color: '#333' }}>
187
																	<a href={item.actions.link_goals} style={{ color: '#333' }}>
188
                                                                    	<i className='fa fa-level-down' />
188
																		<i className='fa fa-level-down' />
189
                                                                    </a>
189
																	</a>
190
                                                				}
190
																}
191
                                                				{
191
																{
192
                                                					permisions.allowEdit
192
																	permisions.allowEdit
193
                                                                    &&
193
																	&&
194
                                                                    <i
194
																	<i
195
                                                                    	className='fa fa-pencil'
195
																		className='fa fa-pencil'
196
                                                                    	onClick={() => {
196
																		onClick={() => {
197
                                                                    		setActionLink(item.actions.link_edit)
197
																			setActionLink(item.actions.link_edit)
198
                                                                    		setModalToShow('edit')
198
																			setModalToShow('edit')
199
                                                                    	}}
199
																		}}
200
                                                                    	style={{ cursor: 'pointer' }}
200
																		style={{ cursor: 'pointer' }}
201
                                                                    />
201
																	/>
202
                                                				}
202
																}
203
                                                				{
203
																{
204
                                                					permisions.allowDelete
204
																	permisions.allowDelete
205
                                                                    &&
205
																	&&
206
                                                                    <i
206
																	<i
207
                                                                    	className='fa fa-trash'
207
																		className='fa fa-trash'
208
                                                                    	onClick={() => {
208
																		onClick={() => {
209
                                                                    		setActionLink(item.actions.link_delete)
209
																			setActionLink(item.actions.link_delete)
210
                                                                    		setModalToShow('delete')
210
																			setModalToShow('delete')
211
                                                                    	}}
211
																		}}
212
                                                                    	style={{ cursor: 'pointer' }}
212
																		style={{ cursor: 'pointer' }}
213
                                                                    />
213
																	/>
214
                                                				}
214
																}
215
                                                			</div>
215
															</div>
216
                                                		</td>
216
														</td>
217
                                                	</tr>
217
													</tr>
218
                                                ))
218
												))
219
											}
219
											}
220
										</Table>
220
										</Table>
221
									</div>
221
									</div>
222
									<div className='row justify-content-between align-items-center'>
222
									<div className='row justify-content-between align-items-center'>
223
										<p className='mb-0'>
223
										<p className='mb-0'>
Línea 238... Línea 238...
238
			</section >
238
			</section >
239
			<EditAndAddModal
239
			<EditAndAddModal
240
				action_link={actionLink}
240
				action_link={actionLink}
241
				type={modalToShow}
241
				type={modalToShow}
242
				closeModal={() => setModalToShow('')}
242
				closeModal={() => setModalToShow('')}
-
 
243
				onComplete={getData({
-
 
244
					url: table_link,
-
 
245
					params: {
-
 
246
						search: search,
-
 
247
						length: dataLength,
-
 
248
						page: pages.current
-
 
249
					}
-
 
250
				})}
243
			/>
251
			/>
244
			<DeleteModal
252
			<DeleteModal
245
				url={actionLink}
253
				url={actionLink}
246
				isOpen={modalToShow === 'delete'}
254
				isOpen={modalToShow === 'delete'}
247
				closeModal={() => setModalToShow('')}
255
				closeModal={() => setModalToShow('')}