SlideShare a Scribd company logo
1 of 33
Download to read offline
What is new in Sulu
2.0
Or how easy it can be to customize a
great administration interface
I'm Daniel Rotter
@danrot90 | https://github.com/danrot
core developer and
support guru.
Passionate traveler and
soccer player.
Who has already used
Sulu?
Who has added
something to the admin?
Status Quo
const a = 1;
a = 2; // TypeError: Assignment to constant variable.
const obj = {};
obj.foo = 'bar';
// lib/math.js
export function sum(x, y) {
return x + y;
}
export var pi = 3.141593;
// app.js
import {sum, pi} from 'lib/math';
sum(pi, 5);
const a = [1, 2, 3];
const b = [4, 5, 6];
console.log([...a, ...b, 7]); // outputs [1, 2, 3, 4, 5, 6, 7]
const c = {a: 1, b: 2};
console.log({...c, b: 5}); // outputs {a: 1, b: 5}
const arr = ['a', 'b'];
arr.values(); // returns iterator with ['a', 'b']
arr.keys(); // returns iterator with [0, 1]
arr.entries(); // returns iterator with [[0, 'a'], [1, 'b']]
arr.findIndex(value => value == 'b'); // returns 1
arr.includes('b'); // return true
class Foo extends Bar {
constructor(id) {
super(id);
}
getId() {
return super.id;
}
static getType() {
return 'FOO';
}
}
const Foo = {
title: 'Bar',
ids: [1, 2, 3, 4, 5],
print() {
this.ids.forEach((id) => {
console.log(this.title + id);
});
}
};
// @flow
function square(n: number): number {
return n * n;
}
// Cannot call `square` with `"2"` bound to `n` because string is
incompatible with number
square("2");
class App extends React.Component {
state = {
value: '',
};
handleChange = (event) => {
this.setState({
value: event.currentTarget.value
});
}
render() {
return <Input
value={this.state.value}
onChange={this.handleChange} />;
}
}
class Input extends React.Component {
render() {
const {value: v, onChange} =
this.props;
return <input
type="text"
value={v}
onChange={onChange}
style={
{
borderColor: v.length < 3
? 'red': undefined
}
} />;
}
}
import {observable} from 'mobx';
import {observer} from 'mobx-react';
class AppState {
@observable content = 'Hello World!';
}
@observer
class App extends React.Component {
render() {
return <h1>
{this.props.state.content}
</h1>;
}
}
const appState = new AppState();
ReactDOM.render(
<App state={appState} />,
document.getElementById('app')
);
setTimeout(() => {
appState.content = 'Hello Earth!';
}, 1000);
import sum from './sum';
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
import {render} from 'enzyme';
import Component from './Component';
test('renders component correctly', () => {
expect(render(<Component />))
.toMatchSnapshot();
})
import React from 'react';
import classNames from 'classnames';
import componentStyles from './component.scss';
export default class Component extends React.Component {
render() {
const divClass = classNames(
componentStyles.component,
{
[componentStyles.invalid]: this.props.invalid,
}
);
return <div className={divClass}>Test</div>
}
}
Sulu 2.0 Frontend
Architecture
Components
Containers Views
Services
Stores
Sulu 2.0 Backend
Adjustments
class SnippetAdmin extends Admin {
public function getRoutes(): array {
return [
(new Route('sulu_snippet.datagrid', '/snippets/:locale',
'sulu_admin.datagrid'))
->addOption('title', 'sulu_snippet.snippets')
->addOption('resourceKey', 'snippets')
->addOption('adapters', ['table'])
->addOption('addRoute', 'sulu_snippet.add_form.detail')
->addOption('editRoute', 'sulu_snippet.edit_form.detail')
->addOption('locales', $snippetLocales)
->addAttributeDefault('locale', $snippetLocales[0]),,
];
}
}
class SnippetAdmin extends Admin {
public function getNavigationV2(): Navigation {
$rootNavigationItem = $this->getNavigationItemRoot();
if ($this->securityChecker->hasPermission('sulu.global.snippets', 'view')) {
$snippet = new NavigationItem('sulu_snippet.snippets');
$snippet->setPosition(20);
$snippet->setIcon('su-snippet');
$snippet->setAction('snippet/snippets');
$snippet->setMainRoute('sulu_snippet.datagrid');
$rootNavigationItem->addChild($snippet);
}
return new Navigation($rootNavigationItem);
}
}
{
"firstName": {
"label": "Vorname",
"type": "text_line",
"size": 6,
"required": true
},
"lastName": {
"label": "Nachname",
"type": "text_line",
"size": 6,
"required": true
}
}
{
"required": [
"formOfAddress",
"firstName",
"lastName"
]
}
{
"firstName": {
"name": "firstName",
"label": "First name",
"type": "string"
},
"lastName": {
"name": "lastName",
"label": "Last name",
"type": "string"
},
}
Live Coding

More Related Content

What's hot

Debugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsDebugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsPlatonov Sergey
 
Programming Global variable
Programming Global variableProgramming Global variable
Programming Global variableimtiazalijoono
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2Rumman Ansari
 
Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)Syed Umair
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markersMicheal Ogundero
 
Exp 3-2 d422 (1)
Exp 3-2  d422 (1)Exp 3-2  d422 (1)
Exp 3-2 d422 (1)Omkar Rane
 
Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++NUST Stuff
 
C++ Question on References and Function Overloading
C++ Question on References and Function OverloadingC++ Question on References and Function Overloading
C++ Question on References and Function Overloadingmohamed sikander
 
Function in C and C++
Function in C and C++Function in C and C++
Function in C and C++Rahul Sahu
 
C programming function
C  programming functionC  programming function
C programming functionargusacademy
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Himanshu Kaushik
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...hwbloom27
 
Few Operator used in c++
Few Operator used in c++Few Operator used in c++
Few Operator used in c++sunny khan
 
Data structure scope of variables
Data structure scope of variablesData structure scope of variables
Data structure scope of variablesSaurav Kumar
 

What's hot (20)

Debugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template MetaprogramsDebugging and Profiling C++ Template Metaprograms
Debugging and Profiling C++ Template Metaprograms
 
Programming Global variable
Programming Global variableProgramming Global variable
Programming Global variable
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2
 
Activities on Operands
Activities on OperandsActivities on Operands
Activities on Operands
 
Advanced pointer
Advanced pointerAdvanced pointer
Advanced pointer
 
Quiz 10 cp_sol
Quiz 10 cp_solQuiz 10 cp_sol
Quiz 10 cp_sol
 
Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markers
 
Exp 3-2 d422 (1)
Exp 3-2  d422 (1)Exp 3-2  d422 (1)
Exp 3-2 d422 (1)
 
Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
C++ Question on References and Function Overloading
C++ Question on References and Function OverloadingC++ Question on References and Function Overloading
C++ Question on References and Function Overloading
 
Function in C and C++
Function in C and C++Function in C and C++
Function in C and C++
 
C programming function
C  programming functionC  programming function
C programming function
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++
 
MCRL2
MCRL2MCRL2
MCRL2
 
Functions
FunctionsFunctions
Functions
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
 
Few Operator used in c++
Few Operator used in c++Few Operator used in c++
Few Operator used in c++
 
Data structure scope of variables
Data structure scope of variablesData structure scope of variables
Data structure scope of variables
 

Similar to What is new in sulu 2.0

2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & Webpack2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & WebpackCodifly
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in AngularYadong Xie
 
angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfNuttavutThongjor1
 
The Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideThe Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideStephen Chin
 
React & The Art of Managing Complexity
React &  The Art of Managing ComplexityReact &  The Art of Managing Complexity
React & The Art of Managing ComplexityRyan Anklam
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz
 
The evolution of redux action creators
The evolution of redux action creatorsThe evolution of redux action creators
The evolution of redux action creatorsGeorge Bukhanov
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy codeShriKant Vashishtha
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"GeeksLab Odessa
 
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentYao Nien Chung
 
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3Rob Tweed
 
Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發HO-HSUN LIN
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Ontico
 
Reactive.architecture.with.Angular
Reactive.architecture.with.AngularReactive.architecture.with.Angular
Reactive.architecture.with.AngularEvan Schultz
 
Thinking Functionally with JavaScript
Thinking Functionally with JavaScriptThinking Functionally with JavaScript
Thinking Functionally with JavaScriptLuis Atencio
 

Similar to What is new in sulu 2.0 (20)

angular fundamentals.pdf
angular fundamentals.pdfangular fundamentals.pdf
angular fundamentals.pdf
 
2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & Webpack2018 05-16 Evolving Technologies: React, Babel & Webpack
2018 05-16 Evolving Technologies: React, Babel & Webpack
 
Angular 2.0 - What to expect
Angular 2.0 - What to expectAngular 2.0 - What to expect
Angular 2.0 - What to expect
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in Angular
 
Ngrx meta reducers
Ngrx meta reducersNgrx meta reducers
Ngrx meta reducers
 
angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdf
 
The Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideThe Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S Guide
 
React & The Art of Managing Complexity
React &  The Art of Managing ComplexityReact &  The Art of Managing Complexity
React & The Art of Managing Complexity
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-redux
 
The evolution of redux action creators
The evolution of redux action creatorsThe evolution of redux action creators
The evolution of redux action creators
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
 
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order component
 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol set
 
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
 
Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
JavaScript Lessons 2023
JavaScript Lessons 2023JavaScript Lessons 2023
JavaScript Lessons 2023
 
Reactive.architecture.with.Angular
Reactive.architecture.with.AngularReactive.architecture.with.Angular
Reactive.architecture.with.Angular
 
Thinking Functionally with JavaScript
Thinking Functionally with JavaScriptThinking Functionally with JavaScript
Thinking Functionally with JavaScript
 

Recently uploaded

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 

What is new in sulu 2.0

  • 1. What is new in Sulu 2.0 Or how easy it can be to customize a great administration interface
  • 2. I'm Daniel Rotter @danrot90 | https://github.com/danrot core developer and support guru. Passionate traveler and soccer player.
  • 3. Who has already used Sulu?
  • 4. Who has added something to the admin?
  • 6.
  • 7.
  • 8.
  • 9. const a = 1; a = 2; // TypeError: Assignment to constant variable. const obj = {}; obj.foo = 'bar';
  • 10. // lib/math.js export function sum(x, y) { return x + y; } export var pi = 3.141593; // app.js import {sum, pi} from 'lib/math'; sum(pi, 5);
  • 11. const a = [1, 2, 3]; const b = [4, 5, 6]; console.log([...a, ...b, 7]); // outputs [1, 2, 3, 4, 5, 6, 7] const c = {a: 1, b: 2}; console.log({...c, b: 5}); // outputs {a: 1, b: 5}
  • 12. const arr = ['a', 'b']; arr.values(); // returns iterator with ['a', 'b'] arr.keys(); // returns iterator with [0, 1] arr.entries(); // returns iterator with [[0, 'a'], [1, 'b']] arr.findIndex(value => value == 'b'); // returns 1 arr.includes('b'); // return true
  • 13. class Foo extends Bar { constructor(id) { super(id); } getId() { return super.id; } static getType() { return 'FOO'; } }
  • 14. const Foo = { title: 'Bar', ids: [1, 2, 3, 4, 5], print() { this.ids.forEach((id) => { console.log(this.title + id); }); } };
  • 15.
  • 16. // @flow function square(n: number): number { return n * n; } // Cannot call `square` with `"2"` bound to `n` because string is incompatible with number square("2");
  • 17.
  • 18. class App extends React.Component { state = { value: '', }; handleChange = (event) => { this.setState({ value: event.currentTarget.value }); } render() { return <Input value={this.state.value} onChange={this.handleChange} />; } } class Input extends React.Component { render() { const {value: v, onChange} = this.props; return <input type="text" value={v} onChange={onChange} style={ { borderColor: v.length < 3 ? 'red': undefined } } />; } }
  • 19.
  • 20. import {observable} from 'mobx'; import {observer} from 'mobx-react'; class AppState { @observable content = 'Hello World!'; } @observer class App extends React.Component { render() { return <h1> {this.props.state.content} </h1>; } } const appState = new AppState(); ReactDOM.render( <App state={appState} />, document.getElementById('app') ); setTimeout(() => { appState.content = 'Hello Earth!'; }, 1000);
  • 21.
  • 22. import sum from './sum'; test('adds 1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3); }); import {render} from 'enzyme'; import Component from './Component'; test('renders component correctly', () => { expect(render(<Component />)) .toMatchSnapshot(); })
  • 23.
  • 24. import React from 'react'; import classNames from 'classnames'; import componentStyles from './component.scss'; export default class Component extends React.Component { render() { const divClass = classNames( componentStyles.component, { [componentStyles.invalid]: this.props.invalid, } ); return <div className={divClass}>Test</div> } }
  • 28. class SnippetAdmin extends Admin { public function getRoutes(): array { return [ (new Route('sulu_snippet.datagrid', '/snippets/:locale', 'sulu_admin.datagrid')) ->addOption('title', 'sulu_snippet.snippets') ->addOption('resourceKey', 'snippets') ->addOption('adapters', ['table']) ->addOption('addRoute', 'sulu_snippet.add_form.detail') ->addOption('editRoute', 'sulu_snippet.edit_form.detail') ->addOption('locales', $snippetLocales) ->addAttributeDefault('locale', $snippetLocales[0]),, ]; } }
  • 29. class SnippetAdmin extends Admin { public function getNavigationV2(): Navigation { $rootNavigationItem = $this->getNavigationItemRoot(); if ($this->securityChecker->hasPermission('sulu.global.snippets', 'view')) { $snippet = new NavigationItem('sulu_snippet.snippets'); $snippet->setPosition(20); $snippet->setIcon('su-snippet'); $snippet->setAction('snippet/snippets'); $snippet->setMainRoute('sulu_snippet.datagrid'); $rootNavigationItem->addChild($snippet); } return new Navigation($rootNavigationItem); } }
  • 30. { "firstName": { "label": "Vorname", "type": "text_line", "size": 6, "required": true }, "lastName": { "label": "Nachname", "type": "text_line", "size": 6, "required": true } }
  • 32. { "firstName": { "name": "firstName", "label": "First name", "type": "string" }, "lastName": { "name": "lastName", "label": "Last name", "type": "string" }, }