Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced settings UI change to centralize save state #53693

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
00fb9c0
feat: centralize advanced settings dirty state
mbondyra Jan 20, 2020
7b53665
fix: types fix
mbondyra Feb 12, 2020
c63e077
Merge branch 'master' into IS-27405_improve-advanced-settings-save
mbondyra Feb 12, 2020
16c5d8f
refactor: don't use lodash function
mbondyra Feb 12, 2020
88b349b
fix: hidden settings saved
mbondyra Feb 12, 2020
eed6aaa
test: corrected for form
mbondyra Feb 12, 2020
7d8d078
Merge branch 'master' into IS-27405_improve-advanced-settings-save
elasticmachine Feb 12, 2020
b9d1d18
Fixing bottom bar position based on NavDrawer and locked status
Feb 12, 2020
d6144a7
Removing `idAria` and updating snaps
Feb 12, 2020
d806bc4
test: mock localStorage
mbondyra Feb 13, 2020
a922733
Merge branch 'master' into IS-27405_improve-advanced-settings-save
mbondyra Feb 13, 2020
2fd4de6
fix: fix tests
mbondyra Feb 13, 2020
3f87057
feat: addressing accessibility review
mbondyra Feb 14, 2020
2551a3e
Merge branch 'master' into IS-27405_improve-advanced-settings-save
mbondyra Feb 14, 2020
a6d4f3d
Update src/plugins/advanced_settings/public/management_app/components…
mbondyra Feb 14, 2020
0c3e567
Merge branch 'master' into IS-27405_improve-advanced-settings-save
mbondyra Feb 20, 2020
462577f
refactor: code review
mbondyra Feb 20, 2020
b657eb3
fix: accessibility
mbondyra Feb 20, 2020
2ffa278
Merge commit '02efb01c481f9f24d8d707f06dfc68b2fb805001' into IS-27405…
mbondyra Feb 21, 2020
3fae234
fix: accesssibility again
mbondyra Feb 21, 2020
493d712
feat: mobile
mbondyra Feb 22, 2020
e5802f7
Merge commit '98aa1d2d4f974f72a9a5397b1b91f11509f6fb7a' into IS-27405…
mbondyra Feb 22, 2020
ad5834e
a11y: don't pass id not necesserilly
mbondyra Feb 22, 2020
47b3d61
fix~: remove parenthesis
mbondyra Feb 22, 2020
d1a3e8b
Merge branch 'master' into IS-27405_improve-advanced-settings-save
elasticmachine Feb 22, 2020
6cd2486
Merge branch 'master' into IS-27405_improve-advanced-settings-save
elasticmachine Feb 23, 2020
917e74e
Merge branch 'master' into IS-27405_improve-advanced-settings-save
elasticmachine Feb 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plugins/advanced_settings/public/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

@import './management_app/advanced_settings';
@import './management_app/index';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import './advanced_settings';

@import './components/index';
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,27 @@
* under the License.
*/

.mgtAdvancedSettings__field {
.mgtAdvancedSettings__field {
+ * {
margin-top: $euiSize;
}

&Wrapper {
width: 640px;

@include internetExplorerOnly() {
min-height: 1px;
}
padding-left: $euiSizeS;
margin-left: -$euiSizeS;
&--unsaved {
// Simulates a left side border without shifting content
box-shadow: -$euiSizeXS 0px $euiColorSecondary;
}

&Actions {
padding-top: $euiSizeM;
&--invalid {
// Simulates a left side border without shifting content
box-shadow: -$euiSizeXS 0px $euiColorDanger;
}
@include internetExplorerOnly() {
min-height: 1px;
}
&Row {
padding-left: $euiSizeS;
}

@include internetExplorerOnly {
Expand All @@ -40,3 +46,19 @@
}
}
}

.mgtAdvancedSettingsForm__unsavedCount {
@include euiBreakpoint('xs', 's') {
display: none;
}
}

.mgtAdvancedSettingsForm__unsavedCountMessage{
// Simulates a left side border without shifting content
box-shadow: -$euiSizeXS 0px $euiColorSecondary;
padding-left: $euiSizeS;
}

.mgtAdvancedSettingsForm__button {
width: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { ComponentRegistry } from '../';

import { getAriaName, toEditableConfig, DEFAULT_CATEGORY } from './lib';

import { FieldSetting, IQuery } from './types';
import { FieldSetting, IQuery, SettingsChanges } from './types';

interface AdvancedSettingsProps {
enableSaving: boolean;
Expand Down Expand Up @@ -177,6 +177,13 @@ export class AdvancedSettingsComponent extends Component<
});
};

saveConfig = async (changes: SettingsChanges) => {
const arr = Object.entries(changes).map(([key, value]) =>
this.props.uiSettings.set(key, value)
);
return Promise.all(arr);
};

render() {
const { filteredSettings, query, footerQueryMatched } = this.state;
const componentRegistry = this.props.componentRegistry;
Expand Down Expand Up @@ -205,18 +212,19 @@ export class AdvancedSettingsComponent extends Component<
<AdvancedSettingsVoiceAnnouncement queryText={query.text} settings={filteredSettings} />

<Form
settings={filteredSettings}
settings={this.groupedSettings}
visibleSettings={filteredSettings}
categories={this.categories}
categoryCounts={this.categoryCounts}
clearQuery={this.clearQuery}
save={this.props.uiSettings.set.bind(this.props.uiSettings)}
clear={this.props.uiSettings.remove.bind(this.props.uiSettings)}
save={this.saveConfig}
showNoResultsMessage={!footerQueryMatched}
enableSaving={this.props.enableSaving}
dockLinks={this.props.dockLinks}
toasts={this.props.toasts}
/>
<PageFooter
toasts={this.props.toasts}
query={query}
onQueryMatchChange={this.onFooterQueryMatchChange}
enableSaving={this.props.enableSaving}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import './form/index';
Loading