Skip to content

Commit

Permalink
Merge pull request #41 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/2.1.0
  • Loading branch information
LinneyS committed May 14, 2024
2 parents 9d63a4e + 3b36f4c commit 4cd191c
Show file tree
Hide file tree
Showing 62 changed files with 324 additions and 166 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
tools: composer, cs2pr
- name: Build Artifact
run: |
composer install
composer translations
rm -rf vendor
cd ${{ github.workspace }}/onlyoffice-docspace-wordpress-block
npm install
npm run build
Expand All @@ -33,7 +42,7 @@ jobs:
rm -rf ./.git/
rm ./.gitignore
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: onlyoffice-docspace
path: deploy
14 changes: 7 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
csscomb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16.15.1"
node-version: 20
- run: |
npm init -y
npm install csscomb --global
Expand All @@ -25,7 +25,7 @@ jobs:
needs: csscomb
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -36,17 +36,17 @@ jobs:

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup cache
uses: pat-s/always-upload-cache@v1.1.4
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Run phpcs
run: |
composer self-update --1
composer install
composer phpcs
17 changes: 13 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get Info
run: |
echo "::set-output name=version::$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md)"
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
id: info
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
tools: composer, cs2pr
- name: Install Zip
run: sudo apt-get install zip
- name: Build Plugin
run: |
composer install
composer translations
rm -rf vendor
cd ${{ github.workspace }}/onlyoffice-docspace-wordpress-block
npm install
npm run build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ node_modules
/vendor
/wpcs
/onlyoffice-docspace-wordpress-block/build
/languages/*.json
/languages/*.mo
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Change Log


## 2.1.0
## Added
- ability to add multiple rooms/files to a page
- block settings (view mode 'editor/embedded')

## Changed
- hide sign out button on page docspace
- hide request name for anonymous
- structure of tables with files (Name,Size,Type)
- base theme in admin panel for docspace

## 2.0.0
## Added
- support for public rooms
Expand Down
6 changes: 4 additions & 2 deletions admin/class-oodsp-docspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function enqueue_styles() {
public function init_menu() {
global $wp_filesystem;

$logo_svg = $wp_filesystem->get_contents( OODSP_PLUGIN_URL . 'admin/images/logo.svg' );
$logo_svg = $wp_filesystem->get_contents( plugin_dir_path( OODSP_PLUGIN_FILE ) . 'admin/images/logo.svg' );

add_menu_page(
'DocSpace',
Expand Down Expand Up @@ -162,7 +162,9 @@ function() {
showMenu: true,
showFilter: true,
showHeader: true,
locale: _oodsp.locale
locale: _oodsp.locale,
showSignOut: false,
theme: "Base"
});
}
);
Expand Down
56 changes: 28 additions & 28 deletions assets-onlyoffice-docspace/js/docspace-integration-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
*/

(function () {
const DOCSPACE_API_URL = "static/scripts/api.js";
const DOCSPACE_API_URL = "static/scripts/sdk/1.0.0/api.js";

const initScript = async (id, url) => {
return new Promise((resolve, reject) => {
try {
// If DocsAPI is defined return resolve.
if (window.DocsAPI) return resolve(null);
// If DocSpace is defined return resolve.
if (window.DocSpace) return resolve(null);

if(url == null) {
return reject("DocSpace Url is not defined!");
Expand All @@ -33,29 +33,29 @@
const existedScript = document.getElementById(id);

if (existedScript) {
// If the script element is found, wait for it to load.
let intervalHandler = setInterval(() => {
const loading = existedScript.getAttribute("loading");
if (loading) {
// If the download is not completed, continue to wait.
return;
} else {
// If the download is completed, stop the wait.
clearInterval(intervalHandler);
// If the script element is found, wait for it to load.
let intervalHandler = setInterval(() => {
const loading = existedScript.getAttribute("loading");
if (loading) {
// If the download is not completed, continue to wait.
return;
} else {
// If the download is completed, stop the wait.
clearInterval(intervalHandler);

// If DocsAPI is defined, after loading return resolve.
if (window.DocsAPI) return resolve(null);
// If DocSpace is defined, after loading return resolve.
if (window.DocSpace) return resolve(null);

// If DocsAPI is not defined, delete the existing script and create a new one.
// If DocSpace is not defined, delete the existing script and create a new one.
const script = _createScriptTag(id , url, resolve, reject);
existedScript.remove();
document.body.appendChild(script);
}
}, 500);
} else {
// If the script element is not found, create it.
const script = _createScriptTag(id, url, resolve, reject);
existedScript.remove();
document.body.appendChild(script);
}
}, 500);
} else {
// If the script element is not found, create it.
const script = _createScriptTag(id, url, resolve, reject);
document.body.appendChild(script);
}
} catch (e) {
console.error(e);
Expand Down Expand Up @@ -157,14 +157,14 @@
script.async = true;

script.onload = () => {
// Remove attribute loading after loading is complete.
script.removeAttribute("loading");
resolve(null);
// Remove attribute loading after loading is complete.
script.removeAttribute("loading");
resolve(null);
};
script.onerror = (error) => {
// Remove attribute loading after loading is complete.
script.removeAttribute("loading");
reject(error);
// Remove attribute loading after loading is complete.
script.removeAttribute("loading");
reject(error);
};

script.setAttribute("loading", "");
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"wp-coding-standards/wpcs": "^3.0.1"
},
"scripts": {
"phpcs": "phpcs --standard=Wordpress --runtime-set minimum_wp_version 6.2 --ignore=*/assets-onlyoffice-docspace/*,*/onlyoffice-docspace-wordpress-block/*,*/vendor/* ./"
"phpcs": "phpcs --standard=Wordpress --runtime-set minimum_wp_version 6.2 --ignore=*/assets-onlyoffice-docspace/*,*/onlyoffice-docspace-wordpress-block/*,*/vendor/* ./",
"translations": [
"wp i18n make-mo languages",
"wp i18n make-json languages --no-purge"
]
},
"config": {
"allow-plugins": {
Expand Down
2 changes: 1 addition & 1 deletion includes/managers/class-oodsp-request-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function get_user_data( $user ) {
}

if ( ! $first_name && ! $last_name ) {
$user_name = substr( $email, strrpos( $email, '@' ) + 1 );
$user_name = substr( $email, 0, strrpos( $email, '@' ) );
$first_name = preg_replace( '/[^\p{L}\p{M} \-]/u', '-', $user_name );
$last_name = $first_name;
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file removed languages/onlyoffice-docspace-plugin-de_DE.mo
Binary file not shown.
11 changes: 11 additions & 0 deletions languages/onlyoffice-docspace-plugin-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,14 @@ msgstr "Hell"
msgid "Dark"
msgstr "Dunkel"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "View"
msgstr "Ansicht"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "Embedded"
msgstr "Eingebettete"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "Editor"
msgstr "Editor"

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file removed languages/onlyoffice-docspace-plugin-es_ES.mo
Binary file not shown.
11 changes: 11 additions & 0 deletions languages/onlyoffice-docspace-plugin-es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,14 @@ msgstr "Claro"
msgid "Dark"
msgstr "Oscuro"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "View"
msgstr "Vista"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "Embedded"
msgstr "Incorporada"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "Editor"
msgstr "Editor"

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file removed languages/onlyoffice-docspace-plugin-fr_FR.mo
Binary file not shown.
13 changes: 12 additions & 1 deletion languages/onlyoffice-docspace-plugin-fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ msgid "Save"
msgstr "Enregistrer"

msgid "The current WordPress user will be added to DocSpace with the <b>Room admin</b> role."
msgstr "L'utilisateur actuel de WordPress sera ajouté à DocSpace avec le rôle <b>Administrateur de salle</b>."
msgstr "L'utilisateur actuel de WordPress sera ajouté à DocSpace avec le rôle <b>Administrateur de salle</b>."

msgid "DocSpace Users"
msgstr "Utilisateurs de DocSpace"
Expand Down Expand Up @@ -229,3 +229,14 @@ msgstr "Clair"
msgid "Dark"
msgstr "Sombre"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "View"
msgstr "Affichage"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "Embedded"
msgstr "Incorporé"

#: onlyoffice-docspace-wordpress-block/build/index.js
msgid "Editor"
msgstr "Éditeur"

This file was deleted.

This file was deleted.

0 comments on commit 4cd191c

Please sign in to comment.