Skip to content

Commit

Permalink
Added demo app code
Browse files Browse the repository at this point in the history
  • Loading branch information
samie committed May 24, 2023
1 parent 04bd470 commit 1631d37
Show file tree
Hide file tree
Showing 21 changed files with 103 additions and 989 deletions.
21 changes: 14 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target/
addon/target/
demo/target/
.idea/
.settings
.project
Expand All @@ -8,13 +9,19 @@
.DS_Store

# The following files are generated/updated by vaadin-maven-plugin
node_modules/
frontend/generated/
pnpmfile.js
vite.generated.ts
addon/node_modules/
addon/frontend/generated/
addon/pnpmfile.js
addon/vite.generated.ts
demo/node_modules/
demo/frontend/generated/
demo/pnpmfile.js
demo/vite.generated.ts

# Browser drivers for local integration tests
drivers/
# Error screenshots generated by TestBench for failed integration tests
error-screenshots/
webpack.generated.js
addon/error-screenshots/
addon/webpack.generated.js
demo/error-screenshots/
demo/webpack.generated.js
2 changes: 1 addition & 1 deletion frontend/index.html → demo/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This file is auto-generated by Vaadin.
-->

<html lang="en">
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions demo/frontend/themes/myapp/theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"lumoImports" : [ "typography", "color", "spacing", "badge", "utility" ]
}
23 changes: 23 additions & 0 deletions demo/src/main/java/com/example/application/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.example.application;

import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.theme.Theme;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* The entry point of the Spring Boot application.
*
* Use the @PWA annotation make the application installable on phones, tablets
* and some desktop browsers.
*
*/
@SpringBootApplication
@Theme(value = "myapp")
public class Application implements AppShellConfigurator {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.example.application.views.empty;

import com.vaadin.flow.component.html.H2;
import com.vaadin.flow.component.html.Image;
import com.vaadin.flow.component.html.Paragraph;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.theme.lumo.LumoUtility.Margin;

@PageTitle("Empty")
@Route(value = "")
public class EmptyView extends VerticalLayout {

public EmptyView() {
setSpacing(false);

Image img = new Image("images/empty-plant.png", "placeholder plant");
img.setWidth("200px");
add(img);

H2 header = new H2("This place intentionally left empty");
header.addClassNames(Margin.Top.XLARGE, Margin.Bottom.MEDIUM);
add(header);
add(new Paragraph("It’s a place where you can grow your own UI 🤗"));

setSizeFull();
setJustifyContentMode(JustifyContentMode.CENTER);
setDefaultHorizontalComponentAlignment(Alignment.CENTER);
getStyle().set("text-align", "center");
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions demo/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server.port=${PORT:8080}
logging.level.org.atmosphere = warn
spring.mustache.check-template-location = false

# Launch the default browser when starting the application in development mode
vaadin.launch-browser=true
# To improve the performance during development.
# For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters
vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,com.example.application
spring.jpa.defer-datasource-initialization = true
6 changes: 6 additions & 0 deletions demo/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__ __ _
| \/ |_ _ / \ _ __ _ __
| |\/| | | | | / _ \ | '_ \| '_ \
| | | | |_| | / ___ \| |_) | |_) |
|_| |_|\__, | /_/ \_\ .__/| .__/
|___/ |_| |_|
243 changes: 0 additions & 243 deletions package.json

This file was deleted.

Loading

0 comments on commit 1631d37

Please sign in to comment.