foreman_resource_quota 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/app/controllers/foreman_resource_quota/api/v2/resource_quotas_controller.rb +1 -1
- data/app/controllers/foreman_resource_quota/concerns/api/v2/hosts_controller_extensions.rb +21 -0
- data/app/helpers/foreman_resource_quota/hosts_helper.rb +18 -7
- data/app/lib/foreman_resource_quota/exceptions.rb +1 -0
- data/app/models/concerns/foreman_resource_quota/host_managed_extensions.rb +9 -10
- data/app/models/concerns/foreman_resource_quota/user_extensions.rb +27 -0
- data/app/models/concerns/foreman_resource_quota/usergroup_extensions.rb +18 -0
- data/app/models/foreman_resource_quota/resource_quota.rb +23 -0
- data/app/views/foreman_resource_quota/resource_quotas/index.html.erb +9 -1
- data/app/views/hosts/_form_quota_fields.html.erb +14 -2
- data/app/views/users/_form_quota_tab.html.erb +2 -2
- data/db/migrate/20240611141939_drop_missing_hosts.rb +9 -2
- data/db/migrate/20250410082728_add_unassigned_flag_to_resource_quota.rb +7 -0
- data/db/seeds.d/030-unassigned_quota.rb +36 -0
- data/lib/foreman_resource_quota/register.rb +8 -0
- data/lib/foreman_resource_quota/version.rb +1 -1
- data/lib/tasks/foreman_resource_quota_tasks.rake +4 -5
- data/package.json +9 -10
- data/webpack/components/CreateResourceQuotaModal.js +1 -0
- data/webpack/components/ResourceQuotaEmptyState/__test__/__snapshots__/ResourceQuotaEmptyState.test.js.snap +4 -0
- data/webpack/components/ResourceQuotaEmptyState/index.js +1 -0
- data/webpack/components/ResourceQuotaForm/ResourceQuotaForm.scss +1 -1
- data/webpack/components/ResourceQuotaForm/ResourceQuotaFormConstants.js +1 -0
- data/webpack/components/ResourceQuotaForm/components/Properties/Properties.scss +4 -3
- data/webpack/components/ResourceQuotaForm/components/Properties/StaticDetail.js +3 -2
- data/webpack/components/ResourceQuotaForm/components/Properties/TextInputField.js +4 -1
- data/webpack/components/ResourceQuotaForm/components/Properties/index.js +86 -45
- data/webpack/components/ResourceQuotaForm/components/Resource/Resource.scss +5 -5
- data/webpack/components/ResourceQuotaForm/components/Resource/UnitInputField.js +84 -37
- data/webpack/components/ResourceQuotaForm/components/Resource/UnitInputField.scss +7 -0
- data/webpack/components/ResourceQuotaForm/components/Resource/UtilizationProgress.js +14 -13
- data/webpack/components/ResourceQuotaForm/components/Resource/UtilizationProgress.scss +4 -4
- data/webpack/components/ResourceQuotaForm/components/Resource/__test__/__snapshots__/UnitInputField.test.js.snap +149 -140
- data/webpack/components/ResourceQuotaForm/components/Resource/index.js +28 -17
- data/webpack/components/ResourceQuotaForm/components/Submit.js +2 -1
- data/webpack/components/ResourceQuotaForm/index.js +33 -19
- data/webpack/components/UpdateResourceQuotaModal.js +7 -1
- data/webpack/lib/ActionableDetail.scss +1 -1
- data/webpack/lib/EditableSwitch.js +1 -1
- data/webpack/lib/EditableTextInput/EditableTextInput.js +81 -77
- data/webpack/lib/EditableTextInput/editableTextInput.scss +30 -28
- metadata +8 -8
@@ -89,87 +89,91 @@ const EditableTextInput = ({
|
|
89
89
|
onKeyUp,
|
90
90
|
component,
|
91
91
|
value: inputValue || '',
|
92
|
-
onChange: setInputValue,
|
92
|
+
onChange: (_event, val) => setInputValue(val),
|
93
93
|
validated: valid,
|
94
94
|
};
|
95
95
|
|
96
|
-
return
|
97
|
-
<
|
98
|
-
|
99
|
-
|
100
|
-
<
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
<
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
96
|
+
return (
|
97
|
+
<div className="container-editable-text-input">
|
98
|
+
{editing ? (
|
99
|
+
<Split>
|
100
|
+
<SplitItem>
|
101
|
+
{textArea ? (
|
102
|
+
<TextArea {...inputProps} aria-label={`${attribute} text area`} />
|
103
|
+
) : (
|
104
|
+
<TextInput
|
105
|
+
{...inputProps}
|
106
|
+
type={isPassword && !showPassword ? 'password' : 'text'}
|
107
|
+
aria-label={`${attribute} text input`}
|
108
|
+
ouiaId={ouiaId}
|
109
|
+
/>
|
110
|
+
)}
|
111
|
+
</SplitItem>
|
112
|
+
<SplitItem>
|
113
|
+
<Button
|
114
|
+
ouiaId={`submit-button-${attribute}`}
|
115
|
+
aria-label={`submit ${attribute}`}
|
116
|
+
variant="plain"
|
117
|
+
onClick={onSubmit}
|
118
|
+
>
|
119
|
+
<CheckIcon />
|
120
|
+
</Button>
|
121
|
+
</SplitItem>
|
122
|
+
<SplitItem>
|
123
|
+
<Button
|
124
|
+
ouiaId={`clear-button-${attribute}`}
|
125
|
+
aria-label={`clear ${attribute}`}
|
126
|
+
variant="plain"
|
127
|
+
onClick={onClear}
|
128
|
+
>
|
129
|
+
<TimesIcon />
|
130
|
+
</Button>
|
131
|
+
</SplitItem>
|
132
|
+
{isPassword ? (
|
133
|
+
<SplitItem>
|
134
|
+
<Button
|
135
|
+
ouiaId={`show-button-${attribute}`}
|
136
|
+
aria-label={`show-password ${attribute}`}
|
137
|
+
variant="plain"
|
138
|
+
isDisabled={!inputValue?.length}
|
139
|
+
onClick={toggleShowPassword}
|
140
|
+
>
|
141
|
+
{showPassword ? <EyeSlashIcon /> : <EyeIcon />}
|
142
|
+
</Button>
|
143
|
+
</SplitItem>
|
144
|
+
) : null}
|
145
|
+
</Split>
|
146
|
+
) : (
|
147
|
+
<Split>
|
148
|
+
<SplitItem>
|
149
|
+
{inputValue ? (
|
150
|
+
<Text
|
151
|
+
className={`text${textArea ? 'Area' : 'Input'}-value`}
|
152
|
+
ouiaId={`${attribute}-text-value`}
|
153
|
+
aria-label={`${attribute} text value`}
|
154
|
+
component={component}
|
155
|
+
>
|
156
|
+
{editing ? inputValue : passwordPlaceholder || inputValue}
|
157
|
+
</Text>
|
158
|
+
) : (
|
159
|
+
<Text
|
160
|
+
className={`text${textArea ? 'Area' : 'Input'}-placeholder`}
|
161
|
+
ouiaId={`${attribute}-text-value`}
|
162
|
+
aria-label={`${attribute} text value`}
|
163
|
+
component={component}
|
164
|
+
>
|
165
|
+
{passwordPlaceholder || placeholder}
|
166
|
+
</Text>
|
167
|
+
)}
|
168
|
+
</SplitItem>
|
169
|
+
{!disabled && (
|
170
|
+
<SplitItem>
|
171
|
+
<PencilEditButton {...{ attribute, onEditClick }} />
|
172
|
+
</SplitItem>
|
173
|
+
)}
|
174
|
+
</Split>
|
171
175
|
)}
|
172
|
-
</
|
176
|
+
</div>
|
173
177
|
);
|
174
178
|
};
|
175
179
|
|
@@ -1,38 +1,40 @@
|
|
1
1
|
/* Credits: https://github.com/Katello/katello/blob/631d5bb83dc5d87320ee9002a6de33809a281b3e/webpack/components/EditableTextInput/editableTextInput.scss */
|
2
|
-
@import '
|
2
|
+
@import 'foremanReact/common/variables';
|
3
3
|
|
4
|
-
.
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
.container-editable-text-input {
|
5
|
+
.foreman-limited-text {
|
6
|
+
max-width: 200px;
|
7
|
+
margin: auto 0px;
|
8
|
+
}
|
8
9
|
|
9
|
-
.foreman-limited-editable-text {
|
10
|
-
|
11
|
-
|
12
|
-
}
|
10
|
+
.foreman-limited-editable-text {
|
11
|
+
max-width: 300px;
|
12
|
+
margin: auto 0px;
|
13
|
+
}
|
13
14
|
|
14
|
-
// Edit icon isn't in line with text
|
15
|
-
.foreman-edit-icon {
|
16
|
-
|
17
|
-
}
|
15
|
+
// Edit icon isn't in line with text
|
16
|
+
.foreman-edit-icon {
|
17
|
+
padding-top: 2px;
|
18
|
+
}
|
18
19
|
|
19
|
-
.textInput-placeholder, .textArea-placeholder {
|
20
|
-
|
21
|
-
}
|
20
|
+
.textInput-placeholder, .textArea-placeholder {
|
21
|
+
color: var(--pf-v5-global--disabled-color--100);
|
22
|
+
}
|
22
23
|
|
23
|
-
textarea.pf-c-form-control {
|
24
|
-
|
25
|
-
}
|
24
|
+
textarea.pf-v5-c-form-control {
|
25
|
+
width: 215px;
|
26
|
+
}
|
26
27
|
|
27
|
-
.pf-c-form-control:not(textarea) {
|
28
|
-
|
29
|
-
}
|
28
|
+
.pf-v5-c-form-control:not(textarea) {
|
29
|
+
width: 215px;
|
30
|
+
}
|
30
31
|
|
31
|
-
p {
|
32
|
-
|
33
|
-
}
|
32
|
+
p {
|
33
|
+
width: 215px;
|
34
|
+
}
|
34
35
|
|
35
|
-
p.textArea-placeholder, p.textArea-value {
|
36
|
-
|
37
|
-
|
36
|
+
p.textArea-placeholder, p.textArea-value {
|
37
|
+
width: 215px;
|
38
|
+
height: 50px;
|
39
|
+
}
|
38
40
|
}
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_resource_quota
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bastian Schmidt
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: foreman-tasks
|
@@ -19,7 +18,7 @@ dependencies:
|
|
19
18
|
version: '10.0'
|
20
19
|
- - "<"
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
21
|
+
version: '12'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +28,7 @@ dependencies:
|
|
29
28
|
version: '10.0'
|
30
29
|
- - "<"
|
31
30
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
31
|
+
version: '12'
|
33
32
|
- !ruby/object:Gem::Dependency
|
34
33
|
name: theforeman-rubocop
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,6 +152,8 @@ files:
|
|
153
152
|
- db/migrate/20240611141939_drop_missing_hosts.rb
|
154
153
|
- db/migrate/20240611142813_create_hosts_resources.rb
|
155
154
|
- db/migrate/20240618163434_remove_resource_quota_from_hosts.rb
|
155
|
+
- db/migrate/20250410082728_add_unassigned_flag_to_resource_quota.rb
|
156
|
+
- db/seeds.d/030-unassigned_quota.rb
|
156
157
|
- lib/foreman_resource_quota.rb
|
157
158
|
- lib/foreman_resource_quota/async/refresh_resource_quota_utilization.rb
|
158
159
|
- lib/foreman_resource_quota/engine.rb
|
@@ -276,6 +277,7 @@ files:
|
|
276
277
|
- webpack/components/ResourceQuotaForm/components/QuotaState.js
|
277
278
|
- webpack/components/ResourceQuotaForm/components/Resource/Resource.scss
|
278
279
|
- webpack/components/ResourceQuotaForm/components/Resource/UnitInputField.js
|
280
|
+
- webpack/components/ResourceQuotaForm/components/Resource/UnitInputField.scss
|
279
281
|
- webpack/components/ResourceQuotaForm/components/Resource/UtilizationProgress.js
|
280
282
|
- webpack/components/ResourceQuotaForm/components/Resource/UtilizationProgress.scss
|
281
283
|
- webpack/components/ResourceQuotaForm/components/Resource/__test__/UnitInputField.test.js
|
@@ -305,7 +307,6 @@ licenses:
|
|
305
307
|
- GPL-3.0
|
306
308
|
metadata:
|
307
309
|
is_foreman_plugin: 'true'
|
308
|
-
post_install_message:
|
309
310
|
rdoc_options: []
|
310
311
|
require_paths:
|
311
312
|
- lib
|
@@ -320,8 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
321
|
- !ruby/object:Gem::Version
|
321
322
|
version: '0'
|
322
323
|
requirements: []
|
323
|
-
rubygems_version: 3.
|
324
|
-
signing_key:
|
324
|
+
rubygems_version: 3.6.7
|
325
325
|
specification_version: 4
|
326
326
|
summary: Foreman Plug-in for resource quota
|
327
327
|
test_files: []
|