Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e140b08
added GET "/datasets/compatible"
JonnyTran Aug 27, 2025
9f45bc1
Add GetImportCompatibleDatasets use case and integrate into dataset c…
JonnyTran Aug 27, 2025
59b8dcc
Enhance dataset creation workflow with update functionality and new d…
JonnyTran Aug 28, 2025
346487c
latest
JonnyTran Aug 28, 2025
eafa6f6
Implement dataset update functionality and improve error handling.
JonnyTran Aug 28, 2025
99ad0bd
refactor
JonnyTran Aug 28, 2025
9308c88
Refactor dataset creation components and introduce DatasetCreateDialog.
JonnyTran Aug 28, 2025
41eaf77
refactoring
JonnyTran Aug 28, 2025
e70e9b4
Enhance error handling in AxiosErrorHandler and DocumentRepository.
JonnyTran Aug 28, 2025
14fdc0a
Refactor dataset configuration components to support TypeScript.
JonnyTran Aug 28, 2025
b397774
fix extralit/unit tests
JonnyTran Aug 28, 2025
aaf8b26
fix tests
JonnyTran Aug 28, 2025
8b87c54
fix tests
JonnyTran Aug 28, 2025
d999ad5
latest
JonnyTran Aug 28, 2025
8fa7f76
fix tests
JonnyTran Aug 28, 2025
76b6898
fix DatasetMapping
JonnyTran Aug 28, 2025
7c41f82
Refactor DatasetCreation and ImportHistoryDatasetBuilder to replace e…
JonnyTran Aug 28, 2025
8273d76
test fixes
JonnyTran Aug 29, 2025
e9bdb5f
fix tests
JonnyTran Aug 29, 2025
3ecb423
fix tests
JonnyTran Aug 29, 2025
15d2aa1
Revert "fix tests"
JonnyTran Aug 29, 2025
a09e8d1
fix tests
JonnyTran Aug 29, 2025
1c215ad
fix tests
JonnyTran Aug 29, 2025
d70caae
Refactor document handling in WorkspacesAPI and update related tests
JonnyTran Aug 29, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/extralit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ jobs:
uv cache prune --ci
- name: Wait for extralit-server to start
run: |
while ! curl -XGET http://localhost:6900/api/_status; do sleep 5; done
while ! curl -s -o /dev/null -XGET http://localhost:6900/api/_status; do sleep 10; done

# Create a directory for local storage that the container can access
mkdir -p /tmp/extralit-files
chmod -R 777 /tmp/extralit-files
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repos:
hooks:
- id: frontend-lint
name: "Lint and fix extralit-frontend files"
entry: bash -c 'cd extralit-frontend && npx eslint --fix "${@#extralit-frontend/}" || true'
entry: bash -c 'cd extralit-frontend && npx eslint --fix --cache "$@" || true'
language: system
files: '^extralit-frontend/.*\.(js|ts|vue)$'
pass_filenames: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ export const useDocumentViewModel = (props: { record: any }) => {

await getDocument.setDocument(params);
} catch (e) {
const identifier = metadata?.pmid || metadata?.doi || metadata?.doc_id || metadata?.reference || "unknown";
console.error(`Error fetching document with identifier "${identifier}":`, e);
notification.notify({
message: `Error fetching document with identifier "${identifier}"`,
type: "danger",
});
clearDocument();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@
</template>
<template #right>
<div class="dataset-config__configuration">
<DatasetConfigurationForm :dataset="dataset" @change-subset="$emit('change-subset', $event)" />
<DatasetConfigurationForm
:dataset="dataset"
:data-source="dataSource"
@change-subset="$emit('change-subset', $event)"
/>
</div>
</template>
</VerticalResizable>
Expand All @@ -88,7 +92,7 @@
</div>
</template>

<script>
<script lang="ts">
import "assets/icons/document";
import { useDatasetConfiguration } from "./useDatasetConfiguration";
import { ImportHistoryDetails } from "~/v1/domain/entities/import/ImportHistoryDetails";
Expand All @@ -102,7 +106,7 @@ export default {
dataSource: {
type: String,
default: "hub",
validator: (value) => ["hub", "import"].includes(value),
validator: (value: string) => ["hub", "import"].includes(value),
},
importData: {
type: [ImportHistoryDetails, Object],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
:options="['text', 'label_selection', 'multi_label_selection', 'rating', 'ranking', 'span']"
@add-question="addQuestion($event)" />
</div>
<div class="config-form__col__content --questions">
<div v-if="!isUpdateWorkflow" class="config-form__col__content --questions">
<draggable v-if="dataset.selectedSubset.questions.length" class="config-form__draggable-area"
ghost-class="config-form__ghost" :list="dataset.selectedSubset.questions" :group="{ name: 'questions' }"
:disabled="isFocused">
Expand All @@ -59,11 +59,33 @@
</div>
</div>
<div class="config-form__button-area">
<BaseButton class="primary" @click.prevent="visibleDatasetCreationDialog = !visibleDatasetCreationDialog">{{
$t("datasetCreation.button")
}}</BaseButton>
<DatasetConfigurationDialog v-if="visibleDatasetCreationDialog" :dataset="dataset" :is-loading="isLoading"
@close-dialog="visibleDatasetCreationDialog = false" @create-dataset="createDataset" />
<BaseButton
class="primary"
@click.prevent="openCreateDatasetDialog"
v-text="$t('datasetCreation.createButton')"
/>
<BaseButton
v-if="dataSource === 'import'"
class="secondary"
@click.prevent="openUpdateDatasetDialog"
v-text="$t('datasetCreation.updateButton')"
/>

<!-- Create Dataset Dialog -->
<DatasetCreateDialog
v-if="visibleDatasetCreationDialog"
:dataset="dataset"
:is-loading="isLoading"
@close-dialog="visibleDatasetCreationDialog = false"
@create-dataset="createDataset" />

<!-- Update Dataset Dialog -->
<DatasetUpdateDialog
v-if="visibleDatasetUpdateDialog"
:dataset="dataset"
:is-loading="isLoading"
@close-dialog="closeUpdateDialog"
@update-dataset="updateDataset" />
</div>
</div>
</div>
Expand All @@ -80,12 +102,19 @@ export default {
type: Object,
required: true,
},
dataSource: {
type: String,
default: "hub",
validator: (value: string) => ["hub", "import"].includes(value),
},
},
data() {
return {
isFocused: false,
visibleDatasetCreationDialog: false,
visibleDatasetUpdateDialog: false,
selectedMetadataFields: [],
isUpdateWorkflow: false,
};
},
computed: {
Expand All @@ -105,11 +134,40 @@ export default {
// Fallback to field names from the dataset
return this.dataset.selectedSubset.fields.map((f: any) => f.name);
},
// Extract field schema information from the dataset for compatibility API
datasetFieldSchema() {
return this.dataset.selectedSubset.fields.map(field => ({
name: field.name,
type: field.originalType?.value || field.type?.value || 'string'
}));
},
// Get column names for compatibility checking
columnNames() {
return this.dataset.selectedSubset.fields.map(f => f.name);
},
},
methods: {
createDataset() {
this.create(this.dataset);
},
openCreateDatasetDialog() {
this.visibleDatasetCreationDialog = true;
},
openUpdateDatasetDialog() {
this.isUpdateWorkflow = true;
this.visibleDatasetUpdateDialog = true;
},
closeUpdateDialog() {
this.isUpdateWorkflow = false;
this.visibleDatasetUpdateDialog = false;
},
updateDataset(updateData) {
this.closeUpdateDialog();

// Use the source dataset from the dialog event, or fall back to this.dataset
const sourceDataset = updateData.source || this.dataset;
this.update(sourceDataset, updateData.targetDataset.id);
},
generateName(type: string, number: string | number): string {
const typeName = this.$t(`config.questionId.${type}`);
return `${typeName}_${parseInt(number as string) || 0}`;
Expand Down Expand Up @@ -268,6 +326,7 @@ export default {

&__button-area {
display: flex;
gap: 1rem;

.button {
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
</template>

<script>
<script lang="ts">
import "assets/icons/check";

export default {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<transition name="fade" appear>
<dialog class="dataset-config-dialog" v-click-outside="closeDialog">
<dialog v-click-outside="closeDialog" class="dataset-config-dialog">
<form class="dataset-config-dialog__content" @submit.prevent="createDataset">
<h1 class="dataset-config-dialog__title" v-text="$t('datasetCreation.createDataset')" />
<div class="dataset-config-dialog__row">
Expand All @@ -22,15 +22,15 @@
class="dataset-config-dialog__unique-workspace"
v-text="dataset.workspace.name"
/>
<DatasetConfigurationSelector v-else :options="workspaces" v-model="dataset.workspace" />
<DatasetConfigurationSelector v-else v-model="dataset.workspace" :options="workspaces" />
</div>

<div class="dataset-config-dialog__row" v-if="dataset.selectedSubset.splits?.length > 1">
<div v-if="dataset.selectedSubset.splits?.length > 1" class="dataset-config-dialog__row">
<label class="dataset-config-dialog__label" v-text="$t('datasetCreation.selectSplit')" />
<DatasetConfigurationSelector
v-model="dataset.selectedSubset.selectedSplit"
class="config-form__selector"
:options="dataset.selectedSubset.splits"
v-model="dataset.selectedSubset.selectedSplit"
/>
</div>
<p class="dataset-config-dialog__info" v-text="$t('datasetCreation.recordWarning')" />
Expand All @@ -39,14 +39,14 @@
:loading="isLoading"
type="submit"
class="dataset-config-dialog__button primary full"
>{{ $t("datasetCreation.button") }}</BaseButton
>{{ $t("datasetCreation.createButton") }}</BaseButton
>
<Validation v-if="!dataset.isValid" :validations="firstTranslatedValidation" />
</form>
</dialog>
</transition>
</template>
<script>
<script lang="ts">
import Validation from "../../annotation/settings/Validation.vue";
import { useDatasetConfigurationNameAndWorkspace } from "./useDatasetConfigurationNameAndWorkspace";

Expand All @@ -61,6 +61,11 @@ export default {
type: Boolean,
default: false,
},
dataSource: {
type: String,
default: "hub",
validator: (value: string) => ["hub", "import"].includes(value),
},
},
watch: {
firstWorkspace: {
Expand Down
Loading
Loading