Skip to content

Commit

Permalink
Various visual tweakings
Browse files Browse the repository at this point in the history
  • Loading branch information
Florimond committed Oct 2, 2020
1 parent ce27208 commit 567a9ed
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion outlook/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>c5549a21-aefb-4ba8-ae7c-b77bceab4023</Id>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<ProviderName>Odoo</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Odoo for Outlook"/>
Expand Down
10 changes: 6 additions & 4 deletions outlook/src/classes/EnrichmentInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class EnrichmentInfo {

constructor(type?:EnrichmentInfoType, info?:string) {
this.type = type || EnrichmentInfoType.None;
this.info = info || this.getTypicalMessage(this.type);
// Override the info returned by the service, unless we don't actually have a typical message.
// Messages' content should come from only one place, and ideally the front end.
this.info = this.getTypicalMessage(this.type) || info;
}

public getTypicalMessage(type: EnrichmentInfoType) {
Expand All @@ -26,11 +28,11 @@ class EnrichmentInfo {
return "Company created!"
case EnrichmentInfoType.NoData:
case EnrichmentInfoType.NotConnected_NoData:
return "Could not autocomplete the company: no data found";
return "No data found for this email address.";
case EnrichmentInfoType.InsufficientCredit:
return "You don't have enough credit to enrich";
return "You don't have enough credit to enrich.";
case EnrichmentInfoType.NotConnected_InsufficientCredit:
return "Oops, looks like you have exhausted your free enrichment requests. Please log in to try again";
return "Oops, looks like you have exhausted your free enrichment requests. Please log in to try again.";
case EnrichmentInfoType.Other:
return "Something bad happened. Please, try again later."
case EnrichmentInfoType.NotConnected_InternalError:
Expand Down
4 changes: 4 additions & 0 deletions outlook/src/taskpane/components/Leads/Leads.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.add-to-db-txt {
font-size: 12.5px;
color: grey;
}
4 changes: 2 additions & 2 deletions outlook/src/taskpane/components/Leads/Leads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LeadList from './LeadList/LeadList';
import LeadData from '../../../classes/Lead';
import AppContext from '../AppContext';
import { HttpVerb, sendHttpRequest, ContentType } from "../../../utils/httpRequest";

import './Leads.css';

type LeadsProps = {};
type LeadsState = {
Expand Down Expand Up @@ -101,7 +101,7 @@ class Leads extends React.Component<LeadsProps, LeadsState> {
if (this.state.leads.length) {
content = <LeadList leads={this.state.leads} more={this.loadMore} log={this.log} showMore={this.state.showMore}></LeadList>;
} else if (this.context.partner.id === -1) {
content = <div>Add the contact to your database to be able to create opportunities</div>
content = <div className='add-to-db-txt'>Add the contact to create opportunities</div>
}

return (
Expand Down
6 changes: 3 additions & 3 deletions outlook/src/taskpane/components/Login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ class Login extends React.Component<LoginProps, LoginState> {
<DefaultButton className="full-width odoo-clear-button" text='Sign up' onClick={this.signup}/>

<div className='login-info'>
<div className='login-info-icon'><FontAwesomeIcon icon={faEnvelope} size="2x" /></div>
<div className='login-info-icon'><FontAwesomeIcon icon={faEnvelope} size="2x" className="fa-fw"/></div>
<div>Create leads from Emails sent to your personal email address.</div>
</div>
<div className='login-info'>
<div className='login-info-icon'><FontAwesomeIcon icon={faHandshake} size="2x" /></div>
<div className='login-info-icon'><FontAwesomeIcon icon={faHandshake} size="2x" className="fa-fw"/></div>
<div>Centralize Prospects&apos; emails into a CRM.</div>
</div>
<div className='login-info'>
<div className='login-info-icon'><FontAwesomeIcon icon={faSearch} size="2x" /></div>
<div className='login-info-icon'><FontAwesomeIcon icon={faSearch} size="2x" className="fa-fw"/></div>
<div>Search and store insights on your contacts.</div>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions outlook/src/taskpane/components/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Main extends React.Component<MainProps, MainState> {
const parsed = JSON.parse(response);
var partner = PartnerData.fromJSON(parsed.result.partner);
this.setState({
EnrichmentInfo: EnrichmentInfo.fromJSON(parsed.result['enrichment_info']),
EnrichmentInfo: new EnrichmentInfo(parsed.result['enrichment_info'].type, parsed.result['enrichment_info'].info),
partnerCreated: parsed.result['created'],
showEnrichmentInfoMessage: true,
showPartnerCreatedMessage: true
Expand Down Expand Up @@ -131,9 +131,11 @@ class Main extends React.Component<MainProps, MainState> {
this.context.addRequestCanceller(cancellableRequest.cancel);
cancellableRequest.promise.then(response => {
const parsed = JSON.parse(response);
if ('error' in parsed) {
//if ('error' in parsed) {
if ('error' in parsed.result) {
this.setState({
EnrichmentInfo: new EnrichmentInfo(parsed.error.data.exception_type) ,
//EnrichmentInfo: new EnrichmentInfo(parsed.error.data.exception_type), // TODO: investigate
EnrichmentInfo: new EnrichmentInfo(parsed.result.error),
showEnrichmentInfoMessage: true
});
this.context.setPartner(partner, false);
Expand Down Expand Up @@ -191,6 +193,7 @@ class Main extends React.Component<MainProps, MainState> {
//setTimeout(this._hideEnrichmentInfoMessage, 3500);
break;
case EnrichmentInfoType.NoData:
case EnrichmentInfoType.NotConnected_NoData:
bars.push(<MessageBar messageBarType={MessageBarType.info} onDismiss={this._hideEnrichmentInfoMessage}>{info}</MessageBar>);
break;
case EnrichmentInfoType.InsufficientCredit:
Expand Down

0 comments on commit 567a9ed

Please sign in to comment.