Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2 計畫管理(編輯設定) #52

Open
8 tasks done
ghost opened this issue Nov 19, 2018 · 19 comments
Open
8 tasks done

3.2 計畫管理(編輯設定) #52

ghost opened this issue Nov 19, 2018 · 19 comments

Comments

@ghost
Copy link

ghost commented Nov 19, 2018

  • 3.2.1 檢查登入人員權限,若為「計畫管理員」則顯示「+新增欄位」
    • /ctp-user/me 可拿到
    • API will run access control and check project_roles.roles: ProjectInitiator & ProjectManager
  • 3.2.2 (b) 可調順序 (d) 可刪除欄位
  • 點選「申請新增欄位」後帶出 3.2.3 對話框
  • 3.2.3 輸入格式若為下拉選單則必須建立選單項目,無則顯示錯誤提示
  • 按下確定送出新增欄位 JSON 說明請見 #21
  • 根據回傳結果使用 src/pages/index/components/DialogUI.vue 通知使用者
  • 範本下載
  • 相機異常檢測,每日測試照片拍攝時間
@ghost ghost added this to To do in API 介接及完成 UI 互動 via automation Nov 19, 2018
@ghost ghost added this to the 計畫資料管理及更新 milestone Nov 22, 2018
@rwu823 rwu823 assigned rwu823 and unassigned rwu823 Nov 28, 2018
@ghost ghost assigned oahehc Dec 3, 2018
@trashmai trashmai added the priority Suggested to work first label Dec 6, 2018
@trashmai
Copy link
Contributor

trashmai commented Dec 6, 2018

編輯常見物種順序
POST /project/bulk-update

[
  {
    "_id": ${projectId},
    "projectId": ${projectId}, // for access control
    "$set": {
      "speciesList": [
        ${orderedSpeciesName}... // e.g. 山羌、水鹿、鼬獾...
      ]
    }
  }
]

@trashmai
Copy link
Contributor

trashmai commented Dec 6, 2018

編輯計畫中的啟用欄位(非申請新欄位)
POST /project/bulk-update

[
  {
    "_id": ${projectId},
    "projectId": ${projectId}, // for access control
    "$set": {
      "dataFieldEnabled": [
        ${selectedKeysInDataFieldAvailable}... // e.g. antler, lifeStage, ...
      ]
    }
  }
]

@trashmai
Copy link
Contributor

trashmai commented Dec 6, 2018

  • 相機異常檢測,每日測試照片拍攝時間 dailyTestTime
    這一項由於有變更的可能性,因此設定為 array,並有 since (設定啟用時間) 與 time (每日拍攝時間)兩個屬性。目前階段先當成設定不變,維持只有一個 element。

POST /project/bulk-update

[
  {
    "_id": ${projectId},
    "projectId": ${projectId}, // for access control
    "$set": {
      "dailyTestTime": [
        {
          since: ${timeStampOfEnabled} // default use Date.now() / 1000 (js timestamp to unix timestamp},
          time: "12:00:00" // 含時分秒
        }
      ]
    }
  }
]

@oahehc
Copy link
Collaborator

oahehc commented Dec 9, 2018

@cjk-halodule @trashmai
確認一下自訂欄位的資料邏輯
project 中 dataFieldEnabled 有對應的 key,
然後 /data-field-available 可以取得欄位的格式,
所以是拿 dataFieldEnabled 去 mapping /data-field-available 來拿到要顯示的自訂欄位的資料?

image

@trashmai
Copy link
Contributor

trashmai commented Dec 9, 2018

是的!

@oahehc
Copy link
Collaborator

oahehc commented Dec 9, 2018

欄位設定要顯示: 欄位形式,輸入格式
從目前 API 給的欄位看來比較像是這樣對應, 請問是否正確?

  "widget_type": "text",  // ---> 欄位形式
  "description": "其他相關內容", // ---> 輸入格式

如果欄位對應無誤, 請問 欄位形式 要直接顯示 api 內容(text/select/...),
還是要轉換成比較好理解的文字說明(輸入欄/下拉選單)?
如果要轉換還請提供所有類型的 mapping table 如下格式

{
  text: '輸入欄',
  select: '下拉選單',
}

@ghost
Copy link
Author

ghost commented Dec 9, 2018

{
  string: '輸入欄',
  select: '下拉選單',
  datePicker: '日期選擇'
}

請參考這裡,需要提供中文的部分,因為是常用介面用語,可以逕行提供喔。

@oahehc
Copy link
Collaborator

oahehc commented Dec 9, 2018

@cjk-halodule
範本下載 => 這部分是前端產生csv還是call API?
相機異常檢測,每日測試照片拍攝時間 => 這部分是有另一隻 API 存對應資料嗎?

@ghost
Copy link
Author

ghost commented Dec 9, 2018

  1. call API 見 9.1 範本下載 #68 確定功能有了就可關 issue
  2. 是計畫資料的一個值 見 https://github.com/TaiBIF/camera-trap-api/wiki/new-project dailyTestTime 所以仍然是用計畫更新的 API.

@oahehc
Copy link
Collaborator

oahehc commented Dec 9, 2018

請問選擇無設定時此欄位要傳什麼值?

      "dailyTestTime": [
        {
          since: ${timeStampOfEnabled} // default use Date.now() / 1000 (js timestamp to unix timestamp},
          time: "12:00:00" // 含時分秒
        }
      ]

image

@ghost
Copy link
Author

ghost commented Dec 9, 2018

無設定的話 dailyTestTime 中物件應該就是空值

{
          "since": ,
          "time": ""
}

因為後端的 model 有 enforce 格式,所以前端的話就以空值表示無設定?

@oahehc
Copy link
Collaborator

oahehc commented Dec 10, 2018

送出申請新增欄位時,
是只要call新增欄位表單project/data-field/add,
還是也要同步將該欄位加入專案中

@oahehc
Copy link
Collaborator

oahehc commented Dec 10, 2018

  1. 新增欄位錯誤提示是沒填輸入格式就顯示&disable確定btn, 還是點擊確定後再檢查&顯示錯誤提示?
  2. information icon 先前設計沒有做, 這部分要補上還是先pass?

image

@ghost
Copy link
Author

ghost commented Dec 10, 2018

這個需要系統管理員確認,所以只 POST 到 api, 然後如上所說通知使用者。對話框文字可用:「新增欄位申請已送出,待所有計畫都知道將有此欄位新增且對於欄位意義一致,系統管理員將會通知您新增欄位已生效。」

@ghost
Copy link
Author

ghost commented Dec 10, 2018

  1. disable btn
  2. assets 中若沒有請開票,我們得請設計端補上。謝謝。

@ghost
Copy link
Author

ghost commented Dec 10, 2018

是只要call新增欄位表單 project/data-field/add,
還是也要同步將該欄位加入專案中

請見 TaiBIF/camera-trap-api#21 (comment)

@ghost
Copy link
Author

ghost commented Dec 24, 2018

同步加入,但不啟用。

@ghost ghost removed the priority Suggested to work first label Dec 24, 2018
@oahehc
Copy link
Collaborator

oahehc commented Dec 24, 2018

新增申請欄位時並沒有 key, 所以無法申請時同步加入到專案中, 除非 response 要回 key
image

但這樣的操作有些奇怪, 因為下拉選單目前是過濾掉還沒 approve 的欄位,
但第一次申請時卻會自動帶入, 邏輯會不一致
image

@ghost
Copy link
Author

ghost commented Dec 25, 2018

@trashmai

Sent with GitHawk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants