"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/app/settings/Provider.js" between
mailvelope-4.2.0.tar.gz and mailvelope-4.2.1.tar.gz

About: Mailvelope is a browser extension offering email encryption with PGP (for Firefox and Chrome).

Provider.js  (mailvelope-4.2.0):Provider.js  (mailvelope-4.2.1)
skipping to change at line 26 skipping to change at line 26
const GMAIL_SCOPE_READONLY = 'https://www.googleapis.com/auth/gmail.readonly'; const GMAIL_SCOPE_READONLY = 'https://www.googleapis.com/auth/gmail.readonly';
const GMAIL_SCOPE_SEND = 'https://www.googleapis.com/auth/gmail.send'; const GMAIL_SCOPE_SEND = 'https://www.googleapis.com/auth/gmail.send';
l10n.register([ l10n.register([
'alert_header_important', 'alert_header_important',
'alert_header_warning', 'alert_header_warning',
'form_cancel', 'form_cancel',
'form_save', 'form_save',
'keygrid_user_email', 'keygrid_user_email',
'provider_gmail_auth', 'provider_gmail_auth',
'provider_gmail_auth_cancel_btn',
'provider_gmail_auth_dialog_intro', 'provider_gmail_auth_dialog_intro',
'provider_gmail_auth_dialog_outro', 'provider_gmail_auth_dialog_outro',
'provider_gmail_auth_dialog_title', 'provider_gmail_auth_dialog_title',
'provider_gmail_auth_readonly', 'provider_gmail_auth_readonly',
'provider_gmail_auth_send', 'provider_gmail_auth_send',
'provider_gmail_auth_table_title',
'provider_gmail_integration', 'provider_gmail_integration',
'provider_gmail_integration_info', 'provider_gmail_integration_info',
'provider_gmail_integration_warning', 'provider_gmail_integration_warning',
'settings_provider' 'settings_provider'
]); ]);
const GMAIL_MATCH_PATTERN = '*.mail.google.com'; const GMAIL_MATCH_PATTERN = '*.mail.google.com';
export default class Provider extends React.Component { export default class Provider extends React.Component {
constructor(props) { constructor(props) {
skipping to change at line 63 skipping to change at line 65
componentDidMount() { componentDidMount() {
this.loadPrefs().then(() => { this.loadPrefs().then(() => {
if (/\/auth$/.test(this.props.location.pathname)) { if (/\/auth$/.test(this.props.location.pathname)) {
getAppDataSlot() getAppDataSlot()
.then(data => this.openOAuthDialog(data)); .then(data => this.openOAuthDialog(data));
} }
}); });
} }
openOAuthDialog({email, scopes, gmailCtrlId, ctrlId}) { openOAuthDialog({email, scopes, gmailCtrlId}) {
this.setState({showAuthModal: true, authMessage: this.getAuthMessage(email, scopes), authModalCallback: async () => { this.setState({showAuthModal: true, authMessage: this.getAuthMessage(email, scopes), authModalCallback: async () => {
try { try {
await port.send('authorize-gmail', {email, scopes, gmailCtrlId}); await port.send('authorize-gmail', {email, scopes, gmailCtrlId});
await this.loadAuthorisations(); await this.loadAuthorisations();
this.setState({showAuthModal: false}); this.setState({showAuthModal: false});
} catch (error) { } catch (error) {
this.props.onSetNotification({header: l10n.map.alert_header_warning, mes sage: error.message, type: 'error', hideDelay: 10000}); this.props.onSetNotification({header: l10n.map.alert_header_warning, mes sage: error.message, type: 'error', hideDelay: 10000});
this.setState({showAuthModal: false, gmail_integration: false}, () => th is.handleSave()); this.setState({showAuthModal: false});
} }
}, authModalClose: () => this.setState({showAuthModal: false}, () => port.em it('activate-component', {ctrlId}))}); }, authModalClose: () => this.setState({showAuthModal: false, gmail_integrat ion: false}, () => this.handleSave())});
} }
getAuthText(authorisation) { getAuthText(authorisation) {
let text; let text;
switch (authorisation) { switch (authorisation) {
case GMAIL_SCOPE_READONLY: case GMAIL_SCOPE_READONLY:
text = l10n.map.provider_gmail_auth_readonly; text = l10n.map.provider_gmail_auth_readonly;
break; break;
case GMAIL_SCOPE_SEND: case GMAIL_SCOPE_SEND:
text = l10n.map.provider_gmail_auth_send; text = l10n.map.provider_gmail_auth_send;
skipping to change at line 192 skipping to change at line 194
<strong key="0">{GMAIL_MATCH_PATTERN}</strong>, <strong key="0">{GMAIL_MATCH_PATTERN}</strong>,
<Link key="1" to="/settings/watchlist">{l10n.map.dashboard_lin k_manage_domains}</Link> <Link key="1" to="/settings/watchlist">{l10n.map.dashboard_lin k_manage_domains}</Link>
]} /> ]} />
</Alert> </Alert>
)} )}
{this.state.gmail && ( {this.state.gmail && (
<Alert className="mt-2" type="info" header={l10n.map.alert_header_ important}> <Alert className="mt-2" type="info" header={l10n.map.alert_header_ important}>
{l10n.map.provider_gmail_integration_info} <a href="https://www. mailvelope.com/faq#gmail_permissions" target="_blank" rel="noopener noreferrer"> {l10n.map.learn_more_link}</a> {l10n.map.provider_gmail_integration_info} <a href="https://www. mailvelope.com/faq#gmail_permissions" target="_blank" rel="noopener noreferrer"> {l10n.map.learn_more_link}</a>
</Alert> </Alert>
)} )}
<p className="lead mt-3">Authorisierungen</p> <p className="lead mt-3">{l10n.map.provider_gmail_auth_table_title}< /p>
<div className="table-responsive"> <div className="table-responsive">
<table className="table table-hover table-custom mb-0"> <table className="table table-hover table-custom mb-0">
<thead> <thead>
<tr> <tr>
<th>{l10n.map.keygrid_user_email}</th> <th>{l10n.map.keygrid_user_email}</th>
<th>{l10n.map.provider_gmail_auth}</th> <th>{l10n.map.provider_gmail_auth}</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{this.state.gmail_authorized_emails.map((entry, index) => {this.state.gmail_authorized_emails.map((entry, index) =>
<tr key={index}> <tr key={index}>
<td>{entry.email}</td> <td>{entry.email}</td>
<td>{entry.scope.split(' ').map(val => this.getAuthText(va l)).filter(val => val !== '').join(', ')}</td> <td>{entry.scope.split(' ').map(val => this.getAuthText(va l)).filter(val => val !== '').join(', ')}</td>
<td className="text-center"> <td className="text-center">
<div className="actions"> <div className="actions">
<button type="button" onClick={e => { e.stopPropagatio n(); this.removeAuthorisation(entry.email); }} className="btn btn-secondary">Aut horisierung aufheben</button> <button type="button" onClick={e => { e.stopPropagatio n(); this.removeAuthorisation(entry.email); }} className="btn btn-secondary">{l1 0n.map.provider_gmail_auth_cancel_btn}</button>
</div> </div>
</td> </td>
</tr> </tr>
)} )}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div className="btn-bar"> <div className="btn-bar">
<button type="button" onClick={this.handleSave} className="btn btn-p rimary" disabled={!this.state.modified}>{l10n.map.form_save}</button> <button type="button" onClick={this.handleSave} className="btn btn-p rimary" disabled={!this.state.modified}>{l10n.map.form_save}</button>
 End of changes. 7 change blocks. 
5 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)