Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

feat: upgrade dev version to `0.8.1` (#656)

boojacka467a7c17352
diff --git a/server/server.go b/server/server.go
index f821ed708..243f26adf 100644
--- a/server/server.go
+++ b/server/server.go
@@ -61,6 +61,9 @@ func NewServer(profile *profile.Profile) *Server {
rootGroup := e.Group("")
s.registerRSSRoutes(rootGroup)
+ webhookGroup := e.Group("/h")
+ s.registerResourcePublicRoutes(webhookGroup)
+
publicGroup := e.Group("/o")
s.registerResourcePublicRoutes(publicGroup)
s.registerGetterPublicRoutes(publicGroup)
diff --git a/server/version/version.go b/server/version/version.go
index fb57fea9f..74248d09d 100644
--- a/server/version/version.go
+++ b/server/version/version.go
@@ -7,10 +7,10 @@ import (
// Version is the service current released version.
// Semantic versioning: https://semver.org/
-var Version = "0.8.0"
+var Version = "0.8.1"
// DevVersion is the service current development version.
-var DevVersion = "0.8.0"
+var DevVersion = "0.8.1"
func GetCurrentVersion(mode string) string {
if mode == "dev" {
diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx
index 1b2883f64..1d7504a33 100644
--- a/web/src/components/Settings/MemberSection.tsx
+++ b/web/src/components/Settings/MemberSection.tsx
@@ -158,12 +158,10 @@ const PreferencesSection = () => {
<span className="tip-text">{t("common.yourself")}</span>
) : (
<Dropdown
- actionsClassName="!w-24"
- positionClassName="bottom-full right-0 mb-1"
actions={
<>
<button
- className="w-full text-left text-sm leading-6 py-1 px-3 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-zinc-600"
+ className="w-full text-left text-sm whitespace-nowrap leading-6 py-1 px-3 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-zinc-600"
onClick={() => handleChangePasswordClick(user)}
>
{t("setting.account-section.change-password")}
@@ -184,7 +182,7 @@ const PreferencesSection = () => {
{t("common.restore")}
</button>
<button
- className="w-full text-left text-sm leading-6 py-1 px-3 cursor-pointer rounded text-red-600 hover:bg-gray-100"
+ className="w-full text-left text-sm leading-6 py-1 px-3 cursor-pointer rounded text-red-600 hover:bg-gray-100 dark:hover:bg-zinc-600"
onClick={() => handleDeleteUserClick(user)}
>
{t("common.delete")}
diff --git a/web/src/helpers/consts.ts b/web/src/helpers/consts.ts
index 30f05a0d3..a305cf9fd 100644
--- a/web/src/helpers/consts.ts
+++ b/web/src/helpers/consts.ts
@@ -8,14 +8,14 @@ export const ANIMATION_DURATION = 200;
export const DAILY_TIMESTAMP = 3600 * 24 * 1000;
export const VISIBILITY_SELECTOR_ITEMS = [
- { text: "PUBLIC", value: "PUBLIC" },
- { text: "PROTECTED", value: "PROTECTED" },
{ text: "PRIVATE", value: "PRIVATE" },
+ { text: "PROTECTED", value: "PROTECTED" },
+ { text: "PUBLIC", value: "PUBLIC" },
];
export const MEMO_DISPLAY_TS_OPTION_SELECTOR_ITEMS = [
{ text: "created_ts", value: "created_ts" },
- { text: "created_ts", value: "updated_ts" },
+ { text: "updated_ts", value: "updated_ts" },
];
export const TAB_SPACE_WIDTH = 2;
diff --git a/web/src/less/memo-detail.less b/web/src/less/memo-detail.less
index 6f311db29..a31bc2bee 100644
--- a/web/src/less/memo-detail.less
+++ b/web/src/less/memo-detail.less
@@ -40,7 +40,7 @@
@apply relative flex-grow max-w-2xl w-full min-h-full flex flex-col justify-start items-start px-4;
> .memo-container {
- @apply flex flex-col justify-start items-start w-full p-4 mt-2 bg-white dark:bg-zinc-800 rounded-lg border border-white dark:border-zinc-800 hover:border-gray-200 dark:hover:border-zinc-700;
+ @apply flex flex-col justify-start items-start w-full p-4 mt-2 bg-white dark:bg-zinc-700 rounded-lg border border-white dark:border-zinc-800 hover:border-gray-200 dark:hover:border-zinc-700;
> .memo-header {
@apply mb-2 w-full flex flex-row justify-between items-center;
@@ -55,7 +55,7 @@
}
> .memo-content {
- @apply cursor-default dark:text-zinc-50;
+ @apply cursor-default;
> * {
@apply cursor-default;
diff --git a/web/src/less/memo-editor.less b/web/src/less/memo-editor.less
index fdbbdb9d1..45fe0e7f6 100644
--- a/web/src/less/memo-editor.less
+++ b/web/src/less/memo-editor.less
@@ -2,7 +2,7 @@
@apply relative w-full flex flex-col justify-start items-start bg-white dark:bg-zinc-700 px-4 rounded-lg border-2 border-gray-200 dark:border-zinc-600;
&.fullscreen {
- @apply transition-all fixed w-full h-full top-0 left-0 z-1000 border-none rounded-none sm:p-8;
+ @apply transition-all fixed w-full h-full top-0 left-0 z-1000 border-none rounded-none sm:p-8 dark:bg-zinc-800;
> .memo-editor {
@apply p-4 mb-4 rounded-lg border shadow-lg flex flex-col flex-grow justify-start items-start relative w-full h-full bg-white dark:bg-zinc-700 dark:border-zinc-600;
@@ -146,7 +146,7 @@
@apply grow-0 shrink-0 flex flex-row justify-end items-center;
> .cancel-btn {
- @apply mr-4 text-sm text-gray-600 hover:opacity-80;
+ @apply mr-4 text-sm text-gray-500 hover:opacity-80 dark:text-gray-300;
}
> .confirm-btn {
diff --git a/web/src/less/resources-selector-dialog.less b/web/src/less/resources-selector-dialog.less
index afc4b225b..2c31c91c3 100644
--- a/web/src/less/resources-selector-dialog.less
+++ b/web/src/less/resources-selector-dialog.less
@@ -7,30 +7,6 @@
> .dialog-content-container {
@apply flex flex-col justify-start items-start w-full;
- > .action-buttons-container {
- @apply w-full flex flex-row justify-between items-center mb-2;
-
- > .buttons-wrapper {
- @apply flex flex-row justify-start items-center;
-
- > .upload-resource-btn {
- @apply text-sm cursor-pointer px-3 py-1 rounded flex flex-row justify-center items-center border border-blue-600 text-blue-600 bg-blue-50 hover:opacity-80;
-
- > .icon-img {
- @apply w-4 h-auto mr-1;
- }
- }
-
- > .delete-unused-resource-btn {
- @apply text-sm cursor-pointer px-3 py-1 rounded flex flex-row justify-center items-center border border-red-600 text-red-600 bg-red-100 hover:opacity-80;
-
- > .icon-img {
- @apply w-4 h-auto mr-1;
- }
- }
- }
- }
-
> .loading-text-container {
@apply flex flex-col justify-center items-center w-full h-32;
}
@@ -39,7 +15,7 @@
@apply flex flex-col justify-start items-start w-full;
> .fields-container {
- @apply px-2 py-2 w-full grid grid-cols-7 border-b;
+ @apply px-2 py-2 w-full grid grid-cols-7 border-b dark:border-b-gray-500;
> .field-text {
@apply font-mono text-gray-400;
@@ -51,7 +27,7 @@
}
> .resource-container {
- @apply px-2 py-2 w-full grid grid-cols-7;
+ @apply px-2 py-2 w-full grid grid-cols-7 dark:bg-zinc-700;
> .buttons-container {
@apply w-full flex flex-row justify-end items-center;
diff --git a/web/src/less/search-bar.less b/web/src/less/search-bar.less
index 3e7243c74..06a67a646 100644
--- a/web/src/less/search-bar.less
+++ b/web/src/less/search-bar.less
@@ -21,11 +21,11 @@
}
> .quickly-action-wrapper {
- @apply hidden absolute top-9 -right-2 p-2 w-80 z-10;
+ @apply hidden absolute top-9 -right-2 p-2 w-60 z-10;
> .quickly-action-container {
@apply flex flex-col justify-start items-start w-full bg-white dark:bg-zinc-700 px-4 py-3 rounded-lg;
- box-shadow: 0 0 8px 0 rgb(0 0 0 / 20%);
+ box-shadow: 0 0 8px 0 rgb(0 0 0 / 40%);
> .title-text {
@apply text-gray-600 dark:text-gray-400 text-xs;
@@ -45,7 +45,7 @@
@apply flex flex-row justify-start items-center leading-6;
.type-item {
- @apply cursor-pointer px-1 rounded dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-zinc-600;
+ @apply cursor-pointer px-2 rounded dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-zinc-600;
&.selected {
@apply !bg-green-600 text-white;
diff --git a/web/src/less/shortcut-list.less b/web/src/less/shortcut-list.less
index 566403a2d..db72071bd 100644
--- a/web/src/less/shortcut-list.less
+++ b/web/src/less/shortcut-list.less
@@ -31,7 +31,7 @@
&.active {
> .shortcut-text-container {
- @apply text-green-600;
+ @apply !text-green-600;
}
}
diff --git a/web/src/less/tag-list.less b/web/src/less/tag-list.less
index 9d957ecef..57c8be410 100644
--- a/web/src/less/tag-list.less
+++ b/web/src/less/tag-list.less
@@ -23,7 +23,7 @@
&.active {
> .tag-text-container {
- @apply text-green-600;
+ @apply !text-green-600;
}
}
diff --git a/web/src/locales/en.json b/web/src/locales/en.json
index 3b4656b9d..3169195eb 100644
--- a/web/src/locales/en.json
+++ b/web/src/locales/en.json
@@ -96,7 +96,7 @@
"view-detail": "View Detail",
"copy": "Copy",
"visibility": {
- "private": "Private",
+ "private": "Only visible to you",
"protected": "Visible to members",
"public": "Everyone can see"
}
diff --git a/web/src/pages/Auth.tsx b/web/src/pages/Auth.tsx
index 001cee2af..693380ca2 100644
--- a/web/src/pages/Auth.tsx
+++ b/web/src/pages/Auth.tsx
@@ -136,7 +136,7 @@ const Auth = () => {
<div className="action-btns-container">
{systemStatus?.host ? (
<>
- {actionBtnLoadingState.isLoading && <Icon.Loader className="w-4 h-auto mr-2 animate-spin" />}
+ {actionBtnLoadingState.isLoading && <Icon.Loader className="w-4 h-auto mr-2 animate-spin dark:text-gray-300" />}
{systemStatus?.allowSignUp && (
<>
<button
diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx
index e0e32d606..be51628e8 100644
--- a/web/src/pages/MemoDetail.tsx
+++ b/web/src/pages/MemoDetail.tsx
@@ -1,4 +1,3 @@
-import copy from "copy-to-clipboard";
import dayjs from "dayjs";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
@@ -7,9 +6,7 @@ import { memoService } from "../services";
import { UNKNOWN_ID } from "../helpers/consts";
import { useAppSelector } from "../store";
import useLoading from "../hooks/useLoading";
-import Icon from "../components/Icon";
import toastHelper from "../components/Toast";
-import Dropdown from "../components/common/Dropdown";
import MemoContent from "../components/MemoContent";
import MemoResources from "../components/MemoResources";
import "../less/memo-detail.less";
@@ -48,11 +45,6 @@ const MemoDetail = () => {
}
}, [location]);
- const handleCopyContent = () => {
- copy(state.memo.content);
- toastHelper.success(t("message.succeed-copy-content"));
- };
-
return (
<section className="page-wrapper memo-detail">
<div className="page-container">
@@ -87,20 +79,6 @@ const MemoDetail = () => {
@{state.memo.creator.nickname || state.memo.creator.username}
</a>
</div>
- <Dropdown
- trigger={<Icon.MoreHorizontal className="ml-2 w-4 h-auto cursor-pointer text-gray-500" />}
- actionsClassName="!w-32"
- actions={
- <>
- <button
- className="w-full flex flex-row justify-start items-center px-3 whitespace-nowrap text-sm text-left leading-8 cursor-pointer rounded hover:bg-gray-100"
- onClick={handleCopyContent}
- >
- {t("memo.copy")}
- </button>
- </>
- }
- />
</div>
<MemoContent className="memo-content" content={state.memo.content} onMemoContentClick={() => undefined} />
<MemoResources resourceList={state.memo.resourceList} />
diff --git a/web/src/theme/index.ts b/web/src/theme/index.ts
index 6dac7471d..2dae5fd99 100644
--- a/web/src/theme/index.ts
+++ b/web/src/theme/index.ts
@@ -2,6 +2,11 @@ import { extendTheme } from "@mui/joy";
const theme = extendTheme({
components: {
+ JoyButton: {
+ defaultProps: {
+ size: "sm",
+ },
+ },
JoySelect: {
defaultProps: {
size: "sm",