1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Mobile: Handle encrypted items on UI side

This commit is contained in:
Laurent Cozic
2017-12-28 19:57:21 +00:00
parent 9e869a5b1f
commit d180e7b5e1
7 changed files with 23 additions and 10 deletions

View File

@@ -81,6 +81,7 @@ class NoteItemComponent extends Component {
onPress() {
if (!this.props.note) return;
if (!!this.props.note.encryption_applied) return;
if (this.props.noteSelectionEnabled) {
this.props.dispatch({
@@ -141,7 +142,7 @@ class NoteItemComponent extends Component {
checked={checkboxChecked}
onChange={(checked) => this.todoCheckbox_change(checked)}
/>
<Text style={listItemTextStyle}>{note.title}</Text>
<Text style={listItemTextStyle}>{Note.displayTitle(note)}</Text>
</View>
</View>
</View>

View File

@@ -95,10 +95,13 @@ class NotesScreenComponent extends BaseScreenComponent {
if (this.props.notesParentType == 'Folder') {
if (this.props.selectedFolderId == Folder.conflictFolderId()) return [];
return [
{ title: _('Delete notebook'), onPress: () => { this.deleteFolder_onPress(this.props.selectedFolderId); } },
{ title: _('Edit notebook'), onPress: () => { this.editFolder_onPress(this.props.selectedFolderId); } },
];
const folder = this.parentItem();
let output = [];
if (!folder.encryption_applied) output.push({ title: _('Edit notebook'), onPress: () => { this.editFolder_onPress(this.props.selectedFolderId); } });
output.push({ title: _('Delete notebook'), onPress: () => { this.deleteFolder_onPress(this.props.selectedFolderId); } });
return output;
} else {
return []; // For tags - TODO
}

View File

@@ -5,6 +5,7 @@ const Icon = require('react-native-vector-icons/Ionicons').default;
const { Log } = require('lib/log.js');
const Tag = require('lib/models/Tag.js');
const Note = require('lib/models/Note.js');
const Folder = require('lib/models/Folder.js');
const Setting = require('lib/models/Setting.js');
const { FoldersScreenUtils } = require('lib/folders-screen-utils.js');
const { Synchronizer } = require('lib/synchronizer.js');
@@ -117,7 +118,7 @@ class SideMenuContentComponent extends Component {
<TouchableOpacity key={folder.id} onPress={() => { this.folder_press(folder) }}>
<View style={folderButtonStyle}>
{ iconComp }
<Text numberOfLines={1} style={this.styles().folderButtonText}>{folder.title}</Text>
<Text numberOfLines={1} style={this.styles().folderButtonText}>{Folder.displayTitle(folder)}</Text>
</View>
</TouchableOpacity>
);
@@ -131,7 +132,7 @@ class SideMenuContentComponent extends Component {
<TouchableOpacity key={tag.id} onPress={() => { this.tag_press(tag) }}>
<View style={tagButtonStyle}>
{ iconComp }
<Text numberOfLines={1} style={this.styles().tagButtonText}>{tag.title}</Text>
<Text numberOfLines={1} style={this.styles().tagButtonText}>{Tag.displayTitle(tag)}</Text>
</View>
</TouchableOpacity>
);