mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 10:27:34 -02:30
Add aw-tool-tip directive to Form > Add disabled tabs, clean up forms
This commit is contained in:
@@ -17,8 +17,6 @@ import JobSummary from "./forms/JobSummary";
|
|||||||
import JobTemplates from "./forms/JobTemplates";
|
import JobTemplates from "./forms/JobTemplates";
|
||||||
import JobVarsPrompt from "./forms/JobVarsPrompt";
|
import JobVarsPrompt from "./forms/JobVarsPrompt";
|
||||||
import Jobs from "./forms/Jobs";
|
import Jobs from "./forms/Jobs";
|
||||||
import LicenseForm from "./forms/LicenseForm";
|
|
||||||
import LicenseUpdate from "./forms/LicenseUpdate";
|
|
||||||
import LogViewerOptions from "./forms/LogViewerOptions";
|
import LogViewerOptions from "./forms/LogViewerOptions";
|
||||||
import LogViewerStatus from "./forms/LogViewerStatus";
|
import LogViewerStatus from "./forms/LogViewerStatus";
|
||||||
import Organizations from "./forms/Organizations";
|
import Organizations from "./forms/Organizations";
|
||||||
@@ -42,8 +40,6 @@ export
|
|||||||
JobTemplates,
|
JobTemplates,
|
||||||
JobVarsPrompt,
|
JobVarsPrompt,
|
||||||
Jobs,
|
Jobs,
|
||||||
LicenseForm,
|
|
||||||
LicenseUpdate,
|
|
||||||
LogViewerOptions,
|
LogViewerOptions,
|
||||||
LogViewerStatus,
|
LogViewerStatus,
|
||||||
Organizations,
|
Organizations,
|
||||||
|
|||||||
@@ -418,6 +418,8 @@ export default
|
|||||||
|
|
||||||
related: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
awToolTip: 'Please save before assigning permissions',
|
||||||
|
dataPlacement: 'top',
|
||||||
basePath: 'credentials/:id/access_list/',
|
basePath: 'credentials/:id/access_list/',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
title: 'Permissions',
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ export default
|
|||||||
|
|
||||||
related: {
|
related: {
|
||||||
scan_job_templates: {
|
scan_job_templates: {
|
||||||
|
awToolTip: 'Please save before adding a scan job template',
|
||||||
|
dataPlacement: 'top',
|
||||||
basePath: 'inventories/:id/scan_job_templates',
|
basePath: 'inventories/:id/scan_job_templates',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Scan Job Templates',
|
title: 'Scan Job Templates',
|
||||||
@@ -153,6 +155,8 @@ export default
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
|
awToolTip: 'Please save before assigning permissions',
|
||||||
|
dataPlacement: 'top',
|
||||||
basePath: 'projects/:id/access_list/',
|
basePath: 'projects/:id/access_list/',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
title: 'Permissions',
|
||||||
|
|||||||
@@ -334,6 +334,8 @@ export default
|
|||||||
include: "CompletedJobsList"
|
include: "CompletedJobsList"
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
|
awToolTip: 'Please save before assigning permissions',
|
||||||
|
dataPlacement: 'top',
|
||||||
basePath: 'job_templates/:id/access_list/',
|
basePath: 'job_templates/:id/access_list/',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
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: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
awToolTip: 'Please save before assigning permissions',
|
||||||
|
dataPlacement: 'top',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
title: 'Permissions',
|
||||||
iterator: 'permission',
|
iterator: 'permission',
|
||||||
|
|||||||
@@ -232,6 +232,8 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
|
|
||||||
related: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
awToolTip: 'Please save before assigning permissions',
|
||||||
|
dataPlacement: 'top',
|
||||||
basePath: 'projects/:id/access_list/',
|
basePath: 'projects/:id/access_list/',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
title: 'Permissions',
|
||||||
@@ -264,7 +266,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notifications": {
|
notifications: {
|
||||||
include: "NotificationsList"
|
include: "NotificationsList"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ export default
|
|||||||
|
|
||||||
related: {
|
related: {
|
||||||
access_list: {
|
access_list: {
|
||||||
|
dataPlacement: 'top',
|
||||||
|
awToolTip: 'Please save before adding users',
|
||||||
basePath: 'teams/:id/access_list/',
|
basePath: 'teams/:id/access_list/',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Users',
|
title: 'Users',
|
||||||
@@ -93,6 +95,8 @@ export default
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
roles: {
|
roles: {
|
||||||
|
dataPlacement: 'top',
|
||||||
|
awToolTip: 'Please save before assigning permissions',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
title: 'Permissions',
|
||||||
iterator: 'role',
|
iterator: 'role',
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ export default
|
|||||||
|
|
||||||
related: {
|
related: {
|
||||||
organizations: {
|
organizations: {
|
||||||
|
awToolTip: 'Please save before assigning to organizations',
|
||||||
|
dataPlacement: 'top',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Organizations',
|
title: 'Organizations',
|
||||||
iterator: 'organization',
|
iterator: 'organization',
|
||||||
@@ -136,6 +138,8 @@ export default
|
|||||||
hideOnSuperuser: true
|
hideOnSuperuser: true
|
||||||
},
|
},
|
||||||
teams: {
|
teams: {
|
||||||
|
awToolTip: 'Please save before assigning to teams',
|
||||||
|
dataPlacement: 'top',
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Teams',
|
title: 'Teams',
|
||||||
iterator: 'team',
|
iterator: 'team',
|
||||||
@@ -156,6 +160,8 @@ export default
|
|||||||
hideOnSuperuser: true
|
hideOnSuperuser: true
|
||||||
},
|
},
|
||||||
roles: {
|
roles: {
|
||||||
|
awToolTip: 'Please save before assigning to organizations',
|
||||||
|
dataPlacement: 'top',
|
||||||
hideSearchAndActions: true,
|
hideSearchAndActions: true,
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
title: 'Permissions',
|
title: 'Permissions',
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
export default
|
export default
|
||||||
angular.module('CompletedJobsDefinition', ['sanitizeFilter'])
|
angular.module('CompletedJobsDefinition', ['sanitizeFilter'])
|
||||||
.value( 'CompletedJobsList', {
|
.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',
|
name: 'completed_jobs',
|
||||||
basePath: 'job_templates/:id/jobs/?or__status=successful&or__status=failed&or__status=error&or__status=canceled',
|
basePath: 'job_templates/:id/jobs/?or__status=successful&or__status=failed&or__status=error&or__status=canceled',
|
||||||
iterator: 'completed_job',
|
iterator: 'completed_job',
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
export default function(){
|
export default function(){
|
||||||
return {
|
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' ,
|
name: 'notifications' ,
|
||||||
title: 'Notifications',
|
title: 'Notifications',
|
||||||
iterator: 'notification',
|
iterator: 'notification',
|
||||||
|
|||||||
@@ -1511,7 +1511,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
|
|
||||||
for (itm in this.form.related) {
|
for (itm in this.form.related) {
|
||||||
collection = this.form.related[itm];
|
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) +
|
"class=\"Form-tab Form-tab--disabled\">" + (collection.title || collection.editTitle) +
|
||||||
"</div>\n";
|
"</div>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user