Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #135 from purplship/purplship-server-2021.7
Browse files Browse the repository at this point in the history
[release-candidate] purplship server edition 2021.7
  • Loading branch information
danh91 authored Aug 5, 2021
2 parents 2130341 + a060bbc commit ccca707
Show file tree
Hide file tree
Showing 98 changed files with 2,443 additions and 638 deletions.
43 changes: 43 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# https://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

# Docstrings and comments use max_line_length = 79
[*.py]
max_line_length = 119

# Use 2 spaces for the HTML files
[*.html]
indent_size = 2

# The JSON files contain newlines inconsistently
[*.json]
indent_size = 2
insert_final_newline = ignore

# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = ignore
insert_final_newline = ignore

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab

# Batch files use tabs for indentation
[*.bat]
indent_style = tab

[docs/**.txt]
max_line_length = 79

[*.yml]
indent_size = 2
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Help us out… If you love Open standard and great software, give us a star!
## Deployment

### `Docker`

> check the latest version tags of the purplship/purplship-server image on [Docker Hub](https://hub.docker.com/r/purplship/purplship-server/tags)
<details>
Expand All @@ -72,7 +72,7 @@ docker run -d \
-e [email protected] \
-e ADMIN_PASSWORD=demo \
--link=db:db -p 5002:5002 \
danh91.docker.scarf.sh/purplship/purplship-server:2021.6.3
danh91.docker.scarf.sh/purplship/purplship-server:2021.7
```

</details>
Expand All @@ -99,7 +99,7 @@ services:
- db_network

pship:
image: danh91.docker.scarf.sh/purplship/purplship-server:2021.6.3
image: danh91.docker.scarf.sh/purplship/purplship-server:2021.7
restart: unless-stopped
environment:
- DEBUG_MODE=True
Expand Down Expand Up @@ -155,8 +155,6 @@ purplship is available in two editions - **OSS** and **Enterprise**.

The Open Source Edition is under the `Apache 2` License.

- [Become a backer or sponsor on Patreon](https://www.patreon.com/danh91)

To get the quotation of our Enterprise Edition, please visit [purplship.com](https://purplship.com) and contact us.

- [Book a Live Demo at purplship.com](https://purplship.com/schedule-demo/)
Expand Down
25 changes: 0 additions & 25 deletions apps/client/purpleserver/client/static/client/profile.svg

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@

<footer class="card-footer">

{% if tracker.delivered %}
{% if tracker.status == 'delivered' %}
<p class="card-footer-item has-background-success has-text-white is-size-4">{% trans 'Delivered' %}</p>
{% elif tracker.pending %}
<p class="card-footer-item has-background-grey-dark has-text-white is-size-4">{% trans 'Pending' %}</p>
{% else %}
{% elif tracker == 'in-transit' %}
<p class="card-footer-item has-background-info has-text-white is-size-4">{% trans 'In-Transit' %}</p>
{% else %}
<p class="card-footer-item has-background-grey-dark has-text-white is-size-4">{% trans 'Pending' %}</p>
{% endif %}

</footer>
Expand Down
9 changes: 5 additions & 4 deletions apps/client/purpleserver/client/views/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
from rest_framework.request import Request

from purpleserver.user.serializers import TokenSerializer
from purpleserver.core import validators
import purpleserver.core.models as core
import purpleserver.manager.models as manager

FEATURE_FLAGS = dict(
ADDRESS_AUTO_COMPLETE=any(config.GOOGLE_CLOUD_API_KEY or ""),
MULTI_ORGANIZATIONS=settings.MULTI_ORGANIZATIONS
)
ENTITY_ACCESS_VIEWS = {
'/api_logs/': core.APILog,
'/shipments/': manager.Shipment,
Expand All @@ -24,6 +21,10 @@

@login_required(login_url='/login')
def index(request: Request, *args, **kwargs):
FEATURE_FLAGS = dict(
MULTI_ORGANIZATIONS=settings.MULTI_ORGANIZATIONS,
ADDRESS_AUTO_COMPLETE=validators.Address.get_info(),
)

if settings.MULTI_ORGANIZATIONS and any(k in request.path for k, _ in ENTITY_ACCESS_VIEWS.items()):
model = next((m for k, m in ENTITY_ACCESS_VIEWS.items() if k in request.path))
Expand Down
2 changes: 1 addition & 1 deletion apps/client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='purplship-server.client',
version='2021.6.3',
version='2021.7',
description='Multi-carrier shipping API client module',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
4 changes: 2 additions & 2 deletions apps/core/purpleserver/core/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, carrier_name: str, carrier_id: str, test: bool = None, active
def dict(self):
return {
name: value for name, value in self.__dict__.items()
if name not in ['carrier_name', 'created_by', 'active']
if name not in ['carrier_name', 'created_by', 'active', 'capabilities']
}

@classmethod
Expand Down Expand Up @@ -231,10 +231,10 @@ class Tracking:
tracking_number: str
events: List[TrackingEvent] = JList[TrackingEvent, REQUIRED]

status: str = ""
delivered: bool = None
id: str = None
test_mode: bool = None
pending: bool = None


@attr.s(auto_attribs=True)
Expand Down
2 changes: 1 addition & 1 deletion apps/core/purpleserver/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, detail=None, code=None, status_code=None):
if code is None:
code = self.default_code
if status_code is None:
code = self.default_status_code
status_code = self.default_status_code

self.status_code = status_code
self.code = code
Expand Down
Loading

0 comments on commit ccca707

Please sign in to comment.