@@ -89,7 +92,8 @@ export default {
progress() {
const { completed_tasks: completedTasks, total_tasks: totalTasks } = this.params;
- if (totalTasks === 0) return 0;
+ if (totalTasks === 0) return 3;
+ if (completedTasks === 0) return 3;
return (completedTasks / totalTasks) * 100;
},
diff --git a/app/javascript/vue/experiments/renderers/completed_tasks.vue b/app/javascript/vue/experiments/renderers/completed_tasks.vue
index c44859e205..bc63741a9f 100644
--- a/app/javascript/vue/experiments/renderers/completed_tasks.vue
+++ b/app/javascript/vue/experiments/renderers/completed_tasks.vue
@@ -33,7 +33,8 @@ export default {
progress() {
const { completed_tasks: completedTasks, total_tasks: totalTasks } = this.params.data;
- if (totalTasks === 0) return 0;
+ if (totalTasks === 0) return 3;
+ if (completedTasks === 0) return 3;
return (completedTasks / totalTasks) * 100;
}
diff --git a/app/javascript/vue/global_search/container.vue b/app/javascript/vue/global_search/container.vue
new file mode 100644
index 0000000000..8d99c680a2
--- /dev/null
+++ b/app/javascript/vue/global_search/container.vue
@@ -0,0 +1,373 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/filters.vue b/app/javascript/vue/global_search/filters.vue
new file mode 100644
index 0000000000..bec1db43cc
--- /dev/null
+++ b/app/javascript/vue/global_search/filters.vue
@@ -0,0 +1,256 @@
+
+
+
+
{{ i18n.t('search.filters.by_type') }}
+
+
+
+
+
+
{{ i18n.t('search.filters.by_created_date') }}
+
{this.createdAt = v}"
+ e2eValue="globalSearch-filters-createdDate"
+ >
+
{{ i18n.t('search.filters.by_updated_date') }}
+
{this.updatedAt = v}"
+ e2eValue="globalSearch-filters-updatedDate"
+ >
+
+ {{ i18n.t('search.filters.by_team') }}
+
+
+
+ {{ i18n.t('search.filters.by_user') }}
+
+
+
+
+
+
+
+
+ {{ i18n.t('search.filters.include_archived') }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/filters/date.vue b/app/javascript/vue/global_search/filters/date.vue
new file mode 100644
index 0000000000..523ef2f24d
--- /dev/null
+++ b/app/javascript/vue/global_search/filters/date.vue
@@ -0,0 +1,160 @@
+
+
+
{selectedOption = v}" />
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/filters_modal.vue b/app/javascript/vue/global_search/filters_modal.vue
new file mode 100644
index 0000000000..1391486ffc
--- /dev/null
+++ b/app/javascript/vue/global_search/filters_modal.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/assets.vue b/app/javascript/vue/global_search/groups/assets.vue
new file mode 100644
index 0000000000..0b1b2ea3a6
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/assets.vue
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.files') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/experiments.vue b/app/javascript/vue/global_search/groups/experiments.vue
new file mode 100644
index 0000000000..823b251986
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/experiments.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.experiments') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/folders.vue b/app/javascript/vue/global_search/groups/folders.vue
new file mode 100644
index 0000000000..748cb40b83
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/folders.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.folders') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/helpers/cell_template.vue b/app/javascript/vue/global_search/groups/helpers/cell_template.vue
new file mode 100644
index 0000000000..2d8fdb3fde
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/helpers/cell_template.vue
@@ -0,0 +1,33 @@
+
+
+
+ {{ label }}:
+
+
+
+
+
+
![]()
+
{{ value }}
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/helpers/link_template.vue b/app/javascript/vue/global_search/groups/helpers/link_template.vue
new file mode 100644
index 0000000000..2898fe33b2
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/helpers/link_template.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/helpers/list_end.vue b/app/javascript/vue/global_search/groups/helpers/list_end.vue
new file mode 100644
index 0000000000..262d9c06b6
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/helpers/list_end.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+ {{ i18n.t('search.index.reached_end') }}
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/helpers/no_search_result.vue b/app/javascript/vue/global_search/groups/helpers/no_search_result.vue
new file mode 100644
index 0000000000..0ff6115720
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/helpers/no_search_result.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.no_results_text') }}
+
+
+ {{ i18n.t('search.index.adjust_search_text') }}
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/helpers/sort_flyout.vue b/app/javascript/vue/global_search/groups/helpers/sort_flyout.vue
new file mode 100644
index 0000000000..8e558fc1f4
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/helpers/sort_flyout.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/helpers/table_header.vue b/app/javascript/vue/global_search/groups/helpers/table_header.vue
new file mode 100644
index 0000000000..03f4930f81
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/helpers/table_header.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/label_templates.vue b/app/javascript/vue/global_search/groups/label_templates.vue
new file mode 100644
index 0000000000..66b1da150d
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/label_templates.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.label_templates') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/my_module_protocols.vue b/app/javascript/vue/global_search/groups/my_module_protocols.vue
new file mode 100644
index 0000000000..f91f4aee01
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/my_module_protocols.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.task_protocols') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/my_modules.vue b/app/javascript/vue/global_search/groups/my_modules.vue
new file mode 100644
index 0000000000..ca1bc7c62a
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/my_modules.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.tasks') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/projects.vue b/app/javascript/vue/global_search/groups/projects.vue
new file mode 100644
index 0000000000..9d89bc2221
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/projects.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.projects') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/protocols.vue b/app/javascript/vue/global_search/groups/protocols.vue
new file mode 100644
index 0000000000..698626e31e
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/protocols.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.protocol_templates') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/reports.vue b/app/javascript/vue/global_search/groups/reports.vue
new file mode 100644
index 0000000000..a81991881b
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/reports.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.reports') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/repository_rows.vue b/app/javascript/vue/global_search/groups/repository_rows.vue
new file mode 100644
index 0000000000..50e4a7dfa2
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/repository_rows.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.inventory_items') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/results.vue b/app/javascript/vue/global_search/groups/results.vue
new file mode 100644
index 0000000000..7d26ec314b
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/results.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ {{ i18n.t('search.index.task_results') }}
+ [{{ total }}]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/global_search/groups/search_mixin.js b/app/javascript/vue/global_search/groups/search_mixin.js
new file mode 100644
index 0000000000..714a414e3a
--- /dev/null
+++ b/app/javascript/vue/global_search/groups/search_mixin.js
@@ -0,0 +1,153 @@
+import axios from '../../../packs/custom_axios.js';
+import StringWithEllipsis from '../../shared/string_with_ellipsis.vue';
+import SortFlyout from './helpers/sort_flyout.vue';
+import Loader from '../loader.vue';
+import ListEnd from './helpers/list_end.vue';
+import NoSearchResult from './helpers/no_search_result.vue';
+import CellTemplate from './helpers/cell_template.vue';
+import LinkTemplate from './helpers/link_template.vue';
+import TableHeader from './helpers/table_header.vue';
+/* global GLOBAL_CONSTANTS I18n */
+
+export default {
+ props: {
+ searchUrl: String,
+ query: String,
+ selected: Boolean,
+ filters: Object
+ },
+ components: {
+ StringWithEllipsis,
+ SortFlyout,
+ Loader,
+ NoSearchResult,
+ ListEnd,
+ CellTemplate,
+ LinkTemplate,
+ TableHeader
+ },
+ data() {
+ return {
+ sort: 'created_desc',
+ results: [],
+ total: 0,
+ loading: false,
+ page: 1,
+ disabled: false,
+ fullDataLoaded: false,
+ };
+ },
+ watch: {
+ filters() {
+ this.reloadData();
+ },
+ selected() {
+ if (this.selected && !this.fullDataLoaded) {
+ this.reloadData();
+ }
+ },
+ query() {
+ this.reloadData();
+ }
+ },
+ mounted() {
+ this.loadData();
+ window.addEventListener('scroll', this.handleScroll);
+ },
+ unmounted() {
+ window.removeEventListener('scroll', this.handleScroll);
+ },
+ computed: {
+ preparedResults() {
+ if (this.selected) {
+ return this.results;
+ }
+ return this.results.slice(0, 4);
+ },
+ viewAll() {
+ return !this.selected && this.total > GLOBAL_CONSTANTS.GLOBAL_SEARCH_PREVIEW_LIMIT;
+ },
+ loaderRows() {
+ return !this.selected ? 4 : 20;
+ },
+ reachedEnd() {
+ return !this.page && this.selected;
+ },
+ showNoSearchResult() {
+ return this.selected && !this.loading && !this.results.length;
+ }
+ },
+ methods: {
+ labelName(object) {
+ if (!object) return '';
+
+ if (!object.archived) return object.name;
+
+ return `${I18n.t('labels.archived')} ${object.name}`;
+ },
+ handleScroll() {
+ if (this.loading || !this.selected) return;
+
+ this.$nextTick(() => {
+ if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 50) {
+ if (this.results.length < this.total) {
+ this.loadData();
+ }
+ }
+ });
+ },
+ changeSort(sort) {
+ this.sort = sort;
+ this.results = [];
+ this.page = 1;
+ this.loadData();
+ },
+ reloadData() {
+ if (this.query.length > 1) {
+ this.results = [];
+ this.page = 1;
+ this.total = 0;
+ this.fullDataLoaded = false;
+ this.loadData();
+ }
+ },
+ loadData() {
+ if (this.query.length < 2) return;
+
+ if (this.loading && this.page && !(this.selected && !this.fullDataLoaded)) return;
+
+ const fullView = this.selected;
+ const currentPage = this.page;
+ this.loading = true;
+ axios.get(this.searchUrl, {
+ params: {
+ q: this.query,
+ sort: this.sort,
+ filters: this.filters,
+ group: this.group,
+ preview: !fullView,
+ page: currentPage
+ }
+ })
+ .then((response) => {
+ if (this.selected) this.fullDataLoaded = true;
+
+ if (this.selected === fullView && this.page === currentPage) {
+ this.results = this.results.concat(response.data.data);
+ this.total = response.data.meta.total;
+ this.disabled = response.data.meta.disabled;
+ this.loading = false;
+ this.page = response.data.meta.next_page;
+
+ this.handleScroll();
+ }
+ })
+ .finally(() => {
+ if (this.selected === fullView) {
+ this.loading = false;
+ this.$emit('updated');
+ }
+ });
+ }
+ }
+};
diff --git a/app/javascript/vue/global_search/loader.vue b/app/javascript/vue/global_search/loader.vue
new file mode 100644
index 0000000000..a11f038d67
--- /dev/null
+++ b/app/javascript/vue/global_search/loader.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
diff --git a/app/javascript/vue/my_modules/list.vue b/app/javascript/vue/my_modules/list.vue
index 8d6c0bf9b4..1c514cd095 100644
--- a/app/javascript/vue/my_modules/list.vue
+++ b/app/javascript/vue/my_modules/list.vue
@@ -274,6 +274,7 @@ export default {
this.reloadingTable = true;
this.editModalObject = null;
this.moveModalObject = null;
+ this.updateNavigator(true);
},
updateNavigator(withExpanedChildren = false) {
window.navigatorContainer.reloadNavigator(withExpanedChildren);
@@ -302,12 +303,14 @@ export default {
edit(_e, rows) {
[this.editModalObject] = rows;
},
- move(_e, rows) {
+ move(event, rows) {
[this.moveModalObject] = rows;
+ this.moveModalObject.movePath = event.path;
},
duplicate(event, rows) {
axios.post(event.path, { my_module_ids: rows.map((row) => row.id) }).then(() => {
this.reloadingTable = true;
+ this.updateNavigator(true);
}).catch((error) => {
HelperModule.flashAlertMsg(error.response.data.error, 'danger');
});
diff --git a/app/javascript/vue/my_modules/modals/move.vue b/app/javascript/vue/my_modules/modals/move.vue
index d9d408f196..452960f13d 100644
--- a/app/javascript/vue/my_modules/modals/move.vue
+++ b/app/javascript/vue/my_modules/modals/move.vue
@@ -52,9 +52,8 @@ export default {
},
methods: {
submit() {
- axios.post(this.my_module.urls.move, {
- to_experiment_id: this.targetExperiment,
- my_module_ids: [this.my_module.id]
+ axios.post(this.my_module.movePath, {
+ to_experiment_id: this.targetExperiment
}).then((response) => {
this.$emit('move');
HelperModule.flashAlertMsg(response.data.message, 'success');
diff --git a/app/javascript/vue/my_modules/modals/new.vue b/app/javascript/vue/my_modules/modals/new.vue
index fdc28a2e43..b362698b08 100644
--- a/app/javascript/vue/my_modules/modals/new.vue
+++ b/app/javascript/vue/my_modules/modals/new.vue
@@ -105,7 +105,7 @@ export default {
},
computed: {
validName() {
- return this.name.length > 0;
+ return this.name.length > 1;
},
formattedTags() {
return this.allTags.map((tag) => (
diff --git a/app/javascript/vue/my_modules/modals/tags.vue b/app/javascript/vue/my_modules/modals/tags.vue
index e1710acec2..05515daf8f 100644
--- a/app/javascript/vue/my_modules/modals/tags.vue
+++ b/app/javascript/vue/my_modules/modals/tags.vue
@@ -20,7 +20,7 @@
{{ i18n.t("experiments.canvas.modal_manage_tags.project_tags", { project: this.projectName }) }}
-
+
@@ -80,13 +77,20 @@
{{ i18n.t('experiments.canvas.modal_manage_tags.create_new') }}
-
+
a
@@ -104,11 +108,13 @@
+
-
-
-
{{ params.data.tags[0].name }}
-
-
+
-
+
+
{{ params.data.tags[0].name }}
+
+
+{{ params.data.tags.length - 1 }}
diff --git a/app/javascript/vue/navigation/quick_search.vue b/app/javascript/vue/navigation/quick_search.vue
new file mode 100644
index 0000000000..f293f7362f
--- /dev/null
+++ b/app/javascript/vue/navigation/quick_search.vue
@@ -0,0 +1,369 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(A)
+
+
+ {{ result.attributes.updated_at }}
+
+
+
+
+ /
+ {{ breadcrumb }}
+
+
+
+
+
+
+
+
{{ i18n.t('search.quick_search.empty_title', {team: currentTeamName}) }}
+
+ {{ i18n.t('search.quick_search.empty_description', {query: searchQuery}) }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/vue/navigation/top_menu.vue b/app/javascript/vue/navigation/top_menu.vue
index 108f1af76d..77d92fcde3 100644
--- a/app/javascript/vue/navigation/top_menu.vue
+++ b/app/javascript/vue/navigation/top_menu.vue
@@ -1,9 +1,5 @@