Commit cf21ab45 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera Committed by Olena Horal-Koretska

Move the store to new infrastructure registry folder

parent cf5889bd
<script>
import { mapState, mapActions } from 'vuex';
import { LIST_KEY_PACKAGE_TYPE } from '~/packages/list/constants';
import { sortableFields } from '~/packages/list/utils';
import { LIST_KEY_PACKAGE_TYPE } from '~/packages_and_registries/infrastructure_registry/list/constants';
import { sortableFields } from '~/packages_and_registries/infrastructure_registry/list/utils';
import RegistrySearch from '~/vue_shared/components/registry/registry_search.vue';
import UrlSync from '~/vue_shared/components/url_sync.vue';
......
......@@ -10,7 +10,7 @@ import { getQueryParams, extractFilterAndSorting } from '~/packages_and_registri
import InfrastructureTitle from '~/packages_and_registries/infrastructure_registry/list/components/infrastructure_title.vue';
import InfrastructureSearch from '~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue';
import PackageList from '~/packages_and_registries/infrastructure_registry/list/components/packages_list.vue';
import { DELETE_PACKAGE_SUCCESS_MESSAGE } from '~/packages/list/constants';
import { DELETE_PACKAGE_SUCCESS_MESSAGE } from '~/packages_and_registries/infrastructure_registry/list/constants';
export default {
components: {
......
import { __, s__ } from '~/locale';
import { PackageType } from '../shared/constants';
import { __ } from '~/locale';
export const FETCH_PACKAGES_LIST_ERROR_MESSAGE = __(
'Something went wrong while fetching the packages list.',
);
export const FETCH_PACKAGE_ERROR_MESSAGE = __('Something went wrong while fetching the package.');
export const DELETE_PACKAGE_SUCCESS_MESSAGE = __('Package deleted successfully');
export const DEFAULT_PAGE = 1;
......@@ -17,14 +15,12 @@ export const LIST_KEY_PROJECT = 'project_path';
export const LIST_KEY_VERSION = 'version';
export const LIST_KEY_PACKAGE_TYPE = 'type';
export const LIST_KEY_CREATED_AT = 'created_at';
export const LIST_KEY_ACTIONS = 'actions';
export const LIST_LABEL_NAME = __('Name');
export const LIST_LABEL_PROJECT = __('Project');
export const LIST_LABEL_VERSION = __('Version');
export const LIST_LABEL_PACKAGE_TYPE = __('Type');
export const LIST_LABEL_CREATED_AT = __('Published');
export const LIST_LABEL_ACTIONS = '';
// The following is not translated because it is used to build a JavaScript exception error message
export const MISSING_DELETE_PATH_ERROR = 'Missing delete_api_path link';
......@@ -52,48 +48,4 @@ export const SORT_FIELDS = [
},
];
export const PACKAGE_TYPES = [
{
title: s__('PackageRegistry|Composer'),
type: PackageType.COMPOSER,
},
{
title: s__('PackageRegistry|Conan'),
type: PackageType.CONAN,
},
{
title: s__('PackageRegistry|Generic'),
type: PackageType.GENERIC,
},
{
title: s__('PackageRegistry|Maven'),
type: PackageType.MAVEN,
},
{
title: s__('PackageRegistry|npm'),
type: PackageType.NPM,
},
{
title: s__('PackageRegistry|NuGet'),
type: PackageType.NUGET,
},
{
title: s__('PackageRegistry|PyPI'),
type: PackageType.PYPI,
},
{
title: s__('PackageRegistry|RubyGems'),
type: PackageType.RUBYGEMS,
},
{
title: s__('PackageRegistry|Debian'),
type: PackageType.DEBIAN,
},
{
title: s__('PackageRegistry|Helm'),
type: PackageType.HELM,
},
];
export const TERRAFORM_SEARCH_TYPE = Object.freeze({ value: { data: 'terraform_module' } });
import { beautifyPath } from '../../shared/utils';
import { beautifyPath } from '~/packages/shared/utils';
import { LIST_KEY_PROJECT } from '../constants';
export default (state) =>
......
import Vue from 'vue';
import { s__ } from '~/locale';
import PackagesListApp from '~/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue';
import { createStore } from '~/packages/list/stores';
import { createStore } from '~/packages_and_registries/infrastructure_registry/list/stores';
import Translate from '~/vue_shared/translate';
Vue.use(Translate);
......
......@@ -32549,9 +32549,6 @@ msgstr ""
msgid "Something went wrong while fetching the environments for this merge request. Please try again."
msgstr ""
msgid "Something went wrong while fetching the package."
msgstr ""
msgid "Something went wrong while fetching the packages list."
msgstr ""
......
import { mount } from '@vue/test-utils';
import PackageTags from '~/packages/shared/components/package_tags.vue';
import { mockTags } from '../../mock_data';
import { mockTags } from 'jest/packages_and_registries/infrastructure_registry/components/mock_data';
describe('PackageTags', () => {
let wrapper;
......
import { shallowMount } from '@vue/test-utils';
import PublishMethod from '~/packages/shared/components/publish_method.vue';
import { packageList } from '../../mock_data';
import { packageList } from 'jest/packages_and_registries/infrastructure_registry/components/mock_data';
describe('publish_method', () => {
let wrapper;
......
......@@ -5,7 +5,7 @@ import {
getPackageTypeLabel,
getCommitLink,
} from '~/packages/shared/utils';
import { packageList } from '../mock_data';
import { packageList } from 'jest/packages_and_registries/infrastructure_registry/components/mock_data';
describe('Packages shared utils', () => {
describe('packageTypeToTrackCategory', () => {
......
......@@ -17,7 +17,7 @@ import TerraformTitle from '~/packages_and_registries/infrastructure_registry/de
import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue';
import Tracking from '~/tracking';
import { mavenPackage, mavenFiles, npmPackage } from 'jest/packages/mock_data';
import { mavenPackage, mavenFiles, npmPackage } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { terraformModule, mavenFiles, npmPackage } from 'jest/packages/mock_data';
import component from '~/packages_and_registries/infrastructure_registry/details/components/details_title.vue';
import TitleArea from '~/vue_shared/components/registry/title_area.vue';
import { terraformModule, mavenFiles, npmPackage } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
......
......@@ -6,7 +6,7 @@ import component from '~/packages_and_registries/infrastructure_registry/details
import FileIcon from '~/vue_shared/components/file_icon.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { npmFiles, mavenFiles } from 'jest/packages/mock_data';
import { npmFiles, mavenFiles } from '../../mock_data';
describe('Package Files', () => {
let wrapper;
......
......@@ -6,7 +6,7 @@ import { HISTORY_PIPELINES_LIMIT } from '~/packages_and_registries/shared/consta
import HistoryItem from '~/vue_shared/components/registry/history_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { mavenPackage, mockPipelineInfo } from 'jest/packages/mock_data';
import { mavenPackage, mockPipelineInfo } from '../../mock_data';
describe('Package History', () => {
let wrapper;
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { terraformModule as packageEntity } from 'jest/packages/mock_data';
import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue';
import CodeInstructions from '~/vue_shared/components/registry/code_instruction.vue';
import { terraformModule as packageEntity } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
......
......@@ -13,7 +13,7 @@ import {
DELETE_PACKAGE_FILE_ERROR_MESSAGE,
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE,
} from '~/packages/shared/constants';
import { npmPackage as packageEntity } from '../../../../../packages/mock_data';
import { npmPackage as packageEntity } from '../../mock_data';
jest.mock('~/flash.js');
jest.mock('~/api.js');
......
......@@ -3,7 +3,7 @@ import {
npmPackage,
mockPipelineInfo,
mavenPackage as packageWithoutBuildInfo,
} from 'jest/packages/mock_data';
} from '../../mock_data';
describe('Getters PackageDetails Store', () => {
let state;
......
import * as types from '~/packages_and_registries/infrastructure_registry/details/store/mutation_types';
import mutations from '~/packages_and_registries/infrastructure_registry/details/store/mutations';
import { npmPackage as packageEntity } from 'jest/packages/mock_data';
import { npmPackage as packageEntity } from '../../mock_data';
describe('Mutations package details Store', () => {
let mockState;
......
......@@ -5,7 +5,7 @@ import setWindowLocation from 'helpers/set_window_location_helper';
import createFlash from '~/flash';
import * as commonUtils from '~/lib/utils/common_utils';
import PackageListApp from '~/packages_and_registries/infrastructure_registry/list/components/packages_list_app.vue';
import { DELETE_PACKAGE_SUCCESS_MESSAGE } from '~/packages/list/constants';
import { DELETE_PACKAGE_SUCCESS_MESSAGE } from '~/packages_and_registries/infrastructure_registry/list/constants';
import { SHOW_DELETE_SUCCESS_ALERT } from '~/packages/shared/constants';
import { FILTERED_SEARCH_TERM } from '~/packages_and_registries/shared/constants';
import * as packageUtils from '~/packages_and_registries/shared/utils';
......
......@@ -9,7 +9,7 @@ import PackagesListLoader from '~/packages/shared/components/packages_list_loade
import { TrackingActions } from '~/packages/shared/constants';
import * as SharedUtils from '~/packages/shared/utils';
import Tracking from '~/tracking';
import { packageList } from '../../../../../packages/mock_data';
import { packageList } from '../../mock_data';
const localVue = createLocalVue();
localVue.use(Vuex);
......
......@@ -3,9 +3,9 @@ import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import Api from '~/api';
import createFlash from '~/flash';
import { MISSING_DELETE_PATH_ERROR } from '~/packages/list/constants';
import * as actions from '~/packages/list/stores/actions';
import * as types from '~/packages/list/stores/mutation_types';
import { MISSING_DELETE_PATH_ERROR } from '~/packages_and_registries/infrastructure_registry/list/constants';
import * as actions from '~/packages_and_registries/infrastructure_registry/list/stores/actions';
import * as types from '~/packages_and_registries/infrastructure_registry/list/stores/mutation_types';
import { DELETE_PACKAGE_ERROR_MESSAGE } from '~/packages/shared/constants';
jest.mock('~/flash.js');
......
import getList from '~/packages/list/stores/getters';
import getList from '~/packages_and_registries/infrastructure_registry/list/stores/getters';
import { packageList } from '../../mock_data';
describe('Getters registry list store', () => {
......
import * as commonUtils from '~/lib/utils/common_utils';
import * as types from '~/packages/list/stores/mutation_types';
import mutations from '~/packages/list/stores/mutations';
import createState from '~/packages/list/stores/state';
import * as types from '~/packages_and_registries/infrastructure_registry/list/stores/mutation_types';
import mutations from '~/packages_and_registries/infrastructure_registry/list/stores/mutations';
import createState from '~/packages_and_registries/infrastructure_registry/list/stores/state';
import { npmPackage, mavenPackage } from '../../mock_data';
describe('Mutations Registry Store', () => {
......
import { SORT_FIELDS } from '~/packages/list/constants';
import { getNewPaginationPage, sortableFields } from '~/packages/list/utils';
import { SORT_FIELDS } from '~/packages_and_registries/infrastructure_registry/list/constants';
import {
getNewPaginationPage,
sortableFields,
} from '~/packages_and_registries/infrastructure_registry/list/utils';
describe('Packages list utils', () => {
describe('sortableFields', () => {
......
......@@ -8,7 +8,7 @@ import PackageTags from '~/packages/shared/components/package_tags.vue';
import { PACKAGE_ERROR_STATUS } from '~/packages/shared/constants';
import ListItem from '~/vue_shared/components/registry/list_item.vue';
import { packageList } from '../../../../packages/mock_data';
import { packageList } from '../mock_data';
describe('packages_list_row', () => {
let wrapper;
......
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