chore(firm): firm users page shows company address

This commit is contained in:
Steffen Jost 2023-10-26 19:13:01 +02:00
parent aae1926840
commit 0f3bf98235
4 changed files with 60 additions and 26 deletions

View File

@ -4,4 +4,5 @@
FirmAllActNotify: Mitteilung versenden
FirmAllActResetSupervision: Ansprechpartner für alle Firmenangehörigen zurücksetzen
FirmUserActNotify: Mitteilung versenden
FirmUserActMkSuper: Zum Firmenansprechparnter ernennen

View File

@ -4,3 +4,5 @@
FirmAllActNotify: Send message
FirmAllActResetSupervision: Reset supervisors for all company associates
FirmUserActNotify: Send message
FirmUserActMkSuper: Mark as company supervisor

View File

@ -119,35 +119,35 @@ type AllCompanyTableData = DBRow (Entity Company, E.Value Word64, E.Value Word64
resultAllCompanyEntity :: Lens' AllCompanyTableData (Entity Company)
resultAllCompanyEntity = _dbrOutput . _1
resultAllCompany :: Lens' AllCompanyTableData Company
resultAllCompany = resultAllCompanyEntity . _entityVal
resultAllCompany :: Lens' AllCompanyTableData Company
resultAllCompany = resultAllCompanyEntity . _entityVal
resultAllCompanyUsers :: Lens' AllCompanyTableData Word64
resultAllCompanyUsers = _dbrOutput . _2 . _unValue
resultAllCompanyUsers :: Lens' AllCompanyTableData Word64
resultAllCompanyUsers = _dbrOutput . _2 . _unValue
resultAllCompanySupervisors :: Lens' AllCompanyTableData Word64
resultAllCompanySupervisors = _dbrOutput . _3 . _unValue
resultAllCompanySupervisors :: Lens' AllCompanyTableData Word64
resultAllCompanySupervisors = _dbrOutput . _3 . _unValue
resultAllCompanyEmployeeSupervised :: Lens' AllCompanyTableData Word64
resultAllCompanyEmployeeSupervised = _dbrOutput . _4 . _unValue
resultAllCompanyEmployeeRerouted :: Lens' AllCompanyTableData Word64
resultAllCompanyEmployeeRerouted = _dbrOutput . _5 . _unValue
resultAllCompanyEmployeeRerouted :: Lens' AllCompanyTableData Word64
resultAllCompanyEmployeeRerouted = _dbrOutput . _5 . _unValue
resultAllCompanyEmpRerPost :: Lens' AllCompanyTableData Word64
resultAllCompanyEmpRerPost = _dbrOutput . _6 . _unValue
resultAllCompanyEmpRerPost :: Lens' AllCompanyTableData Word64
resultAllCompanyEmpRerPost = _dbrOutput . _6 . _unValue
resultAllCompanyForeignSupers :: Lens' AllCompanyTableData Word64
resultAllCompanyForeignSupers = _dbrOutput . _7 . _unValue
resultAllCompanyForeignSupers :: Lens' AllCompanyTableData Word64
resultAllCompanyForeignSupers = _dbrOutput . _7 . _unValue
resultAllCompanyDefaultReroutes :: Lens' AllCompanyTableData Word64
resultAllCompanyDefaultReroutes = _dbrOutput . _8 . _unValue
resultAllCompanyDefaultReroutes :: Lens' AllCompanyTableData Word64
resultAllCompanyDefaultReroutes = _dbrOutput . _8 . _unValue
resultAllCompanyActiveReroutes :: Lens' AllCompanyTableData Word64
resultAllCompanyActiveReroutes = _dbrOutput . _9 . _unValue
resultAllCompanyActiveReroutes :: Lens' AllCompanyTableData Word64
resultAllCompanyActiveReroutes = _dbrOutput . _9 . _unValue
resultAllCompanyActiveReroutes' :: Lens' AllCompanyTableData Word64
resultAllCompanyActiveReroutes' = _dbrOutput . _10 . _unValue
resultAllCompanyActiveReroutes' :: Lens' AllCompanyTableData Word64
resultAllCompanyActiveReroutes' = _dbrOutput . _10 . _unValue
fromUserCompany :: Maybe (E.SqlExpr (Entity UserCompany) -> E.SqlExpr (E.Value Bool)) -> E.SqlExpr (Entity Company) -> E.SqlQuery ()
fromUserCompany mbFltr cmpy = do
@ -362,13 +362,44 @@ postFirmAllR = do
-----------------------
-- Firm Users Table
data FirmUserAction = FirmUserActNotify
| FirmUserActMkSuper
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
deriving anyclass (Universe, Finite)
nullaryPathPiece ''FirmUserAction $ camelToPathPiece' 3
embedRenderMessage ''UniWorX ''FirmUserAction id
data FirmUserActionData = FirmUserActNotifyData
| FirmUserActMkSuperData
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
getFirmUsersR, postFirmUsersR :: CompanyShorthand -> Handler Html
getFirmUsersR = postFirmUsersR
postFirmUsersR fsh = do
let _fshId = CompanyKey fsh
siteLayout (citext2widget fsh) $ do
setTitle $ citext2Html fsh
[whamlet|!!!STUB!!!TO DO!!!|]
let fshId = CompanyKey fsh
Company{..} <- runDB $ get404 fshId
siteLayout (citext2widget companyName) $ do
setTitle $ citext2Html companyShorthand
[whamlet|
<p>
#{companyPostAddress}
<p>
Für neue Firmangehörige ist Benachrichtigungs-Voreinstellung:
$if companyPrefersPostal
#{icon IconLetter} Briefversand
$else
#{icon IconAt} Email
<p>
AVS Nummer #{companyAvsId}
<h1>
!!!STUB!!!TO DO!!!
<p>
Table showing all company associated users
|]
-----------------------------

View File

@ -624,9 +624,9 @@ fillDb = do
I am aware that violations in the form plagiarism or collaboration with third parties will lead to expulsion from the course.
|]
}
fraportAg <- insert' $ Company "Fraport AG" "Fraport" 1 False Nothing
fraGround <- insert' $ Company "Fraport Ground Handling Professionals GmbH" "FraGround" 2 False Nothing -- TODO: better testcases
nice <- insert' $ Company "N*ICE Aircraft Services & Support GmbH" "N*ICE" 33 False Nothing
fraportAg <- insert' $ Company "Fraport AG" "Fraport" 1 True $ Just $ markdownToStoredMarkup ("Frankfurt Airport Services Worldwide\n60547 Frankfurt am Main"::Text)
fraGround <- insert' $ Company "Fraport Ground Handling Professionals GmbH" "FraGround" 2 True $ Just $ markdownToStoredMarkup ("Sauerbierstraße 772 \nBürokomplex 80/C/1\n112233 Nieder-Tupfing-Hohen-Kreisingen\nTöpferbezirk"::Text)
nice <- insert' $ Company "N*ICE Aircraft Services & Support GmbH" "N*ICE" 33 False $ Just $ markdownToStoredMarkup ("69 Nevermore Blvd.\nHarlaemn\nNew York\nUSA"::Text)
ffacil <- insert' $ Company "Fraport Facility Services GmbH" "GCS" 44 False Nothing
bpol <- insert' $ Company "Bundespolizeidirektion Flughafen Frankfurt am Main" "BPol" 5555 False Nothing
void . insert' $ UserCompany jost fraportAg True True