Skip to content

Commit

Permalink
Merge pull request #282 from FroggyTaipei/staging
Browse files Browse the repository at this point in the history
Release 1.2.3 to release
  • Loading branch information
travishen authored Mar 2, 2020
2 parents d1f9d98 + edfe3c2 commit b999a9a
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Django
DEBUG=True
SECRET_KEY=dev

DOMAIN=http://localhost:8000
DOMAIN=http://localhost
ALLOWED_HOSTS=*
JWT_EXPIRATION_DELTA_MINUTES=120

# Email settings, defaults to 1025, mailhog
EMAIL_HOST_USER=email_host
Expand Down
8 changes: 0 additions & 8 deletions backend/apps/users/templates/mail/password_reset.txt

This file was deleted.

6 changes: 3 additions & 3 deletions backend/apps/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.http import JsonResponse
from django.conf import settings
from django.db.models import Q
from rest_framework import viewsets, status
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.permissions import IsAdminUser
from rest_framework.exceptions import AuthenticationFailed, ValidationError
Expand Down Expand Up @@ -33,12 +33,12 @@ def token_auth(self, request):
email = user.email
mobile = user.phone_number
except (
auth.ValueError,
ValueError,
auth.InvalidIdTokenError,
auth.ExpiredIdTokenError,
auth.UserNotFoundError
) as e:
raise AuthenticationFailed(e.message)
raise AuthenticationFailed(str(e))

if mobile:
if not mobile.startswith('+886'):
Expand Down
1 change: 0 additions & 1 deletion backend/config/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def firebase_app(credential_path=settings.FIREBASE_SA_PATH):
try:
yield app
except Exception as e:
delete_app(app)
raise e
finally:
delete_app(app)
4 changes: 2 additions & 2 deletions backend/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@

# JWT
# ------------------------------------------------------------------------------
# See: http://getblimp.github.io/django-rest-framework-jwt/#additional-settings
# See: https://jpadilla.github.io/django-rest-framework-jwt/#additional-settings
JWT_AUTH = {
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=60*30),
'JWT_EXPIRATION_DELTA': datetime.timedelta(minutes=env.float('JWT_EXPIRATION_DELTA_MINUTES', default=120)),
}


Expand Down
17 changes: 9 additions & 8 deletions backend/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
admin.autodiscover()

schema_view = get_schema_view(
openapi.Info(
title="Froggy's Service API",
default_version='v1',
contact=openapi.Contact(email=settings.SERVER_EMAIL),
license=openapi.License(name="MIT License"),
),
public=False,
permission_classes=(permissions.AllowAny,),
openapi.Info(
title="Froggy's Service API",
default_version='v1',
contact=openapi.Contact(email=settings.SERVER_EMAIL),
license=openapi.License(name="MIT License"),
),
url=settings.DOMAIN,
public=False,
permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ article
.froggyServantImg
width: 100%
transform: scale(1.5) translate3d(-5px ,-15px,0)
-webkit-mask-image: -webkit-gradient(linear, left 90%, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)))
mask-image: linear-gradient(rgba(0, 0, 0, 1.0), 90% ,transparent)
.text-center
text-align: center
Expand Down
27 changes: 17 additions & 10 deletions frontend/src/components/AuthModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="modal-mask">
<div class="modal-wrapper">
<div class="modal-container">
<div class="close-btn">
<div class="close-btn" v-show="!isClosed">
<el-button icon="el-icon-close" type="text" @click="cancel('DISMISS')" circle plain></el-button>
</div>
<div id="firebaseui-auth-container"></div>
Expand All @@ -18,6 +18,7 @@ export default {
name: 'AuthModal',
data: () => ({
config: {},
isClosed: false,
ui: ''
}),
created () {
Expand All @@ -40,8 +41,6 @@ export default {
this.ui.start('#firebaseui-auth-container', {
callbacks: {
signInSuccessWithAuthResult: (authResult, redirectUrl) => {
console.info(authResult.user.phoneNumber)
console.info(authResult)
this.cancel(`SUCCESS,${authResult.user.phoneNumber}`)
return false
},
Expand All @@ -55,7 +54,8 @@ export default {
size: 'normal', // 'invisible' or 'compact'
badge: 'inline' //' bottomright' or 'inline' applies to invisible.
},
defaultCountry: 'TW'
defaultCountry: 'TW',
whitelistedCountries: ['TW', '+886']
}
]
});
Expand All @@ -65,6 +65,7 @@ export default {
},
methods: {
cancel(status) {
this.isClosed = true
this.$emit('cancel', status)
this.ui.delete()
}
Expand All @@ -77,7 +78,7 @@ export default {
text-align: right;
}
.close-btn > button:hover {
.close-btn > button:hover, .close-btn > button:focus {
border-color: white !important;
}
Expand All @@ -99,7 +100,7 @@ export default {
}
.modal-container {
width: fit-content;
max-width: 360px;
margin: 0px auto;
background-color: #fff;
box-shadow: 0 2px 8px rgba(0, 0, 0, .33);
Expand All @@ -124,16 +125,22 @@ export default {
text-align: center;
}
@media only screen and (max-width: 768px) {
@media only screen and (max-width: 767px) {
.modal-container {
width: 85vw;
padding: 16px;
max-height: 80vh;
max-width: 360px;
}
.modal-body {
margin: 0;
}
}
@media only screen and (max-width: 359px) {
.modal-container {
min-width: 0 !important;
max-width: 100vw;
}
}
/*
* The following styles are auto-applied to elements with
* transition="modal" when their visibility is toggled
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/components/CaseList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
size="mini"
@click="selectType(t.id)"
:class="{tagSelected: t.id === options.selectedType}"
:key="index"
:key="index + '-type'"
>{{t.text}}</div>
<div class="clearTag" size="mini" @click="selectType()">
<i class="fas fa-times-circle"></i>
Expand All @@ -38,8 +38,9 @@
size="mini"
@click="selectState(s.id)"
:class="{tagSelected: s.id === options.selectedState}"
:key="index"
:key="index + '-state'"
>{{s.text}}</div>
<!-- +'-tag' -->
<div class="clearTag" size="mini" @click="selectState()">
<i class="fas fa-times-circle"></i>
</div>
Expand Down Expand Up @@ -179,7 +180,7 @@ export default {
defaultOption: "選擇{column}"
},
columnsDisplay: {
id: "min_tabletL",
id: "min_desktop",
create_time: "min_tabletL"
},
sortable: ["id", "state", "type", "create_time"],
Expand All @@ -205,17 +206,15 @@ export default {
{
name: "alphabet",
callback: function(row, query) {
console.log(query);
return row.id == query;
}
}
],
perPage: 13,
perPage: 10,
perPageValues: [10],
selectedType: null,
selectedState: null,
requestAdapter(data) {
// console.clear()
return {
limit: this.perPage,
sort: data.orderBy ? data.orderBy : "id",
Expand Down
7 changes: 0 additions & 7 deletions frontend/src/components/InputCase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ export default {
}
},
methods: {
updateCSRFToken () {
this.axios.get('api/csrftoken/')
.then(response => {
this.axios.defaults.headers.common['X-CSRFToken'] = response.data['token']
})
.catch(e => { console.log(e) })
},
removeFile (id) {
this.axios.delete('/api/files/temp/' + id, { headers: this.$store.state.jwt })
.then(response => {
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/components/InputUserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,12 @@ export default {
this.authenticating = true
},
dismissAuthModal (status) {
console.info(status)
this.showAuthModal = false
if(status !== 'DISMISS'){
firebase.auth().currentUser.getIdToken(false).then(t => {
let auth = status.split(',')
console.info("ID token: ", t)
this.sendToken(t, auth[1])
this.sendToken(t, auth[1].replace('+886', '0'))
}).catch(e => {
console.info(e)
this.$alert('請重新認證', '呱吉提示', {
type: 'warning',
confirmButtonText: '好!'
Expand All @@ -155,15 +152,14 @@ export default {
this.axios.post('/api/users/token_auth/', {
token: t
}).then(response => {
console.info("傳送成功")
this.mobileText = '手機號碼'
this.applicant.mobile = mobile
let jwt = { Authorization: 'JWT ' + response.data.jwt }
this.$store.commit('setJWT', jwt)
this.$store.commit('setAuthenticated', true)
}).catch(e => {
let title = e.response.status + ' ' + e.response.statusText
let content = e.response.data.detail ? e.response.data.detail : e.response.data[0]
let content = e.response.data[0] ? e.response.data[0] : '請聯絡工作人員 02-27297708 分機 7152、7252'
this.$alert(content, title, {
type: 'error'
})
Expand Down
17 changes: 15 additions & 2 deletions frontend/src/views/CaseListPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ $tag_selected_color: #dc5f84
&:hover
background-color: $tag_selected_color
.break
display: inline-block
flex-basis: 100%
width: 0px
height: 0px
overflow: hidden
.row-table
min-height: 80vh
table
width: 100%
color: white
Expand All @@ -90,6 +92,7 @@ table
color: transparent
thead>tr>th
font-size: $fz_sub_header_small
min-width: 100px
@media screen and (max-width: $break_small)
font-size: $fz_sub_header_small
tbody>tr
Expand Down Expand Up @@ -120,9 +123,10 @@ table
margin: 10px 0px 20px 0px
.table-responsive
width: 100%
max-height: 50vh
overflow: scroll
border-bottom: 2px solid white
margin-bottom: 100px
margin-bottom: 50px
&::-webkit-scrollbar
width: 0 !important
Expand All @@ -145,9 +149,15 @@ table
height: 30px
padding-left: 15px
.VueTables__heading
@media screen and (max-width: 480px)
font-size: 14px
.VuePagination
position: absolute
bottom: 0
.VuePagination__pagination
margin: 0
.VuePagination, .VuePagination__pagination, .VuePagination__count
display: flex !important
Expand Down Expand Up @@ -175,6 +185,9 @@ table
color: $color_white
border-bottom: solid white 1px
.VuePagination__count
display: none !important
.VuePagination__pagination-item.page-item
@media screen and (max-width: 480px)
a[role='button']
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/InputDialogPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export default {
.category-content-froggy {
height: 25vmax;
bottom: 3vmax !important;
-webkit-mask-image: -webkit-gradient(linear, left 90%, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
mask-image: linear-gradient(rgba(0, 0, 0, 1.0), 90% ,transparent);
}
.category-content-froggy-bottom {
Expand Down
Binary file modified helm/froggy-service/.env.prod.enc
Binary file not shown.
Binary file modified helm/froggy-service/.env.staging.enc
Binary file not shown.
Binary file modified helm/froggy-service/secret/default-sa.json.enc
Binary file not shown.
Binary file modified helm/froggy-service/secret/firebase-sa.json.enc
Binary file not shown.
Binary file modified helm/froggy-service/values.prod.yaml.enc
Binary file not shown.
Binary file modified helm/froggy-service/values.staging.yaml.enc
Binary file not shown.

0 comments on commit b999a9a

Please sign in to comment.