Skip to content
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ const selectTagMenu = ref(false);
const selectTagForRun = ref(null);
const prevSelectedRuns = ref([]);
const prevSelectedTagItems = ref([]);
const selectedRunIds = ref([]);
const selectedTagIds = ref([]);
const search = ref({
placeHolder: "Search for run names (e.g.: myrun*)...",
regexLabel: "Filter by wildcard pattern (e.g.: myrun*)",
Expand Down Expand Up @@ -313,6 +315,7 @@ async function initByUrl() {
if (_runs.length || _tags.length) {
let _selectedTags = [];
if (_tags.length) {
selectedTagIds.value = _tags;
_selectedTags = await getSelectedTagItems(_tags);

// Add runs related to tags.
Expand All @@ -322,6 +325,7 @@ async function initByUrl() {
_runs = [ ...new Set(_runs) ];
}

selectedRunIds.value = _runs;
const _selectedRuns = await getSelectedRunItems(_runs);
prevSelectedRuns.value = _selectedRuns;
prevSelectedTagItems.value = _selectedTags;
Expand Down Expand Up @@ -351,6 +355,8 @@ function applyTagSelection(selected) {
}

async function clear(updateUrl) {
selectedRunIds.value = [];
selectedTagIds.value = [];
await setSelectedItems([], [], updateUrl);
}

Expand All @@ -359,17 +365,27 @@ function selectRunTags(selectedItems) {
}

function getUrlState() {
const _runState = baseSelectOptionFilter.selectedItems.value.map(
let _runState = selectedRunIds.value;
const _newRunState = baseSelectOptionFilter.selectedItems.value.map(
item => baseSelectOptionFilter.encodeValue.value(item.id)
);

const _tagState = runFilter.selectedTagItems.value.map(item => item.id);
if (_newRunState.length) {
_runState = _newRunState;
}

let _tagState = selectedTagIds.value;
const _newTagState = runFilter.selectedTagItems.value.map(item => item.id);

if (_newTagState.length) {
_tagState = _newTagState;
}

return {
[id]: _runState.length ? _runState : undefined,
[runTagId.value]: _tagState.length ? _tagState : undefined
};
}
};

async function setSelectedItems(runItems, tagItems, updateUrl=true) {
baseSelectOptionFilter.selectedItems.value = runItems;
Expand Down
Loading