Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Dashboard interactive views (#1710)

Dominik Żegleń1f5aac21aa8c
diff --git a/.codeclimate.yml b/.codeclimate.yml
index 38d489bf29..6e18cfe5e3 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -1,6 +1,7 @@
engines:
eslint:
enabled: true
+ channel: eslint-4
isort:
enabled: true
channel: beta
diff --git a/.gitignore b/.gitignore
index d226ebd357..4f5cf233a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@
local_settings.py
__pycache__/
build/
+coverage/
dist/
*\.egg*
# data
diff --git a/saleor/dashboard/urls.py b/saleor/dashboard/urls.py
index 142612b995..50634bc99a 100644
--- a/saleor/dashboard/urls.py
+++ b/saleor/dashboard/urls.py
@@ -1,4 +1,5 @@
from django.conf.urls import include, url
+from django.views.generic.base import TemplateView
from . import views as core_views
from .category.urls import urlpatterns as category_urls
@@ -33,4 +34,4 @@ urlpatterns = [
url(r'^style-guide/', core_views.styleguide, name='styleguide'),
url(r'^search/', include(search_urls)),
url(r'^taxes/', include(taxes_urls)),
-]
+ url(r'^next/', TemplateView.as_view(template_name='dashboard/next.html'))]
diff --git a/saleor/graphql/api.py b/saleor/graphql/api.py
index 481909dfb6..f8f450784e 100644
--- a/saleor/graphql/api.py
+++ b/saleor/graphql/api.py
@@ -58,7 +58,6 @@ class Query(graphene.ObjectType):
level=graphene.Argument(graphene.Int),
description='List of the shop\'s product types.')
node = graphene.Node.Field()
- debug = graphene.Field(DjangoDebug, name='__debug')
def resolve_attributes(self, info, in_category=None, **kwargs):
return resolve_attributes(in_category, info)
diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.py
index bcd0152c1b..00c00820a5 100644
--- a/saleor/graphql/product/types.py
+++ b/saleor/graphql/product/types.py
@@ -39,11 +39,9 @@ class Margin(graphene.ObjectType):
class SelectedAttribute(graphene.ObjectType):
name = graphene.String(
- default_value=None,
- description='Name of an attribute')
+ default_value=None, description='Name of an attribute')
value = graphene.String(
- default_value=None,
- description='Value of an attribute.')
+ default_value=None, description='Value of an attribute.')
class Meta:
description = 'Represents a custom product attribute.'
@@ -51,8 +49,7 @@ class SelectedAttribute(graphene.ObjectType):
class ProductVariant(CountableDjangoObjectType):
stock_quantity = graphene.Int(
- required=True,
- description='Quantity of a product available for sale.')
+ required=True, description='Quantity of a product available for sale.')
price_override = graphene.Field(
Money,
description="""Override the base price of a product if necessary.
@@ -95,8 +92,7 @@ class ProductAvailability(graphene.ObjectType):
class Product(CountableDjangoObjectType):
url = graphene.String(
- description='The storefront URL for the product.',
- required=True)
+ description='The storefront URL for the product.', required=True)
thumbnail_url = graphene.String(
description='The URL of a main thumbnail for a product.',
size=graphene.Argument(
@@ -136,8 +132,8 @@ class Product(CountableDjangoObjectType):
self, context.discounts, context.taxes, context.currency)
return ProductAvailability(**availability._asdict())
- def resolve_attributes(self, info):
- return resolve_attribute_list(self.attributes)
+ def resolve_product_type(self, info):
+ return self.product_type
@permission_required(('product.view_product'))
def resolve_purchase_cost(self, info):
@@ -152,7 +148,8 @@ class Product(CountableDjangoObjectType):
class ProductType(CountableDjangoObjectType):
products = DjangoFilterConnectionField(
- Product, filterset_class=ProductFilterSet,
+ Product,
+ filterset_class=ProductFilterSet,
description='List of products of this type.')
class Meta:
@@ -185,15 +182,18 @@ class Collection(CountableDjangoObjectType):
class Category(CountableDjangoObjectType):
products = DjangoFilterConnectionField(
- Product, filterset_class=ProductFilterSet,
+ Product,
+ filterset_class=ProductFilterSet,
description='List of products in the category.')
url = graphene.String(
description='The storefront\'s URL for the category.')
ancestors = DjangoFilterConnectionField(
- lambda: Category, filterset_class=DistinctFilterSet,
+ lambda: Category,
+ filterset_class=DistinctFilterSet,
description='List of ancestors of the category.')
children = DjangoFilterConnectionField(
- lambda: Category, filterset_class=DistinctFilterSet,
+ lambda: Category,
+ filterset_class=DistinctFilterSet,
description='List of children of the category.')
class Meta:
@@ -223,7 +223,8 @@ class Category(CountableDjangoObjectType):
class ProductImage(CountableDjangoObjectType):
url = graphene.String(
- required=True, description='',
+ required=True,
+ description='',
size=graphene.String(
description='Size of an image, for example 255x255.'))
diff --git a/saleor/settings.py b/saleor/settings.py
index 44201b2393..e0f6d8c39d 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -419,9 +419,6 @@ if ES_URL:
'default': {
'hosts': ES_URL}}
-
-GRAPHENE = {'MIDDLEWARE': ['graphene_django.debug.DjangoDebugMiddleware']}
-
AUTHENTICATION_BACKENDS = [
'saleor.account.backends.facebook.CustomFacebookOAuth2',
'saleor.account.backends.google.CustomGoogleOAuth2',