Skip to content

Commit

Permalink
all working, missing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiaggio committed Sep 19, 2024
1 parent 53c0966 commit d0bcbe9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
3 changes: 2 additions & 1 deletion explore/src/main/scala/explore/programs/SupportUsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import cats.data.NonEmptySet
import crystal.react.View
import explore.model.ProgramUserWithRole
import explore.model.UserInvitation
import explore.users.InviteUserButton
import explore.users.ProgramUsersTable
import japgolly.scalajs.react.*
import japgolly.scalajs.react.vdom.html_<^.*
import lucuma.core.enums.ProgramUserRole
import lucuma.core.model.Program
import lucuma.react.common.ReactFnProps
import explore.users.InviteUserButton

case class SupportUsers(
programId: Program.Id,
Expand All @@ -36,6 +36,7 @@ object SupportUsers:
<.label(
props.title,
InviteUserButton(props.programId, props.supportRole.role, props.invitations)
.unless(props.readonly)
),
ProgramUsersTable(
props.programId,
Expand Down
10 changes: 5 additions & 5 deletions explore/src/main/scala/explore/proposal/ProposalEditor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

package explore.proposal

import cats.syntax.option.*
import cats.data.NonEmptySet
import cats.effect.IO
import cats.syntax.option.*
import clue.*
import clue.data.Input
import clue.data.syntax.*
Expand All @@ -27,6 +28,8 @@ import explore.model.UserInvitation
import explore.model.enums.GridLayoutSection
import explore.model.layout.LayoutsMap
import explore.undo.*
import explore.users.InviteUserButton
import explore.users.ProgramUsersTable
import japgolly.scalajs.react.*
import japgolly.scalajs.react.vdom.html_<^.*
import lucuma.core.enums.ProgramUserRole
Expand All @@ -40,13 +43,10 @@ import lucuma.schemas.ObservationDB.Types.*
import lucuma.ui.optics.*
import lucuma.ui.primereact.*
import lucuma.ui.primereact.given
import lucuma.ui.react.given
import lucuma.ui.syntax.all.given
import monocle.Iso
import queries.common.ProposalQueriesGQL
import explore.users.InviteUserButton
import lucuma.ui.react.given
import explore.users.ProgramUsersTable
import cats.data.NonEmptySet

case class ProposalEditor(
programId: Program.Id,
Expand Down
18 changes: 9 additions & 9 deletions explore/src/main/scala/explore/users/InviteUserButton.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
package explore.users

import crystal.react.View
import crystal.react.hooks.*
import explore.Icons
import explore.model.UserInvitation
import explore.model.display.given
import japgolly.scalajs.react.*
import japgolly.scalajs.react.vdom.html_<^.*
import lucuma.core.enums.ProgramUserRole
import lucuma.core.model.Program
import lucuma.core.syntax.display.*
import lucuma.react.common.ReactFnProps
import lucuma.react.primereact.Button
import lucuma.react.primereact.hooks.all.*
import lucuma.ui.primereact.*
import lucuma.ui.syntax.all.given
import explore.Icons
import lucuma.react.primereact.hooks.all.*
import lucuma.core.enums.ProgramUserRole
import explore.model.display.given
import lucuma.core.syntax.display.*
import lucuma.core.model.Program
import explore.model.UserInvitation
import crystal.react.hooks.*

case class InviteUserButton(
programId: Program.Id,
Expand All @@ -37,7 +37,7 @@ object InviteUserButton:
React.Fragment(
InviteUserPopup(
props.programId,
ProgramUserRole.Coi,
props.role,
props.invitations,
createInviteStatus,
overlayRef
Expand Down
6 changes: 3 additions & 3 deletions explore/src/main/scala/explore/users/InviteUserPopup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import explore.Icons
import explore.components.ui.ExploreStyles
import explore.model.AppContext
import explore.model.UserInvitation
import explore.model.display.given
import japgolly.scalajs.react.*
import japgolly.scalajs.react.vdom.html_<^.*
import lucuma.core.data.EmailAddress
import lucuma.core.data.EmailPred
import lucuma.core.enums.ProgramUserRole
import lucuma.core.model.Program
import lucuma.core.syntax.display.*
import lucuma.core.validation.InputValidSplitEpi
import lucuma.react.common.ReactFnProps
import lucuma.react.primereact.Button
Expand All @@ -38,8 +40,6 @@ import lucuma.ui.syntax.all.given
import org.typelevel.log4cats.Logger
import queries.common.InvitationQueriesGQL.*
import queries.common.InvitationQueriesGQL.CreateInviteMutation.Data
import lucuma.core.syntax.display.*
import explore.model.display.given

case class InviteUserPopup(
programId: Program.Id,
Expand Down Expand Up @@ -92,7 +92,7 @@ object InviteUserPopup:
onHide = key.set(None) >> emailView.set(None).runAsyncAndForget
)(
<.div(PrimeStyles.Dialog)(
<.div(PrimeStyles.DialogHeader, s"Create ${props.role.shortName} invitation"),
<.div(PrimeStyles.DialogHeader)(s"Create ${props.role.shortName} invitation"),
<.div(PrimeStyles.DialogContent)(
<.div(LucumaPrimeStyles.FormColumnCompact)(
FormInputTextView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package explore.users

import cats.data.NonEmptySet
import cats.effect.IO
import cats.syntax.all.*
import crystal.*
Expand All @@ -18,6 +19,7 @@ import explore.model.reusability.given
import japgolly.scalajs.react.*
import japgolly.scalajs.react.vdom.html_<^.*
import lucuma.core.enums.InvitationStatus
import lucuma.core.enums.ProgramUserRole
import lucuma.react.common.ReactFnProps
import lucuma.react.floatingui.syntax.*
import lucuma.react.primereact.*
Expand All @@ -28,8 +30,6 @@ import lucuma.ui.primereact.*
import lucuma.ui.syntax.all.given
import lucuma.ui.table.*
import queries.common.InvitationQueriesGQL.*
import cats.data.NonEmptySet
import lucuma.core.enums.ProgramUserRole

case class ProgramUserInvitations(
invitations: View[List[UserInvitation]],
Expand Down Expand Up @@ -139,6 +139,9 @@ object ProgramUserInvitations:
isActive = isActive,
invitations = props.invitations,
readOnly = props.readonly
),
state = PartialTableState(columnVisibility =
ColumnVisibility(RevokeId -> Visibility.fromVisible(!props.readonly))
)
)
.render: (props, _, _, _, _, table) =>
Expand Down
6 changes: 3 additions & 3 deletions explore/src/main/scala/explore/users/ProgramUsersTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import explore.components.ui.PartnerFlags
import explore.model.AppContext
import explore.model.IsActive
import explore.model.ProgramUserWithRole
import explore.model.UserInvitation
import explore.model.display.given
import explore.model.reusability.given
import japgolly.scalajs.react.*
import japgolly.scalajs.react.vdom.html_<^.*
import lucuma.core.enums.EducationalStatus
import lucuma.core.enums.Gender
import lucuma.core.enums.InvitationStatus
import lucuma.core.enums.Partner
import lucuma.core.enums.ProgramUserRole
import lucuma.core.model.PartnerLink
Expand All @@ -39,14 +41,12 @@ import lucuma.refined.*
import lucuma.schemas.ObservationDB.Types.UnlinkUserInput
import lucuma.ui.primereact.*
import lucuma.ui.primereact.given
import lucuma.ui.react.given
import lucuma.ui.syntax.all.given
import lucuma.ui.table.*
import lucuma.ui.utils.*
import monocle.function.Each.*
import queries.common.ProposalQueriesGQL.UnlinkUser
import explore.model.UserInvitation
import lucuma.core.enums.InvitationStatus
import lucuma.ui.react.given

case class ProgramUsersTable(
programId: Program.Id,
Expand Down

0 comments on commit d0bcbe9

Please sign in to comment.