Fakultas Ilmu Komputer UI

Commit f407aa1d authored by RYAN NAUFAL PIOSCHA's avatar RYAN NAUFAL PIOSCHA
Browse files

1606884716 11 Menambahkan link website perusahaan

parent 446f8c78
......@@ -24,6 +24,7 @@ test:
- npm install
- npm run build-production
- pip install -r requirements.txt
- python manage.py makemigrations
- python manage.py migrate
- python manage.py test
- npm run karma
......
......@@ -22,6 +22,7 @@ export default class CompanyProfile extends React.Component {
<h2>{ data.name }</h2>
<h3>{ data.address }t</h3>
<p>{ data.category } - { data.description }</p>
<p>{ data.website }</p>
</div>
</Container>
</Segment>
......
......@@ -25,6 +25,7 @@ const companyUser = {
logo: 'http://localhost:8001/files/company-logo/8a258a48-3bce-4873-b5d1-538b360d0059.png',
address: 'Jl. Kebayoran Baru nomor 13, Jakarta Barat',
category: 'Belum ada kategori perusahaan',
website: 'Belum ada link website'
},
supervisor: null,
student: null,
......
......@@ -158,6 +158,10 @@ export default class CompanyRegisterModal extends React.Component {
<label htmlFor="address">Alamat</label>
<Input onChange={this.handleChange} placeholder="Alamat" name="address" required />
</Form.Field>
<Form.Field required>
<label htmlFor="address">Website</label>
<Input onChange={this.handleChange} placeholder="Website perusahaan anda" name="website" required />
</Form.Field>
<Modal.Actions style={{ textAlign: 'right' }}>
<Button loading={this.state.loading} type="submit" color="blue"> <Icon name="checkmark" />Submit</Button>
</Modal.Actions>
......
......@@ -101,6 +101,7 @@ class Company(models.Model):
logo = models.FileField(upload_to=get_company_logo_file_path, null=True, blank=True, validators=[validate_image_file_extension])
address = models.CharField(max_length=1000, blank=True, null=True)
category = models.CharField(max_length=140, default="Belum ada kategori perusahaan")
website = models.CharField(max_length=100, default="Belum ada link website")
@property
def name(self):
......
......@@ -92,7 +92,7 @@ class RegisterTests(APITestCase):
def test_create_and_recreate(self):
url = '/api/register/'
tc_post = {'password': 'corporatepass', 'name':'tutuplapak', 'description':'menutup lapak', 'email': 'email@email.com', 'logo':'lalala', 'address':'alamat', 'category':'Perusahaan Jasa'}
tc_post = {'password': 'corporatepass', 'name':'tutuplapak', 'description':'menutup lapak', 'email': 'email@email.com', 'logo':'lalala', 'address':'alamat', 'category':'Perusahaan Jasa', 'website':'www.tutuplapak.com'}
response = self.client.post(url, tc_post, format='multipart')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
......
......@@ -240,7 +240,7 @@ class CompanyRegisterViewSet(viewsets.GenericViewSet):
type: string
"""
data = {}
for attr in ['password', 'email', 'name', 'description', 'logo', 'address', 'category']:
for attr in ['password', 'email', 'name', 'description', 'logo', 'address', 'category', 'website']:
data[attr] = request.data.get(attr)
if data[attr] is None:
return Response({'error': attr+' is required'}, status=status.HTTP_400_BAD_REQUEST)
......@@ -258,7 +258,8 @@ class CompanyRegisterViewSet(viewsets.GenericViewSet):
description=data['description'],
logo=data['logo'],
address=data['address'],
category=data['category']
category=data['category'],
website=data['website']
)
user.save()
company.save()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment