Skip to content

Commit b658cf1

Browse files
ui: Added info / tooltip for add role and import role dialogs in the UI (#4836)
1 parent 45e6800 commit b658cf1

4 files changed

Lines changed: 73 additions & 11 deletions

File tree

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/CreateRoleCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class CreateRoleCmd extends RoleCmd {
4242
/////////////////////////////////////////////////////
4343

4444
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true,
45-
description = "creates a role with this unique name", validations = {ApiArgValidator.NotNullOrEmpty})
45+
description = "Creates a role with this unique name", validations = {ApiArgValidator.NotNullOrEmpty})
4646
private String roleName;
4747

4848
@Parameter(name = ApiConstants.ROLE_ID, type = CommandType.UUID, entityType = RoleResponse.class,

ui/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@
479479
"label.baremetalmac": "Host MAC",
480480
"label.baremetalmemory": "Memory (in MB)",
481481
"label.based.on": "Based on",
482+
"label.based.on.role.id.or.type": "Creates a role based on either role id or type",
482483
"label.basic": "Basic",
483484
"label.basic.mode": "Basic Mode",
484485
"label.basicsetup": "Basic setup",
@@ -1827,6 +1828,7 @@
18271828
"label.rule.number": "Rule Number",
18281829
"label.rules": "Rules",
18291830
"label.rules.file": "Rules File",
1831+
"label.rules.file.to.import": "Rule defintions CSV file to import",
18301832
"label.rules.file.import.description": "Click or drag rule defintions CSV file to import",
18311833
"label.run.proxy.locally": "Run proxy locally",
18321834
"label.running": "Running VMs",

ui/src/views/iam/CreateRole.vue

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,39 @@
2222
:form="form"
2323
@submit="handleSubmit"
2424
layout="vertical">
25-
<a-form-item :label="$t('label.name')">
25+
<a-form-item>
26+
<span slot="label">
27+
{{ $t('label.name') }}
28+
<a-tooltip :title="createRoleApiParams.name.description">
29+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
30+
</a-tooltip>
31+
</span>
2632
<a-input
2733
v-decorator="['name', {
2834
rules: [{ required: true, message: $t('message.error.required.input') }]
2935
}]"
3036
:placeholder="createRoleApiParams.name.description" />
3137
</a-form-item>
3238

33-
<a-form-item :label="$t('label.description')">
39+
<a-form-item>
40+
<span slot="label">
41+
{{ $t('label.description') }}
42+
<a-tooltip :title="createRoleApiParams.description.description">
43+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
44+
</a-tooltip>
45+
</span>
3446
<a-input
3547
v-decorator="['description']"
3648
:placeholder="createRoleApiParams.description.description" />
3749
</a-form-item>
3850

39-
<a-form-item :label="$t('label.based.on')" v-if="'roleid' in createRoleApiParams">
51+
<a-form-item v-if="'roleid' in createRoleApiParams">
52+
<span slot="label">
53+
{{ $t('label.based.on') }}
54+
<a-tooltip :title="$t('label.based.on.role.id.or.type')">
55+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
56+
</a-tooltip>
57+
</span>
4058
<a-radio-group
4159
v-decorator="['using', {
4260
initialValue: this.createRoleUsing
@@ -52,7 +70,13 @@
5270
</a-radio-group>
5371
</a-form-item>
5472

55-
<a-form-item :label="$t('label.type')" v-if="this.createRoleUsing === 'type'">
73+
<a-form-item v-if="this.createRoleUsing === 'type'">
74+
<span slot="label">
75+
{{ $t('label.type') }}
76+
<a-tooltip :title="createRoleApiParams.type.description">
77+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
78+
</a-tooltip>
79+
</span>
5680
<a-select
5781
v-decorator="['type', {
5882
rules: [{ required: true, message: $t('message.error.select') }]
@@ -64,7 +88,13 @@
6488
</a-select>
6589
</a-form-item>
6690

67-
<a-form-item :label="$t('label.role')" v-if="this.createRoleUsing === 'role'">
91+
<a-form-item v-if="this.createRoleUsing === 'role'">
92+
<span slot="label">
93+
{{ $t('label.role') }}
94+
<a-tooltip :title="createRoleApiParams.roleid.description">
95+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
96+
</a-tooltip>
97+
</span>
6898
<a-select
6999
v-decorator="['roleid', {
70100
rules: [{ required: true, message: $t('message.error.select') }]

ui/src/views/iam/ImportRole.vue

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
:form="form"
2323
@submit="handleSubmit"
2424
layout="vertical">
25-
<a-form-item :label="$t('label.rules.file')">
25+
<a-form-item>
26+
<span slot="label">
27+
{{ $t('label.rules.file') }}
28+
<a-tooltip :title="$t('label.rules.file.to.import')">
29+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
30+
</a-tooltip>
31+
</span>
2632
<a-upload-dragger
2733
:multiple="false"
2834
:fileList="fileList"
@@ -45,21 +51,39 @@
4551
</p>
4652
</a-upload-dragger>
4753
</a-form-item>
48-
<a-form-item :label="$t('label.name')">
54+
<a-form-item>
55+
<span slot="label">
56+
{{ $t('label.name') }}
57+
<a-tooltip :title="importRoleApiParams.name.description">
58+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
59+
</a-tooltip>
60+
</span>
4961
<a-input
5062
v-decorator="['name', {
5163
rules: [{ required: true, message: $t('message.error.required.input') }]
5264
}]"
5365
:placeholder="importRoleApiParams.name.description" />
5466
</a-form-item>
5567

56-
<a-form-item :label="$t('label.description')">
68+
<a-form-item>
69+
<span slot="label">
70+
{{ $t('label.description') }}
71+
<a-tooltip :title="importRoleApiParams.description.description">
72+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
73+
</a-tooltip>
74+
</span>
5775
<a-input
5876
v-decorator="['description']"
5977
:placeholder="importRoleApiParams.description.description" />
6078
</a-form-item>
6179

62-
<a-form-item :label="$t('label.type')">
80+
<a-form-item>
81+
<span slot="label">
82+
{{ $t('label.type') }}
83+
<a-tooltip :title="importRoleApiParams.type.description">
84+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
85+
</a-tooltip>
86+
</span>
6387
<a-select
6488
v-decorator="['type', {
6589
rules: [{ required: true, message: $t('message.error.select') }]
@@ -71,7 +95,13 @@
7195
</a-select>
7296
</a-form-item>
7397

74-
<a-form-item :label="$t('label.forced')">
98+
<a-form-item>
99+
<span slot="label">
100+
{{ $t('label.forced') }}
101+
<a-tooltip :title="importRoleApiParams.forced.description">
102+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
103+
</a-tooltip>
104+
</span>
75105
<a-switch
76106
v-decorator="['forced', {
77107
initialValue: false

0 commit comments

Comments
 (0)