diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-04 00:10:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-04 00:10:03 +0000 |
commit | c9ebdf468d0ffc669b2ac9c388730d6c3f2741a2 (patch) | |
tree | fa63d665aae06ac1a9bbeffb1426b5173baabe4e /app | |
parent | 8e2f50b44d51768c38d300a2ba2f9208107933b2 (diff) | |
download | gitlab-ce-c9ebdf468d0ffc669b2ac9c388730d6c3f2741a2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
8 files changed, 152 insertions, 287 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue index 90be5b3e470..7213658bdf2 100644 --- a/app/assets/javascripts/notes/components/comment_form.vue +++ b/app/assets/javascripts/notes/components/comment_form.vue @@ -273,6 +273,13 @@ export default { this.toggleIssueState(); } }, + handleEnter() { + if (this.hasDrafts) { + this.handleSaveDraft(); + } else { + this.handleSave(); + } + }, toggleIssueState() { if (this.isIssue) { // We want to invoke the close/reopen logic in the issue header @@ -395,8 +402,8 @@ export default { :aria-label="$options.i18n.comment" :placeholder="$options.i18n.bodyPlaceholder" @keydown.up="editCurrentUserLastNote()" - @keydown.meta.enter="handleSave()" - @keydown.ctrl.enter="handleSave()" + @keydown.meta.enter="handleEnter()" + @keydown.ctrl.enter="handleEnter()" ></textarea> </template> </markdown-field> diff --git a/app/assets/javascripts/releases/components/app_index_apollo_client.vue b/app/assets/javascripts/releases/components/app_index_apollo_client.vue index b915ec9c98f..df2a3c76efc 100644 --- a/app/assets/javascripts/releases/components/app_index_apollo_client.vue +++ b/app/assets/javascripts/releases/components/app_index_apollo_client.vue @@ -4,13 +4,14 @@ import createFlash from '~/flash'; import { getParameterByName } from '~/lib/utils/common_utils'; import { scrollUp } from '~/lib/utils/scroll_utils'; import { __ } from '~/locale'; -import { PAGE_SIZE } from '~/releases/constants'; +import { PAGE_SIZE, RELEASED_AT_DESC } from '~/releases/constants'; import allReleasesQuery from '~/releases/graphql/queries/all_releases.query.graphql'; import { convertAllReleasesGraphQLResponse } from '~/releases/util'; import ReleaseBlock from './release_block.vue'; import ReleaseSkeletonLoader from './release_skeleton_loader.vue'; import ReleasesEmptyState from './releases_empty_state.vue'; import ReleasesPaginationApolloClient from './releases_pagination_apollo_client.vue'; +import ReleasesSortApolloClient from './releases_sort_apollo_client.vue'; export default { name: 'ReleasesIndexApolloClientApp', @@ -20,6 +21,7 @@ export default { ReleaseSkeletonLoader, ReleasesEmptyState, ReleasesPaginationApolloClient, + ReleasesSortApolloClient, }, inject: { projectPath: { @@ -56,6 +58,7 @@ export default { before: getParameterByName('before'), after: getParameterByName('after'), }, + sort: RELEASED_AT_DESC, }; }, computed: { @@ -76,6 +79,7 @@ export default { return { fullPath: this.projectPath, ...paginationParams, + sort: this.sort, }; }, isLoading() { @@ -124,6 +128,9 @@ export default { window.removeEventListener('popstate', this.updateQueryParamsFromUrl); }, methods: { + getReleaseKey(release, index) { + return [release.tagNamerstrs, release.name, index].join('|'); + }, updateQueryParamsFromUrl() { this.cursors.before = getParameterByName('before'); this.cursors.after = getParameterByName('after'); @@ -148,6 +155,8 @@ export default { <template> <div class="flex flex-column mt-2"> <div class="gl-align-self-end gl-mb-3"> + <releases-sort-apollo-client v-model="sort" class="gl-mr-2" /> + <gl-button v-if="newReleasePath" :href="newReleasePath" @@ -165,7 +174,7 @@ export default { <div v-else-if="shouldRenderSuccessState"> <release-block v-for="(release, index) in releases" - :key="index" + :key="getReleaseKey(release, index)" :release="release" :class="{ 'linked-card': releases.length > 1 && index !== releases.length - 1 }" /> diff --git a/app/assets/javascripts/releases/components/releases_sort.vue b/app/assets/javascripts/releases/components/releases_sort.vue index 4988904a2cd..d4210dad19c 100644 --- a/app/assets/javascripts/releases/components/releases_sort.vue +++ b/app/assets/javascripts/releases/components/releases_sort.vue @@ -1,7 +1,7 @@ <script> import { GlSorting, GlSortingItem } from '@gitlab/ui'; import { mapState, mapActions } from 'vuex'; -import { ASCENDING_ODER, DESCENDING_ORDER, SORT_OPTIONS } from '../constants'; +import { ASCENDING_ORDER, DESCENDING_ORDER, SORT_OPTIONS } from '../constants'; export default { name: 'ReleasesSort', @@ -22,13 +22,13 @@ export default { return option.label; }, isSortAscending() { - return this.sort === ASCENDING_ODER; + return this.sort === ASCENDING_ORDER; }, }, methods: { ...mapActions('index', ['setSorting']), onDirectionChange() { - const sort = this.isSortAscending ? DESCENDING_ORDER : ASCENDING_ODER; + const sort = this.isSortAscending ? DESCENDING_ORDER : ASCENDING_ORDER; this.setSorting({ sort }); this.$emit('sort:changed'); }, diff --git a/app/assets/javascripts/releases/components/releases_sort_apollo_client.vue b/app/assets/javascripts/releases/components/releases_sort_apollo_client.vue new file mode 100644 index 00000000000..c102a2765c9 --- /dev/null +++ b/app/assets/javascripts/releases/components/releases_sort_apollo_client.vue @@ -0,0 +1,90 @@ +<script> +import { GlSorting, GlSortingItem } from '@gitlab/ui'; +import { + ASCENDING_ORDER, + DESCENDING_ORDER, + SORT_OPTIONS, + RELEASED_AT, + CREATED_AT, + RELEASED_AT_ASC, + RELEASED_AT_DESC, + CREATED_ASC, + ALL_SORTS, + SORT_MAP, +} from '../constants'; + +export default { + name: 'ReleasesSortApolloclient', + components: { + GlSorting, + GlSortingItem, + }, + props: { + value: { + type: String, + required: true, + validator: (sort) => ALL_SORTS.includes(sort), + }, + }, + computed: { + orderBy() { + if (this.value === RELEASED_AT_ASC || this.value === RELEASED_AT_DESC) { + return RELEASED_AT; + } + + return CREATED_AT; + }, + direction() { + if (this.value === RELEASED_AT_ASC || this.value === CREATED_ASC) { + return ASCENDING_ORDER; + } + + return DESCENDING_ORDER; + }, + sortOptions() { + return SORT_OPTIONS; + }, + sortText() { + return this.sortOptions.find((s) => s.orderBy === this.orderBy).label; + }, + isDirectionAscending() { + return this.direction === ASCENDING_ORDER; + }, + }, + methods: { + onDirectionChange() { + const direction = this.isDirectionAscending ? DESCENDING_ORDER : ASCENDING_ORDER; + this.emitInputEventIfChanged(this.orderBy, direction); + }, + onSortItemClick(item) { + this.emitInputEventIfChanged(item.orderBy, this.direction); + }, + isActiveSortItem(item) { + return this.orderBy === item.orderBy; + }, + emitInputEventIfChanged(orderBy, direction) { + const newSort = SORT_MAP[orderBy][direction]; + if (newSort !== this.value) { + this.$emit('input', SORT_MAP[orderBy][direction]); + } + }, + }, +}; +</script> + +<template> + <gl-sorting + :text="sortText" + :is-ascending="isDirectionAscending" + @sortDirectionChange="onDirectionChange" + > + <gl-sorting-item + v-for="item of sortOptions" + :key="item.orderBy" + :active="isActiveSortItem(item)" + @click="onSortItemClick(item)" + > + {{ item.label }} + </gl-sorting-item> + </gl-sorting> +</template> diff --git a/app/assets/javascripts/releases/constants.js b/app/assets/javascripts/releases/constants.js index f9653e0befa..ac31b2a3384 100644 --- a/app/assets/javascripts/releases/constants.js +++ b/app/assets/javascripts/releases/constants.js @@ -15,7 +15,7 @@ export const DEFAULT_ASSET_LINK_TYPE = ASSET_LINK_TYPE.OTHER; export const PAGE_SIZE = 10; -export const ASCENDING_ODER = 'asc'; +export const ASCENDING_ORDER = 'asc'; export const DESCENDING_ORDER = 'desc'; export const RELEASED_AT = 'released_at'; export const CREATED_AT = 'created_at'; @@ -30,3 +30,20 @@ export const SORT_OPTIONS = [ label: __('Created date'), }, ]; + +export const RELEASED_AT_ASC = 'RELEASED_AT_ASC'; +export const RELEASED_AT_DESC = 'RELEASED_AT_DESC'; +export const CREATED_ASC = 'CREATED_ASC'; +export const CREATED_DESC = 'CREATED_DESC'; +export const ALL_SORTS = [RELEASED_AT_ASC, RELEASED_AT_DESC, CREATED_ASC, CREATED_DESC]; + +export const SORT_MAP = { + [RELEASED_AT]: { + [ASCENDING_ORDER]: RELEASED_AT_ASC, + [DESCENDING_ORDER]: RELEASED_AT_DESC, + }, + [CREATED_AT]: { + [ASCENDING_ORDER]: CREATED_ASC, + [DESCENDING_ORDER]: CREATED_DESC, + }, +}; diff --git a/app/assets/stylesheets/startup/startup-dark.scss b/app/assets/stylesheets/startup/startup-dark.scss index b92d18be2ec..92927fecd09 100644 --- a/app/assets/stylesheets/startup/startup-dark.scss +++ b/app/assets/stylesheets/startup/startup-dark.scss @@ -5,7 +5,6 @@ body.gl-dark { --gray-50: #303030; --gray-100: #404040; - --gray-200: #525252; --gray-950: #fff; --green-100: #0d532a; --green-400: #108548; @@ -28,8 +27,7 @@ html { line-height: 1.15; } aside, -header, -nav { +header { display: block; } body { @@ -96,35 +94,24 @@ button { cursor: pointer; } button:not(:disabled), -[type="button"]:not(:disabled), -[type="submit"]:not(:disabled) { +[type="button"]:not(:disabled) { cursor: pointer; } button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { +[type="button"]::-moz-focus-inner { padding: 0; border-style: none; } [type="search"] { outline-offset: -2px; } -summary { - display: list-item; - cursor: pointer; -} -[hidden] { - display: none !important; -} -h1, -.h1 { +h1 { margin-bottom: 0.25rem; font-weight: 600; line-height: 1.2; color: #fafafa; } -h1, -.h1 { +h1 { font-size: 2.1875rem; } .list-unstyled { @@ -246,9 +233,6 @@ h1, border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 0.25rem; } -.dropdown-menu.show { - display: block; -} .nav { display: flex; flex-wrap: wrap; @@ -322,17 +306,6 @@ h1, display: none; } } -.card { - position: relative; - display: flex; - flex-direction: column; - min-width: 0; - word-wrap: break-word; - background-color: #333; - background-clip: border-box; - border: 1px solid #404040; - border-radius: 0.25rem; -} .badge { display: inline-block; padding: 0.25em 0.4em; @@ -358,20 +331,6 @@ h1, padding-left: 0.6em; border-radius: 10rem; } -.close { - float: right; - font-size: 1.5rem; - font-weight: 600; - line-height: 1; - color: #fff; - text-shadow: 0 1px 0 #333; - opacity: 0.5; -} -button.close { - padding: 0; - background-color: transparent; - border: 0; -} .rounded-circle { border-radius: 50% !important; } @@ -460,12 +419,10 @@ body, } button, html [type="button"], -[type="submit"], [role="button"] { cursor: pointer; } -h1, -.h1 { +h1 { margin-top: 20px; margin-bottom: 10px; } @@ -546,38 +503,9 @@ body { color: #dbdbdb; vertical-align: baseline; } -img.emoji { - height: 20px; - vertical-align: top; - width: 20px; - margin-top: 1px; -} -.chart { - overflow: hidden; - height: 220px; -} .dropdown { position: relative; } -.show.dropdown .dropdown-menu { - transform: translateY(0); - display: block; - min-height: 40px; - max-height: 312px; - overflow-y: auto; -} -@media (max-width: 575.98px) { - .show.dropdown .dropdown-menu { - width: 100%; - } -} -.show.dropdown .dropdown-menu-toggle, -.show.dropdown .dropdown-menu-toggle { - border-color: #c4c4c4; -} -.show.dropdown [data-toggle="dropdown"] { - outline: 0; -} .search-input-container .dropdown-menu { margin-top: 11px; } @@ -945,15 +873,6 @@ input { float: none; } } -.header-user.show .dropdown-menu { - margin-top: 4px; - color: var(--gl-text-color, #fafafa); - left: auto; - max-height: 445px; -} -.header-user.show .dropdown-menu svg { - vertical-align: text-top; -} .header-user-avatar { float: left; margin-right: 5px; @@ -984,9 +903,6 @@ input { .tanuki-logo .tanuki-right-cheek { fill: #fca326; } -.card { - margin-bottom: 16px; -} .context-header { position: relative; margin-right: 2px; @@ -2008,9 +1924,6 @@ body.sidebar-refactoring .avatar.s32 { border-radius: 4px; } -#content-body { - display: block; -} body.gl-dark .navbar-gitlab { background-color: #fafafa; } @@ -2025,12 +1938,8 @@ body.gl-dark .navbar-gitlab .container-fluid .navbar-toggler svg { } body.gl-dark .navbar-gitlab .navbar-sub-nav > li.active > a, body.gl-dark .navbar-gitlab .navbar-sub-nav > li.active > button, -body.gl-dark .navbar-gitlab .navbar-sub-nav > li.dropdown.show > a, -body.gl-dark .navbar-gitlab .navbar-sub-nav > li.dropdown.show > button, body.gl-dark .navbar-gitlab .navbar-nav > li.active > a, -body.gl-dark .navbar-gitlab .navbar-nav > li.active > button, -body.gl-dark .navbar-gitlab .navbar-nav > li.dropdown.show > a, -body.gl-dark .navbar-gitlab .navbar-nav > li.dropdown.show > button { +body.gl-dark .navbar-gitlab .navbar-nav > li.active > button { color: #fafafa; background-color: #333; } @@ -2059,13 +1968,11 @@ body.gl-dark .header-user-avatar { border-color: #fafafa; } -body.gl-dark .navbar-gitlab .nav > li.active > a, -body.gl-dark .navbar-gitlab .nav > li.dropdown.show > a { +body.gl-dark .navbar-gitlab .nav > li.active > a { color: #fafafa; background-color: #333; } -body.gl-dark .navbar-gitlab .nav > li.active > a .notification-dot, -body.gl-dark .navbar-gitlab .nav > li.dropdown.show > a .notification-dot { +body.gl-dark .navbar-gitlab .nav > li.active > a .notification-dot { border-color: #333; } body.gl-dark @@ -2073,12 +1980,6 @@ body.gl-dark .nav > li.active > a.header-help-dropdown-toggle - .notification-dot, -body.gl-dark - .navbar-gitlab - .nav - > li.dropdown.show - > a.header-help-dropdown-toggle .notification-dot { background-color: #fafafa; } @@ -2116,12 +2017,8 @@ body.gl-dark .navbar-gitlab { } body.gl-dark .navbar-gitlab .navbar-sub-nav li.active > a, body.gl-dark .navbar-gitlab .navbar-sub-nav li.active > button, -body.gl-dark .navbar-gitlab .navbar-sub-nav li.dropdown.show > a, -body.gl-dark .navbar-gitlab .navbar-sub-nav li.dropdown.show > button, body.gl-dark .navbar-gitlab .navbar-nav li.active > a, -body.gl-dark .navbar-gitlab .navbar-nav li.active > button, -body.gl-dark .navbar-gitlab .navbar-nav li.dropdown.show > a, -body.gl-dark .navbar-gitlab .navbar-nav li.dropdown.show > button { +body.gl-dark .navbar-gitlab .navbar-nav li.active > button { color: var(--gl-text-color); background-color: var(--gray-200); } diff --git a/app/assets/stylesheets/startup/startup-general.scss b/app/assets/stylesheets/startup/startup-general.scss index fb1713f1329..abc6a6aec1c 100644 --- a/app/assets/stylesheets/startup/startup-general.scss +++ b/app/assets/stylesheets/startup/startup-general.scss @@ -12,8 +12,7 @@ html { line-height: 1.15; } aside, -header, -nav { +header { display: block; } body { @@ -80,35 +79,24 @@ button { cursor: pointer; } button:not(:disabled), -[type="button"]:not(:disabled), -[type="submit"]:not(:disabled) { +[type="button"]:not(:disabled) { cursor: pointer; } button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { +[type="button"]::-moz-focus-inner { padding: 0; border-style: none; } [type="search"] { outline-offset: -2px; } -summary { - display: list-item; - cursor: pointer; -} -[hidden] { - display: none !important; -} -h1, -.h1 { +h1 { margin-bottom: 0.25rem; font-weight: 600; line-height: 1.2; color: #303030; } -h1, -.h1 { +h1 { font-size: 2.1875rem; } .list-unstyled { @@ -230,9 +218,6 @@ h1, border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 0.25rem; } -.dropdown-menu.show { - display: block; -} .nav { display: flex; flex-wrap: wrap; @@ -306,17 +291,6 @@ h1, display: none; } } -.card { - position: relative; - display: flex; - flex-direction: column; - min-width: 0; - word-wrap: break-word; - background-color: #fff; - background-clip: border-box; - border: 1px solid #dbdbdb; - border-radius: 0.25rem; -} .badge { display: inline-block; padding: 0.25em 0.4em; @@ -342,20 +316,6 @@ h1, padding-left: 0.6em; border-radius: 10rem; } -.close { - float: right; - font-size: 1.5rem; - font-weight: 600; - line-height: 1; - color: #000; - text-shadow: 0 1px 0 #fff; - opacity: 0.5; -} -button.close { - padding: 0; - background-color: transparent; - border: 0; -} .rounded-circle { border-radius: 50% !important; } @@ -444,12 +404,10 @@ body, } button, html [type="button"], -[type="submit"], [role="button"] { cursor: pointer; } -h1, -.h1 { +h1 { margin-top: 20px; margin-bottom: 10px; } @@ -530,38 +488,9 @@ body { color: #525252; vertical-align: baseline; } -img.emoji { - height: 20px; - vertical-align: top; - width: 20px; - margin-top: 1px; -} -.chart { - overflow: hidden; - height: 220px; -} .dropdown { position: relative; } -.show.dropdown .dropdown-menu { - transform: translateY(0); - display: block; - min-height: 40px; - max-height: 312px; - overflow-y: auto; -} -@media (max-width: 575.98px) { - .show.dropdown .dropdown-menu { - width: 100%; - } -} -.show.dropdown .dropdown-menu-toggle, -.show.dropdown .dropdown-menu-toggle { - border-color: #c4c4c4; -} -.show.dropdown [data-toggle="dropdown"] { - outline: 0; -} .search-input-container .dropdown-menu { margin-top: 11px; } @@ -929,15 +858,6 @@ input { float: none; } } -.header-user.show .dropdown-menu { - margin-top: 4px; - color: var(--gl-text-color, #303030); - left: auto; - max-height: 445px; -} -.header-user.show .dropdown-menu svg { - vertical-align: text-top; -} .header-user-avatar { float: left; margin-right: 5px; @@ -968,9 +888,6 @@ input { .tanuki-logo .tanuki-right-cheek { fill: #fca326; } -.card { - margin-bottom: 16px; -} .context-header { position: relative; margin-right: 2px; @@ -1969,9 +1886,6 @@ body.sidebar-refactoring .avatar.s32 { border-radius: 4px; } -#content-body { - display: block; -} .tab-width-8 { -moz-tab-size: 8; diff --git a/app/assets/stylesheets/startup/startup-signin.scss b/app/assets/stylesheets/startup/startup-signin.scss index ebb4f32054f..81a87742850 100644 --- a/app/assets/stylesheets/startup/startup-signin.scss +++ b/app/assets/stylesheets/startup/startup-signin.scss @@ -40,11 +40,6 @@ p { margin-top: 0; margin-bottom: 1rem; } -address { - margin-bottom: 1rem; - font-style: normal; - line-height: inherit; -} a { color: #007bff; text-decoration: none; @@ -54,11 +49,6 @@ a:not([href]):not([class]) { color: inherit; text-decoration: none; } -code { - font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", - "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; - font-size: 1em; -} img { vertical-align: middle; border-style: none; @@ -93,28 +83,20 @@ fieldset { margin: 0; border: 0; } -summary { - display: list-item; - cursor: pointer; -} [hidden] { display: none !important; } h1, -h3, -.h1, -.h3 { +h3 { margin-bottom: 0.25rem; font-weight: 600; line-height: 1.2; color: #303030; } -h1, -.h1 { +h1 { font-size: 2.1875rem; } -h3, -.h3 { +h3 { font-size: 1.53125rem; } hr { @@ -123,14 +105,6 @@ hr { border: 0; border-top: 1px solid rgba(0, 0, 0, 0.1); } -code { - font-size: 90%; - color: #1f1f1f; - word-wrap: break-word; -} -a > code { - color: inherit; -} .container { width: 100%; padding-right: 15px; @@ -245,8 +219,7 @@ a > code { margin-right: -5px; margin-left: -5px; } -.form-row > .col, -.form-row > [class*="col-"] { +.form-row > .col { padding-right: 5px; padding-left: 5px; } @@ -290,21 +263,6 @@ fieldset:disabled a.btn { align-items: center; justify-content: space-between; } -.card { - position: relative; - display: flex; - flex-direction: column; - min-width: 0; - word-wrap: break-word; - background-color: #fff; - background-clip: border-box; - border: 1px solid #dbdbdb; - border-radius: 0.25rem; -} -.card > hr { - margin-right: 0; - margin-left: 0; -} .d-block { display: block !important; } @@ -449,9 +407,7 @@ body, cursor: pointer; } h1, -.h1, -h3, -.h3 { +h3 { margin-top: 20px; margin-bottom: 10px; } @@ -461,16 +417,6 @@ a { hr { overflow: hidden; } -code { - padding: 2px 4px; - color: #1f1f1f; - background-color: #f0f0f0; - border-radius: 4px; -} -.code > code { - background-color: inherit; - padding: unset; -} .hidden { display: none !important; visibility: hidden !important; @@ -478,13 +424,6 @@ code { .hide { display: none; } -.label { - padding: 4px 5px; - font-size: 12px; - font-style: normal; - font-weight: 400; - display: inline-block; -} svg { vertical-align: baseline; } @@ -509,11 +448,6 @@ body.navless { margin-top: 20px; } } -@media (max-width: 575.98px) { - .container .container .title { - padding-left: 15px !important; - } -} .navless-container { margin-top: 40px; padding-top: 32px; @@ -627,9 +561,6 @@ label.label-bold { .tanuki-logo .tanuki-right-cheek { fill: #fca326; } -.card { - margin-bottom: 16px; -} input::-moz-placeholder { color: #868686; opacity: 1; |