Skip to content

Commit 3738eb3

Browse files
committed
Roles inputs
1 parent 1d51841 commit 3738eb3

File tree

11 files changed

+336
-106
lines changed

11 files changed

+336
-106
lines changed

webroot/adm/client-key.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h1>UID2 Env - Client Key Management</h1>
5959
name: 'roles',
6060
label: 'Roles',
6161
required: true,
62-
size: 'multi-line'
62+
type: 'multi-line'
6363
};
6464

6565
const keyIdInput = {

webroot/adm/operator-key.html

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,28 @@ <h1>UID2 Env - Operator Key Management</h1>
4545
type: 'number'
4646
};
4747

48-
const rolesMultilineInput = {
48+
const rolesInput = {
4949
name: 'roles',
5050
label: 'Roles',
5151
required: false,
52-
size: 'multi-line',
53-
placeholder: 'Enter roles separated by commas'
52+
type: 'multi-select',
53+
options: [
54+
{
55+
value: 'OPERATOR',
56+
label: 'OPERATOR',
57+
hint: 'Basic operator functionality for handling UID2 operations and client requests'
58+
},
59+
{
60+
value: 'OPTOUT',
61+
label: 'OPTOUT',
62+
hint: 'Handles individual user opt-out requests and direct opt-out operations'
63+
},
64+
{
65+
value: 'OPTOUT_SERVICE',
66+
label: 'OPTOUT_SERVICE',
67+
hint: 'Manages opt-out service infrastructure, bulk processing, and service-to-service opt-out coordination'
68+
}
69+
]
5470
};
5571

5672
const publicOperatorCheckboxInput = {
@@ -97,7 +113,7 @@ <h1>UID2 Env - Operator Key Management</h1>
97113
id: 'addOperatorKey',
98114
title: 'Add Operator Key',
99115
role: 'maintainer',
100-
inputs: [operatorNameInput, protocolInput, siteIdInput, rolesMultilineInput, publicOperatorCheckboxInput],
116+
inputs: [operatorNameInput, protocolInput, siteIdInput, rolesInput, publicOperatorCheckboxInput],
101117
apiCall: {
102118
method: 'POST',
103119
getUrl: (inputs) => {
@@ -140,7 +156,7 @@ <h1>UID2 Env - Operator Key Management</h1>
140156
id: 'setOperatorRoles',
141157
title: 'Set Roles',
142158
role: 'elevated',
143-
inputs: [operatorNameInput, rolesMultilineInput],
159+
inputs: [operatorNameInput, rolesInput],
144160
apiCall: {
145161
method: 'POST',
146162
getUrl: (inputs) => `/api/operator/roles?name=${encodeURIComponent(inputs.operatorName)}&roles=${encodeURIComponent(inputs.roles)}`

webroot/adm/partner-config.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1>UID2 Env - Partner Config</h1>
2828
name: 'configData',
2929
label: 'Configuration Data',
3030
required: true,
31-
size: 'multi-line',
31+
type: 'multi-line',
3232
placeholder: 'Enter JSON configuration data...'
3333
};
3434

webroot/adm/salt.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h1>UID2 Env - Salt Management</h1>
5050
label: 'Min Ages (seconds)',
5151
required: true,
5252
defaultValue: '2592000,5184000,7776000,10368000,12960000,15552000,18144000,20736000,23328000,25920000,28512000,31104000,33696000',
53-
size: 'multi-line'
53+
type: 'multi-line'
5454
};
5555

5656
const operationConfig = {

webroot/adm/service-link.html

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,28 @@ <h1>UID2 Env - Service Link Management</h1>
5151
size: 2
5252
};
5353

54-
const rolesMultilineInput = {
54+
const rolesInput = {
5555
name: 'roles',
5656
label: 'Roles',
5757
required: false,
58-
size: 'multi-line',
59-
placeholder: 'Enter roles separated by commas'
58+
type: 'multi-select',
59+
options: [
60+
{
61+
value: 'MAINTAINER',
62+
label: 'MAINTAINER',
63+
hint: 'General maintenance and administrative operations'
64+
},
65+
{
66+
value: 'PRIVILEGED',
67+
label: 'PRIVILEGED',
68+
hint: 'Elevated operations requiring special approval'
69+
},
70+
{
71+
value: 'SECRET_ROTATION',
72+
label: 'SECRET_ROTATION',
73+
hint: 'Permission to rotate encryption keys and secrets'
74+
}
75+
]
6076
};
6177

6278
const operationConfig = {
@@ -96,14 +112,14 @@ <h1>UID2 Env - Service Link Management</h1>
96112
serviceIdInput,
97113
siteIdInput,
98114
linkNameInput,
99-
rolesMultilineInput
115+
rolesInput
100116
],
101117
apiCall: {
102118
method: 'POST',
103119
url: '/api/service_link/add',
104120
getPayload: (inputs) => {
105121
const rolesArray = inputs.roles ?
106-
inputs.roles.replace(/\s+/g, '').split(',').filter(value => value !== '') :
122+
inputs.roles.split(',').filter(value => value !== '') :
107123
[];
108124

109125
return {
@@ -125,14 +141,14 @@ <h1>UID2 Env - Service Link Management</h1>
125141
serviceIdInput,
126142
siteIdInput,
127143
linkNameInput,
128-
rolesMultilineInput
144+
rolesInput
129145
],
130146
apiCall: {
131147
method: 'POST',
132148
url: '/api/service_link/update',
133149
getPayload: (inputs) => {
134150
const rolesArray = inputs.roles ?
135-
inputs.roles.replace(/\s+/g, '').split(',').filter(value => value !== '') :
151+
inputs.roles.split(',').filter(value => value !== '') :
136152
[];
137153

138154
return {

webroot/adm/service.html

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,32 @@ <h1>UID2 Env - Service Management</h1>
4545
size: 2
4646
};
4747

48-
const rolesMultilineInput = {
48+
const rolesInput = {
4949
name: 'roles',
5050
label: 'Roles',
5151
required: true,
52-
size: 'multi-line',
53-
placeholder: 'Enter roles separated by commas'
52+
type: 'multi-select',
53+
options: [
54+
{
55+
value: 'MAPPER',
56+
label: 'MAPPER',
57+
hint: 'For Advertisers'
58+
},
59+
{
60+
value: 'ID_READER',
61+
label: 'ID_READER',
62+
hint: 'For DSPs'
63+
},
64+
{
65+
value: 'GENERATOR',
66+
label: 'GENERATOR',
67+
hint: 'For Publishers'
68+
},
69+
{
70+
value: 'SHARER',
71+
label: 'SHARER',
72+
},
73+
]
5474
};
5575

5676
const linkIdRegexInput = {
@@ -103,7 +123,7 @@ <h1>UID2 Env - Service Management</h1>
103123
inputs: [
104124
serviceNameInput,
105125
siteIdInput,
106-
rolesMultilineInput,
126+
rolesInput,
107127
linkIdRegexInput
108128
],
109129
apiCall: {
@@ -113,7 +133,7 @@ <h1>UID2 Env - Service Management</h1>
113133
site_id: parseInt(inputs.siteId),
114134
link_id_regex: inputs.linkIdRegex,
115135
name: inputs.serviceName,
116-
roles: inputs.roles.replace(/\s+/g, '').split(',').filter(value => value !== ''),
136+
roles: inputs.roles.split(',').filter(value => value !== ''),
117137
})
118138
}
119139
},
@@ -125,7 +145,7 @@ <h1>UID2 Env - Service Management</h1>
125145
serviceIdInput,
126146
{...serviceNameInput, required: false},
127147
{...siteIdInput, required: false},
128-
{...rolesMultilineInput, required: false},
148+
{...rolesInput, required: false},
129149
linkIdRegexInput
130150
],
131151
apiCall: {
@@ -136,7 +156,7 @@ <h1>UID2 Env - Service Management</h1>
136156
if (inputs.serviceName) payload.name = inputs.serviceName;
137157
if (inputs.siteId) payload.site_id = parseInt(inputs.siteId);
138158
const rolesArray = inputs.roles ?
139-
inputs.roles.replace(/\s+/g, '').split(',').filter(value => value !== '') :
159+
inputs.roles.split(',').filter(value => value !== '') :
140160
[];
141161
if (rolesArray.length > 0) payload.roles = rolesArray;
142162

webroot/adm/site.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1>UID2 Env - Site Management</h1>
4343
const descriptionInput = {
4444
name: 'description',
4545
label: 'Description',
46-
size: 'multi-line',
46+
type: 'multi-line',
4747
required: true
4848
};
4949

@@ -56,13 +56,13 @@ <h1>UID2 Env - Site Management</h1>
5656
const domainNamesMultilineInput = {
5757
name: 'domainNames',
5858
label: 'Domain Names',
59-
size: 'multi-line'
59+
type: 'multi-line'
6060
};
6161

6262
const appNamesMultilineInput = {
6363
name: 'appNames',
6464
label: 'App Names',
65-
size: 'multi-line'
65+
type: 'multi-line'
6666
};
6767
function getTemplateValue(varName, fallback = '') {
6868
const value = '{{ ' + varName + ' }}';

webroot/css/style.css

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,78 @@
33
background-color: #FFFF00;
44
}
55

6+
/* Multi-select input styles */
7+
.multi-select-group {
8+
display: flex;
9+
flex-direction: column;
10+
gap: 8px;
11+
}
12+
13+
.multi-select-label {
14+
font-weight: bold;
15+
margin-bottom: 4px;
16+
}
17+
18+
.multi-select-options {
19+
display: block;
20+
padding: 12px;
21+
border: 1px solid #ccc;
22+
border-radius: 4px;
23+
background-color: #f9f9f9;
24+
}
25+
26+
.multi-select-options .form-check {
27+
display: block;
28+
margin: 0 0 8px 0;
29+
padding: 4px;
30+
border-radius: 3px;
31+
}
32+
33+
.multi-select-options .form-check:last-child {
34+
margin-bottom: 0;
35+
}
36+
37+
.multi-select-options .form-check-input {
38+
margin: 0 8px 0 0;
39+
width: 16px;
40+
height: 16px;
41+
vertical-align: top;
42+
float: none;
43+
}
44+
45+
.multi-select-options .form-check-label {
46+
margin: 0;
47+
font-weight: normal;
48+
font-size: 14px;
49+
cursor: pointer;
50+
display: inline;
51+
vertical-align: top;
52+
}
53+
54+
.multi-select-options .form-check:hover {
55+
background-color: #f8f9fa;
56+
}
57+
58+
/* Info icon styling */
59+
.info-icon {
60+
display: inline-block;
61+
margin-left: 8px;
62+
color: #6c757d;
63+
cursor: help;
64+
vertical-align: middle;
65+
opacity: 0.7;
66+
transition: opacity 0.2s ease;
67+
}
68+
69+
.info-icon:hover {
70+
opacity: 1;
71+
color: #495057;
72+
}
73+
74+
.info-icon svg {
75+
vertical-align: top;
76+
}
77+
678
/* Keyset Admin Page Styles */
779
.permission-badge {
880
padding: 4px 8px;

0 commit comments

Comments
 (0)