Move old package details to infrastructure registry

parent 018e51a2
import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import PackagesApp from './components/app.vue';
import createStore from './store';
Vue.use(Translate);
export default () => {
const el = document.querySelector('#js-vue-packages-detail');
const { package: packageJson, canDelete: canDeleteStr, ...rest } = el.dataset;
const packageEntity = JSON.parse(packageJson);
const canDelete = canDeleteStr === 'true';
const store = createStore({
packageEntity,
packageFiles: packageEntity.package_files,
canDelete,
...rest,
});
// eslint-disable-next-line no-new
new Vue({
el,
components: {
PackagesApp,
},
store,
render(createElement) {
return createElement('packages-app');
},
});
};
...@@ -13,13 +13,13 @@ import { mapActions, mapState } from 'vuex'; ...@@ -13,13 +13,13 @@ import { mapActions, mapState } from 'vuex';
import { numberToHumanSize } from '~/lib/utils/number_utils'; import { numberToHumanSize } from '~/lib/utils/number_utils';
import { objectToQuery } from '~/lib/utils/url_utility'; import { objectToQuery } from '~/lib/utils/url_utility';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import TerraformTitle from '~/packages_and_registries/infrastructure_registry/components/details_title.vue'; import TerraformTitle from '~/packages_and_registries/infrastructure_registry/details/components/details_title.vue';
import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/components/terraform_installation.vue'; import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import PackageListRow from '../../shared/components/package_list_row.vue'; import PackageListRow from '~/packages/shared/components/package_list_row.vue';
import PackagesListLoader from '../../shared/components/packages_list_loader.vue'; import PackagesListLoader from '~/packages/shared/components/packages_list_loader.vue';
import { TrackingActions, SHOW_DELETE_SUCCESS_ALERT } from '../../shared/constants'; import { TrackingActions, SHOW_DELETE_SUCCESS_ALERT } from '~/packages/shared/constants';
import { packageTypeToTrackCategory } from '../../shared/utils'; import { packageTypeToTrackCategory } from '~/packages/shared/utils';
import PackageFiles from './package_files.vue'; import PackageFiles from './package_files.vue';
import PackageHistory from './package_history.vue'; import PackageHistory from './package_history.vue';
......
...@@ -3,10 +3,10 @@ import { GlLink, GlTable, GlDropdownItem, GlDropdown, GlIcon, GlButton } from '@ ...@@ -3,10 +3,10 @@ import { GlLink, GlTable, GlDropdownItem, GlDropdown, GlIcon, GlButton } from '@
import { last } from 'lodash'; import { last } from 'lodash';
import { numberToHumanSize } from '~/lib/utils/number_utils'; import { numberToHumanSize } from '~/lib/utils/number_utils';
import { __ } from '~/locale'; import { __ } from '~/locale';
import FileSha from '~/packages/details/components/file_sha.vue';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import FileIcon from '~/vue_shared/components/file_icon.vue'; import FileIcon from '~/vue_shared/components/file_icon.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import FileSha from './file_sha.vue';
export default { export default {
name: 'PackageFiles', name: 'PackageFiles',
......
...@@ -4,7 +4,7 @@ import { GlLink, GlSprintf } from '@gitlab/ui'; ...@@ -4,7 +4,7 @@ import { GlLink, GlSprintf } from '@gitlab/ui';
import { first } from 'lodash'; import { first } from 'lodash';
import { truncateSha } from '~/lib/utils/text_utility'; import { truncateSha } from '~/lib/utils/text_utility';
import { s__, n__ } from '~/locale'; import { s__, n__ } from '~/locale';
import { HISTORY_PIPELINES_LIMIT } from '~/packages/details/constants'; import { HISTORY_PIPELINES_LIMIT } from '~/packages_and_registries/shared/constants';
import HistoryItem from '~/vue_shared/components/registry/history_item.vue'; import HistoryItem from '~/vue_shared/components/registry/history_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
......
...@@ -3,5 +3,3 @@ import { s__ } from '~/locale'; ...@@ -3,5 +3,3 @@ import { s__ } from '~/locale';
export const FETCH_PACKAGE_VERSIONS_ERROR = s__( export const FETCH_PACKAGE_VERSIONS_ERROR = s__(
'PackageRegistry|Unable to fetch package version information.', 'PackageRegistry|Unable to fetch package version information.',
); );
export const HISTORY_PIPELINES_LIMIT = 5;
import Vue from 'vue'; import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import PackagesApp from '~/packages/details/components/app.vue'; import PackagesApp from '~/packages_and_registries/infrastructure_registry/details/components/app.vue';
import createStore from '~/packages/details/store'; import createStore from '~/packages_and_registries/infrastructure_registry/details/store';
import Translate from '~/vue_shared/translate'; import Translate from '~/vue_shared/translate';
Vue.use(Translate); Vue.use(Translate);
......
...@@ -5,7 +5,7 @@ import { first } from 'lodash'; ...@@ -5,7 +5,7 @@ import { first } from 'lodash';
import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { truncateSha } from '~/lib/utils/text_utility'; import { truncateSha } from '~/lib/utils/text_utility';
import { s__, n__ } from '~/locale'; import { s__, n__ } from '~/locale';
import { HISTORY_PIPELINES_LIMIT } from '~/packages/details/constants'; import { HISTORY_PIPELINES_LIMIT } from '~/packages_and_registries/shared/constants';
import HistoryItem from '~/vue_shared/components/registry/history_item.vue'; import HistoryItem from '~/vue_shared/components/registry/history_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
......
export const FILTERED_SEARCH_TERM = 'filtered-search-term'; export const FILTERED_SEARCH_TERM = 'filtered-search-term';
export const FILTERED_SEARCH_TYPE = 'type'; export const FILTERED_SEARCH_TYPE = 'type';
export const HISTORY_PIPELINES_LIMIT = 5;
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
module Project module Project
module Packages module Packages
class Show < QA::Page::Base class Show < QA::Page::Base
view 'app/assets/javascripts/packages/details/components/app.vue' do view 'app/assets/javascripts/packages_and_registries/package_registry/components/details/app.vue' do
element :delete_button element :delete_button
element :delete_modal_button element :delete_modal_button
element :package_information_content element :package_information_content
......
...@@ -5,19 +5,19 @@ import Vuex from 'vuex'; ...@@ -5,19 +5,19 @@ import Vuex from 'vuex';
import { useMockLocationHelper } from 'helpers/mock_window_location_helper'; import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
import stubChildren from 'helpers/stub_children'; import stubChildren from 'helpers/stub_children';
import PackagesApp from '~/packages/details/components/app.vue'; import PackagesApp from '~/packages_and_registries/infrastructure_registry/details/components/app.vue';
import PackageFiles from '~/packages/details/components/package_files.vue'; import PackageFiles from '~/packages_and_registries/infrastructure_registry/details/components/package_files.vue';
import PackageHistory from '~/packages/details/components/package_history.vue'; import PackageHistory from '~/packages_and_registries/infrastructure_registry/details/components/package_history.vue';
import * as getters from '~/packages/details/store/getters'; import * as getters from '~/packages_and_registries/infrastructure_registry/details/store/getters';
import PackageListRow from '~/packages/shared/components/package_list_row.vue'; import PackageListRow from '~/packages/shared/components/package_list_row.vue';
import PackagesListLoader from '~/packages/shared/components/packages_list_loader.vue'; import PackagesListLoader from '~/packages/shared/components/packages_list_loader.vue';
import { TrackingActions } from '~/packages/shared/constants'; import { TrackingActions } from '~/packages/shared/constants';
import * as SharedUtils from '~/packages/shared/utils'; import * as SharedUtils from '~/packages/shared/utils';
import TerraformTitle from '~/packages_and_registries/infrastructure_registry/components/details_title.vue'; import TerraformTitle from '~/packages_and_registries/infrastructure_registry/details/components/details_title.vue';
import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/components/terraform_installation.vue'; import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import { mavenPackage, mavenFiles, npmPackage } from '../../mock_data'; import { mavenPackage, mavenFiles, npmPackage } from 'jest/packages/mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { terraformModule, mavenFiles, npmPackage } from 'jest/packages/mock_data'; import { terraformModule, mavenFiles, npmPackage } from 'jest/packages/mock_data';
import component from '~/packages_and_registries/infrastructure_registry/components/details_title.vue'; import component from '~/packages_and_registries/infrastructure_registry/details/components/details_title.vue';
import TitleArea from '~/vue_shared/components/registry/title_area.vue'; import TitleArea from '~/vue_shared/components/registry/title_area.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import FileSha from '~/packages/details/components/file_sha.vue'; import FileSha from '~/packages_and_registries/infrastructure_registry/details/components/file_sha.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import DetailsRow from '~/vue_shared/components/registry/details_row.vue'; import DetailsRow from '~/vue_shared/components/registry/details_row.vue';
......
...@@ -2,11 +2,11 @@ import { GlDropdown, GlButton } from '@gitlab/ui'; ...@@ -2,11 +2,11 @@ import { GlDropdown, GlButton } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { nextTick } from 'vue/'; import { nextTick } from 'vue/';
import stubChildren from 'helpers/stub_children'; import stubChildren from 'helpers/stub_children';
import component from '~/packages/details/components/package_files.vue'; import component from '~/packages_and_registries/infrastructure_registry/details/components/package_files.vue';
import FileIcon from '~/vue_shared/components/file_icon.vue'; import FileIcon from '~/vue_shared/components/file_icon.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { npmFiles, mavenFiles } from '../../mock_data'; import { npmFiles, mavenFiles } from 'jest/packages/mock_data';
describe('Package Files', () => { describe('Package Files', () => {
let wrapper; let wrapper;
......
import { GlLink, GlSprintf } from '@gitlab/ui'; import { GlLink, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { stubComponent } from 'helpers/stub_component'; import { stubComponent } from 'helpers/stub_component';
import component from '~/packages/details/components/package_history.vue'; import component from '~/packages_and_registries/infrastructure_registry/details/components/package_history.vue';
import { HISTORY_PIPELINES_LIMIT } from '~/packages/details/constants'; import { HISTORY_PIPELINES_LIMIT } from '~/packages_and_registries/shared/constants';
import HistoryItem from '~/vue_shared/components/registry/history_item.vue'; import HistoryItem from '~/vue_shared/components/registry/history_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { mavenPackage, mockPipelineInfo } from '../../mock_data'; import { mavenPackage, mockPipelineInfo } from 'jest/packages/mock_data';
describe('Package History', () => { describe('Package History', () => {
let wrapper; let wrapper;
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { terraformModule as packageEntity } from 'jest/packages/mock_data'; import { terraformModule as packageEntity } from 'jest/packages/mock_data';
import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/components/terraform_installation.vue'; import TerraformInstallation from '~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue';
import CodeInstructions from '~/vue_shared/components/registry/code_instruction.vue'; import CodeInstructions from '~/vue_shared/components/registry/code_instruction.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
import testAction from 'helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import Api from '~/api'; import Api from '~/api';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { FETCH_PACKAGE_VERSIONS_ERROR } from '~/packages/details/constants'; import { FETCH_PACKAGE_VERSIONS_ERROR } from '~/packages_and_registries/infrastructure_registry/details/constants';
import { import {
fetchPackageVersions, fetchPackageVersions,
deletePackage, deletePackage,
deletePackageFile, deletePackageFile,
} from '~/packages/details/store/actions'; } from '~/packages_and_registries/infrastructure_registry/details/store/actions';
import * as types from '~/packages/details/store/mutation_types'; import * as types from '~/packages_and_registries/infrastructure_registry/details/store/mutation_types';
import { import {
DELETE_PACKAGE_ERROR_MESSAGE, DELETE_PACKAGE_ERROR_MESSAGE,
DELETE_PACKAGE_FILE_ERROR_MESSAGE, DELETE_PACKAGE_FILE_ERROR_MESSAGE,
DELETE_PACKAGE_FILE_SUCCESS_MESSAGE, DELETE_PACKAGE_FILE_SUCCESS_MESSAGE,
} from '~/packages/shared/constants'; } from '~/packages/shared/constants';
import { npmPackage as packageEntity } from '../../mock_data'; import { npmPackage as packageEntity } from '../../../../../packages/mock_data';
jest.mock('~/flash.js'); jest.mock('~/flash.js');
jest.mock('~/api.js'); jest.mock('~/api.js');
......
import { packagePipeline } from '~/packages/details/store/getters'; import { packagePipeline } from '~/packages_and_registries/infrastructure_registry/details/store/getters';
import { import {
npmPackage, npmPackage,
mockPipelineInfo, mockPipelineInfo,
mavenPackage as packageWithoutBuildInfo, mavenPackage as packageWithoutBuildInfo,
} from '../../mock_data'; } from 'jest/packages/mock_data';
describe('Getters PackageDetails Store', () => { describe('Getters PackageDetails Store', () => {
let state; let state;
......
import * as types from '~/packages/details/store/mutation_types'; import * as types from '~/packages_and_registries/infrastructure_registry/details/store/mutation_types';
import mutations from '~/packages/details/store/mutations'; import mutations from '~/packages_and_registries/infrastructure_registry/details/store/mutations';
import { npmPackage as packageEntity } from '../../mock_data'; import { npmPackage as packageEntity } from 'jest/packages/mock_data';
describe('Mutations package details Store', () => { describe('Mutations package details Store', () => {
let mockState; let mockState;
......
...@@ -5,7 +5,7 @@ import { ...@@ -5,7 +5,7 @@ import {
packageData, packageData,
packagePipelines, packagePipelines,
} from 'jest/packages_and_registries/package_registry/mock_data'; } from 'jest/packages_and_registries/package_registry/mock_data';
import { HISTORY_PIPELINES_LIMIT } from '~/packages/details/constants'; import { HISTORY_PIPELINES_LIMIT } from '~/packages_and_registries/shared/constants';
import component from '~/packages_and_registries/package_registry/components/details/package_history.vue'; import component from '~/packages_and_registries/package_registry/components/details/package_history.vue';
import HistoryItem from '~/vue_shared/components/registry/history_item.vue'; import HistoryItem from '~/vue_shared/components/registry/history_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
......
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