diff --git a/src/components/AccountSettings/MyAccount.tsx b/src/components/AccountSettings/MyAccount.tsx index 68c4676b..49d7c183 100644 --- a/src/components/AccountSettings/MyAccount.tsx +++ b/src/components/AccountSettings/MyAccount.tsx @@ -238,20 +238,18 @@ export class MyAccount extends Component { const { status } = responseJSON; // old passwrod entered correctly if (status === 'AUTH_SUCCESS') { + this.handleCancelPassword(); + alert.show('Successfully updated password'); + } else if (status === 'PASSWORD_UNCHANGED') { // new password is the same as the old password - if (enteredPassword === newPassword) { - this.setState({ - passwordError: PasswordError.NewPasswordSameAsOld, - }); - } else { // no error - password changed succesfully - this.handleCancelPassword(); - alert.show('Successfully updated password'); - } + this.setState({ + passwordError: PasswordError.NewPasswordSameAsOld, + }); } else if (status === 'AUTH_FAILURE') { // wrong old password this.setState({ passwordError: PasswordError.OldPasswordWrong, }); - } else if (status === 'INVALID_PARAMETER') { + } else if (status === 'INVALID_PARAMETER') { // invalid password this.setState({ passwordError: PasswordError.NewPasswordInvalid, }); diff --git a/src/components/BaseComponents/BaseActivityCard.tsx b/src/components/BaseComponents/BaseActivityCard.tsx index bfd32ee7..fe2ebb86 100644 --- a/src/components/BaseComponents/BaseActivityCard.tsx +++ b/src/components/BaseComponents/BaseActivityCard.tsx @@ -4,31 +4,44 @@ interface ActivityProps { activity: any; } -export default function (props: ActivityProps): React.ReactElement { - const { activity } = props; - const uploaderUsername = activity.username; +export default function ActivityCard({ activity }: ActivityProps): React.ReactElement { + const uploaderUsername = activity.invokerUsername; + const objectName = activity.objectName; const { type } = activity; - if (uploaderUsername !== '' && type !== '') { - const displayType = type.split('Activity'); + + if (uploaderUsername && type) { + const displayType = type.replace('Activity', ''); const newDate = new Date(Date.parse(activity.occurredAt)); - // return mm/dd/yyyy version of date const dateString = newDate.toLocaleDateString(); - // return difference number of days between current date and dateString for activity const daysDifference = Math.round( (new Date().getTime() - newDate.getTime()) / (1000 * 3600 * 24), ); - // eslint-disable-next-line no-underscore-dangle + return ( -
-
- {displayType} - Activity -
-

- {`Completed by ${uploaderUsername}, ${dateString}, ${daysDifference} days ago`} -

+
+ {/* Column 1: Activity type */} +
+
{displayType}Activity
+
+ + {/* Column 2: Object name */} +
+
{objectName}
+
+ + {/* Column 3: Metadata */} +
+

+ Completed by {uploaderUsername}, {dateString}, {daysDifference} days ago +

+
); } + return
; } diff --git a/src/components/LandingPages/ClientLanding.tsx b/src/components/LandingPages/ClientLanding.tsx index e04a3da1..777e9abe 100644 --- a/src/components/LandingPages/ClientLanding.tsx +++ b/src/components/LandingPages/ClientLanding.tsx @@ -132,11 +132,11 @@ class ClientLanding extends Component {
-
-

Recent Activity

+
+

Recent Activity

- {isLoading ?
:
} -
    + {isLoading ?
    :
    } +
      {this.renderActivitiesCard(activities)}
    diff --git a/src/static/styles/App.scss b/src/static/styles/App.scss index d3c0f982..fd107be0 100644 --- a/src/static/styles/App.scss +++ b/src/static/styles/App.scss @@ -44,7 +44,7 @@ $theme-colors: ( .app { background-color: white; - padding-bottom: 3.75rem; + padding-bottom: 0.01rem; } .input-group-text {