-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: draft revision * chore: fixes to model plan share email template and better match with figma spec * chore: implemented view filter link, updated text for fields which were not selected * chore: refactored error wrapping into store method and loader logic * chore: extended model categories to support additional model categories * fix: do not show model plan share optional message where it has zero length * chore: updated postman collection * Added UI for share model plan * Added mutation and status states/messages * Added close prop to modal alert * Updated unit tests * Added overflow scroll to modal * Imported ModelViewFilter enum to replace FE defined const * Replace IDR with MDM filter view * Trimmed emails strings and added form disable if no emails * Uodated incorrect email recipient hint --------- Co-authored-by: Clay Benson <[email protected]> Co-authored-by: Patrick Segura <[email protected]>
- Loading branch information
1 parent
052d059
commit 78e5deb
Showing
28 changed files
with
7,268 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,38 @@ | |
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Share Model Plan", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "POST", | ||
"header": [], | ||
"body": { | ||
"mode": "graphql", | ||
"graphql": { | ||
"query": "mutation shareModelPlan($modelPlanID: UUID!, $viewFilter: ModelViewFilter, $receiverEmails: [String!]!, $optionalMessage: String) {\n shareModelPlan(modelPlanID: $modelPlanID, viewFilter: $viewFilter, receiverEmails: $receiverEmails, optionalMessage: $optionalMessage)\n}\n", | ||
"variables": "{\n \"modelPlanID\": \"{{modelPlanID}}\",\n \"viewFilter\": \"CMMI\",\n \"receiverEmails\": [\"[email protected]\", \"[email protected]\"],\n \"optionalMessage\": \"\"\n}\n" | ||
} | ||
}, | ||
"url": { | ||
"raw": "{{url}}", | ||
"host": [ | ||
"{{url}}" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Update Model Plan", | ||
"request": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package email | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/cmsgov/mint-app/pkg/models" | ||
) | ||
|
||
// ModelPlanShareSubjectContent defines the parameters necessary for the corresponding email subject | ||
type ModelPlanShareSubjectContent struct { | ||
UserName string | ||
} | ||
|
||
// ModelPlanShareBodyContent defines the parameters necessary for the corresponding email body | ||
type ModelPlanShareBodyContent struct { | ||
UserName string | ||
OptionalMessage *string | ||
ModelName string | ||
ModelShortName *string | ||
ModelCategories []models.ModelCategory | ||
ModelStatus models.TaskStatus | ||
ModelLastUpdated time.Time | ||
ModelLeads []string | ||
ModelViewFilter *string | ||
HumanizedModelViewFilter *string | ||
ClientAddress string | ||
ModelID string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
<title>Content</title> | ||
<style type="text/css"> | ||
/* CSS Reset */ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
/* General */ | ||
body { | ||
padding-left: 5px; | ||
text-align: left; | ||
} | ||
|
||
/* Headings */ | ||
h1 { | ||
font-size: 30pt; | ||
font-weight: bold; | ||
font-style: normal; | ||
color: #1B1B1B; | ||
font-family: 'Public Sans', sans-serif; | ||
text-decoration: none; | ||
} | ||
|
||
h2 { | ||
font-size: 24pt; | ||
font-weight: bold; | ||
font-style: normal; | ||
color: #1B1B1B; | ||
font-family: 'Public Sans', sans-serif; | ||
text-decoration: none; | ||
} | ||
|
||
h3 { | ||
font-size: 16.5pt; | ||
font-weight: bold; | ||
font-style: normal; | ||
color: #1B1B1B; | ||
font-family: 'Public Sans', sans-serif; | ||
text-decoration: none; | ||
line-height: 1.4; | ||
} | ||
|
||
/* Subtitle */ | ||
.subtitle { | ||
font-size: 15.5pt; | ||
font-weight: normal; | ||
font-style: normal; | ||
color: #71767A; | ||
font-family: 'Public Sans', sans-serif; | ||
text-decoration: none; | ||
} | ||
|
||
/* Paragraph */ | ||
p { | ||
font-size: 12pt; | ||
font-weight: normal; | ||
font-style: normal; | ||
color: #1B1B1B; | ||
font-family: 'Public Sans', sans-serif; | ||
text-decoration: none; | ||
line-height: 1.4; | ||
} | ||
|
||
/* Links */ | ||
a { | ||
font-size: 12pt; | ||
color: #005EA2; | ||
font-family: 'Public Sans', sans-serif; | ||
text-decoration: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1 style="padding-top: 3pt;">MINT</h1> | ||
<p class="subtitle" style="padding-top: 11pt;">The Model Innovation Tool</p> | ||
<br/> | ||
<h2 style="padding-top: 14pt;">{{.UserName}} has shared a Model Plan with you:</h2> | ||
<br/> | ||
<!-- Only show the optional message if it exists --> | ||
{{if and .OptionalMessage (gt (len .OptionalMessage) 0)}} | ||
<p style="font-size: 15.5pt; | ||
font-weight: normal; | ||
font-style: normal; | ||
color: #565C65; | ||
font-family: 'Public Sans', sans-serif; | ||
text-decoration: none;">"{{.OptionalMessage}}"</p> | ||
<br/> | ||
{{end}} | ||
|
||
<table style="border: 1px solid #E6E6E6; border-radius: 6px; padding: 20px; display: inline-table;"> | ||
<tr> | ||
<td style="vertical-align: top; padding: 20px;"> | ||
<h1 style="display: inline-block;">{{.ModelName}}</h1> | ||
{{if .ModelShortName}}<h2 style="display: inline-block;"> ({{.ModelShortName}})</h2>{{end}} | ||
<br/> | ||
|
||
<h3>Category</h3> | ||
<p> | ||
{{if .ModelCategories}} | ||
{{- range $index, $element := .ModelCategories -}} | ||
{{- if $index -}}, {{- end -}} | ||
{{$element}} | ||
{{- end -}} | ||
{{else}} | ||
To be determined | ||
{{end}} | ||
</p> | ||
<br/> | ||
|
||
<h3>Status</h3> | ||
<p>{{.ModelStatus}}</p> | ||
<br/> | ||
|
||
<h3>Last Updated</h3> | ||
<p>{{.ModelLastUpdated.Format "2006-01-02 15:04:05"}}</p> | ||
<br/> | ||
|
||
<h3>Model Leads</h3> | ||
<p> | ||
{{if .ModelLeads}} | ||
{{- range $index, $element := .ModelLeads -}} | ||
{{- if $index -}}, {{- end -}} | ||
{{$element}} | ||
{{- end -}} | ||
{{else}} | ||
To be determined | ||
{{end}} | ||
</p> | ||
<br/> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
<br/> | ||
<p style="padding-top: 14pt;"> | ||
{{if .ModelViewFilter}} | ||
<a href="{{.ClientAddress}}/models/{{.ModelID}}/read-only?filter-view={{.ModelViewFilter}}" class="link"> | ||
View {{.HumanizedModelViewFilter}} details in MINT | ||
</a> | ||
{{else}} | ||
<a href="{{.ClientAddress}}/models/{{.ModelID}}/read-only" class="link"> | ||
View more details in MINT | ||
</a> | ||
{{end}} | ||
</p> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{.UserName}} has shared a Model Plan with you |
Oops, something went wrong.