fix: note comparison in template
This commit is contained in:
@@ -319,9 +319,9 @@ class AccountMenuCtrl extends PureViewCtrl {
|
||||
}
|
||||
|
||||
async openPrivilegesModal() {
|
||||
this.close();
|
||||
const run = () => {
|
||||
this.application!.presentPrivilegesManagementModal();
|
||||
this.close();
|
||||
};
|
||||
const needsPrivilege = await this.application!.privilegesService!.actionRequiresPrivilege(
|
||||
ProtectedAction.ManagePrivileges
|
||||
|
||||
@@ -90,21 +90,18 @@ class RevisionPreviewModalCtrl implements RevisionPreviewScope {
|
||||
|
||||
restore(asCopy: boolean) {
|
||||
const run = async () => {
|
||||
let item;
|
||||
if (asCopy) {
|
||||
const contentCopy = Object.assign({}, this.content);
|
||||
if (contentCopy.title) {
|
||||
contentCopy.title += " (copy)";
|
||||
}
|
||||
item = await this.application.createManagedItem(
|
||||
await this.application.createManagedItem(
|
||||
ContentType.Note,
|
||||
contentCopy,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
const uuid = this.uuid;
|
||||
item = this.application.findItem(uuid)!;
|
||||
this.application.changeAndSaveItem(item.uuid, (mutator) => {
|
||||
this.application.changeAndSaveItem(this.uuid, (mutator) => {
|
||||
mutator.setContent(this.content);
|
||||
}, true, PayloadSource.RemoteActionRetrieved);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
)
|
||||
.note(
|
||||
ng-repeat='note in self.state.renderedNotes track by note.uuid'
|
||||
ng-class="{'selected' : self.activeEditorNote == note}"
|
||||
ng-class="{'selected' : self.activeEditorNote.uuid == note.uuid}"
|
||||
ng-click='self.selectNote(note)'
|
||||
)
|
||||
.note-flags(ng-show='self.noteFlags[note.uuid].length > 0')
|
||||
|
||||
@@ -4,15 +4,13 @@ import { SNComponent, LiveItem } from 'snjs';
|
||||
import { WebDirective } from './../../types';
|
||||
export declare type ComponentModalScope = {
|
||||
componentUuid: string;
|
||||
callback: () => void;
|
||||
onDismiss: (component: SNComponent) => void;
|
||||
onDismiss: () => void;
|
||||
application: WebApplication;
|
||||
};
|
||||
export declare class ComponentModalCtrl implements ComponentModalScope {
|
||||
$element: JQLite;
|
||||
componentUuid: string;
|
||||
callback: () => void;
|
||||
onDismiss: (component: SNComponent) => void;
|
||||
onDismiss: () => void;
|
||||
application: WebApplication;
|
||||
liveComponent: LiveItem<SNComponent>;
|
||||
component: SNComponent;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
export { AccountMenu } from './accountMenu';
|
||||
export { ActionsMenu } from './actionsMenu';
|
||||
export { ChallengeModal } from './challengeModal';
|
||||
export { ComponentModal } from './componentModal';
|
||||
export { ComponentView } from './componentView';
|
||||
export { EditorMenu } from './editorMenu';
|
||||
|
||||
@@ -2,12 +2,12 @@ import { WebApplication } from '@/ui_models/application';
|
||||
import { ApplicationService, WebPrefKey } from 'snjs';
|
||||
export declare class PreferencesManager extends ApplicationService {
|
||||
private userPreferences;
|
||||
private loadingPrefs;
|
||||
/** @override */
|
||||
onAppLaunch(): Promise<void>;
|
||||
get webApplication(): WebApplication;
|
||||
streamPreferences(): void;
|
||||
loadSingleton(): Promise<void>;
|
||||
preferencesDidChange(): void;
|
||||
private loadSingleton;
|
||||
syncUserPreferences(): void;
|
||||
getValue(key: WebPrefKey, defaultValue?: any): any;
|
||||
setUserPrefValue(key: WebPrefKey, value: any, sync?: boolean): Promise<void>;
|
||||
|
||||
@@ -8,6 +8,7 @@ export declare class Editor {
|
||||
private removeStreamObserver;
|
||||
isTemplateNote: boolean;
|
||||
constructor(application: WebApplication, noteUuid?: string, noteTitle?: string);
|
||||
deinit(): void;
|
||||
private handleNoteStream;
|
||||
insertTemplatedNote(): Promise<import("../../../../../snjs/dist/@types").SNItem>;
|
||||
/**
|
||||
@@ -15,7 +16,6 @@ export declare class Editor {
|
||||
* and creating a placeholder note.
|
||||
*/
|
||||
reset(noteTitle?: string): Promise<void>;
|
||||
deinit(): void;
|
||||
/**
|
||||
* Register to be notified when the editor's note changes.
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ export declare class EditorGroup {
|
||||
/**
|
||||
* Notifies observer when the active editor has changed.
|
||||
*/
|
||||
addChangeObserver(callback: EditorGroupChangeCallback): void;
|
||||
addChangeObserver(callback: EditorGroupChangeCallback): () => void;
|
||||
private notifyObservers;
|
||||
}
|
||||
export {};
|
||||
|
||||
4
dist/@types/app/assets/javascripts/views/challenge_modal/challenge_modal.d.ts
vendored
Normal file
4
dist/@types/app/assets/javascripts/views/challenge_modal/challenge_modal.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { WebDirective } from '@/types';
|
||||
export declare class ChallengeModal extends WebDirective {
|
||||
constructor();
|
||||
}
|
||||
@@ -6,3 +6,4 @@ export { EditorView } from './editor/editor_view';
|
||||
export { FooterView } from './footer/footer_view';
|
||||
export { NotesView } from './notes/notes_view';
|
||||
export { TagsView } from './tags/tags_view';
|
||||
export { ChallengeModal } from './challenge_modal/challenge_modal';
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { SNNote, SNTag } from 'snjs';
|
||||
export declare enum NoteSortKey {
|
||||
CreatedAt = "created_at",
|
||||
UserUpdatedAt = "userModifiedDate",
|
||||
Title = "title",
|
||||
/** @legacy Use UserUpdatedAt instead */
|
||||
UpdatedAt = "updated_at",
|
||||
ClientUpdatedAt = "client_updated_at",
|
||||
Title = "title"
|
||||
/** @legacy Use UserUpdatedAt instead */
|
||||
ClientUpdatedAt = "client_updated_at"
|
||||
}
|
||||
export declare function filterAndSortNotes(notes: SNNote[], selectedTag: SNTag, showArchived: boolean, hidePinned: boolean, filterText: string, sortBy: string, reverse: boolean): SNNote[];
|
||||
export declare function filterNotes(notes: SNNote[], selectedTag: SNTag, showArchived: boolean, hidePinned: boolean, filterText: string): SNNote[];
|
||||
export declare function sortNotes(notes: SNNote[] | undefined, sortBy: string, reverse: boolean): SNNote[];
|
||||
export declare function notePassesFilter(note: SNNote, selectedTag: SNTag, showArchived: boolean, hidePinned: boolean, filterText: string): boolean;
|
||||
|
||||
36
dist/javascripts/app.js
vendored
36
dist/javascripts/app.js
vendored
File diff suppressed because one or more lines are too long
2
dist/javascripts/app.js.map
vendored
2
dist/javascripts/app.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user