Hasura changes to add searching + indexing. Header and card changes.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Dropdown, Menu, Icon, Avatar, Row, Col } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import i18next from "i18next";
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
import { GET_CURRENT_USER } from "../../graphql/local.queries";
|
||||
import { Avatar, Col, Dropdown, Icon, Menu, Row } from "antd";
|
||||
import i18next from "i18next";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import UserImage from "../../assets/User.svg";
|
||||
import { GET_CURRENT_USER } from "../../graphql/local.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import SignOut from "../sign-out/sign-out.component";
|
||||
|
||||
export default function CurrentUserDropdown() {
|
||||
const { t } = useTranslation();
|
||||
@@ -23,6 +24,9 @@ export default function CurrentUserDropdown() {
|
||||
};
|
||||
const menu = (
|
||||
<Menu mode='vertical' onClick={handleMenuClick}>
|
||||
<Menu.Item>
|
||||
<SignOut />
|
||||
</Menu.Item>
|
||||
<Menu.Item>
|
||||
<Link to='/manage/profile'> {t("menus.currentuser.profile")}</Link>
|
||||
</Menu.Item>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { useApolloClient } from "@apollo/react-hooks";
|
||||
import { Col, Icon, Menu, Row } from "antd";
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { useApolloClient } from "@apollo/react-hooks";
|
||||
import { Menu, Icon, Row, Col } from "antd";
|
||||
import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component";
|
||||
import GlobalSearch from "../global-search/global-search.component";
|
||||
import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component";
|
||||
import "./header.styles.scss";
|
||||
|
||||
import SignOut from "../sign-out/sign-out.component";
|
||||
import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component";
|
||||
import GlobalSearch from "../global-search/global-search.component";
|
||||
import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component";
|
||||
|
||||
export default ({ landingHeader, navItems, selectedNavItem }) => {
|
||||
const apolloClient = useApolloClient();
|
||||
@@ -38,9 +37,7 @@ export default ({ landingHeader, navItems, selectedNavItem }) => {
|
||||
))}
|
||||
|
||||
{!landingHeader ? (
|
||||
<Menu.Item>
|
||||
<SignOut />
|
||||
</Menu.Item>
|
||||
null
|
||||
) : (
|
||||
<Menu.Item>
|
||||
<ManageSignInButton />
|
||||
|
||||
@@ -56,11 +56,17 @@ export default function JobDetailCards({ selectedJob }) {
|
||||
</span>
|
||||
}
|
||||
title={
|
||||
loading
|
||||
? t("general.labels.loading")
|
||||
: data.jobs_by_pk.ro_number
|
||||
? `${t("jobs.fields.ro_number")} ${data.jobs_by_pk.ro_number}`
|
||||
: `${t("jobs.fields.est_number")} ${data.jobs_by_pk.est_number}`
|
||||
loading ? (
|
||||
t("general.labels.loading")
|
||||
) : (
|
||||
<Link to={`/manage/jobs/${data.jobs_by_pk.id}`}>
|
||||
{data.jobs_by_pk.ro_number
|
||||
? `${t("jobs.fields.ro_number")} ${data.jobs_by_pk.ro_number}`
|
||||
: `${t("jobs.fields.est_number")} ${
|
||||
data.jobs_by_pk.est_number
|
||||
}`}{" "}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
extra={[
|
||||
<Link
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Carousel } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CardTemplate from "./job-detail-cards.template.component";
|
||||
import { Carousel } from "antd";
|
||||
import "./job-detail-cards.styles.scss";
|
||||
import CardTemplate from "./job-detail-cards.template.component";
|
||||
|
||||
export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -19,15 +19,17 @@ export default function JobDetailCardsDocumentsComponent({ loading, data }) {
|
||||
loading={loading}
|
||||
title={t("jobs.labels.cards.documents")}
|
||||
extraLink={`/manage/jobs/${data.id}#documents`}>
|
||||
{data.documents ? (
|
||||
{data.documents.count > 0 ? (
|
||||
<Carousel autoplay>
|
||||
{data.documents.map(item => (
|
||||
<div key={item.id}>
|
||||
<img src={item.thumb_url} />
|
||||
<img src={item.thumb_url} alt={item.name} />
|
||||
</div>
|
||||
))}
|
||||
</Carousel>
|
||||
) : null}
|
||||
) : (
|
||||
<div>{t("documents.errors.nodocuments")}</div>
|
||||
)}
|
||||
</CardTemplate>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Icon, Modal, notification, Upload } from "antd";
|
||||
import { Icon, Modal, notification, Upload } from "antd";
|
||||
import axios from "axios";
|
||||
import React, { useState } from "react";
|
||||
import { useMutation } from "react-apollo";
|
||||
@@ -165,7 +165,7 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data }) {
|
||||
});
|
||||
const CloudFrontUrl = "https://d18fc493a0fm4o.cloudfront.net";
|
||||
const url = `${CloudFrontUrl}/${btoa(imageRequest)}`;
|
||||
|
||||
console.log("url", url);
|
||||
return (
|
||||
<div className='clearfix'>
|
||||
<Upload.Dragger
|
||||
|
||||
@@ -34,7 +34,7 @@ export default withRouter(function JobsList({
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Link to={"/manage/jobs/" + record.id}>
|
||||
{record.ro_number ? record.ro_number : t("general.labels.na")}
|
||||
{record.ro_number ? record.ro_number : "EST-" + record.est_number}
|
||||
</Link>
|
||||
</span>
|
||||
)
|
||||
@@ -202,7 +202,9 @@ export default withRouter(function JobsList({
|
||||
return (
|
||||
<Input.Search
|
||||
placeholder='Search...'
|
||||
onSearch={value => console.log(value)}
|
||||
onSearch={value => {
|
||||
console.log(value);
|
||||
}}
|
||||
enterButton
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import React, { Component } from "react";
|
||||
//import { Redirect } from "react-router-dom";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import firebase from "../../firebase/firebase.utils";
|
||||
export default class SignOut extends Component {
|
||||
state = {
|
||||
redirect: false
|
||||
};
|
||||
|
||||
signOut = async () => {
|
||||
export default function SignoutComponent() {
|
||||
const signOut = async () => {
|
||||
try {
|
||||
await firebase.auth().signOut();
|
||||
// this.setState({
|
||||
@@ -17,17 +14,12 @@ export default class SignOut extends Component {
|
||||
}
|
||||
};
|
||||
|
||||
renderRedirect = () => {
|
||||
if (this.state.redirect) {
|
||||
//return <Redirect to="/signin" />;
|
||||
}
|
||||
};
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{this.renderRedirect()}
|
||||
<div onClick={this.signOut}>Sign Out</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div>
|
||||
{this.renderRedirect()}
|
||||
<div onClick={signOut}>{t("user.actions.signout")}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user