You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: .github/contributing-backoffice.md
+41-50
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,14 @@ In the high probability that you are porting something from angular JS then here
6
6
7
7
Here is the LIT documentation and playground: [https://lit.dev](https://lit.dev)
8
8
9
-
### How best to find what needs converting from the old backoffice?
10
-
11
-
1. Navigate to [https://github.com/umbraco/Umbraco-CMS](https://github.com/umbraco/Umbraco-CMS)
12
-
2. Make sure you are on the `v14/dev` branch
13
-
14
9
### What is the process of contribution?
15
10
16
-
- Read the [README](README.md) to learn how to get the project up and running
17
-
- Find an issue marked as [community/up-for-grabs](https://github.com/umbraco/Umbraco.CMS.Backoffice/issues?q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs) - note that some are also marked [good first issue](https://github.com/umbraco/Umbraco.CMS.Backoffice/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) which indicates they are simple to get started on
18
-
- Umbraco HQ owns the Management API on the backend, so features can be worked on in the frontend only when there is an API, or otherwise if no API is required
19
-
- A contribution should be made in a fork of the repository
20
-
- Once a contribution is ready, a pull request should be made to this repository and HQ will assign a reviewer
21
-
- A pull request should always indicate what part of a feature it tries to solve, i.e. does it close the targeted issue (if any) or does the developer expect Umbraco HQ to take over
11
+
-Read the [README](README.md) to learn how to get the project up and running
12
+
-Find an issue marked as [community/up-for-grabs](https://github.com/umbraco/Umbraco.CMS.Backoffice/issues?q=is%3Aissue+is%3Aopen+label%3Acommunity%2Fup-for-grabs) - note that some are also marked [good first issue](https://github.com/umbraco/Umbraco.CMS.Backoffice/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) which indicates they are simple to get started on
13
+
-Umbraco HQ owns the Management API on the backend, so features can be worked on in the frontend only when there is an API, or otherwise if no API is required
14
+
-A contribution should be made in a fork of the repository
15
+
-Once a contribution is ready, a pull request should be made to this repository and HQ will assign a reviewer
16
+
-A pull request should always indicate what part of a feature it tries to solve, i.e. does it close the targeted issue (if any) or does the developer expect Umbraco HQ to take over
22
17
23
18
## Contributing in general terms
24
19
@@ -32,31 +27,27 @@ The management API is the colloquial term used to describe the new backoffice AP
32
27
33
28
The frontend has an API formatter that takes the OpenAPI schema file and converts it into a set of TypeScript classes and interfaces.
34
29
35
-
### Caveats
36
-
37
-
1. The backoffice can be run and tested against a real Umbraco instance by cloning down the `v14/dev` branch, but there are no guarantees about how well it works yet.
@@ -132,58 +123,58 @@ To declare the Published Cache Status Dashboard as a new manifest, we need to ad
132
123
133
124
Let’s go through each of these properties…
134
125
135
-
- Type: can be one of the following:
126
+
-Type: can be one of the following:
136
127
137
-
- section - examples include: `Content`, `Media`
138
-
- dashboard - a view within a section. Examples include: the welcome dashboard
139
-
- propertyEditorUi
140
-
- editorView
141
-
- propertyAction
142
-
- tree
143
-
- editor
144
-
- treeItemAction
128
+
- section - examples include: `Content`, `Media`
129
+
- dashboard - a view within a section. Examples include: the welcome dashboard
130
+
- propertyEditorUi
131
+
- editorView
132
+
- propertyAction
133
+
- tree
134
+
- editor
135
+
- treeItemAction
145
136
146
-
- Alias: is the unique key used to identify this item.
147
-
- Name: is the human-readable name for this item.
137
+
-Alias: is the unique key used to identify this item.
138
+
-Name: is the human-readable name for this item.
148
139
149
-
- ElementName: this is the customElementName declared on the element at the top of the file i.e
140
+
-ElementName: this is the customElementName declared on the element at the top of the file i.e
150
141
151
142
```typescript
152
143
@customElement('umb-dashboard-published-status')
153
144
```
154
145
155
-
- Js: references a function call to import the file that the element is declared within
146
+
-Js: references a function call to import the file that the element is declared within
156
147
157
-
- Weight: allows us to specify the order in which the dashboard will be displayed within the tabs bar
148
+
-Weight: allows us to specify the order in which the dashboard will be displayed within the tabs bar
158
149
159
-
- Meta: allows us to reference additional data - in our case, we can specify the label that is shown in the tabs bar and the pathname that will be displayed in the URL
150
+
-Meta: allows us to reference additional data - in our case, we can specify the label that is shown in the tabs bar and the pathname that will be displayed in the URL
160
151
161
-
- Conditions: allows us to specify the conditions that must be met for the dashboard to be displayed. In our case, we are specifying that the dashboard will only be displayed within the Settings section
152
+
-Conditions: allows us to specify the conditions that must be met for the dashboard to be displayed. In our case, we are specifying that the dashboard will only be displayed within the Settings section
162
153
163
154
## API mock handlers
164
155
165
156
Running the app with `npm run dev`, you will quickly notice the API requests turn into 404 errors. To hit the API, we need to add a mock handler to define the endpoints that our dashboard will call. In the case of the Published Cache Status section, we have several calls to work through. Let’s start by looking at the call to retrieve the current status of the cache:
166
157
167
-

158
+

168
159
169
160
From the existing functionality, we can see that this is a string message that is received as part of a `GET` request from the server.
170
161
171
162
So to define this, we must first add a handler for the Published Status called `published-status.handlers.ts` within the mocks/domains folder. In this file we will have code that looks like the following:
'Database cache is ok. ContentStore contains 1 item and has 1 generation and 0 snapshot. MediaStore contains 5 items and has 1 generation and 0 snapshot.',
"Database cache is ok. ContentStore contains 1 item and has 1 generation and 0 snapshot. MediaStore contains 5 items and has 1 generation and 0 snapshot."
175
+
)
176
+
);
177
+
}),
187
178
];
188
179
```
189
180
@@ -193,7 +184,7 @@ It returns a `200 OK` response and a string value with the current “status”
193
184
194
185
An example `POST` is similar. Let’s take the “Refresh status” button as an example:
195
186
196
-

187
+

197
188
198
189
From our existing functionality, we can see that this makes a `POST` call to the server to prompt a reload of the published cache. So we would add a new endpoint to the mock handler that would look like:
0 commit comments