Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-13 09:08:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-13 09:08:59 +0300
commitc053e70de25ad332aa99e4eefadccd7b9b46748e (patch)
tree4d904e6248902e3ab8e9058a335b2ad7575780a9
parent9d7001c66ec5cd4e3d360f91486f32a2ede294df (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/organizations/show/components/app.vue11
-rw-r--r--app/assets/javascripts/organizations/show/components/association_count_card.vue54
-rw-r--r--app/assets/javascripts/organizations/show/components/association_counts.vue71
-rw-r--r--app/assets/javascripts/organizations/show/index.js3
-rw-r--r--app/helpers/organizations/organization_helper.rb9
-rw-r--r--config/feature_flags/development/standard_merge_train_ref_merge_commit.yml2
-rw-r--r--data/deprecations/15-9-license-compliance-ci-template.yml2
-rw-r--r--doc/development/documentation/styleguide/word_list.md19
-rw-r--r--doc/development/fe_guide/getting_started.md2
-rw-r--r--doc/tutorials/configure_gitlab_runner_to_use_gke/index.md4
-rw-r--r--doc/update/deprecations.md2
-rw-r--r--doc/user/compliance/license_scanning_of_cyclonedx_files/index.md10
-rw-r--r--doc/user/group/manage.md2
-rw-r--r--doc/user/profile/preferences.md18
-rw-r--r--doc/user/project/repository/code_suggestions/saas.md21
-rw-r--r--doc/user/project/repository/code_suggestions/troubleshooting.md2
-rw-r--r--doc/user/search/advanced_search.md4
-rw-r--r--locale/gitlab.pot6
-rw-r--r--spec/frontend/organizations/show/components/app_spec.js13
-rw-r--r--spec/frontend/organizations/show/components/association_count_card_spec.js48
-rw-r--r--spec/frontend/organizations/show/components/association_counts_spec.js61
-rw-r--r--spec/helpers/organizations/organization_helper_spec.rb7
22 files changed, 324 insertions, 47 deletions
diff --git a/app/assets/javascripts/organizations/show/components/app.vue b/app/assets/javascripts/organizations/show/components/app.vue
index 8652a9f0eea..47264d80454 100644
--- a/app/assets/javascripts/organizations/show/components/app.vue
+++ b/app/assets/javascripts/organizations/show/components/app.vue
@@ -1,10 +1,11 @@
<script>
import OrganizationAvatar from './organization_avatar.vue';
import GroupsAndProjects from './groups_and_projects.vue';
+import AssociationCounts from './association_counts.vue';
export default {
name: 'OrganizationShowApp',
- components: { OrganizationAvatar, GroupsAndProjects },
+ components: { OrganizationAvatar, GroupsAndProjects, AssociationCounts },
props: {
organization: {
type: Object,
@@ -14,6 +15,10 @@ export default {
type: String,
required: true,
},
+ associationCounts: {
+ type: Object,
+ required: true,
+ },
},
};
</script>
@@ -21,6 +26,10 @@ export default {
<template>
<div class="gl-py-6">
<organization-avatar :organization="organization" />
+ <association-counts
+ :association-counts="associationCounts"
+ :groups-and-projects-organization-path="groupsAndProjectsOrganizationPath"
+ />
<groups-and-projects
:groups-and-projects-organization-path="groupsAndProjectsOrganizationPath"
/>
diff --git a/app/assets/javascripts/organizations/show/components/association_count_card.vue b/app/assets/javascripts/organizations/show/components/association_count_card.vue
new file mode 100644
index 00000000000..0567f43132f
--- /dev/null
+++ b/app/assets/javascripts/organizations/show/components/association_count_card.vue
@@ -0,0 +1,54 @@
+<script>
+import { GlIcon, GlLink, GlCard } from '@gitlab/ui';
+import { numberToMetricPrefix } from '~/lib/utils/number_utils';
+import { __ } from '~/locale';
+
+export default {
+ name: 'AssociationCountCard',
+ components: { GlIcon, GlLink, GlCard },
+ props: {
+ title: {
+ type: String,
+ required: true,
+ },
+ iconName: {
+ type: String,
+ required: true,
+ },
+ count: {
+ type: Number,
+ required: true,
+ },
+ linkHref: {
+ type: String,
+ required: true,
+ },
+ linkText: {
+ type: String,
+ required: false,
+ default: __('View all'),
+ },
+ },
+ computed: {
+ formattedCount() {
+ return numberToMetricPrefix(this.count, 0);
+ },
+ },
+};
+</script>
+
+<template>
+ <gl-card>
+ <div class="gl-display-flex gl-align-items-center gl-justify-content-space-between">
+ <div class="gl-display-flex gl-align-items-center gl-text-gray-700">
+ <gl-icon :name="iconName" />
+ <span class="gl-ml-2">{{ title }}</span>
+ </div>
+ <gl-link :href="linkHref">{{ linkText }}</gl-link>
+ </div>
+ <span
+ class="gl-font-size-h-display gl-font-weight-bold gl-line-height-ratio-1000 gl-mt-2 gl-display-block"
+ >{{ formattedCount }}</span
+ >
+ </gl-card>
+</template>
diff --git a/app/assets/javascripts/organizations/show/components/association_counts.vue b/app/assets/javascripts/organizations/show/components/association_counts.vue
new file mode 100644
index 00000000000..3b312924bd2
--- /dev/null
+++ b/app/assets/javascripts/organizations/show/components/association_counts.vue
@@ -0,0 +1,71 @@
+<script>
+import { __, s__ } from '~/locale';
+import { RESOURCE_TYPE_GROUPS, RESOURCE_TYPE_PROJECTS } from '../../constants';
+import AssociationCountCard from './association_count_card.vue';
+
+export default {
+ name: 'AssociationCounts',
+ i18n: {
+ groups: __('Groups'),
+ projects: __('Projects'),
+ users: __('Users'),
+ viewAll: __('View all'),
+ manage: s__('Organization|Manage'),
+ },
+ components: { AssociationCountCard },
+ props: {
+ associationCounts: {
+ type: Object,
+ required: true,
+ },
+ groupsAndProjectsOrganizationPath: {
+ type: String,
+ required: true,
+ },
+ },
+ computed: {
+ groupsLinkHref() {
+ return `${this.groupsAndProjectsOrganizationPath}?display=${RESOURCE_TYPE_GROUPS}`;
+ },
+ projectsLinkHref() {
+ return `${this.groupsAndProjectsOrganizationPath}?display=${RESOURCE_TYPE_PROJECTS}`;
+ },
+ associationCountCards() {
+ return [
+ {
+ title: this.$options.i18n.groups,
+ iconName: 'group',
+ count: this.associationCounts.groups,
+ linkHref: this.groupsLinkHref,
+ },
+ {
+ title: this.$options.i18n.projects,
+ iconName: 'project',
+ count: this.associationCounts.projects,
+ linkHref: this.projectsLinkHref,
+ },
+ {
+ title: this.$options.i18n.users,
+ iconName: 'users',
+ count: this.associationCounts.users,
+ linkText: this.$options.i18n.manage,
+ // TODO: update `linkHref` prop to point to users route
+ // https://gitlab.com/gitlab-org/gitlab/-/issues/409313
+ linkHref: '/',
+ },
+ ];
+ },
+ },
+};
+</script>
+
+<template>
+ <div class="gl-display-grid gl-lg-grid-template-columns-4 gl-mt-5 gl-gap-5">
+ <association-count-card
+ v-for="props in associationCountCards"
+ :key="props.title"
+ v-bind="props"
+ class="gl-w-full"
+ />
+ </div>
+</template>
diff --git a/app/assets/javascripts/organizations/show/index.js b/app/assets/javascripts/organizations/show/index.js
index c1ba1a82c0d..83a9c37e325 100644
--- a/app/assets/javascripts/organizations/show/index.js
+++ b/app/assets/javascripts/organizations/show/index.js
@@ -34,6 +34,7 @@ export const initOrganizationsShow = () => {
groupsEmptyStateSvgPath,
newGroupPath,
newProjectPath,
+ associationCounts,
} = convertObjectPropsToCamelCase(JSON.parse(appData));
Vue.use(VueRouter);
@@ -55,7 +56,7 @@ export const initOrganizationsShow = () => {
},
render(createElement) {
return createElement(App, {
- props: { organization, groupsAndProjectsOrganizationPath },
+ props: { organization, groupsAndProjectsOrganizationPath, associationCounts },
});
},
});
diff --git a/app/helpers/organizations/organization_helper.rb b/app/helpers/organizations/organization_helper.rb
index 196327835e3..6b5c4342c5c 100644
--- a/app/helpers/organizations/organization_helper.rb
+++ b/app/helpers/organizations/organization_helper.rb
@@ -5,7 +5,14 @@ module Organizations
def organization_show_app_data(organization)
{
organization: organization.slice(:id, :name),
- groups_and_projects_organization_path: groups_and_projects_organization_path(organization)
+ groups_and_projects_organization_path: groups_and_projects_organization_path(organization),
+ # TODO: Update counts to use real data
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/424531
+ association_counts: {
+ groups: 10,
+ projects: 5,
+ users: 1050
+ }
}.merge(shared_groups_and_projects_app_data).to_json
end
diff --git a/config/feature_flags/development/standard_merge_train_ref_merge_commit.yml b/config/feature_flags/development/standard_merge_train_ref_merge_commit.yml
index 93e73e1c6b7..a9fba90a264 100644
--- a/config/feature_flags/development/standard_merge_train_ref_merge_commit.yml
+++ b/config/feature_flags/development/standard_merge_train_ref_merge_commit.yml
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/422724
milestone: '16.4'
type: development
group: group::pipeline execution
-default_enabled: false
+default_enabled: true
diff --git a/data/deprecations/15-9-license-compliance-ci-template.yml b/data/deprecations/15-9-license-compliance-ci-template.yml
index 9509149d01f..2defcda89ee 100644
--- a/data/deprecations/15-9-license-compliance-ci-template.yml
+++ b/data/deprecations/15-9-license-compliance-ci-template.yml
@@ -12,7 +12,7 @@
To continue using GitLab for license compliance, remove the **License Compliance** template from your CI/CD pipeline and add the **Dependency Scanning** template. The **Dependency Scanning** template is now capable of gathering the required license information, so it is no longer necessary to run a separate license compliance job.
- Before you remove the **License Compliance** CI/CD template, verify that the `license_scanning_sbom_scanner` and `package_metadata_synchronization` flags are enabled for the instance and that the instance has been upgraded to a version that supports the new method of license scanning.
+ Before you remove the **License Compliance** CI/CD template, verify that the instance has been upgraded to a version that supports the new method of license scanning.
To begin using the Dependency Scanner quickly at scale, you may set up a scan execution policy at the group level to enforce the SBOM-based license scan for all projects in the group. Then, you may remove the inclusion of the `Jobs/License-Scanning.gitlab-ci.yml` template from your CI/CD configuration.
diff --git a/doc/development/documentation/styleguide/word_list.md b/doc/development/documentation/styleguide/word_list.md
index 91a1777f8e8..509cabbe631 100644
--- a/doc/development/documentation/styleguide/word_list.md
+++ b/doc/development/documentation/styleguide/word_list.md
@@ -22,7 +22,9 @@ For guidance not on this page, we defer to these style guides:
- [Google Developer Documentation Style Guide](https://developers.google.com/style)
<!-- vale off -->
-<!-- markdownlint-disable -->
+
+<!-- Disable trailing punctuation in heading rule https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md026---trailing-punctuation-in-heading -->
+<!-- markdownlint-disable MD026 -->
## `&`
@@ -233,7 +235,6 @@ Use **text box** to refer to the UI field. Do not use **field** or **box**. For
- In the **Variable name** text box, enter a value.
-
## bullet
Don't refer to individual items in an ordered or unordered list as **bullets**. Use **list item** instead. If you need to be less ambiguous, you can use:
@@ -813,7 +814,7 @@ Do not use **in order to**. Use **to** instead. ([Vale](../testing.md#vale) rule
For the plural of **index**, use **indexes**.
-However, for ElasticSearch, use [**indices**](https://www.elastic.co/blog/what-is-an-elasticsearch-index).
+However, for Elasticsearch, use [**indices**](https://www.elastic.co/blog/what-is-an-elasticsearch-index).
## Installation from source
@@ -848,7 +849,7 @@ Use lowercase for **issue**.
Use lowercase for **issue board**.
-# Issue description generation
+## Issue description generation
Use sentence case for **Issue description generation**.
@@ -923,13 +924,13 @@ When writing about licenses:
Use:
- - Add a license to your instance.
- - Purchase a subscription.
+- Add a license to your instance.
+- Purchase a subscription.
Instead of:
- - Buy a license.
- - Purchase a license.
+- Buy a license.
+- Purchase a license.
## limitations
@@ -1347,7 +1348,7 @@ Do not use **roles** and [**permissions**](#permissions) interchangeably. Each u
Roles are not the same as [**access levels**](#access-level).
-# Root cause analysis
+## Root cause analysis
Use sentence case for **Root cause analysis**.
diff --git a/doc/development/fe_guide/getting_started.md b/doc/development/fe_guide/getting_started.md
index 23914be0f6a..4b9f9a7706d 100644
--- a/doc/development/fe_guide/getting_started.md
+++ b/doc/development/fe_guide/getting_started.md
@@ -45,7 +45,7 @@ As you write code, make sure to test your change thoroughly. It is the author's
When it's time to send your code to review, it can be quite stressful. It is recommended to read through [the code review guidelines](../code_review.md) to get a better sense of what to expect. One of the most valuable pieces of advice that is **essential** is simply:
-> [...] to avoid unnecessary back-and-forth with reviewers, [...] perform a self-review of your own merge request, and follow the Code Review guidelines.
+> ... to avoid unnecessary back-and-forth with reviewers, ... perform a self-review of your own merge request, and follow the Code Review guidelines.
This is key to having a great merge request experience because you will catch small mistakes and leave comments in areas where your reviewer might be uncertain and have questions. This speeds up the process tremendously.
diff --git a/doc/tutorials/configure_gitlab_runner_to_use_gke/index.md b/doc/tutorials/configure_gitlab_runner_to_use_gke/index.md
index b13467b7765..8fa2dbe3479 100644
--- a/doc/tutorials/configure_gitlab_runner_to_use_gke/index.md
+++ b/doc/tutorials/configure_gitlab_runner_to_use_gke/index.md
@@ -80,15 +80,11 @@ Now that you have a cluster, you're ready to install and configure the Kubernete
1. Install the Operator Lifecycle Manager (OLM), a tool that manages the Kubernetes Operators that
run on the cluster:
- <!-- markdownlint-disable -->
-
```shell
curl --silent --location "https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.24.0/install.sh" \
| bash -s v0.24.0
```
- <!-- markdownlint-enable -->
-
1. Install the Kubernetes Operator Catalog:
```shell
diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md
index 3e31c1ab46c..73c4812fe37 100644
--- a/doc/update/deprecations.md
+++ b/doc/update/deprecations.md
@@ -1117,7 +1117,7 @@ The GitLab [**License Compliance**](https://docs.gitlab.com/ee/user/compliance/l
To continue using GitLab for license compliance, remove the **License Compliance** template from your CI/CD pipeline and add the **Dependency Scanning** template. The **Dependency Scanning** template is now capable of gathering the required license information, so it is no longer necessary to run a separate license compliance job.
-Before you remove the **License Compliance** CI/CD template, verify that the `license_scanning_sbom_scanner` and `package_metadata_synchronization` flags are enabled for the instance and that the instance has been upgraded to a version that supports the new method of license scanning.
+Before you remove the **License Compliance** CI/CD template, verify that the instance has been upgraded to a version that supports the new method of license scanning.
To begin using the Dependency Scanner quickly at scale, you may set up a scan execution policy at the group level to enforce the SBOM-based license scan for all projects in the group. Then, you may remove the inclusion of the `Jobs/License-Scanning.gitlab-ci.yml` template from your CI/CD configuration.
diff --git a/doc/user/compliance/license_scanning_of_cyclonedx_files/index.md b/doc/user/compliance/license_scanning_of_cyclonedx_files/index.md
index 214949af19c..a25b16295cd 100644
--- a/doc/user/compliance/license_scanning_of_cyclonedx_files/index.md
+++ b/doc/user/compliance/license_scanning_of_cyclonedx_files/index.md
@@ -7,13 +7,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# License scanning of CycloneDX files **(ULTIMATE ALL)**
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384932) in GitLab 15.9 for GitLab SaaS [with two flags](../../../administration/feature_flags.md) named `license_scanning_sbom_scanner` and `package_metadata_synchronization`. Both flags are disabled by default and both flags must be enabled for this feature to work.
-> - [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/385173) in GitLab 15.10 for GitLab SaaS.
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385173) in GitLab 15.10 for self-managed GitLab [with two flags](../../../administration/feature_flags.md) named `license_scanning_sbom_scanner` and `package_metadata_synchronization`, both of which must be enabled for this feature to work. The flags are disabled by default due to the initial performance load when the license database is first imported. Work to improve performance is being tracked in [issue 397670](https://gitlab.com/gitlab-org/gitlab/-/issues/397670).
-> - [Enabled](https://gitlab.com/gitlab-org/gitlab/-/issues/385173) in GitLab 15.11 for self-managed GitLab.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/384932) in GitLab 15.9 for GitLab SaaS [with two flags](../../../administration/feature_flags.md) named `license_scanning_sbom_scanner` and `package_metadata_synchronization`. Both flags disabled by default.
+> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/385176) in GitLab 16.4. Feature flags `license_scanning_sbom_scanner` and `package_metadata_synchronization` removed.
-FLAG:
-The legacy License Compliance analyzer was deprecated in GitLab 15.9 and removed in GitLab 16.3. To continue using GitLab for License Compliance, remove the License Compliance template from your CI/CD pipeline and add the [Dependency Scanning template](../../application_security/dependency_scanning/index.md#configuration). The Dependency Scanning template is now capable of gathering the required license information so it is no longer necessary to run a separate License Compliance job. The License Compliance CI/CD template should not be removed prior to verifying that the `license_scanning_sbom_scanner` and `package_metadata_synchronization` flags are enabled for the instance and that the instance has been upgraded to a version that supports the new method of license scanning. To begin using the Dependency Scanner quickly at scale, you may set up a [scan execution policy](../../application_security/policies/scan-execution-policies.md) at the group level to enforce the SBOM-based license scan for all projects in the group. Then, you may remove the inclusion of the `Jobs/License-Scanning.gitlab-ci.yml` template from your CI/CD configuration. If you wish to continue using the legacy License Compliance feature, you can do so by setting the `LICENSE_MANAGEMENT_VERSION CI` variable to `4`. This variable can be set at the [project](../../../ci/variables/index.md#for-a-project), [group](../../../ci/variables/index.md#for-a-group) or [instance](../../../ci/variables/index.md#for-an-instance) level. This configuration change will allow you to continue using the existing version of License Compliance to generate [license scanning report](../../../ci/yaml/artifacts_reports.md#artifactsreportslicense_scanning) artifacts in your pipelines. However, since legacy license scanning support is being removed from our codebase, switching back to this legacy analyzer prevents other License Compliance features from working as expected, so this approach is not recommended. In addition to this, **bugs and vulnerabilities in this legacy analyzer will no longer be fixed.**
+NOTE:
+The legacy License Compliance analyzer was deprecated in GitLab 15.9 and removed in GitLab 16.3. To continue using GitLab for License Compliance, remove the License Compliance template from your CI/CD pipeline and add the [Dependency Scanning template](../../application_security/dependency_scanning/index.md#configuration). The Dependency Scanning template is now capable of gathering the required license information so it is no longer necessary to run a separate License Compliance job. The License Compliance CI/CD template should not be removed prior to verifying that the instance has been upgraded to a version that supports the new method of license scanning. To begin using the Dependency Scanner quickly at scale, you may set up a [scan execution policy](../../application_security/policies/scan-execution-policies.md) at the group level to enforce the SBOM-based license scan for all projects in the group. Then, you may remove the inclusion of the `Jobs/License-Scanning.gitlab-ci.yml` template from your CI/CD configuration. If you wish to continue using the legacy License Compliance feature, you can do so by setting the `LICENSE_MANAGEMENT_VERSION CI` variable to `4`. This variable can be set at the [project](../../../ci/variables/index.md#for-a-project), [group](../../../ci/variables/index.md#for-a-group) or [instance](../../../ci/variables/index.md#for-an-instance) level. This configuration change will allow you to continue using the existing version of License Compliance to generate [license scanning report](../../../ci/yaml/artifacts_reports.md#artifactsreportslicense_scanning) artifacts in your pipelines. However, since legacy license scanning support is being removed from our codebase, switching back to this legacy analyzer prevents other License Compliance features from working as expected, so this approach is not recommended. In addition to this, **bugs and vulnerabilities in this legacy analyzer will no longer be fixed.**
To detect the licenses in use, License Compliance relies on running the
[Dependency Scanning CI Jobs](../../application_security/dependency_scanning/index.md),
diff --git a/doc/user/group/manage.md b/doc/user/group/manage.md
index e66ca5591df..0ef71ad5fba 100644
--- a/doc/user/group/manage.md
+++ b/doc/user/group/manage.md
@@ -452,7 +452,7 @@ You can give all users in a group and its subgroups access to [Code Suggestions]
- This setting
[cascades to all projects](../project/merge_requests/approvals/settings.md#settings-cascading) in the group.
- Each user can
- [enable or disable Code Suggestions for themselves](../project/repository/code_suggestions/saas.md#enable-code-suggestions-for-an-individual-user).
+ [Enable Code Suggestions](../../user/profile/preferences.md#enable-code-suggestions).
To enable Code Suggestions for a group:
diff --git a/doc/user/profile/preferences.md b/doc/user/profile/preferences.md
index 4592422eee1..f057e62694b 100644
--- a/doc/user/profile/preferences.md
+++ b/doc/user/profile/preferences.md
@@ -278,7 +278,7 @@ Instead of making separate API calls to get individual accounts, you can find yo
External identities are not included by default.
To enable including external identities, see [Token payload](../../ci/secrets/id_token_authentication.md#token-payload).
-### Control follower engagement
+## Control follower engagement
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/325558) in GitLab 16.0.
@@ -299,8 +299,24 @@ To access your **Followers** and **Following** tabs:
- On the left sidebar, select your avatar > select your name or username.
- Select **Followers** or **Following**.
+## Enable Code Suggestions
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121079) in GitLab 16.1 as [Beta](../../policy/experiment-beta-support.md#beta).
+
+To enable [Code Suggestions](../../user/project/repository/code_suggestions/index.md):
+
+1. On the left sidebar, select your avatar.
+1. Select **Preferences**.
+1. Select the **Enable Code Suggestions** checkbox.
+1. Select **Save changes**.
+
+NOTE:
+If Code Suggestions are turned off [for the group](../../user/group/manage.md#enable-code-suggestions), then you cannot enable them for yourself. (Your setting has no effect.)
+
## Integrate your GitLab instance with third-party services
+Give third-party services access to your GitLab account.
+
### Integrate your GitLab instance with Gitpod
Configure your GitLab instance with Gitpod when you want to launch and manage code directly from your GitLab browser. Gitpod automatically prepares and builds development environments for your projects.
diff --git a/doc/user/project/repository/code_suggestions/saas.md b/doc/user/project/repository/code_suggestions/saas.md
index 4c44034646d..3da854e417b 100644
--- a/doc/user/project/repository/code_suggestions/saas.md
+++ b/doc/user/project/repository/code_suggestions/saas.md
@@ -18,31 +18,22 @@ Write code more efficiently by using generative AI to suggest code while you're
Usage of Code Suggestions is governed by the [GitLab Testing Agreement](https://about.gitlab.com/handbook/legal/testing-agreement/).
Learn about [data usage when using Code Suggestions](index.md#code-suggestions-data-usage).
-## Enable Code Suggestions for a group
-
-You can enable Code Suggestions [for all members of a group](../../../group/manage.md#enable-code-suggestions).
-
-## Enable Code Suggestions for an individual user
+## Enable Code Suggestions
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121079) in GitLab 16.1 as [Beta](../../../../policy/experiment-beta-support.md#beta).
-If Code Suggestions is not enabled for the group, each user can still enable Code Suggestions for themselves:
-
-1. On the left sidebar, select your avatar.
-1. Select **Preferences**.
-1. In the **Code Suggestions** section, select the **Enable Code Suggestions** checkbox.
-1. Select **Save changes**.
+You can enable Code Suggestions for an individual or group:
-If Code Suggestions is enabled for the group, the group setting overrides the user setting.
+- [Enable Code Suggestions for all group members](../../../group/manage.md#enable-code-suggestions). (You must be a group owner).
+- [Enable Code Suggestions for your own account](../../../profile/preferences.md#enable-code-suggestions).
-NOTE:
-This setting controls Code Suggestions for all IDEs. Support for [more granular control per IDE](https://gitlab.com/groups/gitlab-org/-/epics/10624) is proposed.
+The group setting takes precedence over the user setting.
## Use Code Suggestions
Prerequisites:
-- Code Suggestions must be enabled [for the top-level group](../../../group/manage.md#enable-code-suggestions) and [for your user account](#enable-code-suggestions-for-an-individual-user).
+- Ensure Code Suggestions is enabled for your user and group.
- You must have installed and configured a [supported IDE editor extension](index.md#supported-editor-extensions).
To use Code Suggestions:
diff --git a/doc/user/project/repository/code_suggestions/troubleshooting.md b/doc/user/project/repository/code_suggestions/troubleshooting.md
index 4c4c672c2a8..f63dbac03b6 100644
--- a/doc/user/project/repository/code_suggestions/troubleshooting.md
+++ b/doc/user/project/repository/code_suggestions/troubleshooting.md
@@ -15,7 +15,7 @@ If Code Suggestions are not displayed, try the following troubleshooting steps.
In GitLab, ensure Code Suggestions is enabled:
-- [For your user account](saas.md#enable-code-suggestions-for-an-individual-user).
+- [For your user account](../../../profile/preferences.md#enable-code-suggestions).
- [For *all* top-level groups your account belongs to](../../../group/manage.md#enable-code-suggestions). If you don't have a role that lets you view the top-level group's settings, contact a group owner.
To confirm that your account is enabled, go to [https://gitlab.com/api/v4/ml/ai-assist](https://gitlab.com/api/v4/ml/ai-assist). A response of `user_is_allowed` should return `true`.
diff --git a/doc/user/search/advanced_search.md b/doc/user/search/advanced_search.md
index 2d08574b302..c1da3e9e2ba 100644
--- a/doc/user/search/advanced_search.md
+++ b/doc/user/search/advanced_search.md
@@ -39,8 +39,6 @@ You can use advanced search in:
Advanced search uses [Elasticsearch syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax). The syntax supports both exact and fuzzy search queries.
-<!-- markdownlint-disable -->
-
| Syntax | Description | Example |
|--------------|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `"` | Exact search | [`"gem sidekiq"`](https://gitlab.com/search?group_id=9970&project_id=278964&scope=blobs&search=%22gem+sidekiq%22) |
@@ -74,6 +72,8 @@ You can refine user search with [Elasticsearch syntax](#syntax).
### Examples
+<!-- markdownlint-disable MD044 -->
+
| Query | Description |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| [`rails -filename:gemfile.lock`](https://gitlab.com/search?group_id=9970&project_id=278964&repository_ref=&scope=blobs&search=rails+-filename%3Agemfile.lock&snippets=) | Returns `rails` in all files except the `gemfile.lock` file. |
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 879f03519b0..6205cebc585 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -32871,6 +32871,9 @@ msgstr ""
msgid "Organization|Frequently visited projects"
msgstr ""
+msgid "Organization|Manage"
+msgstr ""
+
msgid "Organization|New organization"
msgstr ""
@@ -51912,6 +51915,9 @@ msgstr ""
msgid "View alert details."
msgstr ""
+msgid "View all"
+msgstr ""
+
msgid "View all environments."
msgstr ""
diff --git a/spec/frontend/organizations/show/components/app_spec.js b/spec/frontend/organizations/show/components/app_spec.js
index 268d91c0681..46496e40bdd 100644
--- a/spec/frontend/organizations/show/components/app_spec.js
+++ b/spec/frontend/organizations/show/components/app_spec.js
@@ -2,6 +2,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import App from '~/organizations/show/components/app.vue';
import OrganizationAvatar from '~/organizations/show/components/organization_avatar.vue';
import GroupsAndProjects from '~/organizations/show/components/groups_and_projects.vue';
+import AssociationCount from '~/organizations/show/components/association_counts.vue';
describe('OrganizationShowApp', () => {
let wrapper;
@@ -11,6 +12,11 @@ describe('OrganizationShowApp', () => {
id: 1,
name: 'GitLab',
},
+ associationCounts: {
+ groups: 10,
+ projects: 5,
+ users: 6,
+ },
groupsAndProjectsOrganizationPath: '/-/organizations/default/groups_and_projects',
};
@@ -33,4 +39,11 @@ describe('OrganizationShowApp', () => {
wrapper.findComponent(GroupsAndProjects).props('groupsAndProjectsOrganizationPath'),
).toEqual(defaultPropsData.groupsAndProjectsOrganizationPath);
});
+
+ it('renders associations count component and passes expected props', () => {
+ expect(wrapper.findComponent(AssociationCount).props()).toEqual({
+ associationCounts: defaultPropsData.associationCounts,
+ groupsAndProjectsOrganizationPath: defaultPropsData.groupsAndProjectsOrganizationPath,
+ });
+ });
});
diff --git a/spec/frontend/organizations/show/components/association_count_card_spec.js b/spec/frontend/organizations/show/components/association_count_card_spec.js
new file mode 100644
index 00000000000..752a02110b6
--- /dev/null
+++ b/spec/frontend/organizations/show/components/association_count_card_spec.js
@@ -0,0 +1,48 @@
+import { GlCard, GlLink } from '@gitlab/ui';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
+import AssociationCountCard from '~/organizations/show/components/association_count_card.vue';
+
+describe('AssociationCountCard', () => {
+ let wrapper;
+
+ const defaultPropsData = {
+ title: 'Groups',
+ iconName: 'group',
+ count: 1050,
+ linkHref: '/-/organizations/default/groups_and_projects?display=groups',
+ };
+
+ const createComponent = ({ propsData = {} } = {}) => {
+ wrapper = shallowMountExtended(AssociationCountCard, {
+ propsData: { ...defaultPropsData, ...propsData },
+ });
+ };
+
+ const findCard = () => wrapper.findComponent(GlCard);
+ const findLink = () => findCard().findComponent(GlLink);
+
+ it('renders card with title, link and count', () => {
+ createComponent();
+
+ const card = findCard();
+ const link = findLink();
+
+ expect(card.text()).toContain(defaultPropsData.title);
+ expect(card.text()).toContain('1k');
+ expect(link.text()).toBe('View all');
+ expect(link.attributes('href')).toBe(defaultPropsData.linkHref);
+ });
+
+ describe('when `linkText` prop is set', () => {
+ const linkText = 'Manage';
+ beforeEach(() => {
+ createComponent({
+ propsData: { linkText },
+ });
+ });
+
+ it('sets link text', () => {
+ expect(findLink().text()).toBe(linkText);
+ });
+ });
+});
diff --git a/spec/frontend/organizations/show/components/association_counts_spec.js b/spec/frontend/organizations/show/components/association_counts_spec.js
new file mode 100644
index 00000000000..80e57ede502
--- /dev/null
+++ b/spec/frontend/organizations/show/components/association_counts_spec.js
@@ -0,0 +1,61 @@
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
+import AssociationCounts from '~/organizations/show/components/association_counts.vue';
+import AssociationCountCard from '~/organizations/show/components/association_count_card.vue';
+
+describe('AssociationCounts', () => {
+ let wrapper;
+
+ const defaultPropsData = {
+ associationCounts: {
+ groups: 10,
+ projects: 5,
+ users: 6,
+ },
+ groupsAndProjectsOrganizationPath: '/-/organizations/default/groups_and_projects',
+ };
+
+ const createComponent = ({ propsData = {} } = {}) => {
+ wrapper = shallowMountExtended(AssociationCounts, {
+ propsData: { ...defaultPropsData, ...propsData },
+ });
+ };
+
+ const findAssociationCountCardAt = (index) =>
+ wrapper.findAllComponents(AssociationCountCard).at(index);
+
+ it('renders groups association count card', () => {
+ createComponent();
+
+ expect(findAssociationCountCardAt(0).props()).toEqual({
+ title: 'Groups',
+ iconName: 'group',
+ count: defaultPropsData.associationCounts.groups,
+ linkText: 'View all',
+ linkHref: '/-/organizations/default/groups_and_projects?display=groups',
+ });
+ });
+
+ it('renders projects association count card', () => {
+ createComponent();
+
+ expect(findAssociationCountCardAt(1).props()).toEqual({
+ title: 'Projects',
+ iconName: 'project',
+ count: defaultPropsData.associationCounts.projects,
+ linkText: 'View all',
+ linkHref: '/-/organizations/default/groups_and_projects?display=projects',
+ });
+ });
+
+ it('renders users association count card', () => {
+ createComponent();
+
+ expect(findAssociationCountCardAt(2).props()).toEqual({
+ title: 'Users',
+ iconName: 'users',
+ count: defaultPropsData.associationCounts.users,
+ linkText: 'Manage',
+ linkHref: '/',
+ });
+ });
+});
diff --git a/spec/helpers/organizations/organization_helper_spec.rb b/spec/helpers/organizations/organization_helper_spec.rb
index 0d6d3b34dc9..ec99d928059 100644
--- a/spec/helpers/organizations/organization_helper_spec.rb
+++ b/spec/helpers/organizations/organization_helper_spec.rb
@@ -35,7 +35,12 @@ RSpec.describe Organizations::OrganizationHelper, feature_category: :cell do
'new_group_path' => new_group_path,
'new_project_path' => new_project_path,
'groups_empty_state_svg_path' => groups_empty_state_svg_path,
- 'projects_empty_state_svg_path' => projects_empty_state_svg_path
+ 'projects_empty_state_svg_path' => projects_empty_state_svg_path,
+ 'association_counts' => {
+ 'groups' => 10,
+ 'projects' => 5,
+ 'users' => 1050
+ }
}
)
end