Commit 726c1181 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 9de8a305 f669331e
......@@ -11,6 +11,7 @@ import commitCIFile from '../../graphql/mutations/commit_ci_file.mutation.graphq
import getCommitSha from '../../graphql/queries/client/commit_sha.graphql';
import getCurrentBranch from '../../graphql/queries/client/current_branch.graphql';
import getIsNewCiConfigFile from '../../graphql/queries/client/is_new_ci_config_file.graphql';
import getPipelineEtag from '../../graphql/queries/client/pipeline_etag.graphql';
import CommitForm from './commit_form.vue';
......@@ -94,10 +95,15 @@ export default {
},
update(store, { data }) {
const commitSha = data?.commitCreate?.commit?.sha;
const pipelineEtag = data?.commitCreate?.commit?.commitPipelinePath;
if (commitSha) {
store.writeQuery({ query: getCommitSha, data: { commitSha } });
}
if (pipelineEtag) {
store.writeQuery({ query: getPipelineEtag, data: { pipelineEtag } });
}
},
});
......
......@@ -5,7 +5,11 @@ import { truncateSha } from '~/lib/utils/text_utility';
import { s__ } from '~/locale';
import getCommitSha from '~/pipeline_editor/graphql/queries/client/commit_sha.graphql';
import getPipelineQuery from '~/pipeline_editor/graphql/queries/client/pipeline.graphql';
import { toggleQueryPollingByVisibility } from '~/pipelines/components/graph/utils';
import getPipelineEtag from '~/pipeline_editor/graphql/queries/client/pipeline_etag.graphql';
import {
getQueryHeaders,
toggleQueryPollingByVisibility,
} from '~/pipelines/components/graph/utils';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
const POLL_INTERVAL = 10000;
......@@ -31,7 +35,13 @@ export default {
commitSha: {
query: getCommitSha,
},
pipelineEtag: {
query: getPipelineEtag,
},
pipeline: {
context() {
return getQueryHeaders(this.pipelineEtag);
},
query: getPipelineQuery,
variables() {
return {
......
......@@ -22,6 +22,7 @@ mutation commitCIFile(
commit {
sha
}
commitPipelinePath
errors
}
}
......@@ -6,6 +6,7 @@ import { resetServiceWorkersPublicPath } from '../lib/utils/webpack';
import { CODE_SNIPPET_SOURCE_SETTINGS } from './components/code_snippet_alert/constants';
import getCommitSha from './graphql/queries/client/commit_sha.graphql';
import getCurrentBranch from './graphql/queries/client/current_branch.graphql';
import getPipelineEtag from './graphql/queries/client/pipeline_etag.graphql';
import { resolvers } from './graphql/resolvers';
import typeDefs from './graphql/typedefs.graphql';
import PipelineEditorApp from './pipeline_editor_app.vue';
......@@ -26,6 +27,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
// Add to apollo cache as it can be updated by future queries
commitSha,
initialBranchName,
pipelineEtag,
// Add to provide/inject API for static values
ciConfigPath,
defaultBranch,
......@@ -48,7 +50,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(resolvers, { typeDefs }),
defaultClient: createDefaultClient(resolvers, { typeDefs, useGet: true }),
});
const { cache } = apolloProvider.clients.defaultClient;
......@@ -66,6 +68,13 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
},
});
cache.writeQuery({
query: getPipelineEtag,
data: {
pipelineEtag,
},
});
return new Vue({
el,
apolloProvider,
......
......@@ -9,14 +9,16 @@ module Ci
end
def js_pipeline_editor_data(project)
commit_sha = project.commit ? project.commit.sha : ''
{
"ci-config-path": project.ci_config_path_or_default,
"commit-sha" => project.commit ? project.commit.sha : '',
"commit-sha" => commit_sha,
"default-branch" => project.default_branch,
"empty-state-illustration-path" => image_path('illustrations/empty-state/empty-dag-md.svg'),
"initial-branch-name": params[:branch_name],
"lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'),
"new-merge-request-path" => namespace_project_new_merge_request_path,
"pipeline_etag" => graphql_etag_pipeline_sha_path(project.commit.sha),
"project-path" => project.path,
"project-full-path" => project.full_path,
"project-namespace" => project.namespace.full_path,
......
......@@ -64,6 +64,9 @@
%span.light= _('External User:')
%strong
= @user.external? ? _('Yes') : _('No')
= render_if_exists 'admin/users/provisioned_by', user: @user
%li
%span.light= _('Can create groups:')
%strong
......
---
title: Fix regression in GraphQL field MergeRequest.assignees.webUrl
merge_request: 60428
author:
type: fixed
......@@ -338,7 +338,6 @@ that suggests checking that the app manifest contains these settings:
- `"accessTokenAcceptedVersion": null`
- `"signInAudience": "AzureADMyOrg"`
1. `"signInAudience": "AzureADMyOrg"`
Note that this configuration corresponds with the `Supported account types` setting used when creating the `IdentityExperienceFramework` app.
......
- provisioning_group = @user.provisioned_by_group
- return unless provisioning_group
%li
%span.light
= _("Provisioned by:")
%strong
= link_to provisioning_group.name, admin_group_path(provisioning_group)
%span.light
= '(%{gid})' % {gid: provisioning_group.id}
---
title: Add provisioned by group info in user admin
merge_request: 60315
author:
type: added
......@@ -10,14 +10,14 @@ module Gitlab
end
def self.presenter_class
@presenter_class
@presenter_class || superclass.try(:presenter_class)
end
def self.present(object, attrs)
klass = @presenter_class
klass = presenter_class
return object if !klass || object.is_a?(klass)
@presenter_class.new(object, **attrs)
klass.new(object, **attrs)
end
end
......
......@@ -26155,6 +26155,9 @@ msgstr ""
msgid "Provider"
msgstr ""
msgid "Provisioned by:"
msgstr ""
msgid "Proxy support for this API is not available currently"
msgstr ""
......
......@@ -45,6 +45,7 @@ RSpec.describe Ci::PipelineEditorHelper do
"initial-branch-name": nil,
"lint-help-page-path" => help_page_path('ci/lint', anchor: 'validate-basic-logic-and-syntax'),
"new-merge-request-path" => '/mock/project/-/merge_requests/new',
"pipeline_etag" => graphql_etag_pipeline_sha_path(project.commit.sha),
"project-path" => project.path,
"project-full-path" => project.full_path,
"project-namespace" => project.namespace.full_path,
......
......@@ -63,6 +63,16 @@ RSpec.describe Gitlab::Graphql::Present::FieldExtension do
expect(value).to eq 'made of concrete'
end
context 'when the implementation is inherited' do
it 'resolves the interface field using the implementation from the presenter' do
subclass = Class.new(implementation) { graphql_name 'Subclass' }
field = ::Types::BaseField.new(name: :interface_field, type: GraphQL::STRING_TYPE, null: true, owner: interface)
value = resolve_field(field, object, object_type: subclass)
expect(value).to eq 'made of concrete'
end
end
end
describe 'interactions with inheritance' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment