mirror of
https://github.com/hcengineering/platform.git
synced 2025-03-19 21:31:30 +00:00
Merge remote-tracking branch 'origin/develop'
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
commit
f77b5638bf
@ -34,6 +34,7 @@ export async function moveFiles (
|
|||||||
|
|
||||||
for (const [name, adapter] of exAdapter.adapters.entries()) {
|
for (const [name, adapter] of exAdapter.adapters.entries()) {
|
||||||
if (name === target) continue
|
if (name === target) continue
|
||||||
|
console.log('moving from', name)
|
||||||
|
|
||||||
const iterator = await adapter.listStream(ctx, workspaceId)
|
const iterator = await adapter.listStream(ctx, workspaceId)
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -44,9 +45,16 @@ export async function moveFiles (
|
|||||||
if (blob === undefined) continue
|
if (blob === undefined) continue
|
||||||
if (blob.provider === target) continue
|
if (blob.provider === target) continue
|
||||||
|
|
||||||
const readable = await exAdapter.get(ctx, workspaceId, data._id)
|
try {
|
||||||
const stream = readable.pipe(new PassThrough())
|
const readable = await exAdapter.get(ctx, workspaceId, data._id)
|
||||||
await exAdapter.put(ctx, workspaceId, data._id, stream, blob.contentType, blob.size)
|
readable.on('end', () => {
|
||||||
|
readable.destroy()
|
||||||
|
})
|
||||||
|
const stream = readable.pipe(new PassThrough())
|
||||||
|
await exAdapter.put(ctx, workspaceId, data._id, stream, blob.contentType, blob.size)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('failed to process blob', name, data._id, err)
|
||||||
|
}
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
if (count % 100 === 0) {
|
if (count % 100 === 0) {
|
||||||
|
@ -72,7 +72,7 @@ export function getFileUrl (file: string, filename?: string): string {
|
|||||||
|
|
||||||
const template = getFilesUrl()
|
const template = getFilesUrl()
|
||||||
return template
|
return template
|
||||||
.replaceAll(':filename', encodeURIComponent(filename ?? ''))
|
.replaceAll(':filename', encodeURIComponent(filename ?? file))
|
||||||
.replaceAll(':workspace', encodeURIComponent(getCurrentWorkspace()))
|
.replaceAll(':workspace', encodeURIComponent(getCurrentWorkspace()))
|
||||||
.replaceAll(':blobId', encodeURIComponent(file))
|
.replaceAll(':blobId', encodeURIComponent(file))
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,6 @@ function blobToSrcSet (cfg: PreviewConfig, blob: Ref<Blob>, width: number | unde
|
|||||||
' 2x, ' +
|
' 2x, ' +
|
||||||
fu.replaceAll(':size', `${width * 3}`) +
|
fu.replaceAll(':size', `${width * 3}`) +
|
||||||
' 3x'
|
' 3x'
|
||||||
} else {
|
|
||||||
result += downloadUrl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
@ -68,14 +68,6 @@
|
|||||||
topic: description
|
topic: description
|
||||||
})
|
})
|
||||||
|
|
||||||
await client.createDoc(notification.class.DocNotifyContext, space._id, {
|
|
||||||
user: account._id,
|
|
||||||
objectId: channelId,
|
|
||||||
objectClass: chunter.class.Channel,
|
|
||||||
objectSpace: core.space.Space,
|
|
||||||
isPinned: false
|
|
||||||
})
|
|
||||||
|
|
||||||
openChannel(channelId, chunter.class.Channel)
|
openChannel(channelId, chunter.class.Channel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ export function isAllowed (
|
|||||||
notificationControl: NotificationProviderControl
|
notificationControl: NotificationProviderControl
|
||||||
): boolean {
|
): boolean {
|
||||||
const providerSetting = (notificationControl.byProvider.get(provider._id) ?? []).find(
|
const providerSetting = (notificationControl.byProvider.get(provider._id) ?? []).find(
|
||||||
({ attachedTo, modifiedBy }) => modifiedBy === receiver
|
({ createdBy }) => createdBy === receiver
|
||||||
)
|
)
|
||||||
|
|
||||||
if (providerSetting !== undefined && !providerSetting.enabled) {
|
if (providerSetting !== undefined && !providerSetting.enabled) {
|
||||||
@ -168,7 +168,7 @@ export function isAllowed (
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const setting = (notificationControl.settingsByProvider.get(provider._id) ?? []).find(
|
const setting = (notificationControl.settingsByProvider.get(provider._id) ?? []).find(
|
||||||
(it) => it.type === type._id && it.modifiedBy === receiver
|
(it) => it.type === type._id && it.createdBy === receiver
|
||||||
)
|
)
|
||||||
|
|
||||||
if (setting !== undefined) {
|
if (setting !== undefined) {
|
||||||
|
@ -256,12 +256,8 @@ export class AggregatorStorageAdapter implements StorageAdapter, StorageAdapterE
|
|||||||
|
|
||||||
@withContext('aggregator-get', {})
|
@withContext('aggregator-get', {})
|
||||||
async get (ctx: MeasureContext, workspaceId: WorkspaceId, name: string): Promise<Readable> {
|
async get (ctx: MeasureContext, workspaceId: WorkspaceId, name: string): Promise<Readable> {
|
||||||
// const { provider, stat } = await this.findProvider(ctx, workspaceId, name)
|
const { provider, stat } = await this.findProvider(ctx, workspaceId, name)
|
||||||
const provider = this.adapters.get(this.defaultAdapter)
|
return await provider.get(ctx, workspaceId, stat.storageId)
|
||||||
if (provider === undefined) {
|
|
||||||
throw new NoSuchKeyError('No such provider found')
|
|
||||||
}
|
|
||||||
return await provider.get(ctx, workspaceId, name)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@withContext('find-provider', {})
|
@withContext('find-provider', {})
|
||||||
|
Loading…
Reference in New Issue
Block a user