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: packages/obc/src/components/tables/TopicsList/example.ts
+34-11Lines changed: 34 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,21 @@
1
+
/* MD
2
+
## Showing BCF Topics the Easy Way ✨
3
+
---
4
+
Integration with BIM Collaboration Format is probably one of those features you want to have in your app sooner than later. Problem is, many UIs are needed (one to display the topics, another to create them, another to edit everything, etc). Well, hold tight as here you will learn all you need to know in order to use the power of UI Components to accomplish a fully working user interface for your next BCF integration!
5
+
6
+
### 🏗 Scaffolding the Application
7
+
First of all, let's import the dependencies we need to get this working:
Next, it's always necessary to initialize the core UI library no matter if you're using functional components from `@thatopen/ui-obc`. Also, let's setup `@thatopen/components` with the minimum things to get a [World](/Tutorials/Components/Core/Worlds) up and running to load models.
Integration with BIM Collaboration Format is probably one of those features you want to have in your app sooner than later. Problem is, many UIs are needed (one to display the topics, another to create them, another to edit everything, etc). Well, hold tight as here you will learn all you need to know in order to use the power of UI Components to accomplish a fully working user interface for your next BCF integration!
40
-
41
-
### Loading a model and setting up the topics component
42
-
First things first... let's load a model 👇
50
+
### 🏦 Loading a Model and Setting the BCFTopics
51
+
Just after setting up the world, let's programatically load a model 👇
Once the BCFTopics component has been initialized, let's see how to setup a plug-n-play UI for it! The BIM Components UI package (@thatopen/ui-obc) comes with some UIs to support the usage of the BCFTopics component. Among the components you got:
102
111
112
+
103
113
👉 TopicsList: a table to display the topics created with the component (or the ones you choose to see).
114
+
115
+
104
116
👉 TopicForm: a form to create new or update existing topics.
117
+
118
+
105
119
👉 TopicComments: a table to display the list of comments for a single topic.
120
+
121
+
106
122
👉 TopicCommentsSection: an element to display the comments for a single topic and also a text area to add them.
123
+
124
+
107
125
👉 TopicInformationSection: an element to display the topic markup information and a button with the form included to update it.
126
+
127
+
108
128
👉 TopicRelationsSection: an element to display the topics related with another and the functionality to link them.
129
+
130
+
109
131
👉 TopicViewpointsSection: an element to display the topics viewpoints with the functionality create new or link existing viewpoints.
110
132
133
+
111
134
Is entirely up to you what to use, but using them together gives you a ready to go UI with everything you need to have a production ready BCF integration in your BIM app! Let's start with the topics list table.
112
135
113
-
### Topics List
136
+
### 🔨 Displaying the Topics List in a Table
114
137
The topics list table is the easiest way to display all topics created in the app using the BCFTopics component. Creating it is really simple, as you just need to write the following:
That's it. You don't need anything else other than creating an instance of the UI component and place it anywhere you want in the app. The table updates by it-self anytime a new topic has been created or modified!
127
150
128
-
### Topic Form
151
+
### 📃 Using the Topics Form UI
129
152
Let's now define a topic form so creating them is easier than ever:
130
153
*/
131
154
@@ -178,7 +201,7 @@ updateTopicForm({
178
201
/* MD
179
202
Awesome! Topic form setup correctly 😎
180
203
181
-
### Creating a Custom Topic Panel
204
+
### 🎫 Creating a Custom Topic Panel
182
205
With the form set up, what if we use the topic panel to see it's full information? Typically, you will display the full information for one topic at the same time; in such case, you only need to create one topic panel component. However, you can create as many panels as you need. In this tutorial we will create one as follows:
183
206
*/
184
207
@@ -308,7 +331,7 @@ updateTopicsList({
308
331
});
309
332
310
333
/* MD
311
-
### Creating a Button to Download BCFs
334
+
### ⏬ Creating a Button to Download BCFs
312
335
To complete our BCF integration, let's create a button to download the topics created using the BCFTopics component:
Let's now create a BIM Panel to hold the topics list while also adding the corresponding buttons to trigger the functionalities like showing the form and downloading the BCF file:
0 commit comments