Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5473 Rev 5865
Línea 13... Línea 13...
13
import LocationModal from '../../../location/LocationModal'
13
import LocationModal from '../../../location/LocationModal'
14
import SkillsModal from '../../../skills/SkillsModal'
14
import SkillsModal from '../../../skills/SkillsModal'
Línea 15... Línea 15...
15
 
15
 
16
const EditView = (userInfo) => {
16
const EditView = (userInfo) => {
17
  const {
17
  const {
18
    userExperiences,
18
    experience: userExperiences,
19
    userEducations,
19
    educations: userEducations,
20
    userLanguages,
20
    languages: userLanguages,
21
    userSkills,
21
    skills: userSkills,
22
    userAptitudes,
22
    aptitudes: userAptitudes,
23
    userHobbiesAndInterests,
-
 
24
    companySizesOptions,
-
 
25
    industriesOptions,
23
    hobbiesAndInterests: userHobbiesAndInterests,
26
    months,
-
 
27
    degreesOptions,
24
    months,
28
    skillsOptions,
-
 
29
    languagesOptions,
-
 
30
    aptitudesOptions,
-
 
31
    hobbiesAndInterestsOptions,
25
    options,
32
    formatted_address
26
    formatted_address,
Línea 33... Línea 27...
33
  } = userInfo
27
  } = userInfo
34
 
28
 
35
  const [experiences, setExperiences] = useState(userExperiences)
29
  const [experiences, setExperiences] = useState(userExperiences)
36
  const [educations, setEducations] = useState(userEducations)
30
  const [educations, setEducations] = useState(userEducations)
37
  const [languages, setLanguages] = useState(userLanguages)
31
  const [languages, setLanguages] = useState(userLanguages)
38
  const [skills, setSkills] = useState(userSkills)
32
  const [skills, setSkills] = useState(userSkills)
-
 
33
  const [aptitudes, setAptitudes] = useState(userAptitudes)
-
 
34
  const [hobbiesAndInterests, setHobbiesAndInterests] = useState(
39
  const [aptitudes, setAptitudes] = useState(userAptitudes)
35
    userHobbiesAndInterests
Línea 40... Línea 36...
40
  const [hobbiesAndInterests, setHobbiesAndInterests] = useState(userHobbiesAndInterests)
36
  )
41
  const [address, setAddress] = useState(formatted_address)
37
  const [address, setAddress] = useState(formatted_address)
42
 
38
 
Línea 62... Línea 58...
62
    setIsEdit(false)
58
    setIsEdit(false)
63
    setModalShow(null)
59
    setModalShow(null)
64
  }
60
  }
Línea 65... Línea 61...
65
 
61
 
-
 
62
  const renderModal = {
66
  const renderModal = {
63
    Experiencia: (
67
    Experiencia: <ExperienceModal
64
      <ExperienceModal
68
            companySizesOptions={companySizesOptions}
65
        companySizesOptions={options.companySizes}
69
            industriesOptions={industriesOptions}
66
        industriesOptions={options.industries}
70
            months={months}
67
        months={months}
71
            setUserExperiences={(newExperiences) => setExperiences(newExperiences)}
68
        setUserExperiences={(newExperiences) => setExperiences(newExperiences)}
72
            show={modalShow === 'Experiencia'}
69
        show={modalShow === 'Experiencia'}
73
            postUrl={postUrl}
70
        postUrl={postUrl}
74
            closeModal={closeModal}
71
        closeModal={closeModal}
75
            settedDescription={settedDescription}
72
        settedDescription={settedDescription}
-
 
73
      />
-
 
74
    ),
76
        />,
75
    Educación: (
77
    Educación: <EducationModal
76
      <EducationModal
78
            closeModal={closeModal}
77
        closeModal={closeModal}
79
            postUrl={postUrl}
78
        postUrl={postUrl}
80
            setEducations={(newEducations) => setEducations(newEducations)}
79
        setEducations={(newEducations) => setEducations(newEducations)}
81
            show={modalShow === 'Educación'}
80
        show={modalShow === 'Educación'}
82
            settedDescription={settedDescription}
81
        settedDescription={settedDescription}
83
            degreesOptions={degreesOptions}
82
        degreesOptions={options.degrees}
-
 
83
      />
-
 
84
    ),
84
        />,
85
    Habilidades: (
85
    Habilidades: <SkillsModal
86
      <SkillsModal
86
            closeModal={closeModal}
87
        closeModal={closeModal}
87
            setSkills={(newSkills) => setSkills(newSkills)}
88
        setSkills={(newSkills) => setSkills(newSkills)}
88
            show={modalShow === 'Habilidades'}
89
        show={modalShow === 'Habilidades'}
89
            skillsOptions={skillsOptions}
90
        skillsOptions={options.skills}
90
            userIdEncrypted={userInfo.userProfileIdEncrypted}
91
        userIdEncrypted={userInfo.userProfileIdEncrypted}
91
            userSkillsArray={skills}
92
        userSkillsArray={skills}
-
 
93
      />
-
 
94
    ),
92
        />,
95
    Idiomas: (
93
    Idiomas: <LanguagesModal
96
      <LanguagesModal
94
            show={modalShow === 'Idiomas'}
97
        show={modalShow === 'Idiomas'}
95
            closeModal={closeModal}
98
        closeModal={closeModal}
96
            userIdEncrypted={userInfo.userProfileIdEncrypted}
99
        userIdEncrypted={userInfo.userProfileIdEncrypted}
97
            languagesOptions={languagesOptions}
100
        languagesOptions={options.languages}
98
            userLanguages={languages}
101
        userLanguages={languages}
99
            setLanguages={(newLanguages) => setLanguages(newLanguages)}
102
        setLanguages={(newLanguages) => setLanguages(newLanguages)}
-
 
103
      />
-
 
104
    ),
100
        />,
105
    Aptitudes: (
101
    Aptitudes: <AptitudesModal
106
      <AptitudesModal
102
            show={modalShow === 'Aptitudes'}
107
        show={modalShow === 'Aptitudes'}
103
            closeModal={closeModal}
108
        closeModal={closeModal}
104
            userIdEncrypted={userInfo.userProfileIdEncrypted}
109
        userIdEncrypted={userInfo.userProfileIdEncrypted}
105
            aptitudesOptions={aptitudesOptions}
110
        aptitudesOptions={options.aptitudes}
106
            userAptitudes={aptitudes}
111
        userAptitudes={aptitudes}
107
            setAptitudes={(newAptitudes) => setAptitudes(newAptitudes)}
112
        setAptitudes={(newAptitudes) => setAptitudes(newAptitudes)}
-
 
113
      />
108
        />,
114
    ),
-
 
115
    'Hobbies e Intereses': (
109
    'Hobbies e Intereses': <HobbiesModal
116
      <HobbiesModal
110
            show={modalShow === 'Hobbies e Intereses'}
117
        show={modalShow === 'Hobbies e Intereses'}
111
            closeModal={closeModal}
118
        closeModal={closeModal}
112
            userIdEncrypted={userInfo.userProfileIdEncrypted}
119
        userIdEncrypted={userInfo.userProfileIdEncrypted}
113
            hobbiesAndInterestsOptions={hobbiesAndInterestsOptions}
120
        hobbiesAndInterestsOptions={options.hobbiesAndInterests}
114
            userHobbiesAndInterests={hobbiesAndInterests}
121
        userHobbiesAndInterests={hobbiesAndInterests}
-
 
122
        setUserHobbiesAndInterests={(newHobbiesAndInterests) =>
115
            setUserHobbiesAndInterests={(newHobbiesAndInterests) => setHobbiesAndInterests(newHobbiesAndInterests)}
123
          setHobbiesAndInterests(newHobbiesAndInterests)
-
 
124
        }
-
 
125
      />
-
 
126
    ),
116
        />,
127
    Ubicación: (
117
    Ubicación: <LocationModal
128
      <LocationModal
118
            isModalOpen={modalShow === 'Ubicación'}
129
        isModalOpen={modalShow === 'Ubicación'}
119
            closeModal={() => setModalShow(null)}
130
        closeModal={() => setModalShow(null)}
120
            setSettedAddress={(newAddress) => setAddress(newAddress)}
131
        setSettedAddress={(newAddress) => setAddress(newAddress)}
121
            userIdEncrypted={userInfo.userProfileIdEncrypted}
132
        userIdEncrypted={userInfo.userProfileIdEncrypted}
-
 
133
      />
122
        />
134
    ),
Línea 123... Línea 135...
123
  }
135
  }
124
 
136
 
125
  return (
137
  return (
126
        <main className='w-100'>
138
    <main className="w-100">
127
            <div className='container'>
139
      <div className="container">
128
                <div className="main d-flex flex-column" style={{ gap: '.5rem' }}>
140
        <div className="main d-flex flex-column" style={{ gap: '.5rem' }}>
129
                    <ProfileCard {...{ ...userInfo, formatted_address: address }} />
141
          <ProfileCard {...{ ...userInfo, formatted_address: address }} />
130
                    <ProfileWidget
142
          <ProfileWidget
131
                        title='Experiencia'
143
            title="Experiencia"
132
                        onEdit={() => setIsEdit(!isEdit)}
144
            onEdit={() => setIsEdit(!isEdit)}
133
                        onAdd={handleAdd}
145
            onAdd={handleAdd}
134
                        addUrl={`/profile/my-profiles/experience/${userInfo.userProfileIdEncrypted}/operation/add`}
146
            addUrl={`/profile/my-profiles/experience/${userInfo.userProfileIdEncrypted}/operation/add`}
-
 
147
          >
135
                    >
148
            {experiences.map((experience, index) => {
136
                        {experiences.map((experience, index) => {
149
              return (
137
                          return <ExperienceCard
150
                <ExperienceCard
138
                                key={index}
151
                  key={index}
139
                                experience={experience}
152
                  experience={experience}
140
                                months={userInfo.months}
153
                  months={userInfo.months}
141
                                isEdit={isEdit}
154
                  isEdit={isEdit}
-
 
155
                  onEdit={handleEdit}
142
                                onEdit={handleEdit}
156
                  setExperiences={(newExperiences) =>
143
                                setExperiences={(newExperiences) => setExperiences(newExperiences)}
157
                    setExperiences(newExperiences)
-
 
158
                  }
-
 
159
                />
144
                            />
160
              )
145
                        })}
161
            })}
146
                    </ProfileWidget>
162
          </ProfileWidget>
147
                    <ProfileWidget
163
          <ProfileWidget
148
                        title='Educación'
164
            title="Educación"
149
                        onEdit={() => setIsEdit(!isEdit)}
165
            onEdit={() => setIsEdit(!isEdit)}
150
                        onAdd={handleAdd}
166
            onAdd={handleAdd}
151
                        addUrl={`/profile/my-profiles/education/${userInfo.userProfileIdEncrypted}/operation/add`}
167
            addUrl={`/profile/my-profiles/education/${userInfo.userProfileIdEncrypted}/operation/add`}
152
                    >
168
          >
153
                        {educations.map((education, index) => {
-
 
154
                          return <EducationCard
-
 
155
                                key={index}
-
 
156
                                education={education}
-
 
157
                                isEdit={isEdit}
-
 
158
                                onEdit={handleEdit}
169
            {educations.map((education, index) => {
159
                                setEducations={(newEducations) => setEducations(newEducations)}
170
              return (
160
                            />
171
                <EducationCard
161
                        })}
-
 
162
                    </ProfileWidget>
-
 
163
                    <ProfileWidget title='Ubicación' onEdit={() => setModalShow('Ubicación')} justEdit>
-
 
164
                        <div className='card__items'>
172
                  key={index}
165
                            <p>{address}</p>
173
                  education={education}
166
                        </div>
-
 
167
                    </ProfileWidget>
174
                  isEdit={isEdit}
168
                    <ProfileWidget title='Idiomas' onEdit={() => setModalShow('Idiomas')} justEdit>
-
 
169
                        {!languages.length
175
                  onEdit={handleEdit}
170
                          ? <EmptySection align='left' message="Sin información" />
176
                  setEducations={(newEducations) =>
171
                          : <ItemsList value={languages} />
177
                    setEducations(newEducations)
172
                        }
-
 
173
                    </ProfileWidget>
178
                  }
174
                    <ProfileWidget title='Habilidades' onEdit={() => setModalShow('Habilidades')} justEdit>
-
 
175
                        {!skills.length
-
 
176
                          ? <EmptySection align='left' message="Sin información" />
179
                />
177
                          : <ItemsList value={skills} />
180
              )
178
                        }
-
 
179
                    </ProfileWidget>
-
 
180
                    <ProfileWidget title='Aptitudes' onEdit={() => setModalShow('Aptitudes')} justEdit>
-
 
181
                        {!aptitudes.length
-
 
182
                          ? <EmptySection align='left' message="Sin información" />
181
            })}
183
                          : <ItemsList value={aptitudes} />
182
          </ProfileWidget>
184
                        }
-
 
185
                    </ProfileWidget>
183
          <ProfileWidget
186
                    <ProfileWidget title='Pasatiempos e intereses' onEdit={() => setModalShow('Hobbies e Intereses')} justEdit>
-
 
187
                        {!hobbiesAndInterests.length
-
 
188
                          ? <EmptySection align='left' message="Sin información" />
184
            title="Ubicación"
189
                          : <ItemsList value={hobbiesAndInterests} />
185
            onEdit={() => setModalShow('Ubicación')}
190
                        }
186
            justEdit
191
                    </ProfileWidget>
187
          >
192
                    {renderModal[modalShow]}
188
            <div className="card__items">
-
 
189
              <p>{address}</p>
-
 
190
            </div>
-
 
191
          </ProfileWidget>
-
 
192
          <ProfileWidget
-
 
193
            title="Idiomas"
-
 
194
            onEdit={() => setModalShow('Idiomas')}
-
 
195
            justEdit
-
 
196
          >
-
 
197
            {!languages.length ? (
-
 
198
              <EmptySection align="left" message="Sin información" />
-
 
199
            ) : (
-
 
200
              <ItemsList value={languages} />
-
 
201
            )}
-
 
202
          </ProfileWidget>
-
 
203
          <ProfileWidget
-
 
204
            title="Habilidades"
-
 
205
            onEdit={() => setModalShow('Habilidades')}
-
 
206
            justEdit
-
 
207
          >
-
 
208
            {!skills.length ? (
-
 
209
              <EmptySection align="left" message="Sin información" />
-
 
210
            ) : (
-
 
211
              <ItemsList value={skills} />
-
 
212
            )}
-
 
213
          </ProfileWidget>
-
 
214
          <ProfileWidget
-
 
215
            title="Aptitudes"
-
 
216
            onEdit={() => setModalShow('Aptitudes')}
-
 
217
            justEdit
-
 
218
          >
-
 
219
            {!aptitudes.length ? (
-
 
220
              <EmptySection align="left" message="Sin información" />
-
 
221
            ) : (
-
 
222
              <ItemsList value={aptitudes} />
-
 
223
            )}
-
 
224
          </ProfileWidget>
-
 
225
          <ProfileWidget
-
 
226
            title="Pasatiempos e intereses"
-
 
227
            onEdit={() => setModalShow('Hobbies e Intereses')}
-
 
228
            justEdit
-
 
229
          >
-
 
230
            {!hobbiesAndInterests.length ? (
-
 
231
              <EmptySection align="left" message="Sin información" />
-
 
232
            ) : (
-
 
233
              <ItemsList value={hobbiesAndInterests} />
-
 
234
            )}
193
                </div>
235
          </ProfileWidget>
-
 
236
          {renderModal[modalShow]}
-
 
237
        </div>
194
            </div>
238
      </div>
195
        </main >
239
    </main>
Línea 196... Línea 240...
196
  )
240
  )