Skip to content

Commit 8472e68

Browse files
czoselgitbook-bot
authored andcommitted
GITBOOK-20: change request with no subject merged in GitBook
1 parent 862712f commit 8472e68

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed
63 KB
Loading
32.1 KB
Loading

guides/guide.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Router.map(function() {
7777
To make `ember-apollo-client` work, we need to pass it as dependency for our engine in `app/app.js`. Additionally, we need to specify `ember-intl` as a dependency so that the the application has access to the addon's translations.
7878

7979
```bash
80-
const App = Application.extend({
80+
export default class App extends Application {
8181
// ...
8282

83-
engines: {
83+
engines = {
8484
"@projectcaluma/ember-form-builder": {
8585
dependencies: {
8686
services: [
@@ -92,8 +92,8 @@ const App = Application.extend({
9292
]
9393
}
9494
}
95-
}
96-
});
95+
};
96+
}
9797
```
9898

9999
Also, we'll need to tell the apollo client where the GraphQL API can be reached in `config/environment.js`:
@@ -123,7 +123,23 @@ module.exports = function(defaults) {
123123
});
124124
```
125125
126-
Last but not least import `ember-uikit`, `@projectcaluma/ember-form-builder` and `@projectcaluma/ember-form` to apply styling in `app/styles/app.scss`:
126+
In order to get the frontend to talk to the GraphQL API running on localhost:8000, add the following script to `package.json:`
127+
128+
```
129+
"start-proxy": "ember serve --proxy http://localhost:8000",
130+
```
131+
132+
If you now run `npm run start-proxy` and navigate to [http://localhost:4200/form-builder](http://localhost:4200/form-builder) you might still see the "Welcome page" for the new ember app. To get rid of it, remove the `<WelcomePage />` component in `templates/application.hbs`. After, you should see a first, admittedly not very pretty, glance of the form builder:
133+
134+
<figure><img src="../.gitbook/assets/Screenshot from 2023-04-10 17-10-47.png" alt=""><figcaption></figcaption></figure>
135+
136+
Ember-caluma uses `ember-uikit` for styling, which is based on `SCSS`. To add `SCSS` support to our project, install `ember-cli-sass`:
137+
138+
```
139+
ember install ember-cli-sass
140+
```
141+
142+
After, rename `styles/app.css` to `styles/app.scss` and import the necessary stlyes:
127143
128144
```bash
129145
// https://github.com/uikit/uikit/blob/master/src/scss/variables-theme.scss
@@ -137,7 +153,7 @@ $modal-z-index: 1;
137153
@import "@projectcaluma/ember-form-builder";
138154
```
139155
140-
To show some texts in the form-builder you can configure the locale setting of `ember-intl` to `en` (instead of the default, `en-us`), for example in `application/route.js` (run `ember g route application` if it doesn't exist yet):
156+
To get rid of the "Missing translation" labels you can configure the locale setting of `ember-intl` to `en` (instead of the default, `en-us`), for example in `application/route.js` (run `ember g route application` if it doesn't exist yet):
141157
142158
```javascript
143159
import Route from '@ember/routing/route';
@@ -151,3 +167,14 @@ export default class ApplicationRoute extends Route {
151167
}
152168
}
153169
```
170+
171+
Finally, the form builder should be displayed correctly:
172+
173+
<figure><img src="../.gitbook/assets/Screenshot from 2023-04-10 17-19-20.png" alt=""><figcaption></figcaption></figure>
174+
175+
Congratulations - you now have all the basic building blocks to start building out your app! Currently, this is where the "getting started" guide ends - until there is more content, here are some possible next steps:
176+
177+
* In order to familiarize yourself with the form builder, try adding a form and some questions.
178+
* Set up a new route that lists the available forms (using the `allForms` query)
179+
* Make the forms selectable and create a `Document` for the selected form
180+
* Render the document using `<CfContent />`

0 commit comments

Comments
 (0)