Compare commits

...

6 Commits

Author SHA1 Message Date
Julius Knorr
fb36579e03 Merge pull request #6674 from nextcloud/backport/6671/stable27
[stable27] fix: Properly show attachment extension
2025-04-29 09:16:06 +02:00
dependabot[bot]
3f7389d773 Chore(deps): Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 19:02:42 +02:00
Julius Härtl
9746870ad6 fix: Properly show attachment extension
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2025-04-28 19:00:19 +02:00
Julius Knorr
89bb483a0d Merge pull request #6643 from nextcloud/backport/5859/stable27
[stable27] Update TrelloJsonService.php
2025-01-02 17:13:17 +01:00
mulles
1bbc19f9e0 Update TrelloJsonService.php
removed trailing white space, I am sorry for that thx for your patience.

Signed-off-by: mulles <com.github@emu.lu>
2025-01-02 14:58:49 +00:00
mulles
7467cca0cc Update TrelloJsonService.php
Fixes the following issue: https://github.com/nextcloud/deck/issues/5136
By fixing the following error when running 'php occ deck:import --system=TrelloJson'

Error: Call to a member function getUID() on string in /home/sites/site100028002/web/nextcloud.enklaave.org/apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:136

and 

Error: Call to a member function getUID() on string in /home/sites/site100028002/web/nextcloud.enklaave.org/apps/deck/lib/Service/Importer/Systems/TrelloJsonService.php:364


Signed-off-by: mulles <com.github@emu.lu>
2025-01-02 14:58:49 +00:00
6 changed files with 24 additions and 10 deletions

View File

@@ -37,7 +37,7 @@ jobs:
uname -a
RUST_BACKTRACE=1 krankerl --version
RUST_BACKTRACE=1 krankerl package
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Deck app tarball
path: build/artifacts/deck.tar.gz

View File

@@ -108,7 +108,7 @@ jobs:
npm_package_name: ${{ env.APP_NAME }}
- name: Upload test failure screenshots
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: Upload screenshots
@@ -116,7 +116,7 @@ jobs:
retention-days: 5
- name: Upload nextcloud logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: Upload nextcloud log

View File

@@ -114,7 +114,8 @@ describe('Card', function() {
cy.get('.file-picker__main [data-filename="welcome.txt"]').should('be.visible')
.click()
cy.get('.dialog__actions button.button-vue--vue-primary').click()
cy.get('.attachment-list .basename').contains('welcome.txt')
cy.get('.attachment-list .filename').contains('welcome')
cy.get('.attachment-list .filename .extension').contains('txt')
})
it('Shows the modal with the editor', () => {

View File

@@ -133,7 +133,7 @@ class TrelloJsonService extends ABoardImportService {
$cardId = $this->cards[$trelloCard->id]->getId();
$comment = new Comment();
if (!empty($this->getImportService()->getConfig('uidRelation')->{$trelloComment->memberCreator->username})) {
$actor = $this->getImportService()->getConfig('uidRelation')->{$trelloComment->memberCreator->username}->getUID();
$actor = $this->getImportService()->getConfig('uidRelation')->{$trelloComment->memberCreator->username};
} else {
$actor = $this->getImportService()->getConfig('owner')->getUID();
}
@@ -361,7 +361,7 @@ class TrelloJsonService extends ABoardImportService {
private function replaceUsernames(string $text): string {
foreach ($this->getImportService()->getConfig('uidRelation') as $trello => $nextcloud) {
$text = str_replace($trello, $nextcloud->getUID(), $text);
$text = str_replace($trello, $nextcloud, $text);
}
return $text;
}

View File

@@ -41,7 +41,8 @@
<div class="details">
<a>
<div class="filename">
<span class="basename">{{ attachment.name }}</span>
<span>{{ attachmentBasename(attachment) }}</span>
<span class="extension">.{{ attachmentExtension(attachment) }}</span>
</div>
<progress :value="attachment.progress" max="100" />
</a>
@@ -58,7 +59,8 @@
<div class="details">
<a :href="internalLink(attachment)" @click.prevent="showViewer(attachment)">
<div class="filename">
<span class="basename">{{ attachment.data }}</span>
<span>{{ attachmentBasename(attachment) }}</span>
<span class="extension">.{{ attachmentExtension(attachment) }}</span>
</div>
<div v-if="attachment.deletedAt === 0">
<span class="filesize">{{ formattedFileSize(attachment.extendedData.filesize) }}</span>
@@ -200,6 +202,14 @@ export default {
return t('deck', 'Drop your files to upload')
}
},
attachmentBasename() {
return (attachment) => attachment?.extendedData?.info.filename
?? (attachment?.name ?? attachment.data).replace(/\.[^/.]+$/, '')
},
attachmentExtension() {
return (attachment) => attachment?.extendedData?.info?.extension
?? (attachment?.name ?? attachment.data).split('.').pop()
},
},
watch: {
cardId: {

View File

@@ -255,15 +255,18 @@ export default {
},
addAttachment(attachment) {
const asImage = (attachment.type === 'file' && attachment.extendedData.hasPreview) || attachment.extendedData.mimetype.includes('image')
// We need to strip those as text does not support rtl yet, so we cannot insert them separately
const stripRTLO = (text) => text.replaceAll('\u202e', '')
const fileName = stripRTLO(attachment.extendedData.info.filename) + '.' + stripRTLO(attachment.extendedData.info.extension)
if (this.editor) {
this.editor.insertAtCursor(
asImage
? `<a href="${this.attachmentPreview(attachment)}"><img src="${this.attachmentPreview(attachment)}" alt="${attachment.data}" /></a>`
: `<a href="${this.attachmentPreview(attachment)}">${attachment.data}</a>`,
: `<a href="${this.attachmentPreview(attachment)}">${fileName}</a>`,
)
return
} else {
const attachmentString = (asImage ? '!' : '') + '[📎 ' + attachment.data + '](' + this.attachmentPreview(attachment) + ')'
const attachmentString = (asImage ? '!' : '') + '[📎 ' + fileName + '](' + this.attachmentPreview(attachment) + ')'
const descString = this.$refs.markdownEditor.easymde.value()
const newContent = descString + '\n' + attachmentString
this.$refs.markdownEditor.easymde.value(newContent)