Skip to content

Commit 500fdd5

Browse files
authored
Merge pull request #9455 from kbrock/no_settings
Drop Tenant#use_config_for_attributes
2 parents d9ead32 + 47ce704 commit 500fdd5

File tree

9 files changed

+9
-121
lines changed

9 files changed

+9
-121
lines changed

app/controllers/ops_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ def extra_js_commands(presenter)
751751
presenter[:right_cell_text] = @right_cell_text
752752
presenter[:osf_node] = x_node
753753
presenter.reset_one_trans
754-
presenter.focus('server_company')
754+
presenter.focus('server_name')
755755
presenter[:ajax_action] = {
756756
:controller => controller_name,
757757
:action => @ajax_action,

app/controllers/ops_controller/settings/common.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ def settings_update_save
433433
add_flash(_("Configuration settings saved"))
434434
end
435435
if @sb[:active_tab] == "settings_server" && @sb[:selected_server_id] == MiqServer.my_server.id # Reset session variables for names fields, if editing current server config
436-
session[:customer_name] = @update[:server][:company]
437436
session[:vmdb_name] = @update[:server][:name]
438437
end
439438
set_user_time_zone if @sb[:active_tab] == "settings_server"

app/helpers/application_helper.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,9 +1332,7 @@ def provider_paused?(record)
13321332

13331333
# Return a proper column for an appropriate target klass
13341334
def columns_for_klass(klass)
1335-
if klass == 'Tenant'
1336-
[:name, :use_config_for_attributes]
1337-
elsif klass.safe_constantize.column_names.include?('name')
1335+
if klass.safe_constantize.column_names.include?('name')
13381336
[:name]
13391337
else
13401338
[:description]

app/javascript/components/ops-tenant-form/ops-tenant-form.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const OpsTenantForm = ({
1919
useEffect(() => {
2020
if (recordId) {
2121
miqSparkleOn();
22-
API.get(`/api/tenants/${recordId}?expand=resources&attributes=name,description,use_config_for_attributes,ancestry,divisible`)
22+
API.get(`/api/tenants/${recordId}?expand=resources&attributes=name,description,ancestry,divisible`)
2323
.then(setInitialValues)
2424
.then(() => {
2525
miqSparkleOff();
@@ -78,7 +78,7 @@ const OpsTenantForm = ({
7878
<div>
7979
<MiqFormRenderer
8080
initialValues={initialValues}
81-
schema={createSchema(!recordId, !initialValues.ancestry, ancestry || initialValues.ancestry, initialValues.id)}
81+
schema={createSchema(!recordId, ancestry || initialValues.ancestry, initialValues.id)}
8282
onSubmit={handleSubmit}
8383
onCancel={handleCancel}
8484
canReset={!!recordId}

app/javascript/components/ops-tenant-form/ops-tenant-form.schema.js

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const asyncValidator = (value = '', ancestry, itemId) =>
1616

1717
const asyncValidatorDebounced = debouncePromise(asyncValidator);
1818

19-
const createSchema = (newRecord, showUseConfig, ancestry, itemId) => {
19+
const createSchema = (newRecord, ancestry, itemId) => {
2020
let fields = [{
2121
component: componentTypes.TEXT_FIELD,
2222
id: 'name',
@@ -36,44 +36,6 @@ const createSchema = (newRecord, showUseConfig, ancestry, itemId) => {
3636
validateOnMount: true,
3737
}];
3838

39-
if (!newRecord && showUseConfig) {
40-
fields.push({
41-
component: componentTypes.SWITCH,
42-
id: 'use_config_for_attributes',
43-
name: 'use_config_for_attributes',
44-
label: 'Use Configuration Settings',
45-
onText: __('Yes'),
46-
offText: __('No'),
47-
});
48-
49-
const enabledName = {
50-
...fields[0],
51-
isDisabled: false,
52-
condition: {
53-
when: 'use_config_for_attributes',
54-
is: false,
55-
},
56-
};
57-
58-
const disabledName = {
59-
component: componentTypes.SUB_FORM,
60-
id: 'disabled-placeholder',
61-
name: 'disabled-placeholder',
62-
fields: [{
63-
...fields[0],
64-
isDisabled: true,
65-
}],
66-
condition: {
67-
when: 'use_config_for_attributes',
68-
is: true,
69-
},
70-
};
71-
fields = [
72-
enabledName,
73-
disabledName,
74-
...fields.slice(1),
75-
];
76-
}
7739
return {
7840
fields,
7941
};

0 commit comments

Comments
 (0)