mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
Merge pull request #6651 from nixocio/ui_issue_5820
Rename SCM to Source Control Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -147,7 +147,7 @@ function JobList({ i18n, defaultParams, showTypeColumn = false }) {
|
|||||||
name: i18n._(t`Job Type`),
|
name: i18n._(t`Job Type`),
|
||||||
key: `type`,
|
key: `type`,
|
||||||
options: [
|
options: [
|
||||||
[`project_update`, i18n._(t`SCM Update`)],
|
[`project_update`, i18n._(t`Source Control Update`)],
|
||||||
[`inventory_update`, i18n._(t`Inventory Sync`)],
|
[`inventory_update`, i18n._(t`Inventory Sync`)],
|
||||||
[`job`, i18n._(t`Playbook Run`)],
|
[`job`, i18n._(t`Playbook Run`)],
|
||||||
[`ad_hoc_command`, i18n._(t`Command`)],
|
[`ad_hoc_command`, i18n._(t`Command`)],
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ function JobListItem({
|
|||||||
const labelId = `check-action-${job.id}`;
|
const labelId = `check-action-${job.id}`;
|
||||||
|
|
||||||
const jobTypes = {
|
const jobTypes = {
|
||||||
project_update: i18n._(t`SCM Update`),
|
project_update: i18n._(t`Source Control Update`),
|
||||||
inventory_update: i18n._(t`Inventory Sync`),
|
inventory_update: i18n._(t`Inventory Sync`),
|
||||||
job: i18n._(t`Playbook Run`),
|
job: i18n._(t`Playbook Run`),
|
||||||
command: i18n._(t`Command`),
|
command: i18n._(t`Command`),
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ function ProjectLookup({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: i18n._(t`SCM URL`),
|
name: i18n._(t`Source Control URL`),
|
||||||
key: 'scm_url',
|
key: 'scm_url',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ function PromptDetail({ i18n, resource, launchConfig = {} }) {
|
|||||||
)}
|
)}
|
||||||
{launchConfig.ask_scm_branch_on_launch && (
|
{launchConfig.ask_scm_branch_on_launch && (
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`SCM Branch`)}
|
label={i18n._(t`Source Control Branch`)}
|
||||||
value={defaults?.scm_branch}
|
value={defaults?.scm_branch}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ describe('PromptDetail', () => {
|
|||||||
assertDetail('Job Type', 'run');
|
assertDetail('Job Type', 'run');
|
||||||
assertDetail('Credential', 'Demo Credential');
|
assertDetail('Credential', 'Demo Credential');
|
||||||
assertDetail('Inventory', 'Demo Inventory');
|
assertDetail('Inventory', 'Demo Inventory');
|
||||||
assertDetail('SCM Branch', '123');
|
assertDetail('Source Control Branch', '123');
|
||||||
assertDetail('Limit', '3');
|
assertDetail('Limit', '3');
|
||||||
assertDetail('Verbosity', '1 (Verbose)');
|
assertDetail('Verbosity', '1 (Verbose)');
|
||||||
assertDetail('Job Tags', 'onetwothree');
|
assertDetail('Job Tags', 'onetwothree');
|
||||||
@@ -113,7 +113,7 @@ describe('PromptDetail', () => {
|
|||||||
'Job Type',
|
'Job Type',
|
||||||
'Credential',
|
'Credential',
|
||||||
'Inventory',
|
'Inventory',
|
||||||
'SCM Branch',
|
'Source Control Branch',
|
||||||
'Limit',
|
'Limit',
|
||||||
'Verbosity',
|
'Verbosity',
|
||||||
'Job Tags',
|
'Job Tags',
|
||||||
|
|||||||
@@ -50,15 +50,15 @@ function PromptProjectDetail({ i18n, resource }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`SCM Type`)}
|
label={i18n._(t`Source Control Type`)}
|
||||||
value={scm_type === '' ? i18n._(t`Manual`) : toTitleCase(scm_type)}
|
value={scm_type === '' ? i18n._(t`Manual`) : toTitleCase(scm_type)}
|
||||||
/>
|
/>
|
||||||
<Detail label={i18n._(t`SCM URL`)} value={scm_url} />
|
<Detail label={i18n._(t`Source Control URL`)} value={scm_url} />
|
||||||
<Detail label={i18n._(t`SCM Branch`)} value={scm_branch} />
|
<Detail label={i18n._(t`Source Control Branch`)} value={scm_branch} />
|
||||||
<Detail label={i18n._(t`SCM Refspec`)} value={scm_refspec} />
|
<Detail label={i18n._(t`Source Control Refspec`)} value={scm_refspec} />
|
||||||
{summary_fields?.credential?.id && (
|
{summary_fields?.credential?.id && (
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`SCM Credential`)}
|
label={i18n._(t`Source Control Credential`)}
|
||||||
value={
|
value={
|
||||||
<CredentialChip
|
<CredentialChip
|
||||||
key={resource.summary_fields.credential.id}
|
key={resource.summary_fields.credential.id}
|
||||||
|
|||||||
@@ -32,15 +32,18 @@ describe('PromptProjectDetail', () => {
|
|||||||
expect(wrapper.find(`Detail[label="${label}"] dd`).text()).toBe(value);
|
expect(wrapper.find(`Detail[label="${label}"] dd`).text()).toBe(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
assertDetail('SCM Type', 'Git');
|
assertDetail('Source Control Type', 'Git');
|
||||||
assertDetail('SCM URL', 'https://github.com/ansible/ansible-tower-samples');
|
assertDetail(
|
||||||
assertDetail('SCM Branch', 'foo');
|
'Source Control URL',
|
||||||
assertDetail('SCM Refspec', 'refs/');
|
'https://github.com/ansible/ansible-tower-samples'
|
||||||
|
);
|
||||||
|
assertDetail('Source Control Branch', 'foo');
|
||||||
|
assertDetail('Source Control Refspec', 'refs/');
|
||||||
assertDetail('Cache Timeout', '3 Seconds');
|
assertDetail('Cache Timeout', '3 Seconds');
|
||||||
assertDetail('Ansible Environment', 'mock virtual env');
|
assertDetail('Ansible Environment', 'mock virtual env');
|
||||||
assertDetail('Project Base Path', 'dir/foo/bar');
|
assertDetail('Project Base Path', 'dir/foo/bar');
|
||||||
assertDetail('Playbook Directory', '_6__demo_project');
|
assertDetail('Playbook Directory', '_6__demo_project');
|
||||||
assertDetail('SCM Credential', 'Scm: mock scm');
|
assertDetail('Source Control Credential', 'Scm: mock scm');
|
||||||
expect(
|
expect(
|
||||||
wrapper
|
wrapper
|
||||||
.find('Detail[label="Options"]')
|
.find('Detail[label="Options"]')
|
||||||
|
|||||||
@@ -137,7 +137,10 @@ function ScheduleDetail({ schedule, i18n }) {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Detail label={i18n._(t`SCM Branch`)} value={scm_branch} />
|
<Detail
|
||||||
|
label={i18n._(t`Source Control Branch`)}
|
||||||
|
value={scm_branch}
|
||||||
|
/>
|
||||||
<Detail label={i18n._(t`Limit`)} value={limit} />
|
<Detail label={i18n._(t`Limit`)} value={limit} />
|
||||||
{typeof diff_mode === 'boolean' && (
|
{typeof diff_mode === 'boolean' && (
|
||||||
<Detail
|
<Detail
|
||||||
|
|||||||
@@ -121,7 +121,9 @@ describe('<ScheduleDetail />', () => {
|
|||||||
expect(wrapper.find('Title[children="Prompted Fields"]').length).toBe(0);
|
expect(wrapper.find('Title[children="Prompted Fields"]').length).toBe(0);
|
||||||
expect(wrapper.find('Detail[label="Job Type"]').length).toBe(0);
|
expect(wrapper.find('Detail[label="Job Type"]').length).toBe(0);
|
||||||
expect(wrapper.find('Detail[label="Inventory"]').length).toBe(0);
|
expect(wrapper.find('Detail[label="Inventory"]').length).toBe(0);
|
||||||
expect(wrapper.find('Detail[label="SCM Branch"]').length).toBe(0);
|
expect(wrapper.find('Detail[label="Source Control Branch"]').length).toBe(
|
||||||
|
0
|
||||||
|
);
|
||||||
expect(wrapper.find('Detail[label="Limit"]').length).toBe(0);
|
expect(wrapper.find('Detail[label="Limit"]').length).toBe(0);
|
||||||
expect(wrapper.find('Detail[label="Show Changes"]').length).toBe(0);
|
expect(wrapper.find('Detail[label="Show Changes"]').length).toBe(0);
|
||||||
expect(wrapper.find('Detail[label="Credentials"]').length).toBe(0);
|
expect(wrapper.find('Detail[label="Credentials"]').length).toBe(0);
|
||||||
@@ -209,7 +211,7 @@ describe('<ScheduleDetail />', () => {
|
|||||||
expect(wrapper.find('Detail[label="Inventory"]').length).toBe(1);
|
expect(wrapper.find('Detail[label="Inventory"]').length).toBe(1);
|
||||||
expect(
|
expect(
|
||||||
wrapper
|
wrapper
|
||||||
.find('Detail[label="SCM Branch"]')
|
.find('Detail[label="Source Control Branch"]')
|
||||||
.find('dd')
|
.find('dd')
|
||||||
.text()
|
.text()
|
||||||
).toBe('foo/branch');
|
).toBe('foo/branch');
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function ScheduleListItem({ i18n, isSelected, onSelect, schedule }) {
|
|||||||
const jobTypeLabels = {
|
const jobTypeLabels = {
|
||||||
inventory_update: i18n._(t`Inventory Sync`),
|
inventory_update: i18n._(t`Inventory Sync`),
|
||||||
job: i18n._(t`Playbook Run`),
|
job: i18n._(t`Playbook Run`),
|
||||||
project_update: i18n._(t`SCM Update`),
|
project_update: i18n._(t`Source Control Update`),
|
||||||
system_job: i18n._(t`Management Job`),
|
system_job: i18n._(t`Management Job`),
|
||||||
workflow_job: i18n._(t`Workflow Job`),
|
workflow_job: i18n._(t`Workflow Job`),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ CredentialTypesAPI.read.mockResolvedValue({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'ssh_key_data',
|
id: 'ssh_key_data',
|
||||||
label: 'SCM Private Key',
|
label: 'Source Control Private Key',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
format: 'ssh_private_key',
|
format: 'ssh_private_key',
|
||||||
secret: true,
|
secret: true,
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ CredentialTypesAPI.read.mockResolvedValue({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'ssh_key_data',
|
id: 'ssh_key_data',
|
||||||
label: 'SCM Private Key',
|
label: 'Source Control Private Key',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
format: 'ssh_private_key',
|
format: 'ssh_private_key',
|
||||||
secret: true,
|
secret: true,
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ const credentialTypes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'ssh_key_data',
|
id: 'ssh_key_data',
|
||||||
label: 'SCM Private Key',
|
label: 'Source Control Private Key',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
format: 'ssh_private_key',
|
format: 'ssh_private_key',
|
||||||
secret: true,
|
secret: true,
|
||||||
|
|||||||
@@ -100,17 +100,17 @@ function ProjectDetail({ project, i18n }) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`SCM Type`)}
|
label={i18n._(t`Source Control Type`)}
|
||||||
value={
|
value={
|
||||||
scm_type === '' ? i18n._(t`Manual`) : toTitleCase(project.scm_type)
|
scm_type === '' ? i18n._(t`Manual`) : toTitleCase(project.scm_type)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Detail label={i18n._(t`SCM URL`)} value={scm_url} />
|
<Detail label={i18n._(t`Source Control URL`)} value={scm_url} />
|
||||||
<Detail label={i18n._(t`SCM Branch`)} value={scm_branch} />
|
<Detail label={i18n._(t`Source Control Branch`)} value={scm_branch} />
|
||||||
<Detail label={i18n._(t`SCM Refspec`)} value={scm_refspec} />
|
<Detail label={i18n._(t`Source Control Refspec`)} value={scm_refspec} />
|
||||||
{summary_fields.credential && (
|
{summary_fields.credential && (
|
||||||
<Detail
|
<Detail
|
||||||
label={i18n._(t`SCM Credential`)}
|
label={i18n._(t`Source Control Credential`)}
|
||||||
value={
|
value={
|
||||||
<CredentialChip
|
<CredentialChip
|
||||||
key={summary_fields.credential.id}
|
key={summary_fields.credential.id}
|
||||||
|
|||||||
@@ -74,12 +74,12 @@ describe('<ProjectDetail />', () => {
|
|||||||
assertDetail('Name', mockProject.name);
|
assertDetail('Name', mockProject.name);
|
||||||
assertDetail('Description', mockProject.description);
|
assertDetail('Description', mockProject.description);
|
||||||
assertDetail('Organization', mockProject.summary_fields.organization.name);
|
assertDetail('Organization', mockProject.summary_fields.organization.name);
|
||||||
assertDetail('SCM Type', 'Git');
|
assertDetail('Source Control Type', 'Git');
|
||||||
assertDetail('SCM URL', mockProject.scm_url);
|
assertDetail('Source Control URL', mockProject.scm_url);
|
||||||
assertDetail('SCM Branch', mockProject.scm_branch);
|
assertDetail('Source Control Branch', mockProject.scm_branch);
|
||||||
assertDetail('SCM Refspec', mockProject.scm_refspec);
|
assertDetail('Source Control Refspec', mockProject.scm_refspec);
|
||||||
assertDetail(
|
assertDetail(
|
||||||
'SCM Credential',
|
'Source Control Credential',
|
||||||
`Scm: ${mockProject.summary_fields.credential.name}`
|
`Scm: ${mockProject.summary_fields.credential.name}`
|
||||||
);
|
);
|
||||||
assertDetail(
|
assertDetail(
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ function ProjectList({ i18n }) {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: i18n._(t`SCM URL`),
|
name: i18n._(t`Source Control URL`),
|
||||||
key: 'scm_url',
|
key: 'scm_url',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ function ProjectFormFields({
|
|||||||
helperTextInvalid={scmTypeMeta.error}
|
helperTextInvalid={scmTypeMeta.error}
|
||||||
isRequired
|
isRequired
|
||||||
isValid={!scmTypeMeta.touched || !scmTypeMeta.error}
|
isValid={!scmTypeMeta.touched || !scmTypeMeta.error}
|
||||||
label={i18n._(t`SCM Type`)}
|
label={i18n._(t`Source Control Credential Type`)}
|
||||||
>
|
>
|
||||||
<AnsibleSelect
|
<AnsibleSelect
|
||||||
{...scmTypeField}
|
{...scmTypeField}
|
||||||
@@ -179,7 +179,7 @@ function ProjectFormFields({
|
|||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
key: '',
|
key: '',
|
||||||
label: i18n._(t`Choose an SCM Type`),
|
label: i18n._(t`Choose a Source Control Type`),
|
||||||
isDisabled: true,
|
isDisabled: true,
|
||||||
},
|
},
|
||||||
...scmTypeOptions.map(([value, label]) => {
|
...scmTypeOptions.map(([value, label]) => {
|
||||||
|
|||||||
@@ -119,7 +119,9 @@ describe('<ProjectForm />', () => {
|
|||||||
expect(wrapper.find('FormGroup[label="Name"]').length).toBe(1);
|
expect(wrapper.find('FormGroup[label="Name"]').length).toBe(1);
|
||||||
expect(wrapper.find('FormGroup[label="Description"]').length).toBe(1);
|
expect(wrapper.find('FormGroup[label="Description"]').length).toBe(1);
|
||||||
expect(wrapper.find('FormGroup[label="Organization"]').length).toBe(1);
|
expect(wrapper.find('FormGroup[label="Organization"]').length).toBe(1);
|
||||||
expect(wrapper.find('FormGroup[label="SCM Type"]').length).toBe(1);
|
expect(
|
||||||
|
wrapper.find('FormGroup[label="Source Control Credential Type"]').length
|
||||||
|
).toBe(1);
|
||||||
expect(wrapper.find('FormGroup[label="Ansible Environment"]').length).toBe(
|
expect(wrapper.find('FormGroup[label="Ansible Environment"]').length).toBe(
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
@@ -140,12 +142,18 @@ describe('<ProjectForm />', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
expect(wrapper.find('FormGroup[label="SCM URL"]').length).toBe(1);
|
expect(wrapper.find('FormGroup[label="Source Control URL"]').length).toBe(
|
||||||
|
1
|
||||||
|
);
|
||||||
expect(
|
expect(
|
||||||
wrapper.find('FormGroup[label="SCM Branch/Tag/Commit"]').length
|
wrapper.find('FormGroup[label="Source Control Branch/Tag/Commit"]').length
|
||||||
|
).toBe(1);
|
||||||
|
expect(
|
||||||
|
wrapper.find('FormGroup[label="Source Control Refspec"]').length
|
||||||
|
).toBe(1);
|
||||||
|
expect(
|
||||||
|
wrapper.find('FormGroup[label="Source Control Credential"]').length
|
||||||
).toBe(1);
|
).toBe(1);
|
||||||
expect(wrapper.find('FormGroup[label="SCM Refspec"]').length).toBe(1);
|
|
||||||
expect(wrapper.find('FormGroup[label="SCM Credential"]').length).toBe(1);
|
|
||||||
expect(wrapper.find('FormGroup[label="Options"]').length).toBe(1);
|
expect(wrapper.find('FormGroup[label="Options"]').length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -184,7 +192,7 @@ describe('<ProjectForm />', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should display insights credential lookup when scm type is "insights"', async () => {
|
test('should display insights credential lookup when source control type is "insights"', async () => {
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<ProjectForm handleSubmit={jest.fn()} handleCancel={jest.fn()} />
|
<ProjectForm handleSubmit={jest.fn()} handleCancel={jest.fn()} />
|
||||||
@@ -268,7 +276,7 @@ describe('<ProjectForm />', () => {
|
|||||||
expect(wrapper.find('ManualSubForm Alert').length).toBe(1);
|
expect(wrapper.find('ManualSubForm Alert').length).toBe(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should reset scm subform values when scm type changes', async () => {
|
test('should reset source control subform values when source control type changes', async () => {
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<ProjectForm
|
<ProjectForm
|
||||||
@@ -280,17 +288,21 @@ describe('<ProjectForm />', () => {
|
|||||||
});
|
});
|
||||||
await waitForElement(wrapper, 'ContentLoading', el => el.length === 0);
|
await waitForElement(wrapper, 'ContentLoading', el => el.length === 0);
|
||||||
|
|
||||||
|
console.log(wrapper.debug());
|
||||||
|
|
||||||
const scmTypeSelect = wrapper.find(
|
const scmTypeSelect = wrapper.find(
|
||||||
'FormGroup[label="SCM Type"] FormSelect'
|
'FormGroup[label="Source Control Credential Type"] FormSelect'
|
||||||
);
|
);
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
scmTypeSelect.invoke('onChange')('hg', { target: { name: 'Mercurial' } });
|
scmTypeSelect.invoke('onChange')('hg', { target: { name: 'Mercurial' } });
|
||||||
});
|
});
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper.find('FormGroup[label="SCM URL"] input').simulate('change', {
|
wrapper
|
||||||
target: { value: 'baz', name: 'scm_url' },
|
.find('FormGroup[label="Source Control URL"] input')
|
||||||
});
|
.simulate('change', {
|
||||||
|
target: { value: 'baz', name: 'scm_url' },
|
||||||
|
});
|
||||||
});
|
});
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
expect(wrapper.find('input#project-scm-url').prop('value')).toEqual('baz');
|
expect(wrapper.find('input#project-scm-url').prop('value')).toEqual('baz');
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const GitSubForm = ({
|
|||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
tooltip={
|
tooltip={
|
||||||
<span>
|
<span>
|
||||||
{i18n._(t`Example URLs for GIT SCM include:`)}
|
{i18n._(t`Example URLs for GIT Source Control include:`)}
|
||||||
<ul css="margin: 10px 0 10px 20px">
|
<ul css="margin: 10px 0 10px 20px">
|
||||||
<li>https://github.com/ansible/ansible.git</li>
|
<li>https://github.com/ansible/ansible.git</li>
|
||||||
<li>git@github.com:ansible/ansible.git</li>
|
<li>git@github.com:ansible/ansible.git</li>
|
||||||
@@ -35,10 +35,13 @@ const GitSubForm = ({
|
|||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<BranchFormField i18n={i18n} label={i18n._(t`SCM Branch/Tag/Commit`)} />
|
<BranchFormField
|
||||||
|
i18n={i18n}
|
||||||
|
label={i18n._(t`Source Control Branch/Tag/Commit`)}
|
||||||
|
/>
|
||||||
<FormField
|
<FormField
|
||||||
id="project-scm-refspec"
|
id="project-scm-refspec"
|
||||||
label={i18n._(t`SCM Refspec`)}
|
label={i18n._(t`Source Control Refspec`)}
|
||||||
name="scm_refspec"
|
name="scm_refspec"
|
||||||
type="text"
|
type="text"
|
||||||
tooltipMaxWidth="400px"
|
tooltipMaxWidth="400px"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const HgSubForm = ({
|
|||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
tooltip={
|
tooltip={
|
||||||
<span>
|
<span>
|
||||||
{i18n._(t`Example URLs for Mercurial SCM include:`)}
|
{i18n._(t`Example URLs for Mercurial Source Control include:`)}
|
||||||
<ul css={{ margin: '10px 0 10px 20px' }}>
|
<ul css={{ margin: '10px 0 10px 20px' }}>
|
||||||
<li>https://bitbucket.org/username/project</li>
|
<li>https://bitbucket.org/username/project</li>
|
||||||
<li>ssh://hg@bitbucket.org/username/project</li>
|
<li>ssh://hg@bitbucket.org/username/project</li>
|
||||||
@@ -32,7 +32,10 @@ const HgSubForm = ({
|
|||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<BranchFormField i18n={i18n} label={i18n._(t`SCM Branch/Tag/Revision`)} />
|
<BranchFormField
|
||||||
|
i18n={i18n}
|
||||||
|
label={i18n._(t`Source Control Branch/Tag/Revision`)}
|
||||||
|
/>
|
||||||
<ScmCredentialFormField
|
<ScmCredentialFormField
|
||||||
credential={credential}
|
credential={credential}
|
||||||
onCredentialSelection={onCredentialSelection}
|
onCredentialSelection={onCredentialSelection}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const ManualSubForm = ({
|
|||||||
assigned to other projects. Create a new directory there and make
|
assigned to other projects. Create a new directory there and make
|
||||||
sure the playbook files can be read by the "awx" system user,
|
sure the playbook files can be read by the "awx" system user,
|
||||||
or have ${brandName} directly retrieve your playbooks from
|
or have ${brandName} directly retrieve your playbooks from
|
||||||
source control using the SCM Type option above.`)}
|
source control using the Source Control Type option above.`)}
|
||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
<FormField
|
<FormField
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const UrlFormField = withI18n()(({ i18n, tooltip }) => (
|
|||||||
<FormField
|
<FormField
|
||||||
id="project-scm-url"
|
id="project-scm-url"
|
||||||
isRequired
|
isRequired
|
||||||
label={i18n._(t`SCM URL`)}
|
label={i18n._(t`Source Control URL`)}
|
||||||
name="scm_url"
|
name="scm_url"
|
||||||
tooltip={tooltip}
|
tooltip={tooltip}
|
||||||
tooltipMaxWidth="350px"
|
tooltipMaxWidth="350px"
|
||||||
@@ -32,7 +32,7 @@ export const BranchFormField = withI18n()(({ i18n, label }) => (
|
|||||||
label={label}
|
label={label}
|
||||||
tooltip={i18n._(t`Branch to checkout. In addition to branches,
|
tooltip={i18n._(t`Branch to checkout. In addition to branches,
|
||||||
you can input tags, commit hashes, and arbitrary refs. Some
|
you can input tags, commit hashes, and arbitrary refs. Some
|
||||||
commit hashes and refs may not be availble unless you also
|
commit hashes and refs may not be available unless you also
|
||||||
provide a custom refspec.`)}
|
provide a custom refspec.`)}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
@@ -44,7 +44,7 @@ export const ScmCredentialFormField = withI18n()(
|
|||||||
return (
|
return (
|
||||||
<CredentialLookup
|
<CredentialLookup
|
||||||
credentialTypeId={credential.typeId}
|
credentialTypeId={credential.typeId}
|
||||||
label={i18n._(t`SCM Credential`)}
|
label={i18n._(t`Source Control Credential`)}
|
||||||
value={credential.value}
|
value={credential.value}
|
||||||
onChange={value => {
|
onChange={value => {
|
||||||
onCredentialSelection('scm', value);
|
onCredentialSelection('scm', value);
|
||||||
@@ -94,7 +94,7 @@ export const ScmTypeOptions = withI18n()(
|
|||||||
name="allow_override"
|
name="allow_override"
|
||||||
label={i18n._(t`Allow Branch Override`)}
|
label={i18n._(t`Allow Branch Override`)}
|
||||||
tooltip={i18n._(
|
tooltip={i18n._(
|
||||||
t`Allow changing the SCM branch or revision in a job
|
t`Allow changing the Source Control branch or revision in a job
|
||||||
template that uses this project.`
|
template that uses this project.`
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const SvnSubForm = ({
|
|||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
tooltip={
|
tooltip={
|
||||||
<span>
|
<span>
|
||||||
{i18n._(t`Example URLs for Subversion SCM include:`)}
|
{i18n._(t`Example URLs for Subversion Source Control include:`)}
|
||||||
<ul css={{ margin: '10px 0 10px 20px' }}>
|
<ul css={{ margin: '10px 0 10px 20px' }}>
|
||||||
<li>https://github.com/ansible/ansible</li>
|
<li>https://github.com/ansible/ansible</li>
|
||||||
<li>svn://servername.example.com/path</li>
|
<li>svn://servername.example.com/path</li>
|
||||||
|
|||||||
@@ -206,7 +206,10 @@ function JobTemplateDetail({ i18n, template }) {
|
|||||||
) : (
|
) : (
|
||||||
renderMissingDataDetail(i18n._(t`Project`))
|
renderMissingDataDetail(i18n._(t`Project`))
|
||||||
)}
|
)}
|
||||||
<Detail label={i18n._(t`SCM Branch`)} value={template.scm_branch} />
|
<Detail
|
||||||
|
label={i18n._(t`Source Control Branch`)}
|
||||||
|
value={template.scm_branch}
|
||||||
|
/>
|
||||||
<Detail label={i18n._(t`Playbook`)} value={playbook} />
|
<Detail label={i18n._(t`Playbook`)} value={playbook} />
|
||||||
<Detail label={i18n._(t`Forks`)} value={forks || '0'} />
|
<Detail label={i18n._(t`Forks`)} value={forks || '0'} />
|
||||||
<Detail label={i18n._(t`Limit`)} value={limit} />
|
<Detail label={i18n._(t`Limit`)} value={limit} />
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ describe('<JobTemplateDetail />', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should render SCM_Branch', async () => {
|
test('should render Source Control Branch', async () => {
|
||||||
const SCMBranch = wrapper.find('Detail[label="SCM Branch"]');
|
const SCMBranch = wrapper.find('Detail[label="Source Control Branch"]');
|
||||||
expect(SCMBranch.prop('value')).toBe('Foo branch');
|
expect(SCMBranch.prop('value')).toBe('Foo branch');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ function ProjectsList({ history, i18n, nodeResource, onUpdateNodeResource }) {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: i18n._(t`SCM URL`),
|
name: i18n._(t`Source Control URL`),
|
||||||
key: 'scm_url',
|
key: 'scm_url',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ function JobTemplateForm({
|
|||||||
{project?.allow_override && (
|
{project?.allow_override && (
|
||||||
<FieldWithPrompt
|
<FieldWithPrompt
|
||||||
fieldId="template-scm-branch"
|
fieldId="template-scm-branch"
|
||||||
label={i18n._(t`SCM Branch`)}
|
label={i18n._(t`Source Control Branch`)}
|
||||||
promptId="template-ask-scm-branch-on-launch"
|
promptId="template-ask-scm-branch-on-launch"
|
||||||
promptName="ask_scm_branch_on_launch"
|
promptName="ask_scm_branch_on_launch"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ function WorkflowJobTemplateForm({
|
|||||||
/>
|
/>
|
||||||
<FormField
|
<FormField
|
||||||
type="text"
|
type="text"
|
||||||
label={i18n._(t`SCM Branch`)}
|
label={i18n._(t`Source Control Branch`)}
|
||||||
tooltip={i18n._(
|
tooltip={i18n._(
|
||||||
t`Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.`
|
t`Select a branch for the workflow. This branch is applied to all job template nodes that prompt for a branch.`
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user