This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake-website.git

commit 7a135bc09889ee5ce7f10e1d5b564ee5e04b5a2b
Author: abeizn <[email protected]>
AuthorDate: Wed Jul 13 15:11:25 2022 +0800

    feat: team feature user guide
---
 docs/UserManuals/team-feature-user-guide.md |  41 ++++++++++++++++++----------
 static/img/teamflow6.png                    | Bin 33273 -> 33900 bytes
 2 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/docs/UserManuals/team-feature-user-guide.md 
b/docs/UserManuals/team-feature-user-guide.md
index e798be3b..2c9fb4a4 100644
--- a/docs/UserManuals/team-feature-user-guide.md
+++ b/docs/UserManuals/team-feature-user-guide.md
@@ -23,7 +23,8 @@ curl --location --request GET 
'http://127.0.0.1:8080/plugins/org/teams.csv?fake_
 
 b. The actual api request.
 
-    i. Create the corresponding teams file: teams.csv (Notes: the table header 
is in capital letters).
+    i. Create the corresponding teams file: teams.csv 
+    (Notes: 1.The table table field names should have initial capital letters. 
2.Be careful not to change the file suffix when opening csv files through the 
tool ).
 
     ii. The corresponding curl command.(Quick copy folder path for macOS, 
Shortcut option + command + c)
 
@@ -31,9 +32,11 @@ b. The actual api request.
 curl --location --request PUT 'http://127.0.0.1:8080/plugins/org/teams.csv' 
--form 'file=@"/xxxpath/teams.csv"'
 ```
 
-    iii. After successful execution, the teams table is generated and the data 
can be seen in the database table teams.
+    iii. After successful execution, the teams table is generated and the data 
can be seen in the database table teams. 
+    (Notes: how to connect to the database: mainly through host, port, 
username, password, and then through sql tools, such as sequal ace, datagrip 
and other data, of course you can also access through the command line mysql -h 
`ip` -u `username` -p -P `port`)
+
+![image](/img/teamflow3.png)
 
-<p align="center"><img src="../../static/img/teamflow3.png" /></p>
 
 ## Step 2 - Construct user tables (roster)
 a. Api request example, you can generate sample data.
@@ -56,11 +59,11 @@ curl --location --request PUT 
'http://127.0.0.1:8080/plugins/org/users.csv' --fo
 
     iii. After successful execution, the users table is generated and the data 
can be seen in the database table users.
 
-<p align="center"><img src="../../static/img/teamflow1.png" /></p>
+![image](/img/teamflow1.png)
     
     iv. Generated the team_users table, you can see the data in the team_users 
table.
 
-<p align="center"><img src="../../static/img/teamflow2.png" /></p>
+![image](/img/teamflow2.png)
 
 ## Step 3 - Update users if you need  
 If there is a problem with team_users association or data in users, just 
re-put users api interface, i.e. (b in step 2 above)
@@ -68,9 +71,9 @@ If there is a problem with team_users association or data in 
users, just re-put
 ## Step 4 - Collect accounts 
 accounts table is collected by users through devlake. You can see the accounts 
table information in the database.
 
-<p align="center"><img src="../../static/img/teamflow4.png" /></p>
+![image](/img/teamflow4.png)
 
-## Step 5 - Bind accounts and users table relationship
+## Step 5 - Automatically match existing accounts and users through api 
requests
 
 a. api request:  the name of the plugin is "org", connctionId is order to keep 
same with other plugins.
 
@@ -95,31 +98,39 @@ curl --location --request POST '127.0.0.1:8080/pipelines' \
 
 b. After successful execution, the user_accounts table is generated, and you 
can see the data in table user_accounts.
 
-<p align="center"><img src="../../static/img/teamflow5.png" /></p>
+![image](/img/teamflow5.png)
 
 ## Step 6 - Get user_accountsr relationship
-After generating the user_accounts relationship, the user needs to confirm 
whether the data user and accounts match correctly by the GET method that can 
get the associated data. The main purpose is to check whether the Id in the 
accounts table is associated with the UserId relationship.
+After generating the user_accounts relationship, the user can get the 
associated data through the GET method to confirm whether the data user and 
account match correctly and whether the matched accounts are complete.
 
-a. http://127.0.0.1:8080/plugins/org/user_accounts.csv (put into the browser 
to download the file directly)
+a. http://127.0.0.1:8080/plugins/org/user_account_mapping.csv (put into the 
browser to download the file directly)
 
 b. The corresponding curl command.
 ```
-curl --location --request GET 
'http://127.0.0.1:8080/plugins/org/user_accounts.csv'
+curl --location --request GET 
'http://127.0.0.1:8080/plugins/org/user_account_mapping.csv'
 ```
 
-<p align="center"><img src="../../static/img/teamflow6.png" /></p>
+![image](/img/teamflow6.png)
+
+c. You can also use sql statements to determine, here to provide a sql 
statement for reference only.
+```
+SELECT a.id as account_id, a.email, a.user_name as account_user_name, u.id as 
user_id, u.name as real_name
+FROM accounts a 
+        join user_accounts ua on a.id = ua.account_id
+        join users u on ua.user_id = u.id
+```
 
 ## Step 7 - Update user_accounts if you need
-If the relationship in the accounts table is not as expected, you can change 
the relationship in the accounts table. For example, change the UserId in the 
line Id=github:GithubAccount:1:1234 to 2 in my accounts here, upload the 
user_accounts.csv file through the api user_account.csv file.
+If the association between user and account is not as expected, you can change 
the user_account_mapping.csv file. For example, I change the UserId in the line 
Id=github:GithubAccount:1:1234 in the user_account_mapping.csv file to 2, and 
then upload the user_account_mapping.csv file through the api interface.
 
 a. The corresponding curl command.
 ```
-curl --location --request PUT 
'http://127.0.0.1:8080/plugins/org/user_accounts.csv' --form 
'file=@"/xxxpath/user_accounts.csv"'
+curl --location --request PUT 
'http://127.0.0.1:8080/plugins/org/user_account_mapping.csv' --form 
'file=@"/xxxpath/user_account_mapping.csv"'
 ```
 
 b. You can see that the data in the user_accounts table has been updated.
 
-<p align="center"><img src="../../static/img/teamflow7.png" /></p>
+![image](/img/teamflow7.png)
 
 
 **The above is the flow of user usage for the whole team feature.**
diff --git a/static/img/teamflow6.png b/static/img/teamflow6.png
index 3fee26f9..5a55e468 100644
Binary files a/static/img/teamflow6.png and b/static/img/teamflow6.png differ

Reply via email to