Skip to content
Merged

Update #1142

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion electron_app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "criptext",
"version": "0.23.1",
"version": "0.23.2",
"author": {
"name": "Criptext Inc",
"email": "support@criptext.com",
Expand Down
18 changes: 17 additions & 1 deletion email_login/src/components/PanelWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import PopupHOC from './PopupHOC';
import ForgotPasswordPopup from './ForgotPasswordPopup';
import DialogPopup, { DialogTypes } from './DialogPopup';
import { ButtonState } from './Button';
import { toCapitalize } from './../utils/StringUtils';
import {
createTemporalAccount,
deleteTemporalAccount,
Expand All @@ -21,6 +22,7 @@ import {
closeLoginWindow,
getAccountByParams,
getComputerName,
getOsAndArch,
linkAuth,
linkBegin,
linkStatus,
Expand All @@ -33,6 +35,7 @@ import { DEVICE_TYPE, appDomain } from '../utils/const';
import DeviceNotApproved from './DeviceNotApproved';
import { hashPassword } from '../utils/HashUtils';
import string, { getLang } from './../lang';
import { version } from './../../package.json';
import './panelwrapper.scss';

const { errors, help, signIn, signUp } = string;
Expand Down Expand Up @@ -92,6 +95,7 @@ class PanelWrapper extends Component {
super();
this.state = {
buttonSignInState: ButtonState.DISABLED,
contactURL: '',
currentStep: mode.SIGNIN,
lastStep: [mode.SIGNIN],
mode: mode.SIGNIN,
Expand Down Expand Up @@ -126,14 +130,19 @@ class PanelWrapper extends Component {
);
}

async componentDidMount() {
const contactURL = await this.defineContactURL();
this.setState({ contactURL });
}

renderFooter = () => (
<footer>
<span>
{help.need_help}
&nbsp;
<a
className="footer-link"
href={`https://criptext.com/${getLang}/contact/`}
href={this.state.contactURL}
// eslint-disable-next-line react/jsx-no-target-blank
target="_blank"
>
Expand Down Expand Up @@ -540,6 +549,13 @@ class PanelWrapper extends Component {
: `${usernameOrEmailAddress}@${appDomain}`;
};

defineContactURL = async () => {
const { os, arch, installerType } = await getOsAndArch();
return `https://criptext.com/${getLang}/contact?version=${version}&os=${toCapitalize(
os
)}&installer=${installerType}&arch=${arch}`;
};

goToPasswordLogin = () => {
this.setState(state => ({
buttonSignInState: ButtonState.ENABLED,
Expand Down
12 changes: 12 additions & 0 deletions email_login/src/utils/StringUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,15 @@ export const replaceCharacters = (string, positionsToExclude, character) => {
return replacedString;
}
};

export const toCapitalize = (string, eachWord) => {
if (!eachWord) {
return string.replace(/\b\w/g, firstLetter => firstLetter.toUpperCase());
}
return string
.split(' ')
.map(word =>
word.replace(/\b\w/g, firstLetter => firstLetter.toUpperCase())
)
.join(' ');
};
2 changes: 2 additions & 0 deletions email_login/src/utils/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const closeLoginWindow = () => {

export const getComputerName = () => callMain('get-computer-name');

export const getOsAndArch = () => callMain('get-os-and-arch');

export const isWindows = () => callMain('get-isWindows');

export const minimizeLoginWindow = () => {
Expand Down
2 changes: 1 addition & 1 deletion email_mailbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "email_mailbox",
"version": "0.23.1",
"version": "0.23.2",
"private": true,
"dependencies": {
"@criptext/electron-better-ipc": "^0.1.2-rc5",
Expand Down