Skip to content

Commit

Permalink
feat(Datasets): dataset explorer v1
Browse files Browse the repository at this point in the history
* feat(Datasets):  dataset explorer

* fix(Tabs): render only valid children

* feat(Dataset):  use router to change tab

* feat(Datasets): DatasetLayout component

* chore:clean up

* feat(Datasets):add datasets tabs in dataset layout

* fix(Datasets):regex to match url tabs

* feat(Datasets): improve tabs navigation and file explorer

* feat(Datasets): improvements and bugs fixes

* feat(Datasets): display metadata

* chore(Datasets): remove metadata for now

* fix(Datasets): add version on TabLink

* feat(Datasets): remove parsing methods

* fix(analytics): The condition was not correct

* wip

* chore: Improve the design and implementation of the dataset explorer

* chore: Add size to the files of a dataset

---------

Co-authored-by: Quentin Gérôme <[email protected]>
Co-authored-by: Quentin Gérôme <[email protected]>
  • Loading branch information
3 people authored Oct 22, 2024
1 parent 967c0f2 commit c827924
Show file tree
Hide file tree
Showing 33 changed files with 1,795 additions and 591 deletions.
10 changes: 8 additions & 2 deletions public/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Accept": "Accept",
"Accepted": "Accepted",
"Access key ID": "Access key ID",
"Access Management": "Access Management",
"Access management": "Access management",
"Access Token": "Access Token",
"Account": "Account",
"Account settings": "Account settings",
Expand Down Expand Up @@ -69,6 +69,7 @@
"Check your inbox and type the token you received to disable the two-factor authentication.": "Check your inbox and type the token you received to disable the two-factor authentication.",
"Close": "Close",
"Code": "Code",
"Columns": "Columns",
"Configuration": "Configuration",
"Configure & run": "Configure & run",
"Configure & Run": "Configure & Run",
Expand Down Expand Up @@ -104,6 +105,7 @@
"created by {{name}} on <4></4>": "created by {{name}} on <4></4>",
"Creating ({{progress}}%)": "Creating ({{progress}}%)",
"Credentials": "Credentials",
"Current version": "Current version",
"Currently disabled": "Currently disabled",
"Currently enabled": "Currently enabled",
"Custom": "Custom",
Expand Down Expand Up @@ -176,11 +178,13 @@
"From date": "From date",
"From Notebook": "From Notebook",
"From OpenHEXA CLI": "From OpenHEXA CLI",
"General": "General",
"General settings": "General settings",
"Generate": "Generate",
"Generate a new URL": "Generate a new URL",
"Generate extract": "Generate extract",
"Generate new webhook URL": "Generate new webhook URL",
"Generating sample...": "Generating sample...",
"Go back to login": "Go back to login",
"Go to login page": "Go to login page",
"Hide": "Hide",
Expand Down Expand Up @@ -298,13 +302,15 @@
"Restart all opened notebooks": "Restart all opened notebooks",
"Revoke": "Revoke",
"Role": "Role",
"Rows in sample": "Rows in sample",
"Run": "Run",
"Run again": "Run again",
"Run of {{label}}": "Run of {{label}}",
"Run pipeline": "Run pipeline",
"Running": "Running",
"Runs": "Runs",
"[email protected]": "[email protected]",
"Sample": "Sample",
"Save": "Save",
"Schedule": "Schedule",
"Scheduled": "Scheduled",
Expand Down Expand Up @@ -385,7 +391,6 @@
"There are no snippets for this type of connection.": "There are no snippets for this type of connection.",
"This action cannot be undone.": "This action cannot be undone.",
"This action will replace the current password of the workspace database.": "This action will replace the current password of the workspace database.",
"This dataset has no version. Upload a new version using your browser or the SDK to see it here.": "This dataset has no version. Upload a new version using your browser or the SDK to see it here.",
"This dataset is already linked to this workspace": "This dataset is already linked to this workspace",
"This email address is already taken. Please login instead.": "This email address is already taken. Please login instead.",
"This field is required": "This field is required",
Expand Down Expand Up @@ -455,6 +460,7 @@
"Waiting for messages...": "Waiting for messages...",
"We were not able to add this run to your favorites": "We were not able to add this run to your favorites",
"We were not able to generate a download url for this file": "We were not able to generate a download url for this file",
"We were not able to generate a sample for this file.": "We were not able to generate a sample for this file.",
"We were not able to remove it from your favorites": "We were not able to remove it from your favorites",
"We were unable to create a link for this output.": "We were unable to create a link for this output.",
"Webhook": "Webhook",
Expand Down
22 changes: 14 additions & 8 deletions public/locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"{{files}} is not a valid file___one": "{{files}} n'est pas un fichier valide",
"{{files}} is not a valid file___many": "{{files}} ne sont pas des fichiers valides",
"{{files}} is not a valid file___other": "{{files}} n'est pas un fichier valide",
"{{value}}d": "{{value}}d",
"{{value}}d": "{{value}}j",
"{{value}}h": "{{value}}h",
"{{value}}m": "{{value}}m",
"{{value}}s": "{{value}}s",
Expand All @@ -23,7 +23,7 @@
"Accept": "Accepter",
"Accepted": "Accepté",
"Access key ID": "ID de la clé d'accès",
"Access Management": "Gestion de l'accès",
"Access management": "Gestion de l'accès",
"Access Token": "Jeton d'accès",
"Account": "Compte",
"Account settings": "Paramètres du compte",
Expand All @@ -48,14 +48,14 @@
"An unexpected error ocurred.": "Une erreur inattendue s'est produite.",
"Anyone with the URL will be able to trigger this pipeline": "Quiconque ayant l'URL pourra déclencher cette pipeline",
"Archive": "Archives",
"Archive {{name}}": "Archive {{nom}}",
"Archive {{name}}": "Archive {{name}}",
"Are you sure to delete this directory ? It will delete all its content.": "Êtes-vous sûr de vouloir supprimer ce répertoire ? Cela supprimera tout son contenu.",
"Are you sure to delete this file ?": "Êtes-vous sûr de vouloir supprimer ce fichier ?",
"Are you sure to disable the two-factor authentication for your account?": "Êtes-vous sûr d'avoir désactivé l'authentification à deux facteurs pour votre compte ?",
"Are you sure to remove this run from your favorites?": "Êtes-vous sûr de supprimer cette course de vos favoris ?",
"Are you sure you want to decline this invitation?": "Êtes-vous sûr de vouloir décliner cette invitation ?",
"Are you sure you want to delete pipeline <1>{pipeline.name}</1> ?": "Êtes-vous sûr de vouloir supprimer le pipeline <1>{pipeline.name}</1>?",
"Are you sure you want to delete table \"{{name}}\"?": "Êtes-vous sûr de vouloir supprimer la table \"{{nom}}\" ?",
"Are you sure you want to delete table \"{{name}}\"?": "Êtes-vous sûr de vouloir supprimer la table \"{{name}}\" ?",
"Are you sure you want to delete the access to \"{{name}}\" for this workspace?": "Êtes-vous sûr de vouloir supprimer l'accès à \"{{name}}\" pour ce workspace ?",
"Are you sure you want to delete the connection \"{{name}}\"?": "Êtes-vous sûr de vouloir supprimer la connexion \"{{name}}\" ?",
"Are you sure you want to delete the dataset \"{{name}}\"? It will make it unavailable for all workspaces.": "Êtes-vous sûr de vouloir supprimer le jeu de données \"{{name}}\" ? Cela le rendra indisponible pour tous les workspaces.",
Expand All @@ -71,6 +71,7 @@
"Check your inbox and type the token you received to disable the two-factor authentication.": "Vérifiez votre boîte de réception et saisissez le jeton que vous avez reçu pour désactiver l'authentification à deux facteurs.",
"Close": "Fermer",
"Code": "Code",
"Columns": "Colonnes",
"Configuration": "Configuration",
"Configure & run": "Configurer et exécuter",
"Configure & Run": "Configurer et exécuter",
Expand All @@ -91,7 +92,7 @@
"Create a connection": "Créer une connexion",
"Create a dataset": "Créer un jeu de données",
"Create a folder": "Créer un dossier",
"Create a new link to '{{name}}'": "Créer un nouveau lien vers '{{nom}}'",
"Create a new link to '{{name}}'": "Créer un nouveau lien vers '{{name}}'",
"Create a new run of {{externalId}}": "Créer un nouveau cycle de {{externalId}}",
"Create a new workspace": "Créer un nouveau workspace",
"Create a workspace": "Créer un workspace",
Expand All @@ -106,6 +107,7 @@
"created by {{name}} on <4></4>": "créé par {{name}} le <4></4>",
"Creating ({{progress}}%)": "Création ({{progress}}%)",
"Credentials": "Titres de compétences",
"Current version": "Version actuelle",
"Currently disabled": "Actuellement désactivé",
"Currently enabled": "Actuellement activé",
"Custom": "Sur mesure",
Expand Down Expand Up @@ -178,11 +180,13 @@
"From date": "A partir de la date",
"From Notebook": "Du carnet de notes",
"From OpenHEXA CLI": "À partir de l'interface de commande OpenHEXA",
"General": "Général",
"General settings": "Paramètres généraux",
"Generate": "Générer",
"Generate a new URL": "Générer une nouvelle URL",
"Generate extract": "Générer un extrait",
"Generate new webhook URL": "Générer une nouvelle URL de webhook",
"Generating sample...": "Génération de l'échantillon...",
"Go back to login": "Retourner à la connexion",
"Go to login page": "Accéder à la page de connexion",
"Hide": "Cacher",
Expand Down Expand Up @@ -225,7 +229,7 @@
"Logs": "Journaux",
"Logs will appear here on run completion": "Les journaux apparaîtront ici à la fin de l'exécution",
"Manual": "Manuel",
"Manual run of {{label}} by {{user}}": "Exécution manuelle de {{label}} par {{utilisateur}}",
"Manual run of {{label}} by {{user}}": "Exécution manuelle de {{label}} par {{user}}",
"Mark this run as favorite": "Marquer cette course comme favorite",
"Marking this run as favorite will put it on top of the list of the runs. Please enter a label that better describes it.": "Marquer cette course comme favorite la placera en haut de la liste des courses. Veuillez saisir une étiquette qui la décrit mieux.",
"Maximum 40 characters": "Maximum 40 caractères",
Expand Down Expand Up @@ -300,13 +304,15 @@
"Restart all opened notebooks": "Redémarrer tous les notebooks ouverts",
"Revoke": "Révoquer",
"Role": "Rôle",
"Rows in sample": "Lignes dans l'échantillon",
"Run": "Exécuter",
"Run again": "Recommencer",
"Run of {{label}}": "Exécution de {{label}}",
"Run pipeline": "Lancer la pipeline",
"Running": "En cours d'exécution",
"Runs": "Exécutions",
"[email protected]": "[email protected]",
"Sample": "Échantillon",
"Save": "Sauvegarder",
"Schedule": "Calendrier",
"Scheduled": "Prévu",
Expand Down Expand Up @@ -387,7 +393,6 @@
"There are no snippets for this type of connection.": "Il n'y a pas de snippets pour ce type de connexion.",
"This action cannot be undone.": "Cette action ne peut être annulée.",
"This action will replace the current password of the workspace database.": "Cette action remplacera le mot de passe actuel de la base de données du workspace.",
"This dataset has no version. Upload a new version using your browser or the SDK to see it here.": "Ce jeu de données n'a pas de version. Téléchargez une nouvelle version en utilisant votre navigateur ou le SDK pour la voir ici.",
"This dataset is already linked to this workspace": "Ce jeu de données est déjà lié à ce workspace",
"This email address is already taken. Please login instead.": "Cette adresse e-mail est déjà prise. Veuillez vous connecter à la place.",
"This field is required": "Ce champ est obligatoire",
Expand Down Expand Up @@ -457,6 +462,7 @@
"Waiting for messages...": "En attente de messages...",
"We were not able to add this run to your favorites": "Nous n'avons pas pu ajouter cette course à vos favoris.",
"We were not able to generate a download url for this file": "Nous n'avons pas été en mesure de générer un lien de téléchargement pour ce fichier.",
"We were not able to generate a sample for this file.": "Nous n'avons pas pu générer un échantillon pour ce fichier.",
"We were not able to remove it from your favorites": "Nous n'avons pas pu le supprimer de vos favoris.",
"We were unable to create a link for this output.": "Nous n'avons pas pu créer de lien pour cette sortie.",
"Webhook": "Webhook",
Expand Down Expand Up @@ -486,4 +492,4 @@
"You're about to remove {{name}} from this workspace.": "Vous êtes sur le point de supprimer {{name}} de ce workspace.",
"Your account": "Votre compte",
"Your workspaces": "Vos workspaces"
}
}
111 changes: 101 additions & 10 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,25 @@ type CreateMembershipResult {
errors: [CreateMembershipError!]!
}

"""Errors that can occur when creating an attribute."""
enum CreateMetadataAttributeError {
PERMISSION_DENIED
TARGET_NOT_FOUND
DUPLICATE_KEY
}

"""Input to add a custom attribute, empty field for value is accepted"""
input CreateMetadataAttributeInput {
targetId: OpaqueID!
key: String!
value: JSON
}

type CreateMetadataAttributeResult {
success: Boolean!
errors: [CreateMetadataAttributeError!]!
}

"""Represents the input for creating a pipeline."""
input CreatePipelineInput {
code: String!
Expand Down Expand Up @@ -927,7 +946,7 @@ type DatabaseTablePage {
"""
Dataset is a collection of files that are related to each other and are versioned.
"""
type Dataset {
type Dataset implements MetadataObject {
id: ID!
slug: String!
name: String!
Expand All @@ -941,12 +960,15 @@ type Dataset {
version(id: ID!): DatasetVersion
latestVersion: DatasetVersion
links(page: Int = 1, perPage: Int = 15): DatasetLinkPage!
attributes: [MetadataAttribute!]!
targetId: OpaqueID!
}

"""Metadata for dataset file"""
type DatasetFileMetadata {
sample: JSON!
status: FileMetadataStatus!
"""File sample for dataset file"""
type DatasetFileSample {
sample: JSON
status: FileSampleStatus!
statusReason: String
}

"""A link of a dataset with a workspace."""
Expand Down Expand Up @@ -1000,7 +1022,7 @@ type DatasetPermissions {
"""
A version of a dataset. A version is a snapshot of the dataset at a point in time.
"""
type DatasetVersion {
type DatasetVersion implements MetadataObject {
id: ID!
name: String!
description: String
Expand All @@ -1010,17 +1032,24 @@ type DatasetVersion {
permissions: DatasetVersionPermissions!
fileByName(name: String!): DatasetVersionFile
files(page: Int = 1, perPage: Int = 15): DatasetVersionFilePage!
attributes: [MetadataAttribute!]!
targetId: OpaqueID!
}

"""A file in a dataset version."""
type DatasetVersionFile {
type DatasetVersionFile implements MetadataObject {
id: ID!
uri: String!
filename: String!
createdAt: DateTime!
createdBy: User
contentType: String!
fileMetadata: DatasetFileMetadata
size: BigInt!
fileSample: DatasetFileSample
properties: JSON
attributes: [MetadataAttribute!]!
targetId: OpaqueID!
downloadUrl(attachment: Boolean): String
}

"""A page of dataset version files."""
Expand Down Expand Up @@ -1250,6 +1279,24 @@ type DeleteMembershipResult {
errors: [DeleteMembershipError!]!
}

"""Errors that can occur when deleting an attribute."""
enum DeleteMetadataAttributeError {
PERMISSION_DENIED
TARGET_NOT_FOUND
METADATA_ATTRIBUTE_NOT_FOUND
}

"""Input to delete custom attribute"""
input DeleteMetadataAttributeInput {
targetId: OpaqueID!
key: String!
}

type DeleteMetadataAttributeResult {
success: Boolean!
errors: [DeleteMetadataAttributeError!]!
}

"""Represents the input for deleting a pipeline."""
input DeletePipelineInput {
id: UUID!
Expand Down Expand Up @@ -1439,6 +1486,24 @@ type DisableTwoFactorResult {
errors: [DisableTwoFactorError!]
}

"""Errors that can occur when editing an attribute."""
enum EditMetadataAttributeError {
PERMISSION_DENIED
TARGET_NOT_FOUND
}

"""Input to edit a custom attribute, empty field for value is accepted"""
input EditMetadataAttributeInput {
targetId: OpaqueID!
key: String!
value: JSON
}

type EditMetadataAttributeResult {
success: Boolean!
errors: [EditMetadataAttributeError!]!
}

"""
The EnableTwoFactorError enum represents the possible errors that can occur during the enableTwoFactor mutation.
"""
Expand Down Expand Up @@ -1472,8 +1537,8 @@ type FeatureFlag {
config: JSON!
}

"""Statuses that can occur when generating file metadata"""
enum FileMetadataStatus {
"""Statuses that can occur when generating file sample"""
enum FileSampleStatus {
PROCESSING
FAILED
FINISHED
Expand Down Expand Up @@ -1827,6 +1892,20 @@ enum MessagePriority {
CRITICAL
}

"""Generic metadata attribute"""
type MetadataAttribute {
id: UUID!
key: String!
value: JSON
system: Boolean!
}

"""Interface for type implementing metadata"""
interface MetadataObject {
targetId: OpaqueID!
attributes: [MetadataAttribute!]!
}

scalar MovingSpeeds

type Mutation {
Expand Down Expand Up @@ -1950,6 +2029,15 @@ type Mutation {
updateConnection(input: UpdateConnectionInput!): UpdateConnectionResult!
deleteConnection(input: DeleteConnectionInput!): DeleteConnectionResult!

"""Add a custom metadata attribute to an object instance"""
addMetadataAttribute(input: CreateMetadataAttributeInput!): CreateMetadataAttributeResult!

"""Delete an metadata attribute from an object instance"""
deleteMetadataAttribute(input: DeleteMetadataAttributeInput!): DeleteMetadataAttributeResult!

"""Edit metadata attribute for an object instance"""
editMetadataAttribute(input: EditMetadataAttributeInput!): EditMetadataAttributeResult!

"""Generates a new password for a database."""
generateNewDatabasePassword(input: GenerateNewDatabasePasswordInput!): GenerateNewDatabasePasswordResult!

Expand Down Expand Up @@ -2005,6 +2093,8 @@ type NotebookServer {
ready: Boolean!
}

scalar OpaqueID

"""The direction in which to order a list of items."""
enum OrderByDirection {
ASC
Expand Down Expand Up @@ -2454,6 +2544,7 @@ type Query {
databaseTable(id: String!): DatabaseTable
connection(id: UUID!): Connection
connectionBySlug(workspaceSlug: String!, connectionSlug: String!): Connection
metadataAttributes(targetId: OpaqueID!): [MetadataAttribute]!

"""Retrieves the configuration of the system."""
config: Config!
Expand Down
Loading

0 comments on commit c827924

Please sign in to comment.