From 13739ae0bc66055c69ef0e073e9b09444d473436 Mon Sep 17 00:00:00 2001
From: seotts
Date: Thu, 20 May 2021 14:23:42 -0400
Subject: [PATCH] Minor changes to error messages
---
src/views/studio/studio-description.jsx | 1 -
src/views/studio/studio-image.jsx | 1 -
src/views/studio/studio-projects.jsx | 27 +++++++++++++---------
src/views/studio/studio-title.jsx | 1 -
src/views/studio/studio.jsx | 30 +++++++++++++------------
5 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/src/views/studio/studio-description.jsx b/src/views/studio/studio-description.jsx
index 6e87c18e1..ad98c66f9 100644
--- a/src/views/studio/studio-description.jsx
+++ b/src/views/studio/studio-description.jsx
@@ -13,7 +13,6 @@ import {
import ValidationMessage from '../../components/forms/validation-message.jsx';
import decorateText from '../../lib/decorate-text.jsx';
-import {selectIsMuted} from '../../redux/session';
import StudioMuteEditMessage from './studio-mute-edit-message.jsx';
const errorToMessageId = error => {
diff --git a/src/views/studio/studio-image.jsx b/src/views/studio/studio-image.jsx
index bbc7dfe05..13f98cb3d 100644
--- a/src/views/studio/studio-image.jsx
+++ b/src/views/studio/studio-image.jsx
@@ -12,7 +12,6 @@ import {
} from '../../redux/studio-mutations';
import ValidationMessage from '../../components/forms/validation-message.jsx';
-import {selectIsMuted} from '../../redux/session';
import StudioMuteEditMessage from './studio-mute-edit-message.jsx';
diff --git a/src/views/studio/studio-projects.jsx b/src/views/studio/studio-projects.jsx
index ddf4ca00f..93fb27266 100644
--- a/src/views/studio/studio-projects.jsx
+++ b/src/views/studio/studio-projects.jsx
@@ -5,18 +5,19 @@ import StudioOpenToAll from './studio-open-to-all.jsx';
import {FormattedMessage} from 'react-intl';
import {projects} from './lib/redux-modules';
-import {selectCanAddProjects, selectCanEditOpenToAll, selectHasProjectPermissions, selectShowProjectMuteError} from '../../redux/studio-permissions';
+import {selectCanAddProjects, selectCanEditOpenToAll, selectShowProjectMuteError} from '../../redux/studio-permissions';
import Debug from './debug.jsx';
import StudioProjectAdder from './studio-project-adder.jsx';
import StudioProjectTile from './studio-project-tile.jsx';
import {loadProjects} from './lib/studio-project-actions.js';
import classNames from 'classnames';
import CommentingStatus from '../../components/commenting-status/commenting-status.jsx';
-import {selectMuteStatus} from '../../redux/session.js';
+import {selectIsMuted, selectMuteStatus} from '../../redux/session.js';
import {formatRelativeTime} from '../../lib/format-time.js';
const StudioProjects = ({
- canAddProjects, canEditOpenToAll, hasPermission, items, error, loading, moreToLoad, onLoadMore, muteExpiresAtMs, showMuteError
+ canAddProjects, canEditOpenToAll, items, isMuted, error,
+ loading, moreToLoad, onLoadMore, muteExpiresAtMs, showMuteError
}) => {
useEffect(() => {
if (items.length === 0) onLoadMore();
@@ -31,13 +32,15 @@ const StudioProjects = ({
{showMuteError &&
-
-
+
+
+
+
}
@@ -72,7 +75,7 @@ const StudioProjects = ({
/>
)}
@@ -121,6 +124,7 @@ StudioProjects.propTypes = {
title: PropTypes.string,
username: PropTypes.string
})),
+ isMuted: PropTypes.bool,
loading: PropTypes.bool,
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
moreToLoad: PropTypes.bool,
@@ -134,6 +138,7 @@ export default connect(
...projects.selector(state),
canAddProjects: selectCanAddProjects(state),
canEditOpenToAll: selectCanEditOpenToAll(state),
+ isMuted: selectIsMuted(state),
showMuteError: selectShowProjectMuteError(state),
muteExpiresAtMs: (selectMuteStatus(state).muteExpiresAt * 1000 || 0)
}),
diff --git a/src/views/studio/studio-title.jsx b/src/views/studio/studio-title.jsx
index 996d0744e..b7e9aa0e9 100644
--- a/src/views/studio/studio-title.jsx
+++ b/src/views/studio/studio-title.jsx
@@ -9,7 +9,6 @@ import {selectStudioTitle, selectIsFetchingInfo} from '../../redux/studio';
import {selectCanEditInfo, selectShowEditMuteError} from '../../redux/studio-permissions';
import {Errors, mutateStudioTitle, selectIsMutatingTitle, selectTitleMutationError} from '../../redux/studio-mutations';
import ValidationMessage from '../../components/forms/validation-message.jsx';
-import {selectIsMuted} from '../../redux/session';
import StudioMuteEditMessage from './studio-mute-edit-message.jsx';
const errorToMessageId = error => {
diff --git a/src/views/studio/studio.jsx b/src/views/studio/studio.jsx
index 68b759306..61f429635 100644
--- a/src/views/studio/studio.jsx
+++ b/src/views/studio/studio.jsx
@@ -38,13 +38,13 @@ const {commentsReducer} = require('../../redux/comments');
const {studioMutationsReducer} = require('../../redux/studio-mutations');
import './studio.scss';
-import {selectIsMuted, selectMuteStatus} from '../../redux/session.js';
+import {selectMuteStatus} from '../../redux/session.js';
import {formatRelativeTime} from '../../lib/format-time.js';
import CommentingStatus from '../../components/commenting-status/commenting-status.jsx';
import {FormattedMessage} from 'react-intl';
-import { selectHasCuratorEditPermissions, selectShowCuratorMuteError } from '../../redux/studio-permissions.js';
+import {selectShowCuratorMuteError} from '../../redux/studio-permissions.js';
-const StudioShell = ({showCuratorMuteBox, muteExpiresAtMs, studioLoadFailed}) => {
+const StudioShell = ({showCuratorMuteError, muteExpiresAtMs, studioLoadFailed}) => {
const match = useRouteMatch();
return (
@@ -59,16 +59,18 @@ const StudioShell = ({showCuratorMuteBox, muteExpiresAtMs, studioLoadFailed}) =>
- {showCuratorMuteBox &&
-
+ {showCuratorMuteError &&
+
-
-
+
+
+
+
}
@@ -96,14 +98,14 @@ const StudioShell = ({showCuratorMuteBox, muteExpiresAtMs, studioLoadFailed}) =>
};
StudioShell.propTypes = {
- showCuratorMuteBox: PropTypes.bool,
+ showCuratorMuteError: PropTypes.bool,
muteExpiresAtMs: PropTypes.number,
studioLoadFailed: PropTypes.bool
};
const ConnectedStudioShell = connect(
state => ({
- showCuratorMuteBox: selectShowCuratorMuteError(state),
+ showCuratorMuteError: selectShowCuratorMuteError(state),
studioLoadFailed: selectStudioLoadFailed(state),
muteExpiresAtMs: (selectMuteStatus(state).muteExpiresAt * 1000 || 0)
}),