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

feat: Expose map processing status #1387

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions terraso_backend/apps/graphql/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ type VisualizationConfigNode implements Node {
configuration: JSONString
createdBy: UserNode
mapboxTilesetId: String
mapboxTilesetStatus: SharedDataVisualizationConfigMapboxTilesetStatusChoices!
dataEntry: DataEntryNode!
owner: OwnerNode
}
Expand All @@ -680,6 +681,15 @@ value as specified by
"""
scalar DateTime

"""An enumeration."""
enum SharedDataVisualizationConfigMapboxTilesetStatusChoices {
"""Pending"""
PENDING

"""Ready"""
READY
}

type DataEntryNode implements Node {
createdAt: DateTime!
name: String!
Expand Down
13 changes: 8 additions & 5 deletions terraso_backend/apps/graphql/schema/visualization_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class Meta:
"created_at",
"data_entry",
"mapbox_tileset_id",
"mapbox_tileset_status",
)
interfaces = (relay.Node,)
filterset_class = VisualizationConfigFilterSet
Expand Down Expand Up @@ -137,11 +138,13 @@ def resolve_mapbox_tileset_id(self, info):
return self.mapbox_tileset_id

# Check if tileset ready to be published and update status
published = get_publish_status(self.mapbox_tileset_id)
if published:
self.mapbox_tileset_status = VisualizationConfig.MAPBOX_TILESET_READY
self.save()
return self.mapbox_tileset_id
if self.mapbox_tileset_id:
published = get_publish_status(self.mapbox_tileset_id)
if published:
self.mapbox_tileset_status = VisualizationConfig.MAPBOX_TILESET_READY
self.save()

return self.mapbox_tileset_id


class VisualizationConfigAddMutation(BaseWriteMutation):
Expand Down
Loading