Date: Tue, 13 Aug 2024 13:06:14 -0500
Subject: [PATCH 06/33] Updated email links
---
.../templates/added_as_collaborator_body.html | 2 +-
.../_components/IndividualNotification.tsx | 2 +-
src/views/Notifications/Home/index.tsx | 16 ++++++-------
src/views/Notifications/Settings/index.tsx | 24 +++++++------------
4 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/pkg/email/templates/added_as_collaborator_body.html b/pkg/email/templates/added_as_collaborator_body.html
index 450525310c..f34c942671 100644
--- a/pkg/email/templates/added_as_collaborator_body.html
+++ b/pkg/email/templates/added_as_collaborator_body.html
@@ -3,7 +3,7 @@
You've been added as a collaborator on {{.ModelName}} in MINT.
If you have not already been given access to MINT or if you cannot log in with your EUA credentials, please contact the MINT Team at
diff --git a/src/views/Notifications/Home/_components/IndividualNotification.tsx b/src/views/Notifications/Home/_components/IndividualNotification.tsx
index facb1d1996..4cadb3433f 100644
--- a/src/views/Notifications/Home/_components/IndividualNotification.tsx
+++ b/src/views/Notifications/Home/_components/IndividualNotification.tsx
@@ -88,7 +88,7 @@ const IndividualNotification = ({
}
if (isAddingCollaborator(metaData)) {
handleMarkAsRead(() => {
- history.push(`/models/${metaData.modelPlanID}/task-list`);
+ history.push(`/models/${metaData.modelPlanID}/collaboration-area`);
});
}
if (isSharedActivity(metaData) || isNewModelPlan(metaData)) {
diff --git a/src/views/Notifications/Home/index.tsx b/src/views/Notifications/Home/index.tsx
index 124d383398..afd28bdddf 100644
--- a/src/views/Notifications/Home/index.tsx
+++ b/src/views/Notifications/Home/index.tsx
@@ -8,7 +8,7 @@ import {
useUpdateAllNotificationsAsReadMutation
} from 'gql/gen/graphql';
-import Breadcrumbs from 'components/Breadcrumbs';
+import Breadcrumbs, { BreadcrumbItemOptions } from 'components/Breadcrumbs';
import UswdsReactLink from 'components/LinkWrapper';
import MainContent from 'components/MainContent';
import PageHeading from 'components/PageHeading';
@@ -24,7 +24,6 @@ const NotificationsHome = () => {
const { t: notificationsT } = useTranslation('notifications');
const { t: generalT } = useTranslation('general');
- const { t: miscellaneousT } = useTranslation('miscellaneous');
const { message } = useMessage();
@@ -36,11 +35,6 @@ const NotificationsHome = () => {
const allNotifications = data?.currentUser.notifications.notifications || [];
- const breadcrumbs = [
- { text: miscellaneousT('home'), url: '/' },
- { text: notificationsT('breadcrumb') }
- ];
-
if ((!loading && error) || (!loading && !data?.currentUser)) {
return ;
}
@@ -64,7 +58,13 @@ const NotificationsHome = () => {
-
+
{message && {message}}
diff --git a/src/views/Notifications/Settings/index.tsx b/src/views/Notifications/Settings/index.tsx
index 33707e99c9..2187952ea9 100644
--- a/src/views/Notifications/Settings/index.tsx
+++ b/src/views/Notifications/Settings/index.tsx
@@ -24,6 +24,7 @@ import {
useUpdateNotificationSettingsMutation
} from 'gql/gen/graphql';
+import Breadcrumbs, { BreadcrumbItemOptions } from 'components/Breadcrumbs';
import MainContent from 'components/MainContent';
import PageHeading from 'components/PageHeading';
import Alert from 'components/shared/Alert';
@@ -316,21 +317,14 @@ const NotificationSettings = () => {
-
-
-
- {miscellaneousT('home')}
-
-
-
-
- {notificationsT('breadcrumb')}
-
-
-
- {notificationsT('settings.heading')}
-
-
+
{message && {message}}
From 8c0aabd3cd35b9119e3977ed9b5970ac863875a6 Mon Sep 17 00:00:00 2001
From: Patrick Segura
Date: Tue, 13 Aug 2024 13:08:30 -0500
Subject: [PATCH 07/33] Added CH link
---
src/i18n/en-US/changeHistory.ts | 2 +-
src/views/ModelPlan/ChangeHistory/index.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/i18n/en-US/changeHistory.ts b/src/i18n/en-US/changeHistory.ts
index a9b719190a..6154e84c66 100644
--- a/src/i18n/en-US/changeHistory.ts
+++ b/src/i18n/en-US/changeHistory.ts
@@ -1,7 +1,7 @@
const changeHistory = {
heading: 'Change history',
subheading: 'for {{modelName}}',
- back: 'Back to the task list',
+ back: 'Back to the model collaboration area',
backToReadView: 'Back to the Read view',
thisModelPlan: 'this Model Plan',
change:
diff --git a/src/views/ModelPlan/ChangeHistory/index.tsx b/src/views/ModelPlan/ChangeHistory/index.tsx
index b9479c5fd6..cb307253d7 100644
--- a/src/views/ModelPlan/ChangeHistory/index.tsx
+++ b/src/views/ModelPlan/ChangeHistory/index.tsx
@@ -251,7 +251,7 @@ const ChangeHistory = () => {
From b2f9aafe5b6c2388e187ad17113627b6051d1b69 Mon Sep 17 00:00:00 2001
From: Patrick Segura
Date: Tue, 13 Aug 2024 13:47:13 -0500
Subject: [PATCH 08/33] Tweaks status link styles
---
src/i18n/en-US/collaborationArea.ts | 3 +-
.../ModelPlan/CollaborationArea/index.tsx | 1 +
src/views/ModelPlan/ReadOnly/index.tsx | 2 +-
.../_components/TaskListStatus/index.tsx | 104 +++++++++---------
4 files changed, 57 insertions(+), 53 deletions(-)
diff --git a/src/i18n/en-US/collaborationArea.ts b/src/i18n/en-US/collaborationArea.ts
index 7bea0ab486..c0f7ae8514 100644
--- a/src/i18n/en-US/collaborationArea.ts
+++ b/src/i18n/en-US/collaborationArea.ts
@@ -3,7 +3,8 @@ const collaborationArea = {
heading: 'Model collaboration area',
modelPlan: 'for {{modelName}}',
errorHeading: 'Failed to fetch model plan',
- errorMessage: 'Please try again'
+ errorMessage: 'Please try again',
+ switchToReadView: 'Switch to the read view for the model'
};
export default collaborationArea;
diff --git a/src/views/ModelPlan/CollaborationArea/index.tsx b/src/views/ModelPlan/CollaborationArea/index.tsx
index b7e5a7bf15..aeddabd6f9 100644
--- a/src/views/ModelPlan/CollaborationArea/index.tsx
+++ b/src/views/ModelPlan/CollaborationArea/index.tsx
@@ -211,6 +211,7 @@ const CollaborationArea = () => {
status={status}
updateLabel
statusLabel
+ isCollaborationArea
/>
diff --git a/src/views/ModelPlan/ReadOnly/index.tsx b/src/views/ModelPlan/ReadOnly/index.tsx
index 3bbe5860bc..89e5d1eae1 100644
--- a/src/views/ModelPlan/ReadOnly/index.tsx
+++ b/src/views/ModelPlan/ReadOnly/index.tsx
@@ -356,7 +356,7 @@ const ReadOnly = ({ isHelpArticle }: { isHelpArticle?: boolean }) => {
{
@@ -38,15 +39,14 @@ const TaskListStatus = ({
const { t: h } = useTranslation('generalReadOnly');
const { t: changeHistoryT } = useTranslation('changeHistory');
const { t: modelPlanT } = useTranslation('modelPlan');
-
- const flags = useFlags();
+ const { t: collaborationAreaT } = useTranslation('collaborationArea');
return (
-
+
-
+
{!!modifiedDts && (
{modifiedOrCreateLabel ? h('lastUpdate') : h('createdOn')}
{formatDateLocal(modifiedDts, 'MM/dd/yyyy')}
)}
+
+
+
+
+
+ {!isReadView && (
+
+
+ {icon && }
+ {updateLabel && t('update')}
+
+
+ )}
- {!readOnly && (
-
+
- {icon && }
- {updateLabel && t('update')}
+
+
+ {changeHistoryT('viewChangeHistory')}
- )}
-
- {readOnly && (
-
-
-
-
- {flags.changeHistoryEnabled && (
- <>
-
-
-
- {changeHistoryT('viewChangeHistory')}
-
- {hasEditAccess && (
-
- )}
- >
- )}
+ {hasEditAccess && !isCollaborationArea && (
+
+
+ {t('edit')}
+
+ )}
- {hasEditAccess && (
-
-
- {t('edit')}
-
- )}
-
+ {isCollaborationArea && (
+
+
+ {collaborationAreaT('switchToReadView')}
+
+ )}
- )}
+
);
From a81eff14a0c4edd92e6ec34e443c21047e6dbd40 Mon Sep 17 00:00:00 2001
From: Patrick Segura
Date: Tue, 13 Aug 2024 14:14:13 -0500
Subject: [PATCH 09/33] Began elipsis dropdown work
---
pkg/graph/generated/generated.go | 6 +-
pkg/graph/model/models_gen.go | 6 --
src/components/FavoriteCard/index.tsx | 41 ++++++-----
src/components/ShareExport/index.tsx | 2 +-
src/gql/apolloGQL/ModelPlan/GetModelPlan.ts | 1 +
src/gql/gen/graphql.ts | 5 +-
.../ModelPlan/CollaborationArea/index.tsx | 73 ++++++++++++++++---
.../_components/TaskListStatus/index.tsx | 2 +-
src/views/ModelPlan/TaskList/index.tsx | 1 -
9 files changed, 96 insertions(+), 41 deletions(-)
diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go
index 3634ea98af..a0060cce7a 100644
--- a/pkg/graph/generated/generated.go
+++ b/pkg/graph/generated/generated.go
@@ -25059,7 +25059,7 @@ func (ec *executionContext) fieldContext_DiscussionRoleSelection_userRoleDescrip
return fc, nil
}
-func (ec *executionContext) _EnumTranslation_generalName(ctx context.Context, field graphql.CollectedField, obj *model.EnumTranslation) (ret graphql.Marshaler) {
+func (ec *executionContext) _EnumTranslation_generalName(ctx context.Context, field graphql.CollectedField, obj *models.EnumTranslation) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_EnumTranslation_generalName(ctx, field)
if err != nil {
return graphql.Null
@@ -25103,7 +25103,7 @@ func (ec *executionContext) fieldContext_EnumTranslation_generalName(ctx context
return fc, nil
}
-func (ec *executionContext) _EnumTranslation_groupedName(ctx context.Context, field graphql.CollectedField, obj *model.EnumTranslation) (ret graphql.Marshaler) {
+func (ec *executionContext) _EnumTranslation_groupedName(ctx context.Context, field graphql.CollectedField, obj *models.EnumTranslation) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_EnumTranslation_groupedName(ctx, field)
if err != nil {
return graphql.Null
@@ -121313,7 +121313,7 @@ func (ec *executionContext) _DiscussionRoleSelection(ctx context.Context, sel as
var enumTranslationImplementors = []string{"EnumTranslation"}
-func (ec *executionContext) _EnumTranslation(ctx context.Context, sel ast.SelectionSet, obj *model.EnumTranslation) graphql.Marshaler {
+func (ec *executionContext) _EnumTranslation(ctx context.Context, sel ast.SelectionSet, obj *models.EnumTranslation) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, enumTranslationImplementors)
out := graphql.NewFieldSet(fields)
diff --git a/pkg/graph/model/models_gen.go b/pkg/graph/model/models_gen.go
index 135ddd9fc2..73e25dc9b1 100644
--- a/pkg/graph/model/models_gen.go
+++ b/pkg/graph/model/models_gen.go
@@ -35,12 +35,6 @@ type DiscussionReplyTranslation struct {
IsAssessment models.TranslationFieldWithOptions `json:"isAssessment" db:"is_assessment"`
}
-// Represents a translation of enum values. generalName is the human readable name of the enum value, groupedName is an optional field if usually referenced by a difference table/name
-type EnumTranslation struct {
- GeneralName string `json:"generalName"`
- GroupedName *string `json:"groupedName,omitempty"`
-}
-
// Represents existing model link translation data
type ExistingModelLinkTranslation struct {
ExistingModelID models.TranslationField `json:"existingModelID" db:"existing_model_id"`
diff --git a/src/components/FavoriteCard/index.tsx b/src/components/FavoriteCard/index.tsx
index 50b8f76e8c..d2a24c76e6 100644
--- a/src/components/FavoriteCard/index.tsx
+++ b/src/components/FavoriteCard/index.tsx
@@ -147,6 +147,7 @@ type FavoriteIconProps = {
isFavorite: boolean;
modelPlanID: string;
updateFavorite: (modelPlanID: string, type: UpdateFavoriteProps) => void;
+ isCollaborationArea?: boolean;
};
// Icon favorite tag/toggle for readonly summary box
@@ -154,29 +155,33 @@ export const FavoriteIcon = ({
className,
modelPlanID,
isFavorite,
- updateFavorite
+ updateFavorite,
+ isCollaborationArea
}: FavoriteIconProps) => {
const { t } = useTranslation('plan');
return (
-
-
- isFavorite
- ? updateFavorite(modelPlanID, 'removeFavorite')
- : updateFavorite(modelPlanID, 'addFavorite')
+
- {isFavorite ? (
-
- ) : (
-
- )}
-
- {isFavorite ? t('favorite.following') : t('favorite.follow')}
-
-
+ )}
+ onClick={() =>
+ isFavorite
+ ? updateFavorite(modelPlanID, 'removeFavorite')
+ : updateFavorite(modelPlanID, 'addFavorite')
+ }
+ >
+ {isFavorite ? (
+
+ ) : (
+
+ )}
+
+ {isFavorite ? t('favorite.following') : t('favorite.follow')}
+
);
};
diff --git a/src/components/ShareExport/index.tsx b/src/components/ShareExport/index.tsx
index b2fa87426c..db1d6c8c3c 100644
--- a/src/components/ShareExport/index.tsx
+++ b/src/components/ShareExport/index.tsx
@@ -462,7 +462,7 @@ const ShareExportModal = ({
From 301e2fb247fd1d382cfdcac5827416f55d914a2c Mon Sep 17 00:00:00 2001
From: Patrick Segura
Date: Tue, 13 Aug 2024 15:09:57 -0500
Subject: [PATCH 11/33] Style tweaks
---
.../ShareExport/ShareExportButton.tsx | 13 ++-
src/components/ShareExport/index.scss | 7 ++
src/components/ShareExport/index.tsx | 6 +-
.../ModelPlan/CollaborationArea/index.tsx | 98 +++++--------------
4 files changed, 48 insertions(+), 76 deletions(-)
diff --git a/src/components/ShareExport/ShareExportButton.tsx b/src/components/ShareExport/ShareExportButton.tsx
index a05c6b204e..0934578b5a 100644
--- a/src/components/ShareExport/ShareExportButton.tsx
+++ b/src/components/ShareExport/ShareExportButton.tsx
@@ -5,7 +5,7 @@ import { Button, Menu } from '@trussworks/react-uswds';
import Modal from 'components/Modal';
import { StatusMessageType } from 'views/ModelPlan/TaskList';
-import ShareExportModal from '.';
+import ShareExportModal, { NavModelElemet } from '.';
import './index.scss';
@@ -22,6 +22,8 @@ const ShareExportButton = ({
const [isExportModalOpen, setIsExportModalOpen] = useState(false);
+ const [defaultTab, setDefaultTab] = useState('share');
+
const menuRef = useRef(null);
useEffect(() => {
@@ -50,6 +52,7 @@ const ShareExportButton = ({
closeModal={() => setIsExportModalOpen(false)}
modelID={modelID}
setStatusMessage={setStatusMessage}
+ defaultTab={defaultTab}
/>
@@ -68,10 +71,11 @@ const ShareExportButton = ({