Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Artifact
on:
workflow_dispatch:
push:
branches: [master]
branches: [main, 'stable*']
pull_request:
branches: [master]
branches: [main, 'stable*']

jobs:
artifact:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ name: ESLint
on:
workflow_dispatch:
push:
branches: [master, develop]
branches: [main, 'stable*']
pull_request:
branches: [master, develop]
branches: [main, 'stable*']

env:
NODE_VERSION: 20
# Must stay >= 24: @nextcloud/files@4 requires node ^24.0.0, and npm 10
# (bundled with node 20) cannot `npm ci` this lockfile because it tries to
# materialise fdir's *optional* picomatch peer. The release workflow already
# builds with node ^24 / npm ^11.3.
NODE_VERSION: 24

jobs:
lint:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Lint-php
on:
workflow_dispatch:
push:
branches: [master, develop]
branches: [main, 'stable*']
pull_request:
branches: [master, develop]
branches: [main, 'stable*']

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Lint-phpcs
on:
workflow_dispatch:
push:
branches: [master, develop]
branches: [main, 'stable*']
pull_request:
branches: [master, develop]
branches: [main, 'stable*']

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion src/desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/

/* global _, _oc_appswebroots, oc_current_user */
/* global _oc_appswebroots, oc_current_user */

/**
* @param {object} OCA Nextcloud OCA object
Expand All @@ -44,10 +44,10 @@
document.documentElement.classList.add('AscDesktopEditor')

let domain = /^http(s)?:\/\/[^\\/]+/.exec(location)[0]
domain += OC.getRootPath()

Check warning on line 47 in src/desktop.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.getRootPath was deprecated in Nextcloud 19.0.0

const data = {
displayName: oc_current_user,

Check warning on line 50 in src/desktop.js

View workflow job for this annotation

GitHub Actions / Lint

The global property or function oc_current_user was deprecated in Nextcloud 17.0.0
domain,
provider: 'Nextcloud',
}
Expand Down
2 changes: 0 additions & 2 deletions src/directeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
*
*/

/* global _ */

/**
* @param {object} OCA Nextcloud OCA object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/

/* global _, DocsAPI, moment, oc_defaults */
/* global DocsAPI, moment, oc_defaults */

import axios from '@nextcloud/axios'

Expand Down Expand Up @@ -55,7 +55,7 @@
OCA.Eurooffice.filePath = iframeEditor.dataset.path
OCA.Eurooffice.anchor = iframeEditor.getAttribute('data-anchor')
OCA.Eurooffice.currentWindow = window
OCA.Eurooffice.currentUser = OC.getCurrentUser()

Check warning on line 58 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.getCurrentUser was deprecated in Nextcloud 19.0.0

if (OCA.Eurooffice.inframe) {
OCA.Eurooffice.currentWindow = window.parent
Expand Down Expand Up @@ -211,7 +211,7 @@
}
}

const favicon = OC.filePath(OCA.Eurooffice.AppName, 'img', OCA.Eurooffice.documentType + '.ico')

Check warning on line 214 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.filePath was deprecated in Nextcloud 19.0.0
if (OCA.Eurooffice.inframe) {
window.parent.postMessage({
method: 'changeFavicon',
Expand All @@ -234,7 +234,7 @@
}

OCA.Eurooffice.onRequestHistory = function(version) {
axios.get(OC.generateUrl('apps/' + OCA.Eurooffice.AppName + '/ajax/history?fileId={fileId}',

Check warning on line 237 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.generateUrl was deprecated in Nextcloud 19.0.0
{
fileId: OCA.Eurooffice.fileId || 0,
}))
Expand All @@ -246,7 +246,7 @@
OCA.Eurooffice.onRequestHistoryData = function(event) {
const version = event.data

axios.get(OC.generateUrl('apps/' + OCA.Eurooffice.AppName + '/ajax/version?fileId={fileId}&version={version}',

Check warning on line 249 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.generateUrl was deprecated in Nextcloud 19.0.0
{
fileId: OCA.Eurooffice.fileId || 0,
version,
Expand All @@ -266,7 +266,7 @@
OCA.Eurooffice.onRequestRestore = function(event) {
const version = event.data.version

axios.put(OC.generateUrl('apps/' + OCA.Eurooffice.AppName + '/ajax/restore'), {

Check warning on line 269 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.generateUrl was deprecated in Nextcloud 19.0.0
fileId: OCA.Eurooffice.fileId || 0,
version,
})
Expand Down Expand Up @@ -334,7 +334,7 @@
}

OCA.Eurooffice.editorSaveAs = function(saveData) {
axios.post(OC.generateUrl('apps/' + OCA.Eurooffice.AppName + '/ajax/save'), saveData)

Check warning on line 337 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.generateUrl was deprecated in Nextcloud 19.0.0
.then((response) => {
const data = response.data
if (data.error) {
Expand Down Expand Up @@ -375,7 +375,7 @@
}

OCA.Eurooffice.editorInsertImage = function(filePath) {
axios.get(OC.generateUrl('apps/' + OCA.Eurooffice.AppName + '/ajax/url?filePath={filePath}',

Check warning on line 378 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.generateUrl was deprecated in Nextcloud 19.0.0
{
filePath,
}))
Expand Down Expand Up @@ -427,7 +427,7 @@
}

OCA.Eurooffice.editorSetRecipient = function(filePath) {
axios.get(OC.generateUrl('apps/' + OCA.Eurooffice.AppName + '/ajax/url?filePath={filePath}',

Check warning on line 430 in src/editor.js

View workflow job for this annotation

GitHub Actions / Lint

The property or function OC.generateUrl was deprecated in Nextcloud 19.0.0
{
filePath,
}))
Expand Down
38 changes: 19 additions & 19 deletions src/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/

/* global _, OC, OCP, t */
/* global OC, OCP, t */

import { getLinkWithPicker } from '@nextcloud/vue/components/NcRichText'

Expand Down Expand Up @@ -98,47 +98,47 @@ import { getLinkWithPicker } from '@nextcloud/vue/components/NcRichText'
// the modal manually. The modal's built-in close button dismisses it.
OCA.Eurooffice.onSmartPickerRequest = async function(selectedText, source) {
if (this.showSmartPicker) {
return;
return
}
this.showSmartPicker = true;
this.showSmartPicker = true

if (source === 'contextmenu') {
const openAssistantForm = window.OCA?.Assistant?.openAssistantForm;
const openAssistantForm = window.OCA?.Assistant?.openAssistantForm
if (typeof openAssistantForm !== 'function') {
console.debug('NC Assistant app is not loaded; smart picker is unavailable');
this.showSmartPicker = false;
return;
console.debug('NC Assistant app is not loaded; smart picker is unavailable')
this.showSmartPicker = false
return
}
try {
const seedInputs = selectedText
? { prompt: selectedText, input: selectedText, text: selectedText }
: {};
: {}
await openAssistantForm({
appId: OCA.Eurooffice.AppName,
taskType: 'core:text2text',
inputs: seedInputs,
closeOnResult: false,
});
})
} catch (e) {
// Smart Picker cancelled or failed
}
} else {
// Toolbar button: open the Smart Picker provider selection modal
if (typeof getLinkWithPicker !== 'function') {
console.error('getLinkWithPicker is not available. Make sure @nextcloud/vue supports the Smart Picker.');
this.showSmartPicker = false;
return;
console.error('getLinkWithPicker is not available. Make sure @nextcloud/vue supports the Smart Picker.')
this.showSmartPicker = false
return
}
try {
const linkUrl = await getLinkWithPicker('eurooffice', false);
const linkUrl = await getLinkWithPicker('eurooffice', false)
if (linkUrl) {
OCA.Eurooffice.onInsertLink(linkUrl);
OCA.Eurooffice.onInsertLink(linkUrl)
}
} catch (err) {
console.debug('Smart Picker cancelled or failed:', err);
console.debug('Smart Picker cancelled or failed:', err)
}
}
this.showSmartPicker = false;
this.showSmartPicker = false
}

OCA.Eurooffice.onRequestMailMergeRecipients = function(recipientMimes) {
Expand Down Expand Up @@ -204,10 +204,10 @@ import { getLinkWithPicker } from '@nextcloud/vue/components/NcRichText'
OCA.Eurooffice._isDocumentReady = false

OCA.Eurooffice._doInsertLink = function(link) {
if (!link) return;
const frame = document.querySelector(OCA.Eurooffice.frameSelector);
if (!link) return
const frame = document.querySelector(OCA.Eurooffice.frameSelector)
if (frame && frame.contentWindow && frame.contentWindow.OCA?.Eurooffice?.docEditor) {
frame.contentWindow.OCA.Eurooffice.docEditor.insertLink(link);
frame.contentWindow.OCA.Eurooffice.docEditor.insertLink(link)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/* eslint-disable import/no-unresolved */

/* global _, _oc_appswebroots */
/* global _oc_appswebroots */

import {
File,
Expand Down
2 changes: 0 additions & 2 deletions src/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

/* eslint-disable import/no-unresolved */

/* global _ */

import AppDarkSvg from '../img/app-dark.svg?raw'
import axios from '@nextcloud/axios'

Expand Down
2 changes: 0 additions & 2 deletions src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
*
*/

/* global _ */

import axios from '@nextcloud/axios'
import { spawnDialog } from '@nextcloud/vue/functions/dialog'
import { defineAsyncComponent } from 'vue'
Expand Down
Loading