mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-05 23:54:25 +00:00
feat(project): add recent viewed files section to project folder tree (#348)
* feat(project): add recent viewed files section to project folder tree * feat(webui): disable toolbar buttons and context menu in recents page * test(core): optimize recents cap test execution time * feat(webui): show hint text in recents page top toolbar * feat(webui): rename recents section to Recently Viewed * refactor(core): consolidate recents methods into AssetService * fix(api): forward pagination parameters in folder children endpoint (#349) * fix(project-recents): scope views and disable recents mutations * fix(api): allow recent views in demo mode * fix(api): limit demo recent view exception to post
This commit is contained in:
+4
@@ -138,6 +138,10 @@ export * from "./team_members.js";
|
||||
export * from "./updated_ago.js";
|
||||
export * from "./all_files.js";
|
||||
export * from "./recently_deleted.js";
|
||||
export * from "./recents.js";
|
||||
export * from "./recents_toolbar_hint.js";
|
||||
export * from "./no_recent_files.js";
|
||||
export * from "./no_recent_files_description.js";
|
||||
export * from "./collections.js";
|
||||
export * from "./shares.js";
|
||||
export * from "./no_collections_yet.js";
|
||||
|
||||
+4
@@ -140,6 +140,10 @@ export * from './team_members.js'
|
||||
export * from './updated_ago.js'
|
||||
export * from './all_files.js'
|
||||
export * from './recently_deleted.js'
|
||||
export * from './recents.js'
|
||||
export * from './recents_toolbar_hint.js'
|
||||
export * from './no_recent_files.js'
|
||||
export * from './no_recent_files_description.js'
|
||||
export * from './collections.js'
|
||||
export * from './shares.js'
|
||||
export * from './no_collections_yet.js'
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No recently viewed files" |
|
||||
*
|
||||
* @param {No_Recent_FilesInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_recent_files: ((inputs?: No_Recent_FilesInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<No_Recent_FilesInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type No_Recent_FilesInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} No_Recent_FilesInputs */
|
||||
|
||||
const en_no_recent_files = /** @type {(inputs: No_Recent_FilesInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`No recently viewed files`)
|
||||
};
|
||||
|
||||
const zh_no_recent_files = /** @type {(inputs: No_Recent_FilesInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`暂无最近浏览文件`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "No recently viewed files" |
|
||||
*
|
||||
* @param {No_Recent_FilesInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_recent_files = /** @type {((inputs?: No_Recent_FilesInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<No_Recent_FilesInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_no_recent_files(inputs)
|
||||
return zh_no_recent_files(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Files you view in this project will appear here." |
|
||||
*
|
||||
* @param {No_Recent_Files_DescriptionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_recent_files_description: ((inputs?: No_Recent_Files_DescriptionInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<No_Recent_Files_DescriptionInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type No_Recent_Files_DescriptionInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} No_Recent_Files_DescriptionInputs */
|
||||
|
||||
const en_no_recent_files_description = /** @type {(inputs: No_Recent_Files_DescriptionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Files you view in this project will appear here.`)
|
||||
};
|
||||
|
||||
const zh_no_recent_files_description = /** @type {(inputs: No_Recent_Files_DescriptionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`您在此项目中查看的文件将显示在此处。`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Files you view in this project will appear here." |
|
||||
*
|
||||
* @param {No_Recent_Files_DescriptionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const no_recent_files_description = /** @type {((inputs?: No_Recent_Files_DescriptionInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<No_Recent_Files_DescriptionInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_no_recent_files_description(inputs)
|
||||
return zh_no_recent_files_description(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Recently Viewed" |
|
||||
*
|
||||
* @param {RecentsInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const recents: ((inputs?: RecentsInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<RecentsInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type RecentsInputs = {};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} RecentsInputs */
|
||||
|
||||
const en_recents = /** @type {(inputs: RecentsInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Recently Viewed`)
|
||||
};
|
||||
|
||||
const zh_recents = /** @type {(inputs: RecentsInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`最近浏览`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Recently Viewed" |
|
||||
*
|
||||
* @param {RecentsInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const recents = /** @type {((inputs?: RecentsInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<RecentsInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_recents(inputs)
|
||||
return zh_recents(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "This page displays the 100 most recent files you viewed in this project." |
|
||||
*
|
||||
* @param {Recents_Toolbar_HintInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const recents_toolbar_hint: ((inputs?: Recents_Toolbar_HintInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Recents_Toolbar_HintInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Recents_Toolbar_HintInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Recents_Toolbar_HintInputs */
|
||||
|
||||
const en_recents_toolbar_hint = /** @type {(inputs: Recents_Toolbar_HintInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`This page displays the 100 most recent files you viewed in this project.`)
|
||||
};
|
||||
|
||||
const zh_recents_toolbar_hint = /** @type {(inputs: Recents_Toolbar_HintInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`此页面显示您最近在当前项目中查看过的 100 个文件。`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "This page displays the 100 most recent files you viewed in this project." |
|
||||
*
|
||||
* @param {Recents_Toolbar_HintInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const recents_toolbar_hint = /** @type {((inputs?: Recents_Toolbar_HintInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Recents_Toolbar_HintInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_recents_toolbar_hint(inputs)
|
||||
return zh_recents_toolbar_hint(inputs)
|
||||
});
|
||||
Reference in New Issue
Block a user