Users displayed in project permissions list.

This commit is contained in:
Luka Vandervelden 2019-12-25 02:40:43 +01:00
parent 0aadf3f203
commit 93fc0ac859
2 changed files with 11 additions and 2 deletions

View File

@ -36,6 +36,8 @@ ProjectCreationModal = (args) ->
new-user: "" new-user: ""
new-user-permission: \read new-user-permission: \read
} }
users-cache: args.users-cache
} }
self.project.tasks := void self.project.tasks := void
@ -88,7 +90,12 @@ ProjectCreationModal = (args) ->
for uid in self.project.permissions[permission] for uid in self.project.permissions[permission]
h \tr {key: uid} [ h \tr {key: uid} [
# FIXME: show full name or login # FIXME: show full name or login
h \td [ uid.to-string! ] h \td [
if user = self.users-cache.get-user uid
user.profile?.full_name || user.login
else
uid.to-string!
]
h \td [ permission ] h \td [ permission ]
] ]
] ]
@ -121,7 +128,7 @@ ProjectCreationModal = (args) ->
control [ control [
h \div.button.is-success.is-outlined { h \div.button.is-success.is-outlined {
onclick: -> onclick: ->
uid = parse-int self.input.new-user uid = (parse-int self.input.new-user) || self.input.new-user
perm = self.input.new-user-permission perm = self.input.new-user-permission
self.input.new-user := "" self.input.new-user := ""

View File

@ -149,6 +149,8 @@ Project = (self, todod-ws, users-cache) ->
on-validation: (project) -> on-validation: (project) ->
console.log "Requesting edit for", project console.log "Requesting edit for", project
self.todod-ws.edit-list project.id, project self.todod-ws.edit-list project.id, project
users-cache: users-cache
} }
} [ } [
icon \cog icon \cog