Skip to content

Commit

Permalink
Change layout, adjust ddl and default order
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Castillo <[email protected]>
  • Loading branch information
tomrndom committed Jul 8, 2024
1 parent dbf765e commit 23df79c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/components/inputs/email-template-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export default class EmailTemplateInput extends React.Component {
}

getTemplates (input, callback) {
const {ownerId } = this.props;
const {ownerId, defaultOptions} = this.props;

if (!input) {
if (!input && !defaultOptions) {
return Promise.resolve({ options: [] });
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/nav-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ class NavMenu extends React.Component {
{name: 'emails', iconClass: 'fa-envelope-o', accessRoute: 'emails',
childs: [
{name:'email_templates', linkUrl:`emails/templates`},
{name:'email_logs', linkUrl:`emails/log`},
]
},
{name: 'email_logs', iconClass: 'fa-envelope-o', linkUrl: 'email-logs', accessRoute: 'email-logs'},
{name: 'admin_access', iconClass: 'fa-arrow-circle-o-right', linkUrl: 'admin-access', accessRoute: 'admin-access'},
{name: 'media_file_types', iconClass: 'fa-file-text-o', linkUrl: 'media-file-types', accessRoute: 'admin-access'},
];
Expand Down
2 changes: 2 additions & 0 deletions src/layouts/email-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Breadcrumb } from 'react-breadcrumbs';
import Restrict from '../routes/restrict';
import EmailTemplateListPage from "../pages/emails/email-template-list-page";
import EditEmailTemplatePage from "../pages/emails/edit-email-template-page";
import EmailLogListPage from '../pages/emails/email-log-list-page';

class EmailLayout extends React.Component {

Expand All @@ -33,6 +34,7 @@ class EmailLayout extends React.Component {
<Route exact strict path={`${match.url}/templates`} component={EmailTemplateListPage}/>
<Route strict exact path={`${match.url}/templates/new`} component={EditEmailTemplatePage}/>
<Route path={`${match.url}/templates/:template_id`} component={EditEmailTemplatePage}/>
<Route exact strict path={`${match.url}/log`} component={EmailLogListPage}/>
<Redirect to={`/app/emails/templates`} />
</Switch>
</div>
Expand Down
47 changes: 0 additions & 47 deletions src/layouts/email-logs-layout.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/layouts/primary-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import SummitDirectoryPage from '../pages/summits/summit-directory-page';
import SpeakerLayout from './speaker-layout';
import CompanyLayout from './company-layout';
import EmailLayout from "./email-layout";
import EmailLogsLayout from './email-logs-layout';
import AdminAccessLayout from "./admin-access-layout";
import MediaFileTypeLayout from "./media-file-type-layout";
import SponsoredProjectLayout from "./sponsored-project-layout";
Expand Down Expand Up @@ -57,7 +56,6 @@ class PrimaryLayout extends React.Component {
<Route path="/app/tags" component={TagLayout}/>
<Route path="/app/sponsored-projects" component={SponsoredProjectLayout}/>
<Route path={"/app/emails"} component={EmailLayout}/>
<Route path={"/app/email-logs"} component={EmailLogsLayout}/>
<Route path={"/app/admin-access"} component={AdminAccessLayout}/>
<Route path={"/app/media-file-types"} component={MediaFileTypeLayout}/>
<Route path="/app/summits" component={SummitLayout} />
Expand Down
6 changes: 3 additions & 3 deletions src/pages/emails/email-log-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const SentEmailListPage = ({
...props
}) => {
useEffect(() => {
props.getSentEmails(term, currentPage, perPage, order, orderDir, filters);
props.getSentEmails(term, currentPage, perPage, order, 0, filters);
}, []);

const defaultFilters = {
Expand Down Expand Up @@ -107,8 +107,6 @@ const SentEmailListPage = ({
setEmailFilters({ ...emailFilters, [id]: value });
}

console.log("CHJECK FILTER", emailFilters);

const handleColumnsChange = (ev) => {
const { value } = ev.target;
let newColumns = value;
Expand Down Expand Up @@ -262,6 +260,8 @@ const SentEmailListPage = ({
placeholder={T.translate("email_logs.placeholders.template")}
onChange={handleEmailFilterChange}
isClearable={true}
cacheOptions
defaultOptions
plainValue
/>
</div>
Expand Down

0 comments on commit 23df79c

Please sign in to comment.