diff --git a/ee/app/assets/javascripts/workspaces/common/components/monitor_terminating_workspace.vue b/ee/app/assets/javascripts/workspaces/common/components/monitor_terminating_workspace.vue new file mode 100644 index 0000000000000000000000000000000000000000..5be75f7a28db4d6f938e699dd156f2a9da60ba62 --- /dev/null +++ b/ee/app/assets/javascripts/workspaces/common/components/monitor_terminating_workspace.vue @@ -0,0 +1,38 @@ + diff --git a/ee/app/assets/javascripts/workspaces/common/components/workspace_tab.vue b/ee/app/assets/javascripts/workspaces/common/components/workspace_tab.vue new file mode 100644 index 0000000000000000000000000000000000000000..bfbab4580c62842faebb714c739764621cf7fa9c --- /dev/null +++ b/ee/app/assets/javascripts/workspaces/common/components/workspace_tab.vue @@ -0,0 +1,128 @@ + + diff --git a/ee/app/assets/javascripts/workspaces/common/components/workspaces_list/base_workspaces_list.vue b/ee/app/assets/javascripts/workspaces/common/components/workspaces_list/base_workspaces_list.vue new file mode 100644 index 0000000000000000000000000000000000000000..f63c0406778ae4e99779b7d27f9679090f8e3a39 --- /dev/null +++ b/ee/app/assets/javascripts/workspaces/common/components/workspaces_list/base_workspaces_list.vue @@ -0,0 +1,78 @@ + + diff --git a/ee/app/assets/javascripts/workspaces/common/components/workspaces_list/workspaces_table.vue b/ee/app/assets/javascripts/workspaces/common/components/workspaces_list/workspaces_table.vue index b0a594f8ad0d4e5a96aee303acbb0276f0c6a78f..57cc8882aaf0114c048bb5ac38ad703c0a9f96b4 100644 --- a/ee/app/assets/javascripts/workspaces/common/components/workspaces_list/workspaces_table.vue +++ b/ee/app/assets/javascripts/workspaces/common/components/workspaces_list/workspaces_table.vue @@ -18,6 +18,51 @@ export const i18n = { }, }; +const tableFields = [ + { + key: 'status', + /* + * The status and action columns in this table + * do not have a label in the table header. We + * use this zero-width unicode character because + * using an empty string breaks the table alignment + * in mobile views. + */ + label: '\u200b', + thClass: 'gl-w-2/20', + }, + { + key: 'name', + label: i18n.tableColumnHeaders.name, + thClass: 'gl-w-4/20', + }, + { + key: 'created', + label: i18n.tableColumnHeaders.created, + thClass: 'gl-w-2/20', + }, + { + key: 'terminates', + label: i18n.tableColumnHeaders.terminates, + thClass: 'gl-w-2/20', + }, + { + key: 'devfile', + label: i18n.tableColumnHeaders.devfile, + thClass: 'gl-w-3/20', + }, + { + key: 'preview', + label: i18n.tableColumnHeaders.preview, + thClass: 'gl-w-4/20', + }, + { + key: 'actions', + label: '\u200b', + thClass: 'gl-w-3/20', + }, +]; + export default { components: { GlTableLite, @@ -35,20 +80,33 @@ export default { type: Array, required: true, }, - }, - data() { - return { - transitionProps: { - name: 'fade', - delay: 200, - duration: 300, - }, - }; + tabsMode: { + type: Boolean, + required: false, + default: false, + }, + transitionProps: { + type: Object, + required: false, + default: undefined, + }, }, computed: { sortedWorkspaces() { return [...this.workspaces].sort(this.sortWorkspacesByTerminatedState); }, + tableFields() { + return this.tabsMode + ? tableFields.map((tableField) => ({ + ...tableField, + // eslint-disable-next-line @gitlab/require-i18n-strings + thClass: `${tableField.thClass} gl-border-t-0!`, + })) + : tableFields; + }, + tableClasses() { + return this.tabsMode ? 'gl-mb-5' : 'gl-my-5'; + }, }, methods: { devfileRefAndPathDisplay(ref, path) { @@ -84,50 +142,6 @@ export default { return workspace.actualState === WORKSPACE_STATES.terminated; }, }, - fields: [ - { - key: 'status', - /* - * The status and action columns in this table - * do not have a label in the table header. We - * use this zero-width unicode character because - * using an empty string breaks the table alignment - * in mobile views. - */ - label: '\u200b', - thClass: 'gl-w-1/20', - }, - { - key: 'name', - label: i18n.tableColumnHeaders.name, - thClass: 'gl-w-4/20', - }, - { - key: 'created', - label: i18n.tableColumnHeaders.created, - thClass: 'gl-w-2/20', - }, - { - key: 'terminates', - label: i18n.tableColumnHeaders.terminates, - thClass: 'gl-w-2/20', - }, - { - key: 'devfile', - label: i18n.tableColumnHeaders.devfile, - thClass: 'gl-w-4/20', - }, - { - key: 'preview', - label: i18n.tableColumnHeaders.preview, - thClass: 'gl-w-4/20', - }, - { - key: 'actions', - label: '\u200b', - thClass: 'gl-w-4/20', - }, - ], i18n, WORKSPACE_STATES, }; @@ -139,9 +153,11 @@ export default { >