From 418c3b29009dcc0a2c6b4872557d0274ba0b8077 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 30 Sep 2020 09:10:11 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/gfm_auto_complete.js | 7 +- .../components/publish_toolbar.vue | 2 +- .../static_site_editor/graphql/index.js | 2 + .../has_submitted_changes.mutation.graphql | 5 + .../graphql/queries/app_data.query.graphql | 1 + .../resolvers/has_submitted_changes.js | 17 + .../graphql/typedefs.graphql | 6 + .../javascripts/static_site_editor/index.js | 1 + .../static_site_editor/pages/home.vue | 18 +- .../static_site_editor/pages/success.vue | 45 +- .../services/front_matterify.js | 73 + .../services/parse_source_file.js | 17 +- .../vue_shared/components/gl_mentions.vue | 10 +- .../components/members/constants.js | 2 + .../components/members/table/created_at.vue | 40 + .../components/members/table/expires_at.vue | 66 + .../members/table/members_table.vue | 20 + .../javascripts/whats_new/components/app.vue | 35 +- app/assets/stylesheets/application.scss | 11 - .../stylesheets/application_utilities.scss | 12 + .../application_utilities_dark.scss | 3 + app/helpers/application_helper.rb | 6 + .../quick_actions/interpret_service.rb | 2 +- app/validators/addressable_url_validator.rb | 2 +- .../dashboard/milestones/index.html.haml | 2 +- app/views/dashboard/todos/index.html.haml | 2 +- app/views/groups/milestones/index.html.haml | 2 +- app/views/groups/milestones/show.html.haml | 2 +- app/views/ide/_show.html.haml | 3 +- .../subscriptions/index.html.haml | 2 +- app/views/layouts/_head.html.haml | 6 + app/views/layouts/jira_connect.html.haml | 2 + .../projects/cycle_analytics/show.html.haml | 3 +- .../projects/environments/show.html.haml | 4 +- app/views/projects/issues/index.html.haml | 2 +- app/views/projects/issues/show.html.haml | 2 +- app/views/projects/jobs/show.html.haml | 4 +- app/views/projects/milestones/index.html.haml | 2 +- app/views/projects/milestones/show.html.haml | 2 +- app/views/shared/boards/_show.html.haml | 2 +- ...-project-creating-incidents-usage-ping.yml | 5 + .../241738-prevent-assignment-to-groups.yml | 5 - .../244873-perceived-ux-success-screen.yml | 5 + ...1-migration-user-admin-approval-toggle.yml | 6 + .../unreleased/zj-update-lang-colors.yml | 5 + config/application.rb | 2 + ...2312_update_programming_language_colors.rb | 21 + ...add_incident_issue_type_index_to_issues.rb | 20 + ...ter_user_signup_to_application_settings.rb | 9 + db/schema_migrations/20200923102312 | 1 + db/schema_migrations/20200927224750 | 1 + db/schema_migrations/20200929063159 | 1 + db/structure.sql | 3 + .../geo/replication/updating_the_geo_nodes.md | 3 + .../img/export_audit_log_v13_4.png | Bin 127518 -> 46643 bytes doc/administration/postgresql/external.md | 6 + doc/administration/postgresql/index.md | 5 +- doc/administration/postgresql/pgbouncer.md | 3 + .../postgresql/replication_and_failover.md | 14 +- doc/administration/postgresql/standalone.md | 14 +- doc/api/members.md | 52 + doc/ci/img/ci_lint.png | Bin 37745 -> 11525 bytes doc/ci/img/ci_lint_dry_run.png | Bin 18688 -> 6811 bytes ..._efficiency_pipeline_dag_critical_path.png | Bin 124100 -> 35397 bytes ...ency_pipeline_health_grafana_dashboard.png | Bin 241128 -> 55200 bytes doc/development/api_graphql_styleguide.md | 19 + .../metrics_dashboard_panel_preview_v13_3.png | Bin 67972 -> 45857 bytes .../analytics/img/cohorts_v13_4.png | Bin 92729 -> 31518 bytes .../analytics/img/dev_ops_report_v13_4.png | Bin 167541 -> 51758 bytes .../img/mr_throughput_chart_v13_3.png | Bin 62510 -> 17870 bytes .../img/mr_throughput_table_v13_3.png | Bin 55637 -> 20273 bytes .../analytics/img/new_value_stream_v13_3.png | Bin 82797 -> 31215 bytes .../analytics/img/vsa_filter_bar_v13.3.png | Bin 117834 -> 33694 bytes .../img/cve_request_communication.png | Bin 45402 -> 17386 bytes .../cve_request_communication_publication.png | Bin 66617 -> 24126 bytes .../img/new_cve_request_issue.png | Bin 96795 -> 36847 bytes ..._approval_rules_and_enabled_jobs_v13_4.png | Bin 99883 -> 35553 bytes ...security_approval_rules_and_jobs_v13_4.png | Bin 82526 -> 29773 bytes .../img/vulnerability-check_v13_4.png | Bin 75105 -> 25832 bytes .../img/vulnerability_solution.png | Bin 30211 -> 9750 bytes .../img/group_vulnerability_report_v13_4.png | Bin 136030 -> 50648 bytes ...nstance_security_center_settings_v13_4.png | Bin 87684 -> 30034 bytes ...nstance_security_dashboard_empty_v13_4.png | Bin 38731 -> 13264 bytes .../img/instance_security_dashboard_v13_4.png | Bin 87470 -> 29797 bytes ...ect_security_dashboard_dismissal_v13_4.png | Bin 147574 -> 53541 bytes .../img/project_security_dashboard_v13_3.png | Bin 168847 -> 69112 bytes .../img/project_security_dashboard_v13_4.png | Bin 155207 -> 58167 bytes .../img/vulnerability_list_table_v13_4.png | Bin 164629 -> 61329 bytes .../img/compliance_dashboard_v13_3_1.png | Bin 298542 -> 71374 bytes .../img/license-check_v13_4.png | Bin 74407 -> 25590 bytes .../feature_flags_history_note_info_v13_2.png | Bin 67034 -> 21794 bytes .../version_history_notes_collapsed_v13_2.png | Bin 27528 -> 7770 bytes .../import/img/manifest_status_v13_3.png | Bin 90811 -> 31313 bytes lib/gitlab/ci/pipeline/chain/command.rb | 2 +- lib/gitlab/ci/variables/collection/item.rb | 4 +- lib/gitlab/config/entry/factory.rb | 2 +- lib/gitlab/config/entry/simplifiable.rb | 2 +- lib/gitlab/usage_data.rb | 1 + locale/gitlab.pot | 23 +- package.json | 1 - spec/features/issues/gfm_autocomplete_spec.rb | 27 +- spec/frontend/gfm_auto_complete_spec.js | 4 - .../static_site_editor/pages/home_spec.js | 48 +- .../static_site_editor/pages/success_spec.js | 111 +- .../services/front_matterify_spec.js | 47 + .../members/table/created_at_spec.js | 61 + .../members/table/expires_at_spec.js | 86 + .../members/table/members_table_spec.js | 12 +- .../frontend/whats_new/components/app_spec.js | 33 +- spec/lib/gitlab/usage_data_spec.rb | 1 + .../quick_actions/interpret_service_spec.rb | 13 - vendor/languages.yml | 1433 +++++++++++++++-- yarn.lock | 25 +- 113 files changed, 2209 insertions(+), 372 deletions(-) create mode 100644 app/assets/javascripts/static_site_editor/graphql/mutations/has_submitted_changes.mutation.graphql create mode 100644 app/assets/javascripts/static_site_editor/graphql/resolvers/has_submitted_changes.js create mode 100644 app/assets/javascripts/static_site_editor/services/front_matterify.js create mode 100644 app/assets/javascripts/vue_shared/components/members/table/created_at.vue create mode 100644 app/assets/javascripts/vue_shared/components/members/table/expires_at.vue create mode 100644 app/assets/stylesheets/application_utilities.scss create mode 100644 app/assets/stylesheets/application_utilities_dark.scss create mode 100644 changelogs/unreleased/233719-project-creating-incidents-usage-ping.yml delete mode 100644 changelogs/unreleased/241738-prevent-assignment-to-groups.yml create mode 100644 changelogs/unreleased/244873-perceived-ux-success-screen.yml create mode 100644 changelogs/unreleased/257881-migration-user-admin-approval-toggle.yml create mode 100644 changelogs/unreleased/zj-update-lang-colors.yml create mode 100644 db/migrate/20200923102312_update_programming_language_colors.rb create mode 100644 db/migrate/20200927224750_add_incident_issue_type_index_to_issues.rb create mode 100644 db/migrate/20200929063159_add_require_admin_approval_after_user_signup_to_application_settings.rb create mode 100644 db/schema_migrations/20200923102312 create mode 100644 db/schema_migrations/20200927224750 create mode 100644 db/schema_migrations/20200929063159 create mode 100644 spec/frontend/static_site_editor/services/front_matterify_spec.js create mode 100644 spec/frontend/vue_shared/components/members/table/created_at_spec.js create mode 100644 spec/frontend/vue_shared/components/members/table/expires_at_spec.js diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index f998d5f1b7f..0329006c62a 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -35,7 +35,6 @@ export function membersBeforeSave(members) { : ''; return { - type: member.type, username: member.username, avatarTag: autoCompleteAvatar.length === 1 ? txtAvatar : imgAvatar, title: sanitize(title), @@ -280,11 +279,7 @@ class GfmAutoComplete { if (command === MEMBER_COMMAND.ASSIGN) { // Only include members which are not assigned to Issuable currently - return data.filter( - member => member.type === 'User' && !assignees.includes(member.search), - ); - } else if (command === MEMBER_COMMAND.REASSIGN) { - return data.filter(member => member.type === 'User'); + return data.filter(member => !assignees.includes(member.search)); } else if (command === MEMBER_COMMAND.UNASSIGN) { // Only include members which are assigned to Issuable currently return data.filter(member => assignees.includes(member.search)); diff --git a/app/assets/javascripts/static_site_editor/components/publish_toolbar.vue b/app/assets/javascripts/static_site_editor/components/publish_toolbar.vue index 2d62964cb3b..5f00f9f22f3 100644 --- a/app/assets/javascripts/static_site_editor/components/publish_toolbar.vue +++ b/app/assets/javascripts/static_site_editor/components/publish_toolbar.vue @@ -41,7 +41,7 @@ export default { :disabled="savingChanges" @click="$emit('editSettings')" > - {{ __('Settings') }} + {{ __('Page settings') }} { }, Mutation: { submitContentChanges: submitContentChangesResolver, + hasSubmittedChanges: hasSubmittedChangesResolver, }, }, { diff --git a/app/assets/javascripts/static_site_editor/graphql/mutations/has_submitted_changes.mutation.graphql b/app/assets/javascripts/static_site_editor/graphql/mutations/has_submitted_changes.mutation.graphql new file mode 100644 index 00000000000..1f47929556a --- /dev/null +++ b/app/assets/javascripts/static_site_editor/graphql/mutations/has_submitted_changes.mutation.graphql @@ -0,0 +1,5 @@ +mutation hasSubmittedChanges($input: HasSubmittedChangesInput) { + hasSubmittedChanges(input: $input) @client { + hasSubmittedChanges + } +} diff --git a/app/assets/javascripts/static_site_editor/graphql/queries/app_data.query.graphql b/app/assets/javascripts/static_site_editor/graphql/queries/app_data.query.graphql index 946d80efff0..9f4b0afe55f 100644 --- a/app/assets/javascripts/static_site_editor/graphql/queries/app_data.query.graphql +++ b/app/assets/javascripts/static_site_editor/graphql/queries/app_data.query.graphql @@ -1,6 +1,7 @@ query appData { appData @client { isSupportedContent + hasSubmittedChanges project sourcePath username diff --git a/app/assets/javascripts/static_site_editor/graphql/resolvers/has_submitted_changes.js b/app/assets/javascripts/static_site_editor/graphql/resolvers/has_submitted_changes.js new file mode 100644 index 00000000000..ce55db7f3e5 --- /dev/null +++ b/app/assets/javascripts/static_site_editor/graphql/resolvers/has_submitted_changes.js @@ -0,0 +1,17 @@ +import query from '../queries/app_data.query.graphql'; + +const hasSubmittedChangesResolver = (_, { input: { hasSubmittedChanges } }, { cache }) => { + const { appData } = cache.readQuery({ query }); + cache.writeQuery({ + query, + data: { + appData: { + __typename: 'AppData', + ...appData, + hasSubmittedChanges, + }, + }, + }); +}; + +export default hasSubmittedChangesResolver; diff --git a/app/assets/javascripts/static_site_editor/graphql/typedefs.graphql b/app/assets/javascripts/static_site_editor/graphql/typedefs.graphql index 78cc1746cdb..0ded1722d26 100644 --- a/app/assets/javascripts/static_site_editor/graphql/typedefs.graphql +++ b/app/assets/javascripts/static_site_editor/graphql/typedefs.graphql @@ -16,12 +16,17 @@ type SavedContentMeta { type AppData { isSupportedContent: Boolean! + hasSubmittedChanges: Boolean! project: String! returnUrl: String sourcePath: String! username: String! } +input HasSubmittedChangesInput { + hasSubmittedChanges: Boolean! +} + input SubmitContentChangesInput { project: String! sourcePath: String! @@ -40,4 +45,5 @@ extend type Query { extend type Mutation { submitContentChanges(input: SubmitContentChangesInput!): SavedContentMeta + hasSubmittedChanges(input: HasSubmittedChangesInput!): AppData } diff --git a/app/assets/javascripts/static_site_editor/index.js b/app/assets/javascripts/static_site_editor/index.js index b7e5ea4eee3..bd7d5cf29d7 100644 --- a/app/assets/javascripts/static_site_editor/index.js +++ b/app/assets/javascripts/static_site_editor/index.js @@ -19,6 +19,7 @@ const initStaticSiteEditor = el => { const router = createRouter(baseUrl); const apolloProvider = createApolloProvider({ isSupportedContent: parseBoolean(isSupportedContent), + hasSubmittedChanges: false, project: `${namespace}/${project}`, returnUrl, sourcePath, diff --git a/app/assets/javascripts/static_site_editor/pages/home.vue b/app/assets/javascripts/static_site_editor/pages/home.vue index eef2bd88f0e..5c1af45b831 100644 --- a/app/assets/javascripts/static_site_editor/pages/home.vue +++ b/app/assets/javascripts/static_site_editor/pages/home.vue @@ -5,6 +5,7 @@ import InvalidContentMessage from '../components/invalid_content_message.vue'; import SubmitChangesError from '../components/submit_changes_error.vue'; import appDataQuery from '../graphql/queries/app_data.query.graphql'; import sourceContentQuery from '../graphql/queries/source_content.query.graphql'; +import hasSubmittedChangesMutation from '../graphql/mutations/has_submitted_changes.mutation.graphql'; import submitContentChangesMutation from '../graphql/mutations/submit_content_changes.mutation.graphql'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import Tracking from '~/tracking'; @@ -74,6 +75,20 @@ export default { submitChanges(images) { this.isSavingChanges = true; + // eslint-disable-next-line promise/catch-or-return + this.$apollo + .mutate({ + mutation: hasSubmittedChangesMutation, + variables: { + input: { + hasSubmittedChanges: true, + }, + }, + }) + .finally(() => { + this.$router.push(SUCCESS_ROUTE); + }); + this.$apollo .mutate({ mutation: submitContentChangesMutation, @@ -87,9 +102,6 @@ export default { }, }, }) - .then(() => { - this.$router.push(SUCCESS_ROUTE); - }) .catch(e => { this.submitChangesError = e.message; }) diff --git a/app/assets/javascripts/static_site_editor/pages/success.vue b/app/assets/javascripts/static_site_editor/pages/success.vue index f0d597d7c9b..6a3f40cc1db 100644 --- a/app/assets/javascripts/static_site_editor/pages/success.vue +++ b/app/assets/javascripts/static_site_editor/pages/success.vue @@ -1,5 +1,5 @@ + + + + + + + + diff --git a/app/assets/javascripts/whats_new/components/app.vue b/app/assets/javascripts/whats_new/components/app.vue index 9fc19c51083..ed17927c5b2 100644 --- a/app/assets/javascripts/whats_new/components/app.vue +++ b/app/assets/javascripts/whats_new/components/app.vue @@ -1,6 +1,9 @@