Skip to content

Commit

Permalink
Merge pull request #18313 from guerler/fix_data_dialog_filter
Browse files Browse the repository at this point in the history
[24.1] Filter data dialog entries by dataset state, only display `ok` state
  • Loading branch information
dannon authored Jun 5, 2024
2 parents c681c0c + 4d4f39b commit 849d93e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion client/src/components/DataDialog/DataDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface Record {
interface Props {
allowUpload?: boolean;
callback?: (results: Array<Record>) => void;
filterOkState?: boolean;
format?: string;
library?: boolean;
modalStatic?: boolean;
Expand All @@ -34,6 +35,7 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {
allowUpload: true,
callback: () => {},
filterOkState: false,
format: "download",
library: true,
modalStatic: false,
Expand Down Expand Up @@ -90,7 +92,11 @@ function formatRows() {
/** Returns the default url i.e. the url of the current history **/
function getHistoryUrl() {
return `${getAppRoot()}api/histories/${props.history}/contents?deleted=false`;
let queryString = "&q=deleted&qv=false";
if (props.filterOkState) {
queryString += "&q=state-eq&qv=ok";
}
return `${getAppRoot()}api/histories/${props.history}/contents?v=dev${queryString}`;
}
/** Called when the modal is hidden */
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/Panels/VisualizationPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ onMounted(() => {
<BAlert v-else v-localize variant="info" show> No matching visualization found. </BAlert>
</div>
<DataDialog
v-if="showDataDialog"
v-if="currentHistoryId && showDataDialog"
format=""
:history="currentHistoryId"
:filter-ok-state="true"
@onOk="createVisualization"
@onCancel="showDataDialog = false" />
</ActivityPanel>
Expand Down

0 comments on commit 849d93e

Please sign in to comment.