mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #3168 from omnivore-app/fix/admin-groups
Add groups admin
This commit is contained in:
commit
848d50e15e
4 changed files with 78 additions and 2 deletions
|
|
@ -139,6 +139,7 @@
|
|||
<string name="highlights_list_error_msg_no_highlights">您尚未在此页面新增任何标记。</string>
|
||||
|
||||
<!-- ReaderPreferencesView -->
|
||||
<string name="reader_preferences_font">字体</string>
|
||||
<string name="reader_preferences_view_font_size">字型大小:</string>
|
||||
<string name="reader_preferences_view_margin">边距</string>
|
||||
<string name="reader_preferences_view_line_spacing">行距</string>
|
||||
|
|
@ -204,4 +205,21 @@
|
|||
<string name="settings_view_setting_row_terms_and_conditions">条款和条件</string>
|
||||
<string name="settings_view_setting_row_manage_account">管理帐户</string>
|
||||
<string name="settings_view_setting_row_logout">登出</string>
|
||||
|
||||
<!-- stock filters -->
|
||||
<string name="library_filter_inbox">收集箱</string>
|
||||
<string name="library_filter_non_feed">非订阅内容</string>
|
||||
<string name="library_filter_feeds">订阅内容</string>
|
||||
<string name="library_filter_newsletters">邮件简讯</string>
|
||||
<string name="library_filter_recommended">推荐</string>
|
||||
<string name="library_filter_all">所有内容</string>
|
||||
<string name="library_filter_archived">已归档</string>
|
||||
<string name="library_filter_highlighted">已高亮</string>
|
||||
<string name="library_filter_files">文档</string>
|
||||
|
||||
<!-- stock sorts -->
|
||||
<string name="library_sort_newest">从新到旧</string>
|
||||
<string name="library_sort_oldest">从旧到新</string>
|
||||
<string name="library_sort_recently_read">最近阅读</string>
|
||||
<string name="library_sort_recently_published">最近发布</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ const processSubscription = async (
|
|||
// use published or updated if isoDate is not available for atom feeds
|
||||
item.isoDate =
|
||||
item.isoDate || item.published || item.updated || item.created
|
||||
console.log('Processing feed item', item.links, item.isoDate)
|
||||
console.log('Processing feed item', item.links, item.isoDate, feed.feedUrl)
|
||||
|
||||
if (!item.links || item.links.length === 0) {
|
||||
console.log('Invalid feed item', item)
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ export const registerDatabase = async (secrets: any): Promise<Connection> => {
|
|||
Subscription,
|
||||
LibraryItem,
|
||||
UploadFile,
|
||||
Recommendation,
|
||||
GroupMembership,
|
||||
],
|
||||
})
|
||||
|
||||
|
|
@ -214,7 +216,7 @@ export class Group extends BaseEntity {
|
|||
name!: string
|
||||
|
||||
@OneToOne(() => User)
|
||||
@JoinColumn({ name: 'created_by' })
|
||||
@JoinColumn({ name: 'created_by_id' })
|
||||
createdBy!: User
|
||||
|
||||
@Column({ type: 'timestamp', name: 'created_at' })
|
||||
|
|
@ -338,6 +340,12 @@ export class LibraryItem extends BaseEntity {
|
|||
@Column('text', { nullable: true })
|
||||
subscription?: string | null
|
||||
|
||||
@Column('text', { array: true, nullable: true })
|
||||
recommender_names?: string[] | null
|
||||
|
||||
@Column('text', { array: true, nullable: true })
|
||||
label_names?: string[] | null
|
||||
|
||||
@OneToOne(() => UploadFile, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'upload_file_id' })
|
||||
uploadFile?: UploadFile
|
||||
|
|
@ -382,3 +390,49 @@ export class UploadFile extends BaseEntity {
|
|||
@Column({ type: 'timestamp', name: 'updated_at' })
|
||||
updatedAt!: Date
|
||||
}
|
||||
|
||||
@Entity({ name: 'recommendation' })
|
||||
export class Recommendation extends BaseEntity {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string
|
||||
|
||||
@JoinColumn({ name: 'recommender_id' })
|
||||
@ManyToOne(() => User, (user) => user.articles, { eager: true })
|
||||
recommender!: User
|
||||
|
||||
@JoinColumn({ name: 'library_item_id' })
|
||||
@ManyToOne(() => User, (user) => user.articles, { eager: true })
|
||||
libraryItem!: LibraryItem
|
||||
|
||||
@JoinColumn({ name: 'group_id' })
|
||||
@ManyToOne(() => User, (user) => user.articles, { eager: true })
|
||||
group!: Group
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
note?: string | null
|
||||
|
||||
@Column({ type: 'timestamp', name: 'created_at' })
|
||||
createdAt!: Date
|
||||
}
|
||||
|
||||
@Entity({ name: 'group_membership' })
|
||||
export class GroupMembership extends BaseEntity {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string
|
||||
|
||||
@JoinColumn({ name: 'user_id' })
|
||||
@ManyToOne(() => User, (user) => user.articles, { eager: true })
|
||||
user!: User
|
||||
|
||||
@JoinColumn({ name: 'group_id' })
|
||||
group!: Group
|
||||
|
||||
@Column({ type: 'timestamp', name: 'created_at' })
|
||||
createdAt!: Date
|
||||
|
||||
@Column({ type: 'timestamp', name: 'updated_at' })
|
||||
updatedAt!: Date
|
||||
|
||||
@Column('boolean', { default: false })
|
||||
is_admin!: boolean
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import {
|
|||
Subscription,
|
||||
Integration,
|
||||
LibraryItem,
|
||||
Recommendation,
|
||||
GroupMembership,
|
||||
} from './db'
|
||||
import { compare, hashSync } from 'bcryptjs'
|
||||
const readYamlFile = require('read-yaml-file')
|
||||
|
|
@ -46,6 +48,8 @@ const ADMIN_USER_EMAIL =
|
|||
{
|
||||
resource: ContentDisplayReport,
|
||||
},
|
||||
{ resource: Recommendation, options: { parent: { name: 'Users' } } },
|
||||
{ resource: GroupMembership, options: { parent: { name: 'Users' } } },
|
||||
],
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue