mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
Add aw-tool-tip directive to Form > Add disabled tabs, clean up forms
This commit is contained in:
parent
4096583b47
commit
03bdf0b1aa
@ -17,8 +17,6 @@ import JobSummary from "./forms/JobSummary";
|
||||
import JobTemplates from "./forms/JobTemplates";
|
||||
import JobVarsPrompt from "./forms/JobVarsPrompt";
|
||||
import Jobs from "./forms/Jobs";
|
||||
import LicenseForm from "./forms/LicenseForm";
|
||||
import LicenseUpdate from "./forms/LicenseUpdate";
|
||||
import LogViewerOptions from "./forms/LogViewerOptions";
|
||||
import LogViewerStatus from "./forms/LogViewerStatus";
|
||||
import Organizations from "./forms/Organizations";
|
||||
@ -42,8 +40,6 @@ export
|
||||
JobTemplates,
|
||||
JobVarsPrompt,
|
||||
Jobs,
|
||||
LicenseForm,
|
||||
LicenseUpdate,
|
||||
LogViewerOptions,
|
||||
LogViewerStatus,
|
||||
Organizations,
|
||||
|
||||
@ -418,6 +418,8 @@ export default
|
||||
|
||||
related: {
|
||||
permissions: {
|
||||
awToolTip: 'Please save before assigning permissions',
|
||||
dataPlacement: 'top',
|
||||
basePath: 'credentials/:id/access_list/',
|
||||
type: 'collection',
|
||||
title: 'Permissions',
|
||||
|
||||
@ -79,6 +79,8 @@ export default
|
||||
|
||||
related: {
|
||||
scan_job_templates: {
|
||||
awToolTip: 'Please save before adding a scan job template',
|
||||
dataPlacement: 'top',
|
||||
basePath: 'inventories/:id/scan_job_templates',
|
||||
type: 'collection',
|
||||
title: 'Scan Job Templates',
|
||||
@ -153,6 +155,8 @@ export default
|
||||
}
|
||||
},
|
||||
permissions: {
|
||||
awToolTip: 'Please save before assigning permissions',
|
||||
dataPlacement: 'top',
|
||||
basePath: 'projects/:id/access_list/',
|
||||
type: 'collection',
|
||||
title: 'Permissions',
|
||||
|
||||
@ -334,6 +334,8 @@ export default
|
||||
include: "CompletedJobsList"
|
||||
},
|
||||
permissions: {
|
||||
awToolTip: 'Please save before assigning permissions',
|
||||
dataPlacement: 'top',
|
||||
basePath: 'job_templates/:id/access_list/',
|
||||
type: 'collection',
|
||||
title: 'Permissions',
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
* @name forms.function:LicenseForm
|
||||
* @description This form is for viewing the license information
|
||||
*/
|
||||
|
||||
|
||||
export default
|
||||
angular.module('LicenseFormDefinition', [])
|
||||
.value('LicenseForm', {
|
||||
|
||||
name: 'license',
|
||||
well: false,
|
||||
editTitle: "License",
|
||||
|
||||
licenseTabs: [{
|
||||
name: 'license',
|
||||
label: 'License'
|
||||
}, {
|
||||
name: 'managed',
|
||||
label: 'Managed Hosts'
|
||||
}],
|
||||
|
||||
fields: {
|
||||
license_status: {
|
||||
type: 'custom',
|
||||
control: "<div class=\"license-status\" ng-class=\"status_color\"><i class=\"fa fa-circle\"></i> {{ license_status }}</div>",
|
||||
readonly: true,
|
||||
tab: 'license'
|
||||
},
|
||||
tower_version: {
|
||||
label: 'Tower Version',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
tab: 'license'
|
||||
},
|
||||
license_type: {
|
||||
label: 'License Type',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
tab: 'license'
|
||||
},
|
||||
subscription_name: {
|
||||
label: 'Subscription Name',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
tab: 'license'
|
||||
},
|
||||
license_key: {
|
||||
label: 'License Key',
|
||||
type: 'textarea',
|
||||
'class': 'modal-input-xlarge',
|
||||
readonly: true,
|
||||
tab: 'license'
|
||||
},
|
||||
license_date: {
|
||||
label: 'Expires On',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
tab: 'license'
|
||||
},
|
||||
time_remaining: {
|
||||
label: 'Time Remaining',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
tab: 'license'
|
||||
},
|
||||
available_instances: {
|
||||
label: 'Available',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
tab: 'managed'
|
||||
},
|
||||
current_instances: {
|
||||
label: 'Used',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
tab: 'managed'
|
||||
},
|
||||
free_instances: {
|
||||
label: 'Remaining',
|
||||
type: 'text',
|
||||
readonly: true,
|
||||
controlNGClass: 'free_instances_class',
|
||||
labelNGClass: 'free_instances_class',
|
||||
tab: 'managed'
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1,57 +0,0 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2015 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
* @name forms.function:LicenseUpdate
|
||||
* @description This form is for updating a license
|
||||
*/
|
||||
|
||||
export default
|
||||
angular.module('LicenseUpdateFormDefinition', [])
|
||||
.value('LicenseUpdateForm', {
|
||||
|
||||
name: 'license',
|
||||
well: false,
|
||||
|
||||
fields: {
|
||||
license_json: {
|
||||
label: 'License File',
|
||||
type: 'textarea',
|
||||
'class' : 'prepend-asterisk',
|
||||
addRequired: true,
|
||||
editRequired: true,
|
||||
rows: 10,
|
||||
'default': '---'
|
||||
},
|
||||
eula: {
|
||||
label: 'End User License Agreement',
|
||||
type: 'textarea',
|
||||
addRequired: true,
|
||||
editRequired: true,
|
||||
'class' : 'prepend-asterisk',
|
||||
rows: 5,
|
||||
readonly: true
|
||||
},
|
||||
eula_agreement: {
|
||||
label: 'I agree to the End User License Agreement',
|
||||
type: 'checkbox',
|
||||
addRequired: true,
|
||||
editRequired: true
|
||||
}
|
||||
},
|
||||
buttons: {
|
||||
form_submit: {
|
||||
label: "Submit",
|
||||
"class": "pull-right btn-primary",
|
||||
ngClick: "submitLicenseKey()",
|
||||
// ngDisabled: "true"
|
||||
}
|
||||
},
|
||||
|
||||
related: { }
|
||||
|
||||
}); //LicenseUpdateForm
|
||||
@ -47,6 +47,8 @@ export default
|
||||
|
||||
related: {
|
||||
permissions: {
|
||||
awToolTip: 'Please save before assigning permissions',
|
||||
dataPlacement: 'top',
|
||||
type: 'collection',
|
||||
title: 'Permissions',
|
||||
iterator: 'permission',
|
||||
|
||||
@ -232,6 +232,8 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
|
||||
related: {
|
||||
permissions: {
|
||||
awToolTip: 'Please save before assigning permissions',
|
||||
dataPlacement: 'top',
|
||||
basePath: 'projects/:id/access_list/',
|
||||
type: 'collection',
|
||||
title: 'Permissions',
|
||||
@ -264,7 +266,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
notifications: {
|
||||
include: "NotificationsList"
|
||||
}
|
||||
},
|
||||
|
||||
@ -60,6 +60,8 @@ export default
|
||||
|
||||
related: {
|
||||
access_list: {
|
||||
dataPlacement: 'top',
|
||||
awToolTip: 'Please save before adding users',
|
||||
basePath: 'teams/:id/access_list/',
|
||||
type: 'collection',
|
||||
title: 'Users',
|
||||
@ -93,6 +95,8 @@ export default
|
||||
}
|
||||
},
|
||||
roles: {
|
||||
dataPlacement: 'top',
|
||||
awToolTip: 'Please save before assigning permissions',
|
||||
type: 'collection',
|
||||
title: 'Permissions',
|
||||
iterator: 'role',
|
||||
|
||||
@ -116,6 +116,8 @@ export default
|
||||
|
||||
related: {
|
||||
organizations: {
|
||||
awToolTip: 'Please save before assigning to organizations',
|
||||
dataPlacement: 'top',
|
||||
type: 'collection',
|
||||
title: 'Organizations',
|
||||
iterator: 'organization',
|
||||
@ -136,6 +138,8 @@ export default
|
||||
hideOnSuperuser: true
|
||||
},
|
||||
teams: {
|
||||
awToolTip: 'Please save before assigning to teams',
|
||||
dataPlacement: 'top',
|
||||
type: 'collection',
|
||||
title: 'Teams',
|
||||
iterator: 'team',
|
||||
@ -156,6 +160,8 @@ export default
|
||||
hideOnSuperuser: true
|
||||
},
|
||||
roles: {
|
||||
awToolTip: 'Please save before assigning to organizations',
|
||||
dataPlacement: 'top',
|
||||
hideSearchAndActions: true,
|
||||
type: 'collection',
|
||||
title: 'Permissions',
|
||||
|
||||
@ -10,7 +10,9 @@
|
||||
export default
|
||||
angular.module('CompletedJobsDefinition', ['sanitizeFilter'])
|
||||
.value( 'CompletedJobsList', {
|
||||
|
||||
// These tooltip fields are consumed to build disabled related tabs tooltips in the form > add view
|
||||
awToolTip: 'Please save and run a job to view',
|
||||
dataPlacement: 'top',
|
||||
name: 'completed_jobs',
|
||||
basePath: 'job_templates/:id/jobs/?or__status=successful&or__status=failed&or__status=error&or__status=canceled',
|
||||
iterator: 'completed_job',
|
||||
|
||||
@ -6,6 +6,9 @@
|
||||
|
||||
export default function(){
|
||||
return {
|
||||
// These tooltip fields are consumed to build disabled related tabs tooltips in the form > add view
|
||||
dataPlacement: 'top',
|
||||
awToolTip: 'Please save before adding notifications',
|
||||
name: 'notifications' ,
|
||||
title: 'Notifications',
|
||||
iterator: 'notification',
|
||||
|
||||
@ -1511,7 +1511,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
|
||||
for (itm in this.form.related) {
|
||||
collection = this.form.related[itm];
|
||||
html += "<div id=\"" + itm + "_tab\" "+
|
||||
html += "<div id=\"" + itm + "_tab\" "+ "aw-tool-tip=\"" +
|
||||
collection.awToolTip + "\" aw-tip-placement=\"" + collection.dataPlacement + "\" " +
|
||||
"data-container=\"body\" tooltipinnerclass=\"StartStatus-tooltip\" data-trigger=\"hover\"" +
|
||||
"class=\"Form-tab Form-tab--disabled\">" + (collection.title || collection.editTitle) +
|
||||
"</div>\n";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user