From 794f4879e481343a0d568467a406f14ee01daa1f Mon Sep 17 00:00:00 2001 From: Aviliani Pramestya <avipramestya14@gmail.com> Date: Thu, 14 Nov 2019 13:04:31 +0700 Subject: [PATCH 1/5] migrate data --- core/migrations/0001_initial.py | 4 ++-- package-lock.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py index 02686c37..b473b4b6 100644 --- a/core/migrations/0001_initial.py +++ b/core/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.11.17 on 2019-11-14 02:40 +# Generated by Django 1.11.17 on 2019-11-14 06:00 from __future__ import unicode_literals import core.lib.validators @@ -104,7 +104,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('nip', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999)])), + ('nip', models.IntegerField(unique=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(9999999999L)])), ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ diff --git a/package-lock.json b/package-lock.json index a851f711..76f4d0d9 100755 --- a/package-lock.json +++ b/package-lock.json @@ -4204,7 +4204,7 @@ "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "integrity": "sha1-OYrT88WiSUi+dyXoPRGn3ijNvR0=", "dev": true }, "fast-levenshtein": { @@ -11727,7 +11727,7 @@ "starwars": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/starwars/-/starwars-1.0.1.tgz", - "integrity": "sha1-+OIWt4KUs/y/ytJbRPJxF543U9U=" + "integrity": "sha512-d23qkhEuFNlHas4/w2J6ZF6qS7jqy8OK4N3gfQbtTk/5Lt1wKe+xv0cIweuNxwtwBGVXvmsLV2mdUOBKfj12cA==" }, "static-extend": { "version": "0.1.2", @@ -14609,4 +14609,4 @@ "dev": true } } -} \ No newline at end of file +} -- GitLab From 100082b98942e5be9775c2658b8389853e529023 Mon Sep 17 00:00:00 2001 From: Aviliani Pramestya <avipramestya14@gmail.com> Date: Thu, 5 Dec 2019 16:13:54 +0700 Subject: [PATCH 2/5] add experience section in profilepage --- assets/js/ProfilePage.jsx | 216 ++++++++++++++++++++------------------ 1 file changed, 115 insertions(+), 101 deletions(-) diff --git a/assets/js/ProfilePage.jsx b/assets/js/ProfilePage.jsx index db2278db..19a980b9 100755 --- a/assets/js/ProfilePage.jsx +++ b/assets/js/ProfilePage.jsx @@ -1086,35 +1086,6 @@ export default class ProfilePage extends React.Component { </Grid.Column> </Grid> </Segment> - <Segment basic vertical> - <Grid> - <Grid.Column width={2}> - <Icon name="suitcase" size="big" /> - </Grid.Column> - <Grid.Column width={13}> - <p> - Latest working experience as: - {' '} - <span> - <b> - {' '} - {this.state.latest_work || 'N/A'} - {' '} - </b> - </span> - </p> - <p> - Description: - {' '} - <span> - {' '} - {this.state.latest_work_desc || 'N/A'} - {' '} - </span> - </p> - </Grid.Column> - </Grid> - </Segment> <Segment basic vertical> <Grid> @@ -1131,62 +1102,6 @@ export default class ProfilePage extends React.Component { </Grid> </Segment> - <Segment basic vertical> - <Grid> - <Grid.Column width={2}> - <Icon name="hand peace outline" size="big" /> - </Grid.Column> - <Grid.Column width={13}> - <p> - {' '} - {this.state.volunteer || 'N/A'} - {' '} - </p> - </Grid.Column> - </Grid> - </Segment> - - <Segment basic vertical> - <Grid> - <Grid.Column width={2}> - <Icon name="trophy" size="big" /> - </Grid.Column> - <Grid.Column width={13}> - <p> - {' '} - {this.state.awards || 'Awards belum ditambahkan'} - {' '} - </p> - </Grid.Column> - </Grid> - </Segment> - - <Segment basic vertical> - <Grid> - <Grid.Column width={2}> - <Icon name="trophy" size="big" /> - </Grid.Column> - <Grid.Column width={13}> - {sertifikat_state} - </Grid.Column> - </Grid> - </Segment> - - <Segment basic vertical> - <Grid> - <Grid.Column width={2}> - <Icon name="folder open" size="big" /> - </Grid.Column> - <Grid.Column width={13}> - <p> - {' '} - {this.state.projects - || 'Projects belum ditambahkan'} - {' '} - </p> - </Grid.Column> - </Grid> - </Segment> <Segment basic vertical> <Grid> @@ -1218,22 +1133,6 @@ export default class ProfilePage extends React.Component { </Grid> </Segment> - <Segment basic vertical> - <Grid> - <Grid.Column width={2}> - <Icon name="slideshare" size="big" /> - </Grid.Column> - <Grid.Column width={13}> - <p> - {' '} - {this.state.seminar - || 'Seminar dan Training kosong'} - {' '} - </p> - </Grid.Column> - </Grid> - </Segment> - <Segment basic vertical> <Grid> <Grid.Column width={2}> @@ -1377,6 +1276,121 @@ export default class ProfilePage extends React.Component { </Grid> </Segment> + + <Segment className="status-form"> + <Header as="h3" textAlign="left"> + <h3>Experience</h3> + </Header> + <div> + <h4> + {' '} + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="suitcase" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <p> + Latest working experience as: + {' '} + <span> + <b> + {' '} + {this.state.latest_work || 'N/A'} + {' '} + </b> + </span> + </p> + <p> + Description: + {' '} + <span> + {' '} + {this.state.latest_work_desc || 'N/A'} + {' '} + </span> + </p> + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="trophy" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <p> + {' '} + {this.state.awards || 'Awards belum ditambahkan'} + {' '} + </p> + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="trophy" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + {sertifikat_state} + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="folder open" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <p> + {' '} + {this.state.projects + || 'Projects belum ditambahkan'} + {' '} + </p> + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="hand peace outline" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <p> + {' '} + {this.state.volunteer || 'N/A'} + {' '} + </p> + </Grid.Column> + </Grid> + </Segment> + + <Segment basic vertical> + <Grid> + <Grid.Column width={2}> + <Icon name="slideshare" size="big" /> + </Grid.Column> + <Grid.Column width={13}> + <p> + {' '} + {this.state.seminar + || 'Seminar dan Training kosong'} + {' '} + </p> + </Grid.Column> + </Grid> + </Segment> + + </h4> + </div> + </Segment> + <Segment className="status-form"> <Header as="h3" textAlign="left"> <Icon name="search" /> -- GitLab From 8100a5e442286af8d22322b5629c7e3a9bd8ace9 Mon Sep 17 00:00:00 2001 From: Aviliani Pramestya <avipramestya14@gmail.com> Date: Thu, 5 Dec 2019 17:12:39 +0700 Subject: [PATCH 3/5] edit editprofile page --- assets/js/EditProfile.jsx | 257 ++++++++++++++++++++++---------------- 1 file changed, 151 insertions(+), 106 deletions(-) diff --git a/assets/js/EditProfile.jsx b/assets/js/EditProfile.jsx index dadbd4d2..9fc6f4c8 100644 --- a/assets/js/EditProfile.jsx +++ b/assets/js/EditProfile.jsx @@ -11,9 +11,10 @@ import { import Server from './lib/Server'; import Storage from './lib/Storage'; import ModalAlert from './components/ModalAlert'; -import ProfileHandler from './ProfileHandler'; +import Dumper from './lib/Dumper'; +import { isFromGithubLinkValid } from './Utils'; -export default class EditProfile extends ProfileHandler { +export default class EditProfile extends React.Component { static propTypes = { route: PropTypes.object.isRequired, params: PropTypes.object.isRequired, @@ -156,10 +157,75 @@ export default class EditProfile extends ProfileHandler { return dateIndexArray.reverse().join(' '); } + handleSubmit = (e) => { + e.preventDefault(); + if (!isFromGithubLinkValid(this.state.form.github_url)) { + this.modalAlert.open( + 'Pembaharuan profil gagal', + 'Pastikan link github yang anda tulis benar.(Berpola : https://github.com/<username>', + ); + } else { + const submitForm = {}; + Object.keys(this.state.form).forEach((key) => { + if (this.state.form[key] !== '') { + submitForm[key] = this.state.form[key]; + } + }); + this.setState({ loading: true }); + Server.submit( + `/students/${this.state.id}/profile/`, + submitForm, + 'PATCH', + ).then( + () => { + this.setState({ loading: false }); + this.modalAlert.open( + 'Profil berhasil diperbaharui', + 'Silakan periksa kembali profil anda', + this.getProfile, + ); + }, + (error) => error.then((r) => { + this.setState({ loading: false }); + this.modalAlert.open('Pembaharuan profil gagal', Dumper.dump(r)); + }), + ); + } + }; + + handleFile = (e) => { + const { form } = this.state; + form[e.target.name] = e.target.files[0]; + this.setState({ form }); + }; + + handleChange = (e) => { + const { form } = this.state; + form[e.target.name] = e.target.value; + this.setState({ form }); + }; + + handleCheckbox = (e, d) => { + const { form } = this.state; + form[d.name] = d.checked; + this.setState({ form, show_transcript: d.checked }); + }; + + handleRadioGender = (e, { value }) => { + const { form } = this.state; + form.gender = value; + this.setState({ form }); + }; + + handleRadio = (e, { value }) => { + const { form } = this.state; + form.job_seeking_status = value; + this.setState({ form }); + }; + updateForm(show) { if (show) { return ( - <div className="editProfile"> <Segment className="profile-form"> <Header as="h3" textAlign="center"> <Icon name="edit" /> @@ -176,6 +242,7 @@ export default class EditProfile extends ProfileHandler { }} key={this.state.refresh} size="small" + onSubmit={this.handleSubmit} > <Form.Field> <label htmlFor="photo">Profile Picture</label> @@ -241,7 +308,83 @@ export default class EditProfile extends ProfileHandler { name="self_description" /> </Form.Field> - + <Form.Field> + <label htmlFor="linkedin_url">URL Profile LinkedIn</label> + <input + onChange={this.handleChange} + placeholder={ + this.state.linkedin_url === null + ? 'https://www.linkedin.com/in/jojo/' + : this.state.linkedin_url + } + defaultValue={ + this.state.linkedin_url === null + ? null + : this.state.linkedin_url + } + name="linkedin_url" + /> + </Form.Field> + <Form.Field> + <label htmlFor="hackerrank_url">URL Profile Hackerrank</label> + <input + onChange={this.handleChange} + placeholder={ + this.state.hackerrank_url === null + ? 'https://www.hackerrank.com/james' + : this.state.hackerrank_url + } + defaultValue={ + this.state.hackerrank_url === null + ? null + : this.state.hackerrank_url + } + name="hackerrank_url" + /> + </Form.Field> + <Form.Field> + <label htmlFor="portfolio_link">Portfolio Link</label> + <input + onChange={this.handleChange} + placeholder={ + this.state.portfolio_link === null + ? 'https://www.example.com/myproject/' + : this.state.portfolio_link + } + defaultValue={ + this.state.portfolio_link === null + ? null + : this.state.portfolio_link + } + name="portfolio_link" + /> + </Form.Field> + <Form.Field> + <label htmlFor="website_url">Website URL</label> + <input + onChange={this.handleChange} + placeholder={ + this.state.website_url === null + ? 'https://www.example.com/' + : this.state.website_url + } + defaultValue={ + this.state.website_url === null + ? null + : this.state.website_url + } + name="website_url" + /> + </Form.Field> + <Form.Field> + <label htmlFor="github_url">URL Profile Github</label> + <input + onChange={this.handleChange} + placeholder={this.state.github_url === null ? 'https://github.com/bob' : this.state.github_url} + defaultValue={this.state.github_url === null ? null : this.state.github_url} + name="github_url" + /> + </Form.Field> <Form.Field> <label htmlFor="region">Region</label> <input @@ -534,116 +677,18 @@ export default class EditProfile extends ProfileHandler { name="dependants" /> </Form.Field> - </Form> - </Segment> - <Segment className="links-form"> - <Header as="h3" textAlign="center"> - <Icon name="edit" /> - <Header.Content>Edit Links</Header.Content> - </Header> - <Form - ref={(input) => { - this.form = input; - }} - key={this.state.refresh} - size="small" - onSubmit={this.handleSubmit} - > - - <Form.Field> - <label htmlFor="portfolio_link">Portfolio Link</label> - <input - onChange={this.handleChange} - placeholder={ - this.state.portfolio_link === null - ? 'https://www.example.com/myproject/' - : this.state.portfolio_link - } - defaultValue={ - this.state.portfolio_link === null - ? null - : this.state.portfolio_link - } - name="portfolio_link" - /> - </Form.Field> - - <Form.Field> - <label htmlFor="linkedin_url">URL Profile LinkedIn</label> - <input - onChange={this.handleChange} - placeholder={ - this.state.linkedin_url === null - ? 'https://www.linkedin.com/in/jojo/' - : this.state.linkedin_url - } - defaultValue={ - this.state.linkedin_url === null - ? null - : this.state.linkedin_url - } - name="linkedin_url" - /> - </Form.Field> - - <Form.Field> - <label htmlFor="hackerrank_url">URL Profile Hackerrank</label> - <input - onChange={this.handleChange} - placeholder={ - this.state.hackerrank_url === null - ? 'https://www.hackerrank.com/james' - : this.state.hackerrank_url - } - defaultValue={ - this.state.hackerrank_url === null - ? null - : this.state.hackerrank_url - } - name="hackerrank_url" - /> - </Form.Field> - - <Form.Field> - <label htmlFor="website_url">Website URL</label> - <input - onChange={this.handleChange} - placeholder={ - this.state.website_url === null - ? 'https://www.example.com/' - : this.state.website_url - } - defaultValue={ - this.state.website_url === null - ? null - : this.state.website_url - } - name="website_url" - /> - </Form.Field> - - <Form.Field> - <label htmlFor="github_url">URL Profile Github</label> - <input - onChange={this.handleChange} - placeholder={this.state.github_url === null ? 'https://github.com/bob' : this.state.github_url} - defaultValue={this.state.github_url === null ? null : this.state.github_url} - name="github_url" - /> - </Form.Field> - </Form> - </Segment> - <Button onClick={this.handleSubmit} - fluid + <Button type="submit" size="small" loading={this.state.loading} primary + floated="right" > Submit </Button> - </div> + </Form> + </Segment> ); } -- GitLab From 9c65facf1c33358be815f5a517d045e1e242cd70 Mon Sep 17 00:00:00 2001 From: Aviliani Pramestya <avipramestya14@gmail.com> Date: Thu, 5 Dec 2019 17:30:57 +0700 Subject: [PATCH 4/5] add experience section in editprofile page --- assets/js/EditProfile.jsx | 403 +++++++++++++++++++++----------------- 1 file changed, 225 insertions(+), 178 deletions(-) diff --git a/assets/js/EditProfile.jsx b/assets/js/EditProfile.jsx index 9fc6f4c8..5d4dfece 100644 --- a/assets/js/EditProfile.jsx +++ b/assets/js/EditProfile.jsx @@ -226,6 +226,7 @@ export default class EditProfile extends React.Component { updateForm(show) { if (show) { return ( + <div className="editProfile"> <Segment className="profile-form"> <Header as="h3" textAlign="center"> <Icon name="edit" /> @@ -242,7 +243,6 @@ export default class EditProfile extends React.Component { }} key={this.state.refresh} size="small" - onSubmit={this.handleSubmit} > <Form.Field> <label htmlFor="photo">Profile Picture</label> @@ -308,120 +308,210 @@ export default class EditProfile extends React.Component { name="self_description" /> </Form.Field> + <Form.Field> - <label htmlFor="linkedin_url">URL Profile LinkedIn</label> + <label htmlFor="region">Region</label> <input onChange={this.handleChange} placeholder={ - this.state.linkedin_url === null - ? 'https://www.linkedin.com/in/jojo/' - : this.state.linkedin_url + this.state.region === null ? 'Indonesia' : this.state.region } defaultValue={ - this.state.linkedin_url === null - ? null - : this.state.linkedin_url + this.state.region === null ? null : this.state.region } - name="linkedin_url" + name="region" /> </Form.Field> <Form.Field> - <label htmlFor="hackerrank_url">URL Profile Hackerrank</label> + <label htmlFor="alamat">Alamat</label> <input onChange={this.handleChange} placeholder={ - this.state.hackerrank_url === null - ? 'https://www.hackerrank.com/james' - : this.state.hackerrank_url + this.state.alamat === null + ? 'JL. Satya Raya No.41' + : this.state.alamat } defaultValue={ - this.state.hackerrank_url === null - ? null - : this.state.hackerrank_url + this.state.alamat === null ? null : this.state.alamat } - name="hackerrank_url" + name="alamat" /> </Form.Field> <Form.Field> - <label htmlFor="portfolio_link">Portfolio Link</label> + <label htmlFor="skills">Skills</label> + <input + onChange={this.handleChange} + placeholder="Isi sesuai dengan keahlian anda" + defaultValue={this.state.skills === null ? 'Competitive Programming' : this.state.skills} + name="skills" + /> + </Form.Field> + <Form.Field> + <label htmlFor="languages">Bahasa yang dikuasai</label> <input onChange={this.handleChange} placeholder={ - this.state.portfolio_link === null - ? 'https://www.example.com/myproject/' - : this.state.portfolio_link + this.state.languages === null + ? 'Indonesia' + : this.state.languages } defaultValue={ - this.state.portfolio_link === null - ? null - : this.state.portfolio_link + this.state.languages === null ? null : this.state.languages } - name="portfolio_link" + name="languages" /> </Form.Field> + + <Form.Field> - <label htmlFor="website_url">Website URL</label> + <label htmlFor="interests">Interests</label> + <input + onChange={this.handleChange} + placeholder={this.state.interests === null ? 'Machine Learning' : this.state.interests} + defaultValue={this.state.interests === null ? null : this.state.interests} + name="interests" + /> + </Form.Field> + + <Form.Field> + <label htmlFor="related_course">Related Coursework Taken</label> <input onChange={this.handleChange} placeholder={ - this.state.website_url === null - ? 'https://www.example.com/' - : this.state.website_url + this.state.related_course === null + ? 'Intraction System, Machine Learning' + : this.state.related_course } defaultValue={ - this.state.website_url === null - ? null - : this.state.website_url + this.state.related_course === null ? null : this.state.related_course } - name="website_url" + name="related_course" /> </Form.Field> + <Form.Field> - <label htmlFor="github_url">URL Profile Github</label> + <label htmlFor="resume">Resume</label> <input - onChange={this.handleChange} - placeholder={this.state.github_url === null ? 'https://github.com/bob' : this.state.github_url} - defaultValue={this.state.github_url === null ? null : this.state.github_url} - name="github_url" + onChange={this.handleFile} + placeholder="Resume" + name="resume" + type="File" /> </Form.Field> <Form.Field> - <label htmlFor="region">Region</label> + <label htmlFor="expected_salary">Expected Salary</label> + <input onChange={this.handleChange} placeholder="2000000" name="expected_salary" /> + </Form.Field> + <Form.Field> + <label htmlFor="intro">Intro</label> <input onChange={this.handleChange} placeholder={ - this.state.region === null ? 'Indonesia' : this.state.region + this.state.intro === null + ? 'Ceritakan dirimu secara singkat' + : this.state.intro } defaultValue={ - this.state.region === null ? null : this.state.region + this.state.intro === null ? null : this.state.intro } - name="region" + name="intro" /> </Form.Field> <Form.Field> - <label htmlFor="alamat">Alamat</label> + <label htmlFor="intro">Status Pencarian Kerja</label> + <Form.Radio + label="Aktif" + name="job_seeking_status" + value="Active" + onClick={this.handleRadio} + /> + <Form.Radio + label="Pasif" + name="job_seeking_status" + value="Passive" + onClick={this.handleRadio} + /> + </Form.Field> + <Form.Field> + <Checkbox + onChange={this.handleCheckbox} + checked={!!this.state.show_transcript} + label="Ijinkan perusahaan tempat saya mendaftar untuk melihat transkrip akademik saya" + name="show_transcript" + /> + </Form.Field> + <Form.Field> + <label htmlFor="student_gpa">GPA</label> <input onChange={this.handleChange} placeholder={ - this.state.alamat === null - ? 'JL. Satya Raya No.41' - : this.state.alamat + this.state.student_gpa === null + ? '3.50' + : this.state.student_gpa } defaultValue={ - this.state.alamat === null ? null : this.state.alamat + this.state.student_gpa === null + ? null + : this.state.student_gpa } - name="alamat" + name="student_gpa" /> </Form.Field> + <Form.Field> - <label htmlFor="skills">Skills</label> + <label htmlFor="student_toefl">TOEFL</label> + <input + onChange={this.handleChange} + placeholder={ + this.state.student_toefl === null + ? '400' + : this.state.student_toefl + } + defaultValue={ + this.state.student_toefl === null + ? null + : this.state.student_toefl + } + name="student_toefl" + /> + <input + onChange={this.handleFile} + placeholder="TOEFL file" + name="student_toefl_file" + type="File" + /> + </Form.Field> + + <Form.Field> + <label htmlFor="dependants">Dependants</label> <input onChange={this.handleChange} - placeholder="Isi sesuai dengan keahlian anda" - defaultValue={this.state.skills === null ? 'Competitive Programming' : this.state.skills} - name="skills" + placeholder={ + this.state.dependants === null ? '0' : this.state.dependants + } + defaultValue={ + this.state.dependants === null ? null : this.state.dependants + } + name="dependants" /> </Form.Field> + </Form> + </Segment> + + <Segment className="links-form"> + <Header as="h3" textAlign="center"> + <Icon name="edit" /> + <Header.Content>Edit Experience</Header.Content> + </Header> + <Form + ref={(input) => { + this.form = input; + }} + key={this.state.refresh} + size="small" + onSubmit={this.handleSubmit} + > + <Form.Field> <label htmlFor="latest_work">Latest Working Experience</label> <input @@ -439,6 +529,7 @@ export default class EditProfile extends React.Component { name="latest_work" /> </Form.Field> + <Form.Field> <label htmlFor="latest_work_desc"> Latest Working Experience Description @@ -458,6 +549,7 @@ export default class EditProfile extends React.Component { name="latest_work_desc" /> </Form.Field> + <Form.Field> <label htmlFor="awards">Awards and Achievements</label> <input @@ -473,21 +565,7 @@ export default class EditProfile extends React.Component { name="awards" /> </Form.Field> - <Form.Field> - <label htmlFor="projects">Projects</label> - <input - onChange={this.handleChange} - placeholder={ - this.state.projects === null - ? 'Ow-Jek - Android Mobile Project' - : this.state.projects - } - defaultValue={ - this.state.projects === null ? null : this.state.projects - } - name="projects" - /> - </Form.Field> + <Form.Field> <label htmlFor="certification">Sertifikasi</label> <input @@ -505,19 +583,29 @@ export default class EditProfile extends React.Component { name="certification" /> </Form.Field> + <Form.Field> - <label htmlFor="languages">Bahasa yang dikuasai</label> + <label htmlFor="projects">Projects</label> <input onChange={this.handleChange} placeholder={ - this.state.languages === null - ? 'Indonesia' - : this.state.languages + this.state.projects === null + ? 'Ow-Jek - Android Mobile Project' + : this.state.projects } defaultValue={ - this.state.languages === null ? null : this.state.languages + this.state.projects === null ? null : this.state.projects } - name="languages" + name="projects" + /> + </Form.Field> + + <Form.Field> + <label htmlFor="volunteer">Volunteering Experience</label> + <input + onChange={this.handleChange} + placeholder="Ketua Organisasi A - 2020" + name="volunteer" /> </Form.Field> @@ -537,158 +625,117 @@ export default class EditProfile extends React.Component { /> </Form.Field> - <Form.Field> - <label htmlFor="interests">Interests</label> - <input - onChange={this.handleChange} - placeholder={this.state.interests === null ? 'Machine Learning' : this.state.interests} - defaultValue={this.state.interests === null ? null : this.state.interests} - name="interests" - /> - </Form.Field> + </Form> + </Segment> - <Form.Field> - <label htmlFor="related_course">Related Coursework Taken</label> + + <Segment className="links-form"> + <Header as="h3" textAlign="center"> + <Icon name="edit" /> + <Header.Content>Edit Links</Header.Content> + </Header> + <Form + ref={(input) => { + this.form = input; + }} + key={this.state.refresh} + size="small" + onSubmit={this.handleSubmit} + > + + <Form.Field> + <label htmlFor="portfolio_link">Portfolio Link</label> <input onChange={this.handleChange} placeholder={ - this.state.related_course === null - ? 'Intraction System, Machine Learning' - : this.state.related_course + this.state.portfolio_link === null + ? 'https://www.example.com/myproject/' + : this.state.portfolio_link } defaultValue={ - this.state.related_course === null ? null : this.state.related_course + this.state.portfolio_link === null + ? null + : this.state.portfolio_link } - name="related_course" + name="portfolio_link" /> </Form.Field> <Form.Field> - <label htmlFor="resume">Resume</label> - <input - onChange={this.handleFile} - placeholder="Resume" - name="resume" - type="File" - /> - </Form.Field> - <Form.Field> - <label htmlFor="expected_salary">Expected Salary</label> - <input onChange={this.handleChange} placeholder="2000000" name="expected_salary" /> - </Form.Field> - <Form.Field> - <label htmlFor="intro">Intro</label> + <label htmlFor="linkedin_url">URL Profile LinkedIn</label> <input onChange={this.handleChange} placeholder={ - this.state.intro === null - ? 'Ceritakan dirimu secara singkat' - : this.state.intro + this.state.linkedin_url === null + ? 'https://www.linkedin.com/in/jojo/' + : this.state.linkedin_url } defaultValue={ - this.state.intro === null ? null : this.state.intro + this.state.linkedin_url === null + ? null + : this.state.linkedin_url } - name="intro" - /> - </Form.Field> - <Form.Field> - <label htmlFor="volunteer">Volunteering Experience</label> - <input - onChange={this.handleChange} - placeholder="Ketua Organisasi A - 2020" - name="volunteer" - /> - </Form.Field> - <Form.Field> - <label htmlFor="intro">Status Pencarian Kerja</label> - <Form.Radio - label="Aktif" - name="job_seeking_status" - value="Active" - onClick={this.handleRadio} - /> - <Form.Radio - label="Pasif" - name="job_seeking_status" - value="Passive" - onClick={this.handleRadio} - /> - </Form.Field> - <Form.Field> - <Checkbox - onChange={this.handleCheckbox} - checked={!!this.state.show_transcript} - label="Ijinkan perusahaan tempat saya mendaftar untuk melihat transkrip akademik saya" - name="show_transcript" + name="linkedin_url" /> </Form.Field> + <Form.Field> - <label htmlFor="student_gpa">GPA</label> + <label htmlFor="hackerrank_url">URL Profile Hackerrank</label> <input onChange={this.handleChange} placeholder={ - this.state.student_gpa === null - ? '3.50' - : this.state.student_gpa + this.state.hackerrank_url === null + ? 'https://www.hackerrank.com/james' + : this.state.hackerrank_url } defaultValue={ - this.state.student_gpa === null + this.state.hackerrank_url === null ? null - : this.state.student_gpa + : this.state.hackerrank_url } - name="student_gpa" + name="hackerrank_url" /> </Form.Field> <Form.Field> - <label htmlFor="student_toefl">TOEFL</label> - <input - onChange={this.handleChange} - placeholder={ - this.state.student_toefl === null - ? '400' - : this.state.student_toefl - } - defaultValue={ - this.state.student_toefl === null - ? null - : this.state.student_toefl - } - name="student_toefl" - /> - <input - onChange={this.handleFile} - placeholder="TOEFL file" - name="student_toefl_file" - type="File" - /> - </Form.Field> - - <Form.Field> - <label htmlFor="dependants">Dependants</label> + <label htmlFor="website_url">Website URL</label> <input onChange={this.handleChange} placeholder={ - this.state.dependants === null ? '0' : this.state.dependants + this.state.website_url === null + ? 'https://www.example.com/' + : this.state.website_url } defaultValue={ - this.state.dependants === null ? null : this.state.dependants + this.state.website_url === null + ? null + : this.state.website_url } - name="dependants" + name="website_url" /> </Form.Field> - <Button + <Form.Field> + <label htmlFor="github_url">URL Profile Github</label> + <input + onChange={this.handleChange} + placeholder={this.state.github_url === null ? 'https://github.com/bob' : this.state.github_url} + defaultValue={this.state.github_url === null ? null : this.state.github_url} + name="github_url" + /> + </Form.Field> + </Form> + </Segment> + <Button onClick={this.handleSubmit} + fluid type="submit" size="small" loading={this.state.loading} primary - floated="right" > Submit </Button> - </Form> - </Segment> + </div> ); } -- GitLab From 958238a14e7e5a3c591265d070abce4394d08751 Mon Sep 17 00:00:00 2001 From: Aviliani Pramestya <avipramestya14@gmail.com> Date: Thu, 5 Dec 2019 17:32:32 +0700 Subject: [PATCH 5/5] delete inimportant line in profilepage --- assets/js/ProfilePage.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/js/ProfilePage.jsx b/assets/js/ProfilePage.jsx index 30e9b957..7f53f751 100755 --- a/assets/js/ProfilePage.jsx +++ b/assets/js/ProfilePage.jsx @@ -13,7 +13,6 @@ import { } from 'semantic-ui-react'; import Server from './lib/Server'; import Storage from './lib/Storage'; -import ModalAlert from './components/ModalAlert'; import ProfileHandler from './ProfileHandler'; import Dumper from './lib/Dumper'; import { isFromGithubLinkValid, gotoLink } from './Utils'; -- GitLab