1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

metadata copy and paste cell (#6472)

This commit is contained in:
Michael An
2024-08-02 16:15:38 +08:00
committed by GitHub
parent 7934cfe2ed
commit 6ce8336e9a
13 changed files with 692 additions and 45 deletions

View File

@@ -3,6 +3,7 @@ import { UserService, LocalStorage, PRIVATE_COLUMN_KEYS, EDITABLE_DATA_PRIVATE_C
EDITABLE_PRIVATE_COLUMN_KEYS, PREDEFINED_COLUMN_KEYS } from './_basic';
import EventBus from '../../components/common/event-bus';
import { username } from '../../utils/constants';
import User from './model/user';
class Context {
@@ -14,6 +15,7 @@ class Context {
this.eventBus = null;
this.hasInit = false;
this.permission = 'r';
this.collaboratorsCache = {};
}
async init({ otherSettings }) {
@@ -128,9 +130,22 @@ class Context {
return true;
};
getCollaboratorsFromCache = () => {
//
};
getCollaboratorFromCache(email) {
return this.collaboratorsCache[email];
}
getCollaboratorsFromCache() {
const collaboratorsCache = this.collaboratorsCache;
return Object.values(collaboratorsCache).filter(item => item.email !== 'anonymous');
}
updateCollaboratorsCache(email, collaborator) {
if (collaborator instanceof User) {
this.collaboratorsCache[email] = collaborator;
return;
}
this.collaboratorsCache[email] = new User(collaborator);
}
restoreRows = () => {
// todo