Skip to content

Commit 4abdafa

Browse files
committed
Use 4 spaces
1 parent 4506154 commit 4abdafa

File tree

13 files changed

+371
-361
lines changed

13 files changed

+371
-361
lines changed

scss/List/List.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
.details-box-wrap.show-as-column {
1313
flex: 1;
14-
margin-left: 1rem;
14+
margin-left: 1rem;
1515
margin-right: 1rem;
1616
opacity: 1;
1717
}

scss/app.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@import '../node_modules/d2-ui/lib/css/DataTable';
33
@import '../node_modules/d2-ui/lib/css/Pagination';
44
@import '../node_modules/d2-ui/lib/css/HeaderBar';
5-
65
@import '../scss/List/DetailsBox';
76
@import '../scss/List/List';
87

src/App/App.component.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ log.setLevel(log.levels.INFO);
2222
// Check this repo:
2323
// https://github.com/zilverline/react-tap-event-plugin
2424
import injectTapEventPlugin from 'react-tap-event-plugin';
25+
2526
injectTapEventPlugin();
2627

2728
import appState, { setAppState } from './appStateStore';
@@ -30,7 +31,8 @@ import { goToRoute } from '../router';
3031
const HeaderBar = withStateFrom(headerBarStore$, HeaderBarComponent);
3132

3233
const withMuiContext = Object.assign(AppWithD2.childContextTypes,
33-
{muiTheme: PropTypes.object});
34+
{ muiTheme: PropTypes.object });
35+
3436
class App extends AppWithD2 {
3537
getChildContext() {
3638
return Object.assign({}, super.getChildContext(), {
@@ -49,7 +51,7 @@ class App extends AppWithD2 {
4951
.map(() => false);
5052

5153
const nonAllSectionSelected$ = appState
52-
// The all section is managed separately so we do not want to process those any further
54+
// The all section is managed separately so we do not want to process those any further
5355
.filter(state => state.sideBar.currentSection !== 'all')
5456
.map((state) => (
5557
// Check if the current section is in the list of mainSections
@@ -76,22 +78,23 @@ class App extends AppWithD2 {
7678

7779
render() {
7880
if (!this.state.d2) {
79-
return (<LoadingMask />);
81+
return (<LoadingMask/>);
8082
}
8183

8284
return (
8385
<MuiThemeProvider muiTheme={appTheme}>
8486
<div>
85-
<HeaderBar />
87+
<HeaderBar/>
8688
<SinglePanelLayout>
8789
<MainContent>{this.props.children}</MainContent>
8890
</SinglePanelLayout>}
89-
<SnackbarContainer />
91+
<SnackbarContainer/>
9092
</div>
9193
</MuiThemeProvider>
9294
);
9395
}
9496
}
97+
9598
App.defaultProps = {
9699
d2: getInstance(),
97100
};

src/App/app.theme.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { blue500, blue700, blue100, orange500, grey100, darkBlack, white, grey500, grey400 }
1+
import {
2+
blue500, blue700, blue100, orange500, grey100, darkBlack, white, grey500, grey400
3+
}
24
from 'material-ui/styles/colors';
35
import { fade } from 'material-ui/utils/colorManipulator';
46
import Spacing from 'material-ui/styles/spacing';

src/App/appStateStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function getCurrentUserOrganisationUnits(disableCache = false) {
5050
const organisationUnitsCollection = await d2.currentUser.getOrganisationUnits();
5151

5252
if (d2.currentUser.authorities.has('ALL') && !organisationUnitsCollection.size) {
53-
const rootLevelOrgUnits = await d2.models.organisationUnits.list({level: 1});
53+
const rootLevelOrgUnits = await d2.models.organisationUnits.list({ level: 1 });
5454

5555
getCurrentUserOrganisationUnits.currentUserOrganisationUnits = rootLevelOrgUnits;
5656

src/List/ContextActions.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,52 @@ config.i18n.strings.add('details');
88
config.i18n.strings.add('assignToOrgUnits');
99

1010
const contextActions = Action.createActionsFromNames([
11-
'details',
12-
'assignToOrgUnits',
13-
'assignRoles',
14-
'assignGroups',
15-
'edit'
11+
'details',
12+
'assignToOrgUnits',
13+
'assignRoles',
14+
'assignGroups',
15+
'edit'
1616
]);
1717

1818
/** Show user details */
1919
contextActions.details
20-
.subscribe(({data: model}) => {
21-
detailsStore.setState(model);
22-
});
20+
.subscribe(({ data: model }) => {
21+
detailsStore.setState(model);
22+
});
2323

2424
/** Assign user to organization unit */
2525
contextActions.assignToOrgUnits
26-
.subscribe(async ({data: model}) => {
27-
const d2 = await getD2();
28-
const options = {fields: ":all,organisationUnits[id,path,displayName]"};
29-
const modelItem = await d2.models[model.modelDefinition.name].get(model.id, options);
30-
const userOrgUnitRoots = await appStateStore
31-
.map(appState => appState.userOrganisationUnits.toArray())
32-
.first().toPromise();
33-
34-
orgUnitAssignmentDialogStore.setState({
35-
model: modelItem,
36-
roots: userOrgUnitRoots,
37-
open: true,
26+
.subscribe(async ({ data: model }) => {
27+
const d2 = await getD2();
28+
const options = { fields: ":all,organisationUnits[id,path,displayName]" };
29+
const modelItem = await d2.models[model.modelDefinition.name].get(model.id, options);
30+
const userOrgUnitRoots = await appStateStore
31+
.map(appState => appState.userOrganisationUnits.toArray())
32+
.first().toPromise();
33+
34+
orgUnitAssignmentDialogStore.setState({
35+
model: modelItem,
36+
roots: userOrgUnitRoots,
37+
open: true,
38+
});
3839
});
39-
});
4040

4141
/** Assign roles */
4242
contextActions.assignRoles
43-
.subscribe(({data: model}) => {
44-
alert('Assign roles');
45-
});
43+
.subscribe(({ data: model }) => {
44+
alert('Assign roles');
45+
});
4646

4747
/** Assign to groups */
4848
contextActions.assignGroups
49-
.subscribe(({data: model}) => {
50-
alert('Assign to groups');
51-
});
49+
.subscribe(({ data: model }) => {
50+
alert('Assign to groups');
51+
});
5252

5353
/** Edit user */
5454
contextActions.edit
55-
.subscribe(({data: model}) => {
56-
alert('Edit user');
57-
});
55+
.subscribe(({ data: model }) => {
56+
alert('Edit user');
57+
});
5858

5959
export default contextActions;

src/List/DetailsBox.component.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export default React.createClass({
4949

5050
return (
5151
<div key={fieldName} className="detail-field">
52-
<div className={`detail-field__label detail-field__${fieldName}-label`}>{this.getTranslation(camelCaseToUnderscores(fieldName))}</div>
52+
<div
53+
className={`detail-field__label detail-field__${fieldName}-label`}>{this.getTranslation(camelCaseToUnderscores(fieldName))}</div>
5354
<div className={`detail-field__value detail-field__${fieldName}`}>{valueToRender}</div>
5455
</div>
5556
);
@@ -96,7 +97,8 @@ export default React.createClass({
9697

9798
return (
9899
<div className={classList}>
99-
<FontIcon className="details-box__close-button material-icons" onClick={this.props.onClose}>close</FontIcon>
100+
<FontIcon className="details-box__close-button material-icons"
101+
onClick={this.props.onClose}>close</FontIcon>
100102
<div>
101103
{this.getDetailBoxContent()}
102104
</div>

0 commit comments

Comments
 (0)