Skip to content

Commit

Permalink
Merge pull request #58 from coder-mind-project/develop
Browse files Browse the repository at this point in the history
Alpha 2.0.1 version
  • Loading branch information
allanalves23 authored Jul 13, 2020
2 parents 2c63a8c + a7ccfd2 commit 968869b
Show file tree
Hide file tree
Showing 20 changed files with 111 additions and 100 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coder-mind-panel",
"version": "2.0.0",
"version": "2.0.1",
"description": "Coder Mind Panel",
"author": "Allan Wanderley Alves",
"license": "BSD-3-Clause",
Expand Down
7 changes: 5 additions & 2 deletions src/components/Comments/AnswerItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { displayFullDate, displayDate } from '@/config/masks';

import axios from 'axios';


import WhatIsDisabledAnswersDialog from './WhatIsDisabledAnswersDialog';

import {
Expand Down Expand Up @@ -217,7 +216,11 @@ function AnswerItem(props) {

AnswerItem.propTypes = {
answer: commentType.isRequired,
changeAnswerState: PropTypes.func.isRequired,
changeAnswerState: PropTypes.func,
};

AnswerItem.defaultProps = {
changeAnswerState: () => null,
};

export default AnswerItem;
6 changes: 1 addition & 5 deletions src/components/Comments/AnswersSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
useMediaQuery,
} from '@material-ui/core';


import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { callToast as toastEmitter } from '@/redux/toast/toastActions';
Expand All @@ -37,7 +36,6 @@ import CustomButton from '@/components/Buttons/Button.jsx';

import AnswerItem from './AnswerItem';


import {
DialogSettingsTitle,
CustomDialog,
Expand All @@ -54,7 +52,6 @@ function AnswersSection(props) {
readComment,
} = props;


/**
* @description Controller states
*/
Expand All @@ -79,7 +76,6 @@ function AnswersSection(props) {
const [order, setOrder] = useState('desc');
const [type, setType] = useState('');


const matches = useMediaQuery(devices.mobileLarge);

function close(event) {
Expand Down Expand Up @@ -503,7 +499,7 @@ function AnswersSection(props) {
</Box>
)
}
{ latestAnswer
{ latestAnswer && count > limit
&& (
<Box width="100%">
<AnswerItem answer={latestAnswer} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Comments/CommentCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function CommentCard(props) {
component="img"
alt={comment && comment.article ? comment.article.title : 'Artigo não definido'}
height="110"
image={comment && comment.article ? `${comment.article.smallImg}` : ArticleLogoSample}
image={comment && comment.article ? `${comment.article.logoImg}` : ArticleLogoSample}
title={comment && comment.article ? comment.article.title : 'Artigo não definido'}
className="article-logo"
/>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Comments/CommentDetailsDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function CommentDetailsDialog(props) {
style={{ boxShadow: '0px 0px 2px 1px #ccc', objectFit: 'cover' }}
width="100%"
height="200px"
src={comment.article ? `${comment.article.smallImg}` : ArticleLogoSample}
src={comment.article ? `${comment.article.logoImg}` : ArticleLogoSample}
alt={comment.article ? comment.article.title : 'Artigo não definido'}
/>
<Box
Expand All @@ -188,7 +188,7 @@ function CommentDetailsDialog(props) {
justifyContent="center"
mt={1}
>
<CustomLink to={`/articles/${comment.article.customURL}`}>
<CustomLink to={`/articles/${comment.article.customUri}`}>
<Button
color="primary"
variant={theme === 'dark' ? 'contained' : 'text'}
Expand Down Expand Up @@ -271,7 +271,7 @@ function CommentDetailsDialog(props) {
{matches
&& (
<Box mr={2}>
<CustomLink to={`/articles/${comment.article.customURL}`}>
<CustomLink to={`/articles/${comment.article.customUri}`}>
<Button
color="primary"
variant="contained"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Comments/HudCommentDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function HudCommentDetails(props) {
>
<MenuItem onClick={() => performAction('answer')}>Responder</MenuItem>
<MenuItem onClick={() => performAction('state')}>{comment.state === 'enabled' ? 'Desabilitar' : 'Habilitar'}</MenuItem>
<CustomLink to={`/articles/${comment.article.customURL}`}>
<CustomLink to={`/articles/${comment.article.customUri}`}>
<MenuItem>Abrir artigo</MenuItem>
</CustomLink>
</Menu>
Expand Down
12 changes: 6 additions & 6 deletions src/components/Comments/HudCommentList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Menu,
MenuItem,
useMediaQuery,
Icon,
} from '@material-ui/core';

import { devices } from '@/config/devices';
Expand All @@ -32,7 +33,6 @@ import {
HudIconButton,
HudSearchBar,
HudSearchBarContainer,
CustomIcon,
} from './styles';

function HudCommentList(props) {
Expand Down Expand Up @@ -198,7 +198,7 @@ function HudCommentList(props) {
{ matches && (
<Box>
<HudIconButton onClick={(evt) => handleOpenMenu(evt, 'options')}>
<CustomIcon>more_vert</CustomIcon>
<Icon>more_vert</Icon>
</HudIconButton>
<Menu
anchorEl={anchorOptions}
Expand Down Expand Up @@ -250,7 +250,7 @@ function HudCommentList(props) {
)}
>
<HudIconButton onClick={(evt) => handleOpenMenu(evt, 'order')}>
<CustomIcon>sort_by_alpha</CustomIcon>
<Icon>sort_by_alpha</Icon>
</HudIconButton>
</Tooltip>
<Menu
Expand Down Expand Up @@ -285,7 +285,7 @@ function HudCommentList(props) {
)}
>
<HudIconButton onClick={reload}>
<CustomIcon>refresh</CustomIcon>
<Icon>refresh</Icon>
</HudIconButton>
</Tooltip>
<Tooltip title={(
Expand All @@ -299,7 +299,7 @@ function HudCommentList(props) {
>
<Box>
<HudIconButton searchtype={type} onClick={confirmAllAsReaded} disabled={type === 'only-readed'}>
<CustomIcon>done_all</CustomIcon>
<Icon>done_all</Icon>
</HudIconButton>
</Box>
</Tooltip>
Expand All @@ -313,7 +313,7 @@ function HudCommentList(props) {
)}
>
<HudIconButton onClick={displaySettings}>
<CustomIcon>settings</CustomIcon>
<Icon>settings</Icon>
</HudIconButton>
</Tooltip>
</Box>
Expand Down
15 changes: 5 additions & 10 deletions src/components/Comments/UnreadComment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { bindActionCreators } from 'redux';
import { callToast as toastEmitter } from '@/redux/toast/toastActions';
import { error as toastError } from '@/config/toasts';

import ArticleSmallImgSample from '@/assets/img_not_found_512x512.png';
import ArticlelogoImgSample from '@/assets/img_not_found_512x512.png';
import {
ArticleSmallImgContainer,
ArticleLogoImgContainer,
CommentContainer,
CustomMenuItem,
} from './styles';
Expand All @@ -29,11 +29,6 @@ const UnreadComment = (props) => {
callToast,
} = props;

/**
* @function
* @description Flag the current comment (`notification`) as read -
* Used only in comment notification feature
*/
function markAsRead() {
const { _id } = notification;

Expand All @@ -52,13 +47,13 @@ const UnreadComment = (props) => {
<CommentContainer item xs={12}>
<CustomMenuItem onClick={displayCommentDetails}>
<Box display="flex" alignItems="center" width="100%">
<ArticleSmallImgContainer>
<ArticleLogoImgContainer>
<img
className="article-small-img"
src={notification.article.smallImg ? `${notification.article.smallImg}` : ArticleSmallImgSample}
src={notification.article.logoImg ? `${notification.article.logoImg}` : ArticlelogoImgSample}
alt={notification.article.title}
/>
</ArticleSmallImgContainer>
</ArticleLogoImgContainer>
<Box className="comment-info">
<Typography component="p" variant="body2">
{`${notification.userName.length > 30 ? `${notification.userName.slice(0, 29)}...` : notification.userName} fez um novo comentário no artigo ${notification.article.title}`}
Expand Down
6 changes: 1 addition & 5 deletions src/components/Comments/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export const CustomMenuItem = styled(MenuItem)({
},
});

export const CustomIcon = styled(Icon)({
color: '#666',
});

export const CustomMenu = styled(Menu)({
marginTop: '.5rem',
});
Expand All @@ -55,7 +51,7 @@ export const CommentContainer = styled(Grid)({
maxWidth: '350px',
});

export const ArticleSmallImgContainer = styled(Box)({
export const ArticleLogoImgContainer = styled(Box)({
marginRight: '8px',
'& .article-small-img': {
height: '48px',
Expand Down
50 changes: 26 additions & 24 deletions src/components/Tickets/SendTickets/AccountProblem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ import {
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCheckCircle } from '@fortawesome/free-solid-svg-icons';


import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';

import { MuiPickersUtilsProvider, KeyboardDateTimePicker } from '@material-ui/pickers';
import { MuiPickersUtilsProvider } from '@material-ui/pickers';
import MomentUtils from '@date-io/moment';

import axios from 'axios';
Expand All @@ -31,6 +30,8 @@ import { error as toastError } from '../../../config/toasts';

import CustomButton from '../../Buttons/Button';

import { CustomTextField, CustomKeyboardDateTimePicker } from './styles';

function AccountProblem(props) {
const {
user,
Expand Down Expand Up @@ -94,7 +95,7 @@ function AccountProblem(props) {
<Box display="flex" flexDirection="column" justifyContent="center" margin="25px">
<Box width="100%" display="flex" alignItems="center">
<Box display="flex" alignItems="center" mr={1}>
<Icon>security</Icon>
<Icon color="action">security</Icon>
</Box>
<Box display="flex" alignItems="center">
<Typography component="h4" variant="h6">Alteraram os dados da minha conta</Typography>
Expand All @@ -113,19 +114,16 @@ function AccountProblem(props) {
</Box>
{!success
&& (
<Box padding="25px">
<Box display="flex" flexWrap="wrap" alignItems="flex-start">
<Grid item xs={12} md={5} className="formInput">
<TextField
<Box padding="25px" paddingTop={0}>
<Box display="flex" flexWrap="wrap" alignItems="flex-start">
<CustomTextField
fullWidth
label="Código *"
value={ticket.code}
onChange={(evt) => handleChangeTicket(evt, 'code')}
/>
</Grid>
<Grid item xs={12} md={5} className="formInput">
<MuiPickersUtilsProvider utils={MomentUtils}>
<KeyboardDateTimePicker
<CustomKeyboardDateTimePicker
label="Data de alteração *"
ampm={false}
clearable
Expand All @@ -143,21 +141,25 @@ function AccountProblem(props) {
fullWidth
/>
</MuiPickersUtilsProvider>
</Grid>
</Box>
<TextField
className="formInput"
fullWidth
multiline
rows="10"
label="Descreva seu problema *"
value={ticket.msg}
onChange={(evt) => handleChangeTicket(evt, 'msg')}
/>
<Box width="100%" marginTop="15px">
<CustomButton onClick={() => sendTicket()} fullWidth color="primary" variant="contained" disabled={isSending} icon="save" loading={isSending} text={isSending ? 'Enviando ticket...' : 'Enviar'} />
</Box>
<Box margin="10px">
<TextField
className="formInput"
fullWidth
multiline
rows="10"
label="Descreva seu problema *"
value={ticket.msg}
onChange={(evt) => handleChangeTicket(evt, 'msg')}
/>
</Box>
<Box padding={0.5}>
<Typography variant="body2" component="p">* Informações obrigatórias</Typography>
</Box>
<Box width="100%" marginTop={4}>
<CustomButton onClick={() => sendTicket()} fullWidth color="primary" variant="contained" disabledIcon disabled={isSending} loading={isSending} text={isSending ? 'Enviando ticket...' : 'Enviar'} />
</Box>
</Box>
</Box>
)
}
{ success
Expand Down
2 changes: 0 additions & 2 deletions src/components/Tickets/SendTickets/AccountRecuperation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import axios from 'axios';
import { error } from '../../../config/toasts';
import { callToast as toastEmitter } from '../../../redux/toast/toastActions';


import { defineErrorMsg } from '../../../config/backend';

import { CODER_MIND_URL } from '../../../config/dataProperties';
Expand All @@ -28,7 +27,6 @@ import CustomButton from '../../Buttons/Button';

import { CustomTextField, CustomBox, IconBox } from './styles';


function AccountRecuperation(props) {
const { params, callToast } = props;

Expand Down
Loading

0 comments on commit 968869b

Please sign in to comment.