Skip to content

Commit

Permalink
update instances of Duplicate to Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed May 22, 2024
1 parent 2f5f986 commit 6781a38
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ describe('Custom serving runtimes', () => {
});
});

it('should duplicate a serving runtime', () => {
it('should clone a serving runtime', () => {
cy.interceptOdh(
'POST /api/servingRuntimes/',
{ query: { dryRun: 'All' } },
mockServingRuntimeK8sResource({}),
).as('duplicateServingRuntime');
).as('cloneServingRuntime');

cy.interceptOdh('POST /api/templates/', mockServingRuntimeTemplateK8sResource({})).as(
'duplicateTemplate',
'cloneTemplate',
);

const ServingRuntimeTemplateMock = mockServingRuntimeTemplateK8sResource({
Expand All @@ -198,8 +198,8 @@ describe('Custom serving runtimes', () => {
mockK8sResourceList([...customServingRuntimesInitialMock, ServingRuntimeTemplateMock]),
).as('refreshServingRuntime');

servingRuntimes.getRowById('template-1').find().findKebabAction('Duplicate').click();
servingRuntimes.findAppTitle().should('have.text', 'Duplicate serving runtime');
servingRuntimes.getRowById('template-1').find().findKebabAction('Clone').click();
servingRuntimes.findAppTitle().should('have.text', 'Clone serving runtime');
cy.url().should('include', '/addServingRuntime');

servingRuntimes.shouldDisplayAPIProtocolValues([
Expand All @@ -210,15 +210,15 @@ describe('Custom serving runtimes', () => {
servingRuntimes.findSubmitButton().should('be.enabled');
servingRuntimes.findSubmitButton().click();

cy.wait('@duplicateServingRuntime').then((interception) => {
cy.wait('@cloneServingRuntime').then((interception) => {
expect(interception.request.body.metadata).to.containSubset({
name: 'template-1-copy',
annotations: { 'openshift.io/display-name': 'Copy of Multi Platform' },
namespace: 'opendatahub',
});
});

cy.wait('@duplicateTemplate').then((interception) => {
cy.wait('@cloneTemplate').then((interception) => {
expect(interception.request.body).to.containSubset({
metadata: {
annotations: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ describe('Pipeline create runs', () => {
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/view/${createRunParams.run_id}`);
});

it('duplicates an active run', () => {
it('clones an active run', () => {
const [mockRun] = initialMockRuns;
const mockExperiment = mockExperiments[0];
const mockDuplicateRun = buildMockRunKF({
display_name: 'Duplicate of Test run',
run_id: 'duplicate-run-id',
const mockCloneRun = buildMockRunKF({
display_name: 'Clone of Test run',
run_id: 'cloned-run-id',
experiment_id: mockExperiment.experiment_id,
});

Expand All @@ -177,11 +177,11 @@ describe('Pipeline create runs', () => {
cloneRunPage.mockGetExperiment(projectName, mockExperiment);

// Mock runs list with newly cloned run
activeRunsTable.mockGetActiveRuns([...initialMockRuns, mockDuplicateRun], projectName);
activeRunsTable.mockGetActiveRuns([...initialMockRuns, mockCloneRun], projectName);

// Navigate to clone run page for a given active run
pipelineRunsGlobal.findActiveRunsTab().click();
activeRunsTable.getRowByName(mockRun.display_name).findKebabAction('Duplicate').click();
activeRunsTable.getRowByName(mockRun.display_name).findKebabAction('Clone').click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/clone/${mockRun.run_id}`);

// Verify pre-populated values & submit
Expand All @@ -196,13 +196,13 @@ describe('Pipeline create runs', () => {
paramsSection.findParamById('standard_scaler').should('have.value', 'false');

cloneRunPage
.mockCreateRun(projectName, mockPipelineVersion, mockDuplicateRun)
.as('duplicateRun');
.mockCreateRun(projectName, mockPipelineVersion, mockCloneRun)
.as('cloneRun');
cloneRunPage.submit();

cy.wait('@duplicateRun').then((interception) => {
cy.wait('@cloneRun').then((interception) => {
expect(interception.request.body).to.eql({
display_name: 'Duplicate of Test run',
display_name: 'Clone of Test run',
description: '',
pipeline_version_reference: {
pipeline_id: 'test-pipeline',
Expand All @@ -217,7 +217,7 @@ describe('Pipeline create runs', () => {
});

// Should redirect to the details of the newly cloned active run
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/view/${mockDuplicateRun.run_id}`);
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/view/${mockCloneRun.run_id}`);
});

it('create run with default and optional parameters', () => {
Expand Down Expand Up @@ -566,12 +566,12 @@ describe('Pipeline create runs', () => {
);
});

it('duplicates a schedule', () => {
it('clones a schedule', () => {
const [mockRecurringRun] = initialMockRecurringRuns;
const mockExperiment = mockExperiments[0];
const mockDuplicateRecurringRun = buildMockJobKF({
display_name: 'Duplicate of Test job',
recurring_run_id: 'duplicate-job-id',
const mockCloneRecurringRun = buildMockJobKF({
display_name: 'Clone of Test job',
recurring_run_id: 'cloned-job-id',
experiment_id: mockExperiment.experiment_id,
});

Expand All @@ -591,7 +591,7 @@ describe('Pipeline create runs', () => {
// Navigate to clone run page for a given schedule
pipelineRunJobTable
.getRowByName(mockRecurringRun.display_name)
.findKebabAction('Duplicate')
.findKebabAction('Clone')
.click();
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRun/cloneJob/${mockRecurringRun.recurring_run_id}?runType=scheduled`,
Expand All @@ -608,13 +608,13 @@ describe('Pipeline create runs', () => {
paramsSection.findParamById('neighbors').find('input').should('have.value', '0');
paramsSection.findParamById('standard_scaler').should('have.value', 'yes');
cloneSchedulePage
.mockCreateRecurringRun(projectName, mockPipelineVersion, mockDuplicateRecurringRun)
.as('duplicateSchedule');
.mockCreateRecurringRun(projectName, mockPipelineVersion, mockCloneRecurringRun)
.as('cloneSchedule');
cloneSchedulePage.submit();

cy.wait('@duplicateSchedule').then((interception) => {
cy.wait('@cloneSchedule').then((interception) => {
expect(interception.request.body).to.eql({
display_name: 'Duplicate of Test job',
display_name: 'Clone of Test job',
description: '',
pipeline_version_reference: {
pipeline_id: 'test-pipeline',
Expand All @@ -640,7 +640,7 @@ describe('Pipeline create runs', () => {

// Should be redirected to the schedule details page
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRunJob/view/${mockDuplicateRecurringRun.recurring_run_id}`,
`/pipelineRuns/${projectName}/pipelineRunJob/view/${mockCloneRecurringRun.recurring_run_id}`,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ describe('Pipeline runs', () => {
it('navigate to clone run page', () => {
activeRunsTable
.getRowByName(mockActiveRuns[0].display_name)
.findKebabAction('Duplicate')
.findKebabAction('Clone')
.click();
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRun/clone/${mockActiveRuns[0].run_id}`,
Expand Down Expand Up @@ -1004,7 +1004,7 @@ describe('Pipeline runs', () => {
it('navigate to clone scheduled run page', () => {
pipelineRunJobTable
.getRowByName(mockJobs[0].display_name)
.findKebabAction('Duplicate')
.findKebabAction('Clone')
.click();
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRun/cloneJob/${mockJobs[0].recurring_run_id}?runType=scheduled`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ describe('Pipeline topology', () => {
initIntercepts();
});

it('Test pipeline run duplicate navigation', () => {
it('Test pipeline run clone navigation', () => {
pipelineRunDetails.visit(projectId, mockRun.run_id);
pipelineRunDetails.selectActionDropdownItem('Clone');
verifyRelativeURL(`/pipelineRuns/${projectId}/pipelineRun/clone/${mockRun.run_id}`);
});

it('Test pipeline job duplicate navigation', () => {
it.only('Test pipeline job clone navigation', () => {
pipelineRunJobDetails.visit(projectId, mockJob.recurring_run_id);
pipelineRunJobDetails.selectActionDropdownItem('Duplicate');
pipelineRunJobDetails.selectActionDropdownItem('Clone');
verifyRelativeURL(
`/pipelineRuns/${projectId}/pipelineRun/cloneJob/${mockJob.recurring_run_id}?runType=scheduled`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const CloneRunPage: React.FC<PathProps> = ({ breadcrumbPath, contextPath }) => {
const [run, loaded, error] = useCloneRunData();
const { runType: runTypeString } = useGetSearchParamValues([PipelineRunSearchParam.RunType]);
const runType = asEnumMember(runTypeString, PipelineRunType);
const title = `Duplicate ${runTypeCategory[runType || PipelineRunType.Active]}`;
const title = `Clone ${runTypeCategory[runType || PipelineRunType.Active]}`;

return (
<ApplicationsPage
Expand All @@ -23,7 +23,7 @@ const CloneRunPage: React.FC<PathProps> = ({ breadcrumbPath, contextPath }) => {
<Breadcrumb>
{breadcrumbPath}
<BreadcrumbItem isActive>
{run ? `Duplicate of ${run.display_name}` : 'Duplicate'}
{run ? `Clone of ${run.display_name}` : 'Clone'}
</BreadcrumbItem>
</Breadcrumb>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const useRunFormData = (
const formState = useGenericObjectState<RunFormData>({
project,
nameDesc: {
name: run?.display_name ? `Duplicate of ${run.display_name}` : '',
name: run?.display_name ? `Clone of ${run.display_name}` : '',
description: run?.description ?? '',
},
pipeline: pipeline ?? null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const PipelineRunJobDetailsActions: React.FC<PipelineRunJobDetailsActionsProps>
})
}
>
Duplicate
Clone
</DropdownItem>,
<DropdownSeparator key="separator" />,
<DropdownItem key="delete-run" onClick={() => onDelete()}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const PipelineRunTableRow: React.FC<PipelineRunTableRowProps> = ({

const actions: IAction[] = React.useMemo(() => {
const cloneAction: IAction = {
title: 'Duplicate',
title: 'Clone',
onClick: () => {
navigate(
cloneRunRoute(namespace, run.run_id, isExperimentsAvailable ? experimentId : undefined),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const PipelineRunJobTableRow: React.FC<PipelineRunJobTableRowProps> = ({
<ActionsColumn
items={[
{
title: 'Duplicate',
title: 'Clone',
onClick: () => {
navigate({
pathname: cloneScheduleRoute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const CustomServingRuntimeAddTemplate: React.FC<CustomServingRuntimeAddTemplateP
title={
existingTemplate
? `Edit ${getServingRuntimeDisplayNameFromTemplate(existingTemplate)}`
: `${state ? 'Duplicate' : 'Add'} serving runtime`
: `${state ? 'Clone' : 'Add'} serving runtime`
}
description={
existingTemplate
Expand All @@ -145,7 +145,7 @@ const CustomServingRuntimeAddTemplate: React.FC<CustomServingRuntimeAddTemplateP
</BreadcrumbItem>
)}
<BreadcrumbItem isActive>
{existingTemplate ? 'Edit' : state ? 'Duplicate' : 'Add'} serving runtime
{existingTemplate ? 'Edit' : state ? 'Clone' : 'Add'} serving runtime
</BreadcrumbItem>
</Breadcrumb>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const CustomServingRuntimeTableRow: React.FC<CustomServingRuntimeTableRowProps>
templateOOTB
? [
{
title: 'Duplicate',
title: 'Clone',
onClick: () =>
navigate('/servingRuntimes/addServingRuntime', {
state: { template },
Expand All @@ -77,7 +77,7 @@ const CustomServingRuntimeTableRow: React.FC<CustomServingRuntimeTableRowProps>
navigate(`/servingRuntimes/editServingRuntime/${servingRuntimeName}`),
},
{
title: 'Duplicate',
title: 'Clone',
onClick: () =>
navigate('/servingRuntimes/addServingRuntime', {
state: { template },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const BiasConfigurationTableRow: React.FC<BiasConfigurationTableRowProps> = ({
<ActionsColumn
items={[
{
title: 'Duplicate',
title: 'Clone',
onClick: () => {
onCloneConfiguration(obj);
},
Expand Down

0 comments on commit 6781a38

Please sign in to comment.