Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/3.6.18' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed Jul 5, 2021
2 parents 6f26c52 + 3f0d6bd commit f5f6df0
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 18 deletions.
8 changes: 4 additions & 4 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "StandardNotes",
"version": "3.6.17",
"user-version": "3.6.17",
"version": "3.6.18",
"user-version": "3.6.18",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"@standardnotes/sncrypto-common": "1.2.9",
"@standardnotes/snjs": "2.7.9",
"@standardnotes/snjs": "2.7.14",
"js-base64": "^3.5.2",
"moment": "^2.29.1",
"react": "17.0.1",
Expand All @@ -41,7 +41,7 @@
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.9.0",
"react-native-keychain": "^4.0.5",
"react-native-mail": "standardnotes/react-native-mail#f7f74be",
"react-native-mail": "standardnotes/react-native-mail#fd26119e67a2ffc5eaa95a9c17049743e39ce2d3",
"react-native-privacy-snapshot": "standardnotes/react-native-privacy-snapshot#653e904",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.1.9",
Expand Down
11 changes: 4 additions & 7 deletions src/lib/backups_service.ts
Expand Up @@ -91,19 +91,16 @@ export class BackupsService extends ApplicationService {
}

private async _exportAndroid(filename: string, data: string) {
const filepath = `${RNFS.DownloadDirectoryPath}/${filename}`;
try {
let filepath = `${RNFS.ExternalDirectoryPath}/${filename}`;
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
await RNFS.writeFile(filepath, data);
this._showFileSavePromptAndroid(filepath);
} else {
this.application.alertService.alert(
'We need permission to write to the external storage in order to save your backup file.'
);
filepath = `${RNFS.DownloadDirectoryPath}/${filename}`;
}
await RNFS.writeFile(filepath, data);
this._showFileSavePromptAndroid(filepath);
} catch (err) {
console.log('Error exporting backup', err);
this.application.alertService.alert(
Expand Down
25 changes: 24 additions & 1 deletion src/screens/Compose/ComponentView.styled.ts
@@ -1,4 +1,4 @@
import { ICON_LOCK } from '@Style/icons';
import { ICON_LOCK, ICON_ALERT } from '@Style/icons';
import { ThemeService } from '@Style/theme_service';
import { SafeAreaView } from 'react-native-safe-area-context';
import Icon from 'react-native-vector-icons/Ionicons';
Expand Down Expand Up @@ -45,3 +45,26 @@ export const StyledIcon = styled(Icon).attrs(({ theme }) => ({
size: 16,
name: ThemeService.nameForIcon(ICON_LOCK),
}))``;

export const DeprecatedContainer = styled.View`
justify-content: flex-start;
flex-direction: row;
align-items: center;
padding: 10px;
background-color: ${({ theme }) => theme.stylekitWarningColor};
border-bottom-color: ${({ theme }) => theme.stylekitBorderColor};
border-bottom-width: 1px;
`;

export const DeprecatedText = styled.Text`
font-weight: bold;
font-size: 12px;
color: ${({ theme }) => theme.stylekitBackgroundColor};
padding-left: 10px;
`;

export const DeprecatedIcon = styled(Icon).attrs(({ theme }) => ({
color: theme.stylekitBackgroundColor,
size: 16,
name: ThemeService.nameForIcon(ICON_ALERT),
}))``;
16 changes: 16 additions & 0 deletions src/screens/Compose/ComponentView.tsx
Expand Up @@ -24,6 +24,9 @@ import {
WebViewMessageEvent,
} from 'react-native-webview/lib/WebViewTypes';
import {
DeprecatedContainer,
DeprecatedIcon,
DeprecatedText,
FlexContainer,
LockedContainer,
LockedText,
Expand Down Expand Up @@ -221,6 +224,9 @@ export const ComponentView = ({
})()`;
};

const deprecationMessage =
liveComponent?.item.package_info.deprecation_message;

return (
<FlexContainer>
{liveComponent?.item.valid_until &&
Expand All @@ -233,6 +239,16 @@ export const ComponentView = ({
</LockedText>
</LockedContainer>
)}

{liveComponent?.item.isDeprecated && (
<DeprecatedContainer>
<DeprecatedIcon />
<DeprecatedText>
{deprecationMessage || 'This extension is deprecated.'}
</DeprecatedText>
</DeprecatedContainer>
)}

{Boolean(url) && (
<StyledWebview
showWebView={showWebView}
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Expand Up @@ -1630,10 +1630,10 @@
resolved "https://registry.yarnpkg.com/@standardnotes/sncrypto-common/-/sncrypto-common-1.2.9.tgz#5212a959e4ec563584e42480bfd39ef129c3cbdf"
integrity sha512-xJ5IUGOZztjSgNP/6XL+Ut5+q9UgSTv6xMtKkcQC5aJxCOkJy9u6RamPLdF00WQgwibxx2tu0e43bKUjTgzMig==

"@standardnotes/snjs@2.7.9":
version "2.7.9"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.7.9.tgz#8b2a5d0f6248e1872b2fe68a73307f754528b4c3"
integrity sha512-FNiLXdaUb2+WpCteTbfg/iiv4k0UXFzz57RnY1O8X40vEVFVY8VjrJuJxxwDuZqidUZeLIdTMlmfdKWoD+NRDA==
"@standardnotes/snjs@2.7.14":
version "2.7.14"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.7.14.tgz#3c1e57a53cfe61957bbcb253281c5c43611c9acf"
integrity sha512-xh71KLOCjodmVdrnNT0zfChB4fy3FaWMvWoh/5iso+myI6tQ8X59+gUM+VuNk9N9rwyItiBvq88BD82RUia8uQ==
dependencies:
"@standardnotes/auth" "^2.0.0"
"@standardnotes/sncrypto-common" "^1.2.9"
Expand Down Expand Up @@ -6847,9 +6847,9 @@ react-native-keychain@^4.0.5:
resolved "https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-4.0.5.tgz#6d3aef8f2789fc0dfa8149b8400d82ff77be361a"
integrity sha512-TbiO8AO055EPjaxIuKxrCEOB4r81uQCVDFbtcs+e4pEOHxf6z3JgDC0UU0poJElKfCh37b+TFRxQhg6DbsYJBA==

react-native-mail@standardnotes/react-native-mail#f7f74be:
react-native-mail@standardnotes/react-native-mail#fd26119e67a2ffc5eaa95a9c17049743e39ce2d3:
version "4.1.0"
resolved "https://codeload.github.com/standardnotes/react-native-mail/tar.gz/f7f74be22edef77bef6901ca2e2cd4eddc15bbc0"
resolved "https://codeload.github.com/standardnotes/react-native-mail/tar.gz/fd26119e67a2ffc5eaa95a9c17049743e39ce2d3"

react-native-privacy-snapshot@standardnotes/react-native-privacy-snapshot#653e904:
version "1.0.0"
Expand Down

0 comments on commit f5f6df0

Please sign in to comment.