Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-09-04 00:09:54 +00:00
parent a50ba8dc15
commit 02bb524d05
6 changed files with 85 additions and 90 deletions

View File

@ -143,6 +143,8 @@ export default {
hideText: __('Hide values'),
},
formElementClasses: 'md:gl-mr-3 gl-mb-3 gl-basis-1/4 gl-shrink-0 gl-flex-grow-0',
// it's used to prevent the overwrite if 'gl-h-7' or '!gl-h-7' were used
textAreaStyle: { height: '32px' },
computed: {
dropdownTranslations() {
return {
@ -374,7 +376,7 @@ export default {
<div v-for="(variable, index) in variables" :key="`var-${index}`">
<div
v-if="!variable.destroy"
class="gl-mb-3 gl-flex gl-flex-col gl-items-stretch gl-pb-2 md:gl-flex-row"
class="gl-mb-3 gl-flex gl-flex-col gl-items-stretch gl-pb-2 md:gl-flex-row md:gl-items-start"
data-testid="ci-variable-row"
>
<gl-collapsible-listbox
@ -399,7 +401,6 @@ export default {
value="*****************"
disabled
class="gl-mb-3 !gl-h-7"
:no-resize="false"
data-testid="pipeline-form-ci-variable-hidden-value"
/>
@ -407,7 +408,8 @@ export default {
v-else
v-model="variable.value"
:placeholder="s__('CiVariables|Input variable value')"
class="gl-mb-3 !gl-h-7"
class="gl-mb-3 gl-min-h-7"
:style="$options.textAreaStyle"
:no-resize="false"
data-testid="pipeline-form-ci-variable-value"
@change="resetVariable(index)"

View File

@ -11,6 +11,8 @@ import {
getDefaultWorkItemTypes,
getInitialPageParams,
getTypeTokenOptions,
getFilterTokens,
convertToUrlParams,
} from 'ee_else_ce/issues/list/utils';
import { TYPENAME_USER } from '~/graphql_shared/constants';
import { convertToGraphQLId } from '~/graphql_shared/utils';
@ -22,10 +24,20 @@ import {
WORKSPACE_PROJECT,
} from '~/issues/constants';
import { AutocompleteCache } from '~/issues/dashboard/utils';
import {
CREATED_DESC,
PARAM_FIRST_PAGE_SIZE,
PARAM_LAST_PAGE_SIZE,
PARAM_PAGE_AFTER,
PARAM_PAGE_BEFORE,
PARAM_STATE,
PARAM_SORT,
} from '~/issues/list/constants';
import searchLabelsQuery from '~/issues/list/queries/search_labels.query.graphql';
import setSortPreferenceMutation from '~/issues/list/queries/set_sort_preference.mutation.graphql';
import { fetchPolicies } from '~/lib/graphql';
import { scrollUp } from '~/lib/utils/scroll_utils';
import { isPositiveInteger } from '~/lib/utils/number_utils';
import { __, s__ } from '~/locale';
import {
OPERATORS_IS,
@ -53,6 +65,7 @@ import IssuableList from '~/vue_shared/issuable/list/components/issuable_list_ro
import WorkItemDrawer from '~/work_items/components/work_item_drawer.vue';
import { DEFAULT_PAGE_SIZE, issuableListTabs } from '~/vue_shared/issuable/list/constants';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { getParameterByName } from '~/lib/utils/url_utility';
import { STATE_CLOSED, STATE_OPEN, WORK_ITEM_TYPE_ENUM_EPIC } from '../constants';
import getWorkItemsQuery from '../graphql/list/get_work_items.query.graphql';
import getWorkItemStateCountsQuery from '../graphql/list/get_work_item_state_counts.query.graphql';
@ -114,9 +127,9 @@ export default {
hasAnyIssues: false,
isInitialLoadComplete: false,
pageInfo: {},
pageParams: getInitialPageParams(),
pageParams: {},
pageSize: DEFAULT_PAGE_SIZE,
sortKey: deriveSortKey({ sort: this.initialSort, sortMap: urlSortParams }),
sortKey: CREATED_DESC,
state: STATUS_OPEN,
workItems: [],
workItemStateCounts: {},
@ -241,7 +254,6 @@ export default {
isProject: !this.isGroup,
recentSuggestionsStorageKey: `${this.fullPath}-issues-recent-tokens-assignee`,
preloadedUsers,
multiSelect: this.glFeatures.groupMultiSelectTokens,
},
{
type: TOKEN_TYPE_AUTHOR,
@ -255,7 +267,6 @@ export default {
isProject: !this.isGroup,
recentSuggestionsStorageKey: `${this.fullPath}-issues-recent-tokens-author`,
preloadedUsers,
multiSelect: this.glFeatures.groupMultiSelectTokens,
},
{
type: TOKEN_TYPE_GROUP,
@ -275,7 +286,6 @@ export default {
fetchLabels: this.fetchLabels,
fetchLatestLabels: this.glFeatures.frontendCaching ? this.fetchLatestLabels : null,
recentSuggestionsStorageKey: `${this.fullPath}-issues-recent-tokens-label`,
multiSelect: this.glFeatures.groupMultiSelectTokens,
},
{
type: TOKEN_TYPE_MILESTONE,
@ -362,6 +372,20 @@ export default {
hasQualityManagementFeature: this.hasQualityManagementFeature,
});
},
urlFilterParams() {
return convertToUrlParams(this.filterTokens);
},
urlParams() {
return {
sort: urlSortParams[this.sortKey],
state: this.state,
...this.urlFilterParams,
first_page_size: this.pageParams.firstPageSize,
last_page_size: this.pageParams.lastPageSize,
page_after: this.pageParams.afterCursor ?? undefined,
page_before: this.pageParams.beforeCursor ?? undefined,
};
},
},
watch: {
eeWorkItemUpdateCount() {
@ -371,8 +395,14 @@ export default {
}
this.$apollo.queries.workItems.refetch();
},
$route(newValue, oldValue) {
if (newValue.fullPath !== oldValue.fullPath) {
this.updateData(getParameterByName(PARAM_SORT));
}
},
},
created() {
this.updateData(this.initialSort);
this.autocompleteCache = new AutocompleteCache();
},
methods: {
@ -417,10 +447,14 @@ export default {
this.state = state;
this.pageParams = getInitialPageParams(this.pageSize);
this.$router.push({ query: this.urlParams });
},
handleFilter(tokens) {
this.filterTokens = tokens;
this.pageParams = getInitialPageParams(this.pageSize);
this.$router.push({ query: this.urlParams });
},
handleNextPage() {
this.pageParams = {
@ -428,11 +462,15 @@ export default {
firstPageSize: this.pageSize,
};
scrollUp();
this.$router.push({ query: this.urlParams });
},
handlePageSizeChange(pageSize) {
this.pageSize = pageSize;
this.pageParams = getInitialPageParams(pageSize);
scrollUp();
this.$router.push({ query: this.urlParams });
},
handlePreviousPage() {
this.pageParams = {
@ -440,6 +478,8 @@ export default {
lastPageSize: this.pageSize,
};
scrollUp();
this.$router.push({ query: this.urlParams });
},
handleSort(sortKey) {
if (this.sortKey === sortKey) {
@ -452,6 +492,8 @@ export default {
if (this.isSignedIn) {
this.saveSortPreference(sortKey);
}
this.$router.push({ query: this.urlParams });
},
saveSortPreference(sortKey) {
this.$apollo
@ -485,6 +527,26 @@ export default {
await this.$apollo.queries.workItems.refetch();
this.isRefetching = false;
},
updateData(sort) {
const firstPageSize = getParameterByName(PARAM_FIRST_PAGE_SIZE);
const lastPageSize = getParameterByName(PARAM_LAST_PAGE_SIZE);
const state = getParameterByName(PARAM_STATE);
this.filterTokens = getFilterTokens(window.location.search);
this.pageParams = getInitialPageParams(
this.pageSize,
isPositiveInteger(firstPageSize) ? parseInt(firstPageSize, 10) : undefined,
isPositiveInteger(lastPageSize) ? parseInt(lastPageSize, 10) : undefined,
getParameterByName(PARAM_PAGE_AFTER) ?? undefined,
getParameterByName(PARAM_PAGE_BEFORE) ?? undefined,
);
// Trigger pageSize UI component update based on URL changes
this.pageSize = this.pageParams.firstPageSize;
this.sortKey = deriveSortKey({ sort, sortMap: urlSortParams });
this.state = state || STATUS_OPEN;
},
},
};
</script>
@ -508,6 +570,7 @@ export default {
:error="error"
:has-next-page="pageInfo.hasNextPage"
:has-previous-page="pageInfo.hasPreviousPage"
:initial-filter-value="filterTokens"
:initial-sort-by="sortKey"
:issuables="workItems"
:issuables-loading="isLoading"
@ -520,6 +583,7 @@ export default {
:show-pagination-controls="showPaginationControls"
show-work-item-type-icon
:sort-options="$options.sortOptions"
sync-filter-and-sort
:tab-counts="tabCounts"
:tabs="$options.issuableListTabs"
use-keyset-pagination

View File

@ -4,39 +4,6 @@
border: 1px solid $gray-100;
border-radius: $gl-border-radius-base;
.card.card-body-segment {
padding: $gl-padding;
&:not(:last-of-type) {
border-bottom: 1px solid $gray-100;
}
&.borderless {
border-bottom: 0;
}
&.branch-info {
.commit-sha,
.commit-info {
margin-left: 4px;
.fork-svg {
margin-right: 4px;
vertical-align: bottom;
}
}
.ref-name {
font-size: 12px;
}
}
&.admin-well h4 {
border-bottom: 1px solid $border-color;
padding-bottom: 8px;
}
}
.icon-container {
display: inline-block;
margin: 0 0.5rem 0 0.25rem;
@ -57,10 +24,6 @@
}
}
.label-gray {
background-color: $well-expand-item;
}
.branches {
display: inline;
}
@ -69,11 +32,3 @@
vertical-align: text-top;
}
}
.card.card-body-centered {
h1 {
font-weight: $gl-font-weight-normal;
text-align: center;
font-size: 48px;
}
}

View File

@ -162,10 +162,6 @@
.generic-commit-status {
a {
color: $gl-text-color;
&.autodevops-badge {
color: $white;
}
}
.commit-row-description {
@ -232,29 +228,3 @@
font-weight: $gl-font-weight-normal;
line-height: 1.5;
}
.gpg-popover-icon {
// same margin as .s32.avatar
margin-right: $btn-side-margin;
&.valid {
svg {
border: 1px solid $brand-success;
fill: $brand-success;
}
}
&.invalid {
svg {
border: 1px solid $gray-200;
fill: $gray-200;
}
}
svg {
width: 32px;
height: 32px;
border-radius: 50%;
vertical-align: middle;
}
}

View File

@ -267,7 +267,7 @@ Using the [rails console](../../../administration/operations/rails_console.md#st
```ruby
p = Project.find_by_full_path('project/path')
p.events.pushed_action.last(100).each do |e|
puts "%-20.20s %8s...%8s (%s)", e.push_event_payload[:ref], e.push_event_payload[:commit_from], e.push_event_payload[:commit_to], e.author.try(:username)
printf "%-20.20s %8s...%8s (%s)", e.push_event_payload[:ref], e.push_event_payload[:commit_from], e.push_event_payload[:commit_to], e.author.try(:username)
end ; nil
```

View File

@ -3,6 +3,7 @@ import { shallowMount } from '@vue/test-utils';
import { cloneDeep } from 'lodash';
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import VueRouter from 'vue-router';
import * as Sentry from '~/sentry/sentry_browser_wrapper';
import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_statistics.vue';
import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue';
@ -39,6 +40,7 @@ import getWorkItemStateCountsQuery from '~/work_items/graphql/list/get_work_item
import getWorkItemsQuery from '~/work_items/graphql/list/get_work_items.query.graphql';
import WorkItemDrawer from '~/work_items/components/work_item_drawer.vue';
import { STATE_CLOSED } from '~/work_items/constants';
import { createRouter } from '~/work_items/router';
import {
groupWorkItemsQueryResponse,
groupWorkItemStateCountsQueryResponse,
@ -58,6 +60,7 @@ describeSkipVue3(skipReason, () => {
let wrapper;
Vue.use(VueApollo);
Vue.use(VueRouter);
const defaultQueryHandler = jest.fn().mockResolvedValue(groupWorkItemsQueryResponse);
const countsQueryHandler = jest.fn().mockResolvedValue(groupWorkItemStateCountsQueryResponse);
@ -74,6 +77,7 @@ describeSkipVue3(skipReason, () => {
sortPreferenceMutationResponse = mutationHandler,
} = {}) => {
wrapper = shallowMount(WorkItemsListApp, {
router: createRouter({ fullPath: '/work_item' }),
apolloProvider: createMockApollo([
[getWorkItemsQuery, queryHandler],
[getWorkItemStateCountsQuery, countsQueryHandler],
@ -182,7 +186,6 @@ describeSkipVue3(skipReason, () => {
includeDescendants: true,
sort: CREATED_DESC,
state: STATUS_OPEN,
firstPageSize: 20,
types: type,
});
});
@ -213,7 +216,6 @@ describeSkipVue3(skipReason, () => {
describe('when eeCreatedWorkItemsCount is updated', () => {
it('refetches work items', async () => {
mountComponent();
await waitForPromises();
expect(defaultQueryHandler).toHaveBeenCalledTimes(1);
@ -478,17 +480,20 @@ describeSkipVue3(skipReason, () => {
});
it('refetches and resets when work item is deleted', async () => {
expect(defaultQueryHandler).toHaveBeenCalledTimes(2);
findDrawer().vm.$emit('workItemDeleted');
await nextTick();
checkThatDrawerPropsAreEmpty();
// first call when mounted, second call after deletion
expect(defaultQueryHandler).toHaveBeenCalledTimes(2);
expect(defaultQueryHandler).toHaveBeenCalledTimes(3);
});
it('refetches when the selected work item is closed', async () => {
expect(defaultQueryHandler).toHaveBeenCalledTimes(2);
// component displays open work items by default
findDrawer().vm.$emit('work-item-updated', {
state: STATE_CLOSED,
@ -496,8 +501,7 @@ describeSkipVue3(skipReason, () => {
await nextTick();
// first call when mounted, second call after update
expect(defaultQueryHandler).toHaveBeenCalledTimes(2);
expect(defaultQueryHandler).toHaveBeenCalledTimes(3);
});
});
});