Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPD-37264 Apply Root Model to the Data Set Object definition through the batch engine #4511

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ const ActionForm = ({
method,
modalSize,
permissionKey,
[OBJECT_RELATIONSHIP.DATA_SET_ACTIONS_ID]: dataSet.id,
[relationship]: dataSet.id,
requestBody,
title_i18n: titleTranslations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import {IBaseVisualizationMode} from './types';

const API_URL_PREFIX = '/o/data-set-admin';
const API_URL_PREFIX = '/o/data-set-admin/data-sets';

const API_URL = {
ACTIONS: `${API_URL_PREFIX}/actions`,
CARDS_SECTIONS: `${API_URL_PREFIX}/cards-sections`,
CLIENT_EXTENSION_FILTERS: `${API_URL_PREFIX}/client-extension-filters`,
DATA_SETS: `${API_URL_PREFIX}/data-sets`,
DATA_SETS: `${API_URL_PREFIX}`,
DATE_FILTERS: `${API_URL_PREFIX}/date-filters`,
LIST_SECTIONS: `${API_URL_PREFIX}/list-sections`,
SELECTION_FILTERS: `${API_URL_PREFIX}/selection-filters`,
Expand All @@ -33,6 +33,8 @@ const FUZZY_OPTIONS = {
const OBJECT_RELATIONSHIP_PREFIX = 'dataSetTo';

const OBJECT_RELATIONSHIP = {
DATA_SET_ACTIONS: `${OBJECT_RELATIONSHIP_PREFIX}DataSetActions`,
DATA_SET_ACTIONS_ID: `r_${OBJECT_RELATIONSHIP_PREFIX}DataSetActions_l_dataSetId`,
DATA_SET_CARDS_SECTIONS: `${OBJECT_RELATIONSHIP_PREFIX}DataSetCardsSections`,
DATA_SET_CARDS_SECTIONS_ERC: `r_${OBJECT_RELATIONSHIP_PREFIX}DataSetCardsSections_l_dataSetERC`,
DATA_SET_CLIENT_EXTENSION_FILTERS: `${OBJECT_RELATIONSHIP_PREFIX}DataSetClientExtensionFilters`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,24 @@
}
],
"objectRelationships": [
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_ACTIONS",
"label": {
"en_US": "Data Set to Data Set Actions"
},
"name": "dataSetToDataSetActions",
"objectDefinitionExternalReferenceCode1": "L_DATA_SET",
"objectDefinitionExternalReferenceCode2": "L_DATA_SET_ACTION",
"objectDefinitionName2": "DataSetAction",
"objectDefinitionSystem2": true,
"parameterObjectFieldId": 0,
"parameterObjectFieldName": "",
"reverse": false,
"system": true,
"type": "oneToMany"
},
{
"deletionType": "cascade",
"externalReferenceCode": "L_DATA_SET_TO_CREATION_DATA_SET_ACTIONS",
Expand All @@ -251,6 +269,7 @@
},
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_CARDS_SECTIONS",
"label": {
"en_US": "Data Set to Data Set Cards Sections"
Expand All @@ -268,6 +287,7 @@
},
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_CLIENT_EXTENSION_FILTERS",
"label": {
"en_US": "Data Set to Data Set Client Extension Filters"
Expand All @@ -285,6 +305,7 @@
},
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_DATE_FILTERS",
"label": {
"en_US": "Data Set to Data Set Date Filters"
Expand All @@ -302,6 +323,7 @@
},
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_LIST_SECTIONS",
"label": {
"en_US": "Data Set to Data Set List Sections"
Expand All @@ -319,6 +341,7 @@
},
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_SELECTION_FILTERS",
"label": {
"en_US": "Data Set to Data Set Selection Filters"
Expand All @@ -336,6 +359,7 @@
},
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_SORTS",
"label": {
"en_US": "Data Set to Data Set Sorts"
Expand All @@ -353,6 +377,7 @@
},
{
"deletionType": "cascade",
"edge": true,
"externalReferenceCode": "L_DATA_SET_TO_DATA_SET_TABLE_SECTIONS",
"label": {
"en_US": "Data Set to Data Set Table Sections"
Expand Down Expand Up @@ -390,6 +415,7 @@
"en_US": "Data Sets"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -620,6 +646,7 @@
"en_US": "Data Set Actions"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -685,6 +712,7 @@
"en_US": "Data Set Cards Sections"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -754,6 +782,7 @@
"en_US": "Data Set Client Extension Filters"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -855,6 +884,7 @@
"en_US": "Data Set Date Filters"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -920,6 +950,7 @@
"en_US": "Data Set List Sections"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -1133,6 +1164,7 @@
"en_US": "Data Set Selection Filters"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -1218,6 +1250,7 @@
"en_US": "Data Set Sorts"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down Expand Up @@ -1335,6 +1368,7 @@
"en_US": "Data Set Table Sections"
},
"portlet": false,
"rootObjectDefinitionExternalReferenceCode": "L_DATA_SET",
"scope": "company",
"status": {
"code": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,23 @@ private static String _getInvokerFileNameRegex(
).put(
"DataSet", "/data-set-admin/data-sets"
).put(
"DataSetAction", "/data-set-admin/actions"
"DataSetAction", "/data-set-admin/data-sets/actions"
).put(
"DataSetCardsSection", "/data-set-admin/cards-sections"
"DataSetCardsSection", "/data-set-admin/data-sets/cards-sections"
).put(
"DataSetClientExtensionFilter",
"/data-set-admin/client-extension-filters"
"/data-set-admin/data-sets/client-extension-filters"
).put(
"DataSetDateFilter", "/data-set-admin/date-filters"
"DataSetDateFilter", "/data-set-admin/data-sets/date-filters"
).put(
"DataSetListSection", "/data-set-admin/list-sections"
"DataSetListSection", "/data-set-admin/data-sets/list-sections"
).put(
"DataSetSelectionFilter", "/data-set-admin/selection-filters"
"DataSetSelectionFilter",
"/data-set-admin/data-sets/selection-filters"
).put(
"DataSetSort", "/data-set-admin/sorts"
"DataSetSort", "/data-set-admin/data-sets/sorts"
).put(
"DataSetTableSection", "/data-set-admin/table-sections"
"DataSetTableSection", "/data-set-admin/data-sets/table-sections"
).put(
"FDSAction", "/data-set-manager/actions"
).put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import {ApiHelpers} from '../../../helpers/ApiHelpers';
import {liferayConfig} from '../../../liferay.config';
import {
API_ENDPOINT_PATH,
CARDS_SECTION_DATA_SET_RELATIONSHIP,
CLIENT_EXTENSION_FILTER_DATA_SET_RELATIONSHIP,
CREATION_ACTION_DATA_SET_RELATIONSHIP,
Expand Down Expand Up @@ -34,7 +35,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
erc = 'sampleDataSetERC',
label = DEFAULT_LABEL.DATA_SET,
listOfItemsPerPage = '4, 8, 20, 40, 60',
restApplication = '/data-set-admin/table-sections',
restApplication = `${API_ENDPOINT_PATH}/table-sections`,
restEndpoint = '/',
restSchema = 'DataSetTableSection',
}: {
Expand All @@ -49,7 +50,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
restEndpoint?: string;
restSchema?: string;
}) {
const url = `${this.baseUrl}data-set-admin/data-sets`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}`;

const data = {
additionalAPIURLParameters,
Expand All @@ -76,7 +77,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
fieldName?: string;
name?: string;
}) {
const url = `${this.baseUrl}data-set-admin/cards-sections`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/cards-sections`;

const data = {
[CARDS_SECTION_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand All @@ -98,7 +99,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
fieldName: string;
label_i18n?: {[key: string]: string};
}) {
const url = `${this.baseUrl}data-set-admin/client-extension-filters`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/client-extension-filters`;

const data = {
[CLIENT_EXTENSION_FILTER_DATA_SET_RELATIONSHIP]: dataSetId,
Expand Down Expand Up @@ -129,7 +130,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
type?: ECreationActionType;
url?: string;
}) {
const endpointUrl = `${this.baseUrl}data-set-admin/actions`;
const endpointUrl = `${this.baseUrl}${API_ENDPOINT_PATH}/actions`;

const data = {
[CREATION_ACTION_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand Down Expand Up @@ -164,7 +165,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
sortable?: boolean;
type?: string;
}) {
const url = `${this.baseUrl}data-set-admin/table-sections`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/table-sections`;

const data = {
[TABLE_SECTION_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand Down Expand Up @@ -195,7 +196,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
to?: string;
type: 'date' | 'date-time';
}) {
const url = `${this.baseUrl}data-set-admin/date-filters`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/date-filters`;

const data = {
[DATE_FILTER_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand Down Expand Up @@ -232,7 +233,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
source: string;
sourceType: string;
}) {
const url = `${this.baseUrl}data-set-admin/selection-filters`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/selection-filters`;

const data = {
[SELECTION_FILTER_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand Down Expand Up @@ -281,7 +282,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
type?: EItemActionType;
url?: string;
}) {
const endpointUrl = `${this.baseUrl}data-set-admin/actions`;
const endpointUrl = `${this.baseUrl}${API_ENDPOINT_PATH}/actions`;

const data = {
[ITEM_ACTION_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand Down Expand Up @@ -316,7 +317,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
label_i18n?: {[key: string]: string};
orderType?: string;
}) {
const url = `${this.baseUrl}data-set-admin/sorts`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/sorts`;

const data = {
[SORT_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand All @@ -338,7 +339,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
fieldName?: string;
name?: string;
}) {
const url = `${this.baseUrl}data-set-admin/list-sections`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/list-sections`;

const data = {
[LIST_SECTION_DATA_SET_RELATIONSHIP]: dataSetERC,
Expand All @@ -350,7 +351,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
}

async deleteDataSet({erc = DEFAULT_DATA_SET_ERC}: {erc?: string}) {
const url = `${this.baseUrl}data-set-admin/data-sets/by-external-reference-code/${erc}`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/by-external-reference-code/${erc}`;

return this.delete(url);
}
Expand All @@ -370,7 +371,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
label?: string;
listOfItemsPerPage?: string;
}) {
const url = `${this.baseUrl}data-set-admin/data-sets/by-external-reference-code/${erc}`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/by-external-reference-code/${erc}`;

const data = {
additionalAPIURLParameters,
Expand Down Expand Up @@ -402,7 +403,7 @@ export class DataSetManagerApiHelpers extends ApiHelpers {
multiple?: boolean;
preselectedValues?: string;
}) {
const url = `${this.baseUrl}data-set-admin/selection-filters/by-external-reference-code/${erc}`;
const url = `${this.baseUrl}${API_ENDPOINT_PATH}/selection-filters/by-external-reference-code/${erc}`;

const data = {
fieldName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {featureFlagsTest} from '../../../../fixtures/featureFlagsTest';
import {loginTest} from '../../../../fixtures/loginTest';
import getRandomString from '../../../../utils/getRandomString';
import {dataSetManagerApiHelpersTest} from '../../fixtures/dataSetManagerApiHelpersTest';
import {API_ENDPOINT_PATH} from '../../utils/constants';
import {dataSetManagerSetupTest} from './fixtures/dataSetManagerSetupTest';
import {dataSetsPageTest} from './fixtures/dataSetsPageTest';

Expand Down Expand Up @@ -54,14 +55,14 @@ const skusDataSetConfig = {

const tableSectionsDataSetConfig = {
name: getRandomString(),
restApplication: '/data-set-admin/table-sections',
restApplication: `${API_ENDPOINT_PATH}table-sections`,
restEndpoint: '/',
restSchema: 'DataSetTableSection',
};

const tableSectionsWithSpecialCharactersDataSetConfig = {
name: 'Data Set ~!@#$%^&*(){}[].<>/? name',
restApplication: '/data-set-admin/table-sections',
restApplication: `${API_ENDPOINT_PATH}/table-sections`,
restEndpoint: '/',
restSchema: 'DataSetTableSection',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {loginTest} from '../../../../fixtures/loginTest';
import getRandomString from '../../../../utils/getRandomString';
import {waitForAlert} from '../../../../utils/waitForAlert';
import {dataSetManagerApiHelpersTest} from '../../fixtures/dataSetManagerApiHelpersTest';
import {API_ENDPOINT_PATH} from '../../utils/constants';
import {dataSetManagerSetupTest} from './fixtures/dataSetManagerSetupTest';
import {detailsPageTest} from './fixtures/detailsPageTest';
import {visualizationModesPageTest} from './fixtures/visualizationModesPageTest';
Expand Down Expand Up @@ -92,7 +93,7 @@ test.describe('Data Set Details', () => {

await test.step('Check the URL Preview input properly displays the REST endpoint with the encoded parameters', async () => {
await expect(detailsPage.urlPreviewInput).toHaveValue(
'/data-set-admin/table-sections?filter=name%20eq%20%22Test%20Test%22'
`${API_ENDPOINT_PATH}/table-sections?filter=name%20eq%20%22Test%20Test%22`
);
});
});
Expand Down
Loading