Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #513

Merged
merged 3 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/api/karrio/server/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.2.rc4
2024.2.rc5
2 changes: 2 additions & 0 deletions apps/dashboard/src/components/tracking-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export const TrackingPreview: React.FC<TrackingPreviewComponent> = ({ children }
<CarrierImage
carrier_name={(tracker?.meta as any)?.carrier || tracker?.carrier_name}
width={60} height={60}
text_color={tracker?.tracking_carrier?.config?.text_color}
background={tracker?.tracking_carrier?.config?.brand_color}
/>
</div>

Expand Down
2 changes: 2 additions & 0 deletions apps/dashboard/src/modules/Trackers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export default function TrackersPage(pageProps: any) {
<CarrierImage
carrier_name={tracker.meta?.carrier || tracker.carrier_name}
containerClassName="mt-1 ml-1 mr-2" height={28} width={28}
text_color={tracker.tracking_carrier?.config?.text_color}
background={tracker.tracking_carrier?.config?.brand_color}
/>
<div className="text-ellipsis" style={{ maxWidth: '190px', lineHeight: '16px' }}>
<span className="has-text-info has-text-weight-bold">{tracker.tracking_number}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class Meta:
username = models.CharField(max_length=100)
password = models.CharField(max_length=100)
dhl_api_key = models.CharField(max_length=200)
customer_number = models.CharField(max_length=50)
tracking_consumer_key = models.CharField(max_length=200, blank=True, null=True)
tracking_consumer_secret = models.CharField(max_length=200, blank=True, null=True)
customer_number = models.CharField(max_length=50, blank=True, null=True, default="")
services = models.ManyToManyField("ServiceLevel", blank=True)

@property
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.8 on 2024-02-04 09:47

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("providers", "0065_deutschepostsettings"),
]

operations = [
migrations.AddField(
model_name="servicelevel",
name="carrier_service_code",
field=models.CharField(blank=True, max_length=50, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.8 on 2024-02-04 10:04

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
("providers", "0066_servicelevel_carrier_service_code"),
]

operations = [
migrations.AlterField(
model_name="deutschepostsettings",
name="customer_number",
field=models.CharField(default=django.utils.timezone.now, max_length=50),
preserve_default=False,
),
]
1 change: 1 addition & 0 deletions modules/core/karrio/server/providers/models/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Meta:
service_code = models.CharField(
max_length=50, validators=[validators.RegexValidator(r"^[a-z0-9_]+$")]
)
carrier_service_code = models.CharField(max_length=50, null=True, blank=True)
description = models.CharField(max_length=250, null=True, blank=True)
active = models.BooleanField(null=True, default=True)

Expand Down
1 change: 1 addition & 0 deletions modules/graph/karrio/server/graph/schemas/base/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ class CreateServiceLevelInput(utils.BaseInput):
currency: utils.CurrencyCodeEnum
zones: typing.List[ServiceZoneInput]

carrier_service_code: typing.Optional[str] = strawberry.UNSET
description: typing.Optional[str] = strawberry.UNSET
active: typing.Optional[bool] = strawberry.UNSET

Expand Down
1 change: 1 addition & 0 deletions modules/graph/karrio/server/graph/schemas/base/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ class ServiceLevelType:
object_type: str
service_name: typing.Optional[str]
service_code: typing.Optional[str]
carrier_service_code: typing.Optional[str]
description: typing.Optional[str]
active: typing.Optional[bool]

Expand Down
2 changes: 2 additions & 0 deletions modules/sdk/karrio/core/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Karrio Unified model definitions module."""

import attr
from typing import List, Dict, Any, Union
from jstruct import JList, JStruct, REQUIRED
Expand Down Expand Up @@ -409,6 +410,7 @@ class ServiceLevel:

service_name: str
service_code: str
carrier_service_code: str = None
description: str = ""
active: bool = True
id: str = None
Expand Down
72 changes: 72 additions & 0 deletions packages/types/graphql/admin/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,21 @@ export const GET_SYSTEM_CONNECTIONS = gql`query GetSystemConnections {
account
service_type
}
... on AlliedExpressLocalSettingsType {
id
carrier_id
carrier_name
display_name
test_mode
active
capabilities
metadata
config
username
password
account
service_type
}
... on AmazonShippingSettingsType {
id
carrier_id
Expand Down Expand Up @@ -420,6 +435,63 @@ export const GET_SYSTEM_CONNECTIONS = gql`query GetSystemConnections {
metadata
}
}
... on DeutschePostSettingsType {
id
carrier_id
carrier_name
display_name
test_mode
active
metadata
capabilities
username
password
customer_number
dhl_api_key
tracking_consumer_key
tracking_consumer_secret
config
services {
id
active
service_name
service_code
carrier_service_code
description
currency
transit_days
transit_time
max_weight
max_width
max_height
max_length
weight_unit
dimension_unit
domicile
international
zones {
label
rate
min_weight
max_weight
transit_days
transit_time
radius
latitude
longitude
cities
postal_codes
country_codes
}
}
rate_sheet {
id
name
slug
carrier_name
metadata
}
}
... on DHLExpressSettingsType {
id
carrier_id
Expand Down
Loading
Loading