Skip to content

Commit

Permalink
feat: introduce "changed at" field (#251), closes #233
Browse files Browse the repository at this point in the history
- create new `changedAt` field on notes and tags
- the field differentiates content-editing update timestamps (`changedAt`) from all database writes to the records (`updatedAt`)
- the UI and sorting in the UI now focus on or default to `changedAt`
- generated code for GraphQL typings has changed settings
  • Loading branch information
neopostmodern authored Oct 26, 2024
1 parent 135946c commit b0eb966
Show file tree
Hide file tree
Showing 21 changed files with 2,414 additions and 823 deletions.
1 change: 1 addition & 0 deletions client/src/renderer/actions/userInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum ArchiveState {
export enum SortBy {
CREATED_AT = 'CREATED_AT',
UPDATED_AT = 'UPDATED_AT',
CHANGED_AT = 'CHANGED_AT',
}

export const REQUEST_LOGIN = 'REQUEST_LOGIN';
Expand Down
9 changes: 7 additions & 2 deletions client/src/renderer/components/EntityMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const EntityMetadata = ({
entity: {
createdAt: DateOrTimestamp;
updatedAt: DateOrTimestamp;
changedAt: DateOrTimestamp;
user: {
name: string;
};
Expand All @@ -32,9 +33,13 @@ const EntityMetadata = ({
</ButtonLike>
<ButtonLike
startIcon={<Edit />}
tooltip={`Updated at ${dateToCustomizedLongISO8061(entity.updatedAt)}`}
tooltip={`Changed at ${dateToCustomizedLongISO8061(
entity.changedAt
)} (last database update at ${dateToCustomizedLongISO8061(
entity.updatedAt
)})`}
>
Updated {dateToShortISO8601(entity.updatedAt)}
Changed {dateToShortISO8601(entity.changedAt)}
</ButtonLike>
</>
);
Expand Down
2 changes: 2 additions & 0 deletions client/src/renderer/containers/LinkPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const LINK_QUERY = gql`
_id
createdAt
updatedAt
changedAt
archivedAt
user {
...BaseUser
Expand All @@ -51,6 +52,7 @@ const UPDATE_LINK_MUTATION = gql`
_id
createdAt
updatedAt
changedAt
url
domain
name
Expand Down
1 change: 1 addition & 0 deletions client/src/renderer/containers/TagPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const UPDATE_TAG_MUTATION = gql`
name
createdAt
archivedAt
changedAt
description
tags {
_id
Expand Down
2 changes: 2 additions & 0 deletions client/src/renderer/containers/TextPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const TEXT_QUERY = gql`
_id
createdAt
updatedAt
changedAt
archivedAt
user {
...BaseUser
Expand All @@ -48,6 +49,7 @@ const UPDATE_TEXT_MUTATION = gql`
_id
createdAt
updatedAt
changedAt
archivedAt
name
description
Expand Down
Loading

0 comments on commit b0eb966

Please sign in to comment.