2019-04-19 16:22:14 +03:00
|
|
|
// Test .wasp file.
|
|
|
|
|
2020-02-05 00:39:38 +03:00
|
|
|
import something from "@ext/some/file"
|
2019-12-17 23:40:05 +03:00
|
|
|
|
2019-05-05 18:54:51 +03:00
|
|
|
// App definition.
|
2019-04-19 16:22:14 +03:00
|
|
|
app test_app {
|
|
|
|
// Title of the app.
|
|
|
|
title: "Hello World!"
|
|
|
|
}
|
2019-05-05 18:54:51 +03:00
|
|
|
|
2020-07-31 15:26:10 +03:00
|
|
|
route "/" -> page Landing
|
2019-05-05 18:54:51 +03:00
|
|
|
page Landing {
|
2020-08-04 14:02:34 +03:00
|
|
|
component: import Landing from "@ext/pages/Landing"
|
2019-05-31 20:35:50 +03:00
|
|
|
}
|
|
|
|
|
2020-07-31 15:26:10 +03:00
|
|
|
route "/test" -> page TestPage
|
2019-05-31 20:35:50 +03:00
|
|
|
page TestPage {
|
2020-08-04 14:02:34 +03:00
|
|
|
component: import Test from "@ext/pages/Test"
|
2019-05-05 18:54:51 +03:00
|
|
|
}
|
2019-05-09 23:05:59 +03:00
|
|
|
|
2020-09-04 15:21:47 +03:00
|
|
|
entityPSL Task {=psl
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
description String
|
|
|
|
isDone Boolean @default(false)
|
|
|
|
psl=}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(matija): old Entity stuff, to be removed.
|
2019-05-09 23:05:59 +03:00
|
|
|
entity Task {
|
|
|
|
description :: string,
|
|
|
|
isDone :: boolean
|
|
|
|
}
|
2020-01-04 23:37:57 +03:00
|
|
|
|
|
|
|
// NOTE(matija): this is only being parsed for now, no code is generated yet.
|
|
|
|
// Entity form definition.
|
|
|
|
entity-form<Task> CreateTaskForm {
|
2020-01-26 19:59:23 +03:00
|
|
|
fields: {
|
|
|
|
description: {
|
|
|
|
show: true,
|
2020-02-05 12:52:54 +03:00
|
|
|
defaultValue: "doable task",
|
2020-02-05 21:04:09 +03:00
|
|
|
label: none,
|
2020-02-05 12:52:54 +03:00
|
|
|
placeholder: "What will you do?"
|
2020-01-26 19:59:23 +03:00
|
|
|
},
|
|
|
|
isDone: {
|
|
|
|
show: false,
|
|
|
|
defaultValue: false // Although not shown, this field will be set to "false".
|
|
|
|
}
|
|
|
|
},
|
2020-01-04 23:37:57 +03:00
|
|
|
submit: {
|
2020-01-21 16:03:14 +03:00
|
|
|
onEnter: false,
|
|
|
|
button: {
|
|
|
|
show: true
|
|
|
|
}
|
2020-01-04 23:37:57 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-29 14:53:22 +03:00
|
|
|
entity-list<Task> TaskList {
|
2020-02-05 15:46:48 +03:00
|
|
|
showHeader: false,
|
2020-02-03 18:16:45 +03:00
|
|
|
fields: {
|
|
|
|
description: {
|
|
|
|
render: {=js
|
|
|
|
task => task.description
|
|
|
|
js=}
|
|
|
|
}
|
2020-02-28 00:33:09 +03:00
|
|
|
},
|
|
|
|
mutuallyExclusiveFilters: {
|
|
|
|
completed: {=js task => task.isDone js=},
|
|
|
|
active: {=js task => !task.isDone js=}
|
2020-02-03 18:16:45 +03:00
|
|
|
}
|
2020-01-29 14:53:22 +03:00
|
|
|
}
|
2020-08-25 16:08:02 +03:00
|
|
|
|
2020-09-04 15:21:47 +03:00
|
|
|
|
|
|
|
|
2020-08-25 16:08:02 +03:00
|
|
|
query myQuery {
|
|
|
|
fn: import { myJsQuery } from "@ext/some/path"
|
|
|
|
}
|