diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-06-21 10:11:53 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-06-21 10:11:53 +0000 |
commit | dff6165e8c7d9e1cadbc7c014136dab1c69df62c (patch) | |
tree | 10c79f7fea1018322ca603d06d91497c10db6775 | |
parent | 77cb03166d34c25bb3383fac0065e64d544323fc (diff) | |
parent | 91cf0cb2d53b6f48560862fc121f897bb7331046 (diff) | |
download | gitlab-ce-dff6165e8c7d9e1cadbc7c014136dab1c69df62c.tar.gz |
Merge branch 'paginate-license-management' into 'master'
Backport and Docs for Paginate license management and add license search
See merge request gitlab-org/gitlab-ce!27602
-rw-r--r-- | app/assets/javascripts/vue_shared/components/paginated_list.vue | 35 | ||||
-rw-r--r-- | changelogs/unreleased/paginate-license-management.yml | 5 | ||||
-rw-r--r-- | doc/user/application_security/license_management/img/license_management_add_license.png | bin | 0 -> 87049 bytes | |||
-rw-r--r-- | doc/user/application_security/license_management/img/license_management_search.png | bin | 0 -> 104278 bytes | |||
-rw-r--r-- | doc/user/application_security/license_management/img/license_management_settings.png | bin | 13300 -> 171592 bytes | |||
-rw-r--r-- | doc/user/application_security/license_management/index.md | 16 | ||||
-rw-r--r-- | spec/frontend/vue_shared/components/paginated_list_spec.js | 56 |
7 files changed, 112 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/paginated_list.vue b/app/assets/javascripts/vue_shared/components/paginated_list.vue new file mode 100644 index 00000000000..e19b8510399 --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/paginated_list.vue @@ -0,0 +1,35 @@ +<script> +import { GlPaginatedList } from '@gitlab/ui'; +import { PREV, NEXT } from '~/vue_shared/components/pagination/constants'; + +export default { + components: { + GlPaginatedList, + }, + labels: { + prev: PREV, + next: NEXT, + }, +}; +</script> + +<template> + <gl-paginated-list + v-bind="$attrs" + :prev-text="$options.labels.prev" + :next-text="$options.labels.next" + > + <!-- proxy the slots --> + <template #header> + <slot name="header"></slot> + </template> + + <template #subheader> + <slot name="subheader"></slot> + </template> + + <template #default="{ listItem, query }"> + <slot :listItem="listItem" :query="query"></slot> + </template> + </gl-paginated-list> +</template> diff --git a/changelogs/unreleased/paginate-license-management.yml b/changelogs/unreleased/paginate-license-management.yml new file mode 100644 index 00000000000..c5134978612 --- /dev/null +++ b/changelogs/unreleased/paginate-license-management.yml @@ -0,0 +1,5 @@ +--- +title: Backport and Docs for Paginate license management and add license search +merge_request: 27602 +author: +type: changed diff --git a/doc/user/application_security/license_management/img/license_management_add_license.png b/doc/user/application_security/license_management/img/license_management_add_license.png Binary files differnew file mode 100644 index 00000000000..1e1a698515b --- /dev/null +++ b/doc/user/application_security/license_management/img/license_management_add_license.png diff --git a/doc/user/application_security/license_management/img/license_management_search.png b/doc/user/application_security/license_management/img/license_management_search.png Binary files differnew file mode 100644 index 00000000000..7b6006cef9d --- /dev/null +++ b/doc/user/application_security/license_management/img/license_management_search.png diff --git a/doc/user/application_security/license_management/img/license_management_settings.png b/doc/user/application_security/license_management/img/license_management_settings.png Binary files differindex b5490e59074..1a2bfa78a03 100644 --- a/doc/user/application_security/license_management/img/license_management_settings.png +++ b/doc/user/application_security/license_management/img/license_management_settings.png diff --git a/doc/user/application_security/license_management/index.md b/doc/user/application_security/license_management/index.md index 7a583016586..957c4ede981 100644 --- a/doc/user/application_security/license_management/index.md +++ b/doc/user/application_security/license_management/index.md @@ -262,6 +262,8 @@ To approve or blacklist a license: navigate to the project's **Settings > CI/CD** and expand the **License Management** section. 1. Click the **Add a license** button. + + ![License Management Add License](img/license_management_add_license.png) 1. In the **License name** dropdown, either: - Select one of the available licenses. You can search for licenses in the field at the top of the list. @@ -270,8 +272,22 @@ To approve or blacklist a license: 1. Select the **Approve** or **Blacklist** radio button to approve or blacklist respectively the selected license. + + +To modify an existing license: + +1. In the **License Management** list, click the **Approved/Declined** dropdown to change it to the desired status. + ![License Management Settings](img/license_management_settings.png) +Searching for Licenses: + +1. Use the **Search** box to search for a specific license. + + ![License Management Search](img/license_management_search.png) + + + ## License Management report under pipelines > [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/5491) diff --git a/spec/frontend/vue_shared/components/paginated_list_spec.js b/spec/frontend/vue_shared/components/paginated_list_spec.js new file mode 100644 index 00000000000..31ac362d35f --- /dev/null +++ b/spec/frontend/vue_shared/components/paginated_list_spec.js @@ -0,0 +1,56 @@ +import PaginatedList from '~/vue_shared/components/paginated_list.vue'; +import { PREV, NEXT } from '~/vue_shared/components/pagination/constants'; +import { mount } from '@vue/test-utils'; + +describe('Pagination links component', () => { + let wrapper; + let glPaginatedList; + + const template = ` + <div class="slot" slot-scope="{ listItem }"> + <span class="item">Item Name: {{listItem.id}}</span> + </div> + `; + + const props = { + prevText: PREV, + nextText: NEXT, + }; + + beforeEach(() => { + wrapper = mount(PaginatedList, { + scopedSlots: { + default: template, + }, + propsData: { + list: [{ id: 'foo' }, { id: 'bar' }], + props, + }, + }); + + [glPaginatedList] = wrapper.vm.$children; + }); + + afterEach(() => { + wrapper.destroy(); + }); + + describe('Paginated List Component', () => { + describe('props', () => { + // We test attrs and not props because we pass through to child component using v-bind:"$attrs" + it('should pass prevText to GitLab UI paginated list', () => { + expect(glPaginatedList.$attrs['prev-text']).toBe(props.prevText); + }); + it('should pass nextText to GitLab UI paginated list', () => { + expect(glPaginatedList.$attrs['next-text']).toBe(props.nextText); + }); + }); + + describe('rendering', () => { + it('it renders the gl-paginated-list', () => { + expect(wrapper.contains('ul.list-group')).toBe(true); + expect(wrapper.findAll('li.list-group-item').length).toBe(2); + }); + }); + }); +}); |