Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
f407aa1d
Commit
f407aa1d
authored
Oct 07, 2019
by
RYAN NAUFAL PIOSCHA
Browse files
1606884716 11 Menambahkan link website perusahaan
parent
446f8c78
Changes
7
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
f407aa1d
...
...
@@ -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
...
...
assets/js/CompanyProfile.jsx
View file @
f407aa1d
...
...
@@ -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
>
...
...
assets/js/__test__/CompanyProfile-test.jsx
View file @
f407aa1d
...
...
@@ -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
,
...
...
assets/js/components/CompanyRegisterModal.jsx
View file @
f407aa1d
...
...
@@ -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
>
...
...
core/models/accounts.py
View file @
f407aa1d
...
...
@@ -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
):
...
...
core/tests/test_accounts.py
View file @
f407aa1d
...
...
@@ -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
)
...
...
core/views/accounts.py
View file @
f407aa1d
...
...
@@ -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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment