diff --git a/client/openapi_to_schema.mjs b/client/openapi_to_schema.mjs index eb6e22a290cc..d85b349f096d 100644 --- a/client/openapi_to_schema.mjs +++ b/client/openapi_to_schema.mjs @@ -7,11 +7,15 @@ const inputFilePath = process.argv[2]; const localPath = new URL(inputFilePath, import.meta.url); openapiTS(localPath, { transform(schemaObject, metadata) { - if ( - "const" in schemaObject && - (typeof schemaObject.const === "string" || schemaObject.const instanceof String) - ) { - return `"${schemaObject.const}"`; + if ("const" in schemaObject) { + const constType = typeof schemaObject.const; + switch (constType) { + case "number": + case "boolean": + return `${schemaObject.const}`; + default: + return `"${schemaObject.const}"`; + } } }, }).then((output) => console.log(output)); diff --git a/client/src/api/index.ts b/client/src/api/index.ts index a32e076b84ff..75574ac0834b 100644 --- a/client/src/api/index.ts +++ b/client/src/api/index.ts @@ -89,6 +89,11 @@ export type DatasetSummary = components["schemas"]["HDASummary"]; */ export type DatasetDetails = components["schemas"]["HDADetailed"]; +/** + * Represents a HistoryDatasetAssociation that is inaccessible to the user. + */ +export type HDAInaccessible = components["schemas"]["HDAInaccessible"]; + /** * Contains storage (object store, quota, etc..) details for a dataset. */ @@ -97,7 +102,7 @@ export type DatasetStorageDetails = components["schemas"]["DatasetStorageDetails /** * Represents a HistoryDatasetAssociation with either summary or detailed information. */ -export type DatasetEntry = DatasetSummary | DatasetDetails; +export type DatasetEntry = DatasetSummary | DatasetDetails | HDAInaccessible; /** * Contains summary information about a DCE (DatasetCollectionElement). @@ -183,6 +188,10 @@ export function hasDetails(entry: DatasetEntry): entry is DatasetDetails { return "peek" in entry; } +export function isInaccessible(entry: DatasetEntry): entry is HDAInaccessible { + return "accessible" in entry && !entry.accessible; +} + /** * Contains dataset metadata information. */ diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index cb7b0dc21217..d22b21166646 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -5997,11 +5997,94 @@ export interface components { */ visible: boolean; }; + /** + * HDAInaccessible + * @description History Dataset Association information when the user can not access it. + */ + HDAInaccessible: { + /** + * Accessible + * @constant + */ + accessible: false; + /** Copied From Ldda Id */ + copied_from_ldda_id?: string | null; + /** + * Create Time + * @description The time and date this item was created. + */ + create_time: string | null; + /** + * Deleted + * @description Whether this item is marked as deleted. + */ + deleted: boolean; + /** + * HID + * @description The index position of this item in the History. + */ + hid: number; + /** + * History Content Type + * @description This is always `dataset` for datasets. + * @constant + */ + history_content_type: "dataset"; + /** + * History ID + * @example 0123456789ABCDEF + */ + history_id: string; + /** + * Id + * @example 0123456789ABCDEF + */ + id: string; + /** + * Name + * @description The name of the item. + */ + name: string | null; + /** + * State + * @description The current state of this dataset. + */ + state: components["schemas"]["DatasetState"]; + tags: components["schemas"]["TagCollection"]; + /** + * Type + * @description The type of this item. + */ + type: string; + /** + * Type - ID + * @description The type and the encoded ID of this item. Used for caching. + */ + type_id?: string | null; + /** + * Update Time + * @description The last time and date this item was updated. + */ + update_time: string | null; + /** + * URL + * @deprecated + * @description The relative URL to access this item. + */ + url: string; + /** + * Visible + * @description Whether this item is visible or hidden to the user by default. + */ + visible: boolean; + }; /** * HDAObject * @description History Dataset Association Object */ HDAObject: { + /** Accessible */ + accessible?: boolean | null; /** Copied From Ldda Id */ copied_from_ldda_id?: string | null; /** @@ -6924,6 +7007,7 @@ export interface components { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] )[]; @@ -6940,6 +7024,7 @@ export interface components { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] )[]; @@ -13530,6 +13615,7 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] )[]; @@ -13710,7 +13796,8 @@ export interface operations { "application/json": | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] - | components["schemas"]["HDASummary"]; + | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"]; }; }; /** @description Validation Error */ @@ -16460,12 +16547,14 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] | ( | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] )[]; @@ -17049,6 +17138,7 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"]; }; @@ -17100,6 +17190,7 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"]; }; @@ -17332,12 +17423,14 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] | ( | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] )[]; @@ -17388,6 +17481,7 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"]; }; @@ -17438,6 +17532,7 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"]; }; @@ -17669,6 +17764,7 @@ export interface operations { | components["schemas"]["HDACustom"] | components["schemas"]["HDADetailed"] | components["schemas"]["HDASummary"] + | components["schemas"]["HDAInaccessible"] | components["schemas"]["HDCADetailed"] | components["schemas"]["HDCASummary"] )[]; diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index e0d6acdb8178..cba8f0bdc4d3 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -91,7 +91,9 @@ const contentId = computed(() => { const contentCls = computed(() => { const status = contentState.value && contentState.value.status; - if (props.selected) { + if (props.item.accessible === false) { + return "alert-inaccessible"; + } else if (props.selected) { return "alert-info"; } else if (!status) { return `alert-success`; @@ -99,7 +101,6 @@ const contentCls = computed(() => { return `alert-${status}`; } }); - const contentState = computed(() => { return STATES[state.value] && STATES[state.value]; }); @@ -116,6 +117,9 @@ const state = computed(() => { if (props.isPlaceholder) { return "placeholder"; } + if (props.item.accessible === false) { + return "inaccessible"; + } if (props.item.populated_state === "failed") { return "failed_populated_state"; } @@ -135,7 +139,13 @@ const state = computed(() => { }); const dataState = computed(() => { - return state.value === "new_populated_state" ? "new" : state.value; + if (props.item.accessible === false) { + return "inaccessible"; + } else if (state.value === "new_populated_state") { + return "new"; + } else { + return state.value; + } }); const tags = computed(() => { @@ -334,7 +344,7 @@ function unexpandedClick(event: Event) { :data-state="dataState" tabindex="0" role="button" - draggable + :draggable="props.item.accessible === false ? false : true" @dragstart="onDragStart" @dragend="onDragEnd" @keydown="onKeyDown"> @@ -428,8 +438,9 @@ function unexpandedClick(event: Event) { +
You are not allowed to access this dataset
(), { const emit = defineEmits<{ (e: "toggleHighlights"): void; + (e: "edit"): void; }>(); const result = computed(() => datasetStore.getDataset(props.id)); @@ -40,7 +42,7 @@ function toggleHighlights() {