From 903a180d57da571ecc95035a086c2cfbdbe83d89 Mon Sep 17 00:00:00 2001 From: Ronak Date: Wed, 5 Jul 2023 01:26:05 -0700 Subject: [PATCH 01/22] temp change --- lib/Service/AppsService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 17f300a..570cbd7 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -52,22 +52,26 @@ class AppsService { "id" => "onlyoffice_docx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), "name" => $l->t("Document"), + "default_filename" => 'untitled.docx' ), array( "id" => "onlyoffice_xlsx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), "name" => $l->t("Spreadsheet"), + "default_filename" => 'untitled.xlsx' ), array( "id" => "onlyoffice_pptx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), "name" => $l->t("Presentation"), + "default_filename" => 'untitled.pptx' ), ); $onlyOfficeEntries = array_map(function ($entry) { $entry["type"] = "link"; $entry["active"] = false; - $entry["href"] = "/apps/onlyoffice/ajax/new?id=".$entry["id"]; + $baseDirectory = "Documents"; + $entry["href"] = "/apps/onlyoffice/new?id=".$entry["id"]."&name=".$entry["default_filename"]."&dir=".$baseDirectory; return $entry; }, $onlyOfficeEntries); -- GitLab From e43aea5be7728fa24aeeca8a8cfe38baa4d7775d Mon Sep 17 00:00:00 2001 From: Ronak Date: Wed, 5 Jul 2023 02:22:44 -0700 Subject: [PATCH 02/22] gitlab added --- .gitlab-ci.yml | 106 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 96 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbc5b2c..4ffdd5b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,97 @@ +# variables: +# APP_NAME: 'murena-dashboard' +# TO_PACKAGE: 'appinfo l10n lib templates js css' + +# include: +# - project: "e/infra/ecloud/nextcloud-apps/ci-templates" +# ref: main +# file: "nc-apps-lint-build-frontend.yml" +# - project: "e/infra/ecloud/nextcloud-apps/ci-templates" +# ref: main +# file: "nc-apps-deploy.yml" + + variables: - APP_NAME: 'murena-dashboard' - TO_PACKAGE: 'appinfo l10n lib templates js css' - -include: - - project: "e/infra/ecloud/nextcloud-apps/ci-templates" - ref: main - file: "nc-apps-lint-build-frontend.yml" - - project: "e/infra/ecloud/nextcloud-apps/ci-templates" - ref: main - file: "nc-apps-deploy.yml" + APP_NAME: $CI_PROJECT_NAME + TO_PACKAGE: 'appinfo l10n lib templates js css' + CONTAINER_IMAGE: ubuntu + CONTAINER_TAG: focal + CONTAINER_NAME: nextcloud + APP_ENABLE_ARGS: '' + +.frontend:base: + image: node:15.14.0-stretch + before_script: + - npm set cache .npm + - npm install --prefer-offline --no-audit + cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - .npm/ + - node_modules/ + +install-node-deps: + extends: .frontend:base + stage: .pre + before_script: + - node --version + - npm --version + script: + - npm ci --cache .npm --prefer-offline + only: + changes: + - package*.json + +build-frontend: + extends: .frontend:base + stage: build + script: + - npm run build + - mkdir -p dist/${APP_NAME} + - rm -f dist/js/*.map + - echo "packaging ${TO_PACKAGE}" && cp -a ${TO_PACKAGE} dist/${APP_NAME} && rm -rf dist/js + - find dist/${APP_NAME} -type d -exec chmod 755 {} \; + - find dist/${APP_NAME} -type f -exec chmod 644 {} \; + artifacts: + paths: + - dist/ + +.deploy:nextcloud-app: + stage: deploy + # assuming all deployment will happen with sames image + image: $CONTAINER_IMAGE:$CONTAINER_TAG + # assuming we will need to add SSH for all deployment + before_script: + - echo "FAIL" > .job_status + - mkdir $HOME/.ssh + - chmod 700 ~/.ssh + - echo "$SSH_PRIVATE_KEY_ED" > $HOME/.ssh/id_ed25519 + - echo "$SSH_PUBKEY_ED" > $HOME/.ssh/id_ed25519.pub + - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts + - chmod 600 ~/.ssh/id_ed25519 + - chmod 644 ~/.ssh/known_hosts ~/.ssh/id_ed25519.pub + - apt-get update && apt-get install -y openssh-client rsync + script: + - echo "Deploying ${APP_NAME} to $CI_ENVIRONMENT_NAME ($DEPLOYMENT_HOST)" + - rsync -avzh dist/ $SSH_USER@$DEPLOYMENT_HOST:/tmp/${CI_JOB_ID} + - ssh $SSH_USER@$DEPLOYMENT_HOST "sudo docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ app:disable ${APP_NAME} && + sudo rsync -avzh --chown www-data:www-data --delete /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}/html/custom_apps/ && + sudo docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ app:enable ${APP_ENABLE_ARGS} ${APP_NAME}" + - echo "SUCCESS" > .job_status + after_script: + # reading job status, checking it and implementing additional steps + # are not handled here as rm -rf /tmp/${CI_JOB_ID} will always execute + - ssh $SSH_USER@$DEPLOYMENT_HOST "rm -rf /tmp/${CI_JOB_ID}" + +deploy:staging: + extends: .deploy:nextcloud-app + when: manual + only: + - main + - murena-main + - production + - tags + - dev/oo-new-file + environment: + name: staging/01 + url: https://eeo.one -- GitLab From 7ff71cec66ca7117be61ee202fc19b346f78f32a Mon Sep 17 00:00:00 2001 From: Ronak Date: Wed, 5 Jul 2023 02:48:01 -0700 Subject: [PATCH 03/22] changes --- lib/Service/AppsService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 570cbd7..c4f6126 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -71,7 +71,7 @@ class AppsService { $entry["type"] = "link"; $entry["active"] = false; $baseDirectory = "Documents"; - $entry["href"] = "/apps/onlyoffice/new?id=".$entry["id"]."&name=".$entry["default_filename"]."&dir=".$baseDirectory; + $entry["href"] = "/apps/onlyoffice/new?id=" . $entry["id"] . "&name=" . $entry["default_filename"] . "&dir=" . $baseDirectory; return $entry; }, $onlyOfficeEntries); -- GitLab From 624ac00ad9ecc4e3ce2b9741365c0fb369635e34 Mon Sep 17 00:00:00 2001 From: Ronak Date: Wed, 5 Jul 2023 06:44:52 -0700 Subject: [PATCH 04/22] reverted --- .gitlab-ci.yml | 106 +++++-------------------------------------------- 1 file changed, 10 insertions(+), 96 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ffdd5b..cbc5b2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,97 +1,11 @@ -# variables: -# APP_NAME: 'murena-dashboard' -# TO_PACKAGE: 'appinfo l10n lib templates js css' - -# include: -# - project: "e/infra/ecloud/nextcloud-apps/ci-templates" -# ref: main -# file: "nc-apps-lint-build-frontend.yml" -# - project: "e/infra/ecloud/nextcloud-apps/ci-templates" -# ref: main -# file: "nc-apps-deploy.yml" - - variables: - APP_NAME: $CI_PROJECT_NAME - TO_PACKAGE: 'appinfo l10n lib templates js css' - CONTAINER_IMAGE: ubuntu - CONTAINER_TAG: focal - CONTAINER_NAME: nextcloud - APP_ENABLE_ARGS: '' - -.frontend:base: - image: node:15.14.0-stretch - before_script: - - npm set cache .npm - - npm install --prefer-offline --no-audit - cache: - key: ${CI_COMMIT_REF_SLUG} - paths: - - .npm/ - - node_modules/ - -install-node-deps: - extends: .frontend:base - stage: .pre - before_script: - - node --version - - npm --version - script: - - npm ci --cache .npm --prefer-offline - only: - changes: - - package*.json - -build-frontend: - extends: .frontend:base - stage: build - script: - - npm run build - - mkdir -p dist/${APP_NAME} - - rm -f dist/js/*.map - - echo "packaging ${TO_PACKAGE}" && cp -a ${TO_PACKAGE} dist/${APP_NAME} && rm -rf dist/js - - find dist/${APP_NAME} -type d -exec chmod 755 {} \; - - find dist/${APP_NAME} -type f -exec chmod 644 {} \; - artifacts: - paths: - - dist/ - -.deploy:nextcloud-app: - stage: deploy - # assuming all deployment will happen with sames image - image: $CONTAINER_IMAGE:$CONTAINER_TAG - # assuming we will need to add SSH for all deployment - before_script: - - echo "FAIL" > .job_status - - mkdir $HOME/.ssh - - chmod 700 ~/.ssh - - echo "$SSH_PRIVATE_KEY_ED" > $HOME/.ssh/id_ed25519 - - echo "$SSH_PUBKEY_ED" > $HOME/.ssh/id_ed25519.pub - - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts - - chmod 600 ~/.ssh/id_ed25519 - - chmod 644 ~/.ssh/known_hosts ~/.ssh/id_ed25519.pub - - apt-get update && apt-get install -y openssh-client rsync - script: - - echo "Deploying ${APP_NAME} to $CI_ENVIRONMENT_NAME ($DEPLOYMENT_HOST)" - - rsync -avzh dist/ $SSH_USER@$DEPLOYMENT_HOST:/tmp/${CI_JOB_ID} - - ssh $SSH_USER@$DEPLOYMENT_HOST "sudo docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ app:disable ${APP_NAME} && - sudo rsync -avzh --chown www-data:www-data --delete /tmp/${CI_JOB_ID}/${APP_NAME} ${DEPLOYMENT_PATH}/html/custom_apps/ && - sudo docker exec -u www-data $CONTAINER_NAME /usr/local/bin/php /var/www/html/occ app:enable ${APP_ENABLE_ARGS} ${APP_NAME}" - - echo "SUCCESS" > .job_status - after_script: - # reading job status, checking it and implementing additional steps - # are not handled here as rm -rf /tmp/${CI_JOB_ID} will always execute - - ssh $SSH_USER@$DEPLOYMENT_HOST "rm -rf /tmp/${CI_JOB_ID}" - -deploy:staging: - extends: .deploy:nextcloud-app - when: manual - only: - - main - - murena-main - - production - - tags - - dev/oo-new-file - environment: - name: staging/01 - url: https://eeo.one + APP_NAME: 'murena-dashboard' + TO_PACKAGE: 'appinfo l10n lib templates js css' + +include: + - project: "e/infra/ecloud/nextcloud-apps/ci-templates" + ref: main + file: "nc-apps-lint-build-frontend.yml" + - project: "e/infra/ecloud/nextcloud-apps/ci-templates" + ref: main + file: "nc-apps-deploy.yml" -- GitLab From 749d5700279dd20b08e1c433ee93ebff134b2b0d Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 10 Jul 2023 11:23:37 -0700 Subject: [PATCH 05/22] added document folder code --- appinfo/info.xml | 2 +- lib/Service/AppsService.php | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 81ee266..4aa7c71 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Murena Dashboard Murena Dashboard - 2.0.5 + 2.0.6 agpl Murena MurenaDashboard diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index c4f6126..a5bdc00 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -9,6 +9,7 @@ use OCP\IGroupManager; use OCP\IUserSession; use OCP\IURLGenerator; use OCP\L10N\IFactory; +use OCP\Files\IRootFolder; class AppsService { private string $appName; @@ -20,7 +21,7 @@ class AppsService { private IUserSession $userSession; private IGroupManager $groupManager; private IURLGenerator $urlGenerator; - + private IRootFolder $rootFolder; private const DEFAULT_ORDER = array("/apps/snappymail/", "/apps/calendar/", "/apps/files/" , "/apps/photos/", "/apps/memories/", "/apps/contacts/", "/apps/onlyoffice/ajax/new?id=onlyoffice_docx", "/apps/onlyoffice/ajax/new?id=onlyoffice_xlsx", "/apps/onlyoffice/ajax/new?id=onlyoffice_pptx", "/apps/notes/", "/apps/tasks/", "https://spot.murena.io" , "https://murena.com" ); public function __construct( @@ -32,6 +33,7 @@ class AppsService { IUserSession $userSession, IGroupManager $groupManager, IURLGenerator $urlGenerator, + IRootFolder $rootFolder, $userId ) { $this->appName = $appName; @@ -43,6 +45,7 @@ class AppsService { $this->userSession = $userSession; $this->groupManager = $groupManager; $this->urlGenerator = $urlGenerator; + $this->rootFolder = $rootFolder; } public function getOnlyOfficeEntries() { @@ -70,7 +73,7 @@ class AppsService { $onlyOfficeEntries = array_map(function ($entry) { $entry["type"] = "link"; $entry["active"] = false; - $baseDirectory = "Documents"; + $baseDirectory = $this->getDocumentsFolder(); $entry["href"] = "/apps/onlyoffice/new?id=" . $entry["id"] . "&name=" . $entry["default_filename"] . "&dir=" . $baseDirectory; return $entry; }, $onlyOfficeEntries); @@ -152,4 +155,25 @@ class AppsService { $gid = $this->config->getSystemValue("beta_group_name"); return $this->groupManager->isInGroup($uid, $gid); } + + /** + * @NoAdminRequired + * @return string + */ + public function getDocumentsFolder() { + $folderName = 'Documents'; + $userId = $this->userSession->getUser()->getUID(); + $userPath = $this->rootFolder->getUserFolder($userId)->getPath(); + $filePath = $userPath . '/' . $folderName; + + $folder = null; + if ($this->rootFolder->nodeExists($filePath)) { + $folder = $this->rootFolder->get($filePath); + } else { + $folder = $this->rootFolder->get($userPath); + $filePath = $userPath; + } + return $filePath === $userPath ? '/' : $folder->getName(); + } + } -- GitLab From 60879e3862315828bfa76b3b6b0ad904b8d9f80d Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 10 Jul 2023 11:37:47 -0700 Subject: [PATCH 06/22] lint --- lib/Service/AppsService.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index a5bdc00..360d367 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -155,11 +155,6 @@ class AppsService { $gid = $this->config->getSystemValue("beta_group_name"); return $this->groupManager->isInGroup($uid, $gid); } - - /** - * @NoAdminRequired - * @return string - */ public function getDocumentsFolder() { $folderName = 'Documents'; $userId = $this->userSession->getUser()->getUID(); @@ -175,5 +170,4 @@ class AppsService { } return $filePath === $userPath ? '/' : $folder->getName(); } - } -- GitLab From d057b9c596bccafd2f34af2cdf2e2ab034715730 Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 10 Jul 2023 12:14:43 -0700 Subject: [PATCH 07/22] added new service --- lib/Controller/PageController.php | 2 +- lib/Service/AppsService.php | 173 ------------------------------ 2 files changed, 1 insertion(+), 174 deletions(-) delete mode 100644 lib/Service/AppsService.php diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 7248821..f382ea3 100755 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -8,7 +8,7 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Services\IInitialState; use OCP\IConfig; use OCP\IUserSession; -use OCA\MurenaDashboard\Service\AppsService; +use OCA\EcloudAccounts\Service\AppsService; class PageController extends Controller { /** @var IInitialState */ diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php deleted file mode 100644 index 360d367..0000000 --- a/lib/Service/AppsService.php +++ /dev/null @@ -1,173 +0,0 @@ -appName = $appName; - $this->userId = $userId; - $this->config = $config; - $this->navigationManager = $navigationManager; - $this->appManager = $appManager; - $this->l10nFac = $l10nFac; - $this->userSession = $userSession; - $this->groupManager = $groupManager; - $this->urlGenerator = $urlGenerator; - $this->rootFolder = $rootFolder; - } - - public function getOnlyOfficeEntries() { - $l = $this->l10nFac->get("onlyoffice"); - $onlyOfficeEntries = array( - array( - "id" => "onlyoffice_docx", - "icon" => $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), - "name" => $l->t("Document"), - "default_filename" => 'untitled.docx' - ), - array( - "id" => "onlyoffice_xlsx", - "icon" => $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), - "name" => $l->t("Spreadsheet"), - "default_filename" => 'untitled.xlsx' - ), - array( - "id" => "onlyoffice_pptx", - "icon" => $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), - "name" => $l->t("Presentation"), - "default_filename" => 'untitled.pptx' - ), - ); - $onlyOfficeEntries = array_map(function ($entry) { - $entry["type"] = "link"; - $entry["active"] = false; - $baseDirectory = $this->getDocumentsFolder(); - $entry["href"] = "/apps/onlyoffice/new?id=" . $entry["id"] . "&name=" . $entry["default_filename"] . "&dir=" . $baseDirectory; - return $entry; - }, $onlyOfficeEntries); - - return $onlyOfficeEntries; - } - - public function getAppOrder() { - $order_raw = $this->config->getUserValue($this->userId, 'murena_launcher', 'order'); - // If order raw empty try to get from 'apporder' app config - $order_raw = !$order_raw ? $this->config->getUserValue($this->userId, 'apporder', 'order') : $order_raw; - // If order raw is still empty, return empty array - if (!$order_raw) { - return self::DEFAULT_ORDER; - } - return json_decode($order_raw); - } - - public function getAppEntries() { - $entries = array_values($this->navigationManager->getAll()); - $order = $this->getAppOrder(); - $entriesByHref = array(); - if ($this->appManager->isEnabledForUser("onlyoffice")) { - $office_entries = $this->getOnlyOfficeEntries(); - $entries = array_merge($entries, $office_entries); - } - $betaGroupName = $this->config->getSystemValue("beta_group_name"); - $isBeta = $this->isBetaUser(); - foreach ($entries as &$entry) { - try { - $entry["icon"] = $this->urlGenerator->imagePath($entry["id"], 'app-color.svg'); - } catch (\Throwable $th) { - //exception - continue execution - } - if (strpos($entry["id"], "external_index") !== 0) { - $entry["target"] = ""; - } else { - $entry["target"] = "_blank"; - } - $entry["class"] = ""; - if (strpos($entry["icon"], "/custom_apps/") === 0) { - $entry["class"] = "icon-invert"; - } - $entry["iconOffsetY"] = 0; - $entry["is_beta"] = 0; - $appEnabledGroups = $this->config->getAppValue($entry['id'], 'enabled', 'no'); - if ($isBeta && str_contains($appEnabledGroups, $betaGroupName)) { - $entry["is_beta"] = 1; - } - $entriesByHref[$entry["href"]] = $entry; - } - /* - Sort apps according to order - Since "entriesByHref" is indexed by "href", simply reverse the order array and prepend in "entriesByHref" - Prepend is done by using each "href" in the reversed order array and doing a union of the "entriesByHref" - array with the current element - */ - if ($order) { - $order = array_reverse($order); - foreach ($order as $href) { - if (!empty($entriesByHref[$href])) { - $entriesByHref = array($href => $entriesByHref[$href]) + $entriesByHref; - } - } - } - unset($entriesByHref['/apps/dashboard/']); - unset($entriesByHref['/apps/murena-dashboard/']); - unset($entriesByHref['']); - - return array_values($entriesByHref); - } - - public function updateOrder(string $order) { - $this->config->setUserValue($this->userId, $this->appName, 'order', $order); - } - - private function isBetaUser() { - $uid = $this->userSession->getUser()->getUID(); - $gid = $this->config->getSystemValue("beta_group_name"); - return $this->groupManager->isInGroup($uid, $gid); - } - public function getDocumentsFolder() { - $folderName = 'Documents'; - $userId = $this->userSession->getUser()->getUID(); - $userPath = $this->rootFolder->getUserFolder($userId)->getPath(); - $filePath = $userPath . '/' . $folderName; - - $folder = null; - if ($this->rootFolder->nodeExists($filePath)) { - $folder = $this->rootFolder->get($filePath); - } else { - $folder = $this->rootFolder->get($userPath); - $filePath = $userPath; - } - return $filePath === $userPath ? '/' : $folder->getName(); - } -} -- GitLab From c972e47e2c8cb997b408b393f3a5195a3d2415f7 Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 10 Jul 2023 12:32:07 -0700 Subject: [PATCH 08/22] change in key --- lib/Controller/PageController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index f382ea3..78f4602 100755 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -41,7 +41,7 @@ class PageController extends Controller { $displayName = $this->userSession->getUser()->getDisplayName(); $this->initialState->provideInitialState('shopReferralProgramUrl', $referralUrl); $this->initialState->provideInitialState('increaseStorageUrl', $storageUrl); - $this->initialState->provideInitialState('entries', $entries); + $this->initialState->provideInitialState('entries', $entries['apps']); $this->initialState->provideInitialState('displayName', $displayName); return new TemplateResponse($this->appName, 'dashboard'); } -- GitLab From cf10d8f2c19e53e484139ac6df2788a190df8445 Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 10 Jul 2023 12:44:50 -0700 Subject: [PATCH 09/22] added temp css --- src/components/AllApps.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index 50de872..71b5300 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -151,6 +151,8 @@ export default { table-layout: fixed; width: 100%; box-sizing: border-box; + transform-origin: 50% 0; + animation: append-animate .3s linear; } .item { vertical-align: middle; @@ -270,4 +272,14 @@ a.item.beta-app { .item-label { height: 2em; } +@keyframes append-animate { + from { + transform: scaleY(0); + opacity: 0; + } + to { + transform: scaleY(1); + opacity: 1; + } +} -- GitLab From 5eb83726c62c65b274c6f62d93c7e8251bb7e8a5 Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 10 Jul 2023 12:50:43 -0700 Subject: [PATCH 10/22] reverted temp css --- src/components/AllApps.vue | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index 71b5300..50de872 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -151,8 +151,6 @@ export default { table-layout: fixed; width: 100%; box-sizing: border-box; - transform-origin: 50% 0; - animation: append-animate .3s linear; } .item { vertical-align: middle; @@ -272,14 +270,4 @@ a.item.beta-app { .item-label { height: 2em; } -@keyframes append-animate { - from { - transform: scaleY(0); - opacity: 0; - } - to { - transform: scaleY(1); - opacity: 1; - } -} -- GitLab From 501427477822666bce9d3351d36589eeb0effa58 Mon Sep 17 00:00:00 2001 From: Ronak Date: Tue, 11 Jul 2023 01:26:46 -0700 Subject: [PATCH 11/22] added Appservice --- lib/Controller/PageController.php | 2 +- lib/Services/AppsService.php | 175 ++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 lib/Services/AppsService.php diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 78f4602..cc55969 100755 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -8,7 +8,7 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Services\IInitialState; use OCP\IConfig; use OCP\IUserSession; -use OCA\EcloudAccounts\Service\AppsService; +use OCA\MurenaDashboard\Service\AppsService; class PageController extends Controller { /** @var IInitialState */ diff --git a/lib/Services/AppsService.php b/lib/Services/AppsService.php new file mode 100644 index 0000000..92a3636 --- /dev/null +++ b/lib/Services/AppsService.php @@ -0,0 +1,175 @@ +appName = $appName; + $this->userId = $userId; + $this->config = $config; + $this->navigationManager = $navigationManager; + $this->appManager = $appManager; + $this->l10nFac = $l10nFac; + $this->userSession = $userSession; + $this->groupManager = $groupManager; + $this->urlGenerator = $urlGenerator; + $this->rootFolder = $rootFolder; + } + + public function getOnlyOfficeEntries(bool $navEntry = true) { + $l = $this->l10nFac->get("onlyoffice"); + $onlyOfficeEntries = array( + array( + "id" => "onlyoffice_docx", + "icon" => ($navEntry) ? $this->urlGenerator->imagePath('onlyoffice', 'docx/app.svg') : $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), + "name" => $l->t("Document"), + "default_filename" => 'untitled.docx' + ), + array( + "id" => "onlyoffice_xlsx", + "icon" => ($navEntry) ? $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app.svg') : $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), + "name" => $l->t("Spreadsheet"), + "default_filename" => 'untitled.xlsx' + ), + array( + "id" => "onlyoffice_pptx", + "icon" => ($navEntry) ? $this->urlGenerator->imagePath('onlyoffice', 'pptx/app.svg') : $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), + "name" => $l->t("Presentation"), + "default_filename" => 'untitled.pptx' + ), + ); + $onlyOfficeEntries = array_map(function ($entry) { + $entry["type"] = "link"; + $entry["active"] = false; + $baseDirectory = $this->getDocumentsFolder(); + $entry["href"] = "/apps/onlyoffice/new?id=" . $entry["id"] . "&name=" . $entry["default_filename"] . "&dir=" . $baseDirectory; + return $entry; + }, $onlyOfficeEntries); + + return $onlyOfficeEntries; + } + + public function getAppOrder() { + $order_raw = $this->config->getUserValue($this->userId, $this->appName, 'order'); + // If order raw empty try to get from 'apporder' app config + $order_raw = !$order_raw ? $this->config->getUserValue($this->userId, 'apporder', 'order') : $order_raw; + // If order raw is still empty, return empty array + if (!$order_raw) { + return self::DEFAULT_ORDER; + } + return json_decode($order_raw); + } + + public function getAppEntries() { + $entries = array_values($this->navigationManager->getAll()); + $order = $this->getAppOrder(); + $entriesByHref = array(); + if ($this->appManager->isEnabledForUser("onlyoffice")) { + $officeEntries = $this->getOnlyOfficeEntries(false); + $entries = array_merge($entries, $officeEntries); + } + $betaGroupName = $this->config->getSystemValue("beta_group_name"); + $isBeta = $this->isBetaUser(); + foreach ($entries as &$entry) { + try { + $entry["icon"] = $this->urlGenerator->imagePath($entry["id"], 'app-color.svg'); + } catch (\Throwable $th) { + //exception - continue execution + } + if (strpos($entry["id"], "external_index") !== 0) { + $entry["target"] = ""; + } else { + $entry["target"] = "_blank"; + } + $entry["class"] = ""; + if (strpos($entry["icon"], "/custom_apps/") === 0) { + $entry["class"] = "icon-invert"; + } + $entry["iconOffsetY"] = 0; + $entry["is_beta"] = 0; + $appEnabledGroups = $this->config->getAppValue($entry['id'], 'enabled', 'no'); + if ($isBeta && str_contains($appEnabledGroups, $betaGroupName)) { + $entry["is_beta"] = 1; + } + $entriesByHref[$entry["href"]] = $entry; + } + /* + Sort apps according to order + Since "entriesByHref" is indexed by "href", simply reverse the order array and prepend in "entriesByHref" + Prepend is done by using each "href" in the reversed order array and doing a union of the "entriesByHref" + array with the current element + */ + if ($order) { + $order = array_reverse($order); + foreach ($order as $href) { + if (!empty($entriesByHref[$href])) { + $entriesByHref = array($href => $entriesByHref[$href]) + $entriesByHref; + } + } + } + unset($entriesByHref['/apps/dashboard/']); + unset($entriesByHref['/apps/murena-dashboard/']); + unset($entriesByHref['']); + + return array('apps' => array_values($entriesByHref)); + } + + public function updateOrder(string $order) { + $this->config->setUserValue($this->userId, $this->appName, 'order', $order); + } + + private function isBetaUser() { + $uid = $this->userSession->getUser()->getUID(); + $gid = $this->config->getSystemValue("beta_group_name"); + return $this->groupManager->isInGroup($uid, $gid); + } + public function getDocumentsFolder() + { + $folderName = 'Documents'; + $userId = $this->userSession->getUser()->getUID(); + $userPath = $this->rootFolder->getUserFolder($userId)->getPath(); + $filePath = $userPath . '/' . $folderName; + + $folder = null; + if ($this->rootFolder->nodeExists($filePath)) { + $folder = $this->rootFolder->get($filePath); + } else { + $folder = $this->rootFolder->get($userPath); + $filePath = $userPath; + } + return $filePath === $userPath ? '/' : $folder->getName(); + } +} -- GitLab From 674e076f2233f3e9ac70a9e83d47ce45bc8a8ec0 Mon Sep 17 00:00:00 2001 From: Ronak Date: Tue, 11 Jul 2023 01:30:20 -0700 Subject: [PATCH 12/22] lint --- lib/Services/AppsService.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Services/AppsService.php b/lib/Services/AppsService.php index 92a3636..99ce9cb 100644 --- a/lib/Services/AppsService.php +++ b/lib/Services/AppsService.php @@ -156,8 +156,7 @@ class AppsService { $gid = $this->config->getSystemValue("beta_group_name"); return $this->groupManager->isInGroup($uid, $gid); } - public function getDocumentsFolder() - { + public function getDocumentsFolder() { $folderName = 'Documents'; $userId = $this->userSession->getUser()->getUID(); $userPath = $this->rootFolder->getUserFolder($userId)->getPath(); -- GitLab From 846e99eedc317bd90240825a3fba115dd5247609 Mon Sep 17 00:00:00 2001 From: Ronak Date: Tue, 11 Jul 2023 01:53:31 -0700 Subject: [PATCH 13/22] dashboard changes reverted --- lib/Controller/PageController.php | 2 +- lib/Services/AppsService.php | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index cc55969..7248821 100755 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -41,7 +41,7 @@ class PageController extends Controller { $displayName = $this->userSession->getUser()->getDisplayName(); $this->initialState->provideInitialState('shopReferralProgramUrl', $referralUrl); $this->initialState->provideInitialState('increaseStorageUrl', $storageUrl); - $this->initialState->provideInitialState('entries', $entries['apps']); + $this->initialState->provideInitialState('entries', $entries); $this->initialState->provideInitialState('displayName', $displayName); return new TemplateResponse($this->appName, 'dashboard'); } diff --git a/lib/Services/AppsService.php b/lib/Services/AppsService.php index 99ce9cb..360d367 100644 --- a/lib/Services/AppsService.php +++ b/lib/Services/AppsService.php @@ -23,7 +23,6 @@ class AppsService { private IURLGenerator $urlGenerator; private IRootFolder $rootFolder; - private const DEFAULT_ORDER = array("/apps/snappymail/", "/apps/calendar/", "/apps/files/" , "/apps/photos/", "/apps/memories/", "/apps/contacts/", "/apps/onlyoffice/ajax/new?id=onlyoffice_docx", "/apps/onlyoffice/ajax/new?id=onlyoffice_xlsx", "/apps/onlyoffice/ajax/new?id=onlyoffice_pptx", "/apps/notes/", "/apps/tasks/", "https://spot.murena.io" , "https://murena.com" ); public function __construct( $appName, @@ -49,24 +48,24 @@ class AppsService { $this->rootFolder = $rootFolder; } - public function getOnlyOfficeEntries(bool $navEntry = true) { + public function getOnlyOfficeEntries() { $l = $this->l10nFac->get("onlyoffice"); $onlyOfficeEntries = array( array( "id" => "onlyoffice_docx", - "icon" => ($navEntry) ? $this->urlGenerator->imagePath('onlyoffice', 'docx/app.svg') : $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), + "icon" => $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), "name" => $l->t("Document"), "default_filename" => 'untitled.docx' ), array( "id" => "onlyoffice_xlsx", - "icon" => ($navEntry) ? $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app.svg') : $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), + "icon" => $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), "name" => $l->t("Spreadsheet"), "default_filename" => 'untitled.xlsx' ), array( "id" => "onlyoffice_pptx", - "icon" => ($navEntry) ? $this->urlGenerator->imagePath('onlyoffice', 'pptx/app.svg') : $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), + "icon" => $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), "name" => $l->t("Presentation"), "default_filename" => 'untitled.pptx' ), @@ -83,7 +82,7 @@ class AppsService { } public function getAppOrder() { - $order_raw = $this->config->getUserValue($this->userId, $this->appName, 'order'); + $order_raw = $this->config->getUserValue($this->userId, 'murena_launcher', 'order'); // If order raw empty try to get from 'apporder' app config $order_raw = !$order_raw ? $this->config->getUserValue($this->userId, 'apporder', 'order') : $order_raw; // If order raw is still empty, return empty array @@ -98,8 +97,8 @@ class AppsService { $order = $this->getAppOrder(); $entriesByHref = array(); if ($this->appManager->isEnabledForUser("onlyoffice")) { - $officeEntries = $this->getOnlyOfficeEntries(false); - $entries = array_merge($entries, $officeEntries); + $office_entries = $this->getOnlyOfficeEntries(); + $entries = array_merge($entries, $office_entries); } $betaGroupName = $this->config->getSystemValue("beta_group_name"); $isBeta = $this->isBetaUser(); @@ -144,7 +143,7 @@ class AppsService { unset($entriesByHref['/apps/murena-dashboard/']); unset($entriesByHref['']); - return array('apps' => array_values($entriesByHref)); + return array_values($entriesByHref); } public function updateOrder(string $order) { -- GitLab From 841c946f0326b447c8e19dc07fd63b909f89369e Mon Sep 17 00:00:00 2001 From: Ronak Date: Tue, 11 Jul 2023 01:58:22 -0700 Subject: [PATCH 14/22] service folder --- lib/{Services => Service}/AppsService.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{Services => Service}/AppsService.php (100%) diff --git a/lib/Services/AppsService.php b/lib/Service/AppsService.php similarity index 100% rename from lib/Services/AppsService.php rename to lib/Service/AppsService.php -- GitLab From 01109ebfbe2ead26cf76e26cef31b8cc0e5e474e Mon Sep 17 00:00:00 2001 From: Ronak Date: Tue, 11 Jul 2023 08:47:43 -0700 Subject: [PATCH 15/22] moved baseDirectory out of array_map --- lib/Service/AppsService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 360d367..d93ded2 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -70,10 +70,10 @@ class AppsService { "default_filename" => 'untitled.pptx' ), ); - $onlyOfficeEntries = array_map(function ($entry) { + $baseDirectory = $this->getDocumentsFolder(); + $onlyOfficeEntries = array_map(function ($entry) use ($baseDirectory) { $entry["type"] = "link"; $entry["active"] = false; - $baseDirectory = $this->getDocumentsFolder(); $entry["href"] = "/apps/onlyoffice/new?id=" . $entry["id"] . "&name=" . $entry["default_filename"] . "&dir=" . $baseDirectory; return $entry; }, $onlyOfficeEntries); -- GitLab From 7ac4b9e949dc938264569e01f740d671ccb08311 Mon Sep 17 00:00:00 2001 From: Ronak Date: Tue, 11 Jul 2023 09:10:43 -0700 Subject: [PATCH 16/22] added translations --- l10n/de.js | 3 ++- l10n/de.json | 3 ++- l10n/en.js | 3 ++- l10n/en.json | 3 ++- l10n/es.js | 3 ++- l10n/es.json | 3 ++- l10n/fr.js | 3 ++- l10n/fr.json | 3 ++- l10n/it.js | 3 ++- l10n/it.json | 3 ++- lib/Service/AppsService.php | 8 +++++--- 11 files changed, 25 insertions(+), 13 deletions(-) diff --git a/l10n/de.js b/l10n/de.js index f656e84..2caaea9 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -13,6 +13,7 @@ OC.L10N.register( "Upgrade Storage" : "Speicherplatz erweitern", "getCredits" : "Holen Sie sich bis zu 40 € Guthaben für Ihren Cloud-Speicher, indem Sie Ihre Freunde einladen!", "openAnAccount" : "Für jeden Freund, der ein Konto eröffnet, erhalten Sie beide 2 €, die für Cloud-Speicher verwendet werden können.", - "Invite Your Friends" : "Lade deine Freunde ein" + "Invite Your Friends" : "Lade deine Freunde ein", + "untitled": "unbetitelt" }, "nplurals=2; plural=n != 1;"); diff --git a/l10n/de.json b/l10n/de.json index 0745f5d..27cd47d 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -11,6 +11,7 @@ "Upgrade Storage" : "Speicherplatz erweitern", "getCredits" : "Holen Sie sich bis zu 40 € Guthaben für Ihren Cloud-Speicher, indem Sie Ihre Freunde einladen!", "openAnAccount" : "Für jeden Freund, der ein Konto eröffnet, erhalten Sie beide 2 €, die für Cloud-Speicher verwendet werden können.", - "Invite Your Friends" : "Lade deine Freunde ein" + "Invite Your Friends" : "Lade deine Freunde ein", + "untitled": "unbetitelt" },"pluralForm" :"nplurals=2; plural=n != 1;" } \ No newline at end of file diff --git a/l10n/en.js b/l10n/en.js index 59c9511..49e2ebb 100755 --- a/l10n/en.js +++ b/l10n/en.js @@ -10,6 +10,7 @@ OC.L10N.register( "Upgrade Storage" : "Upgrade Storage", "getCredits" : "Get up to 40€ of credits for your cloud storage by inviting your friends!", "openAnAccount" : "For every friend who opens an account, you will earn 2€ to be used for cloud storage on Murena cloud.", - "Invite Your Friends" : "Invite Your Friends" + "Invite Your Friends" : "Invite Your Friends", + "untitled" : "untitled" }, "nplurals=2; plural=n != 1;"); diff --git a/l10n/en.json b/l10n/en.json index 6a514dd..eab1a23 100755 --- a/l10n/en.json +++ b/l10n/en.json @@ -8,6 +8,7 @@ "Upgrade Storage" : "Upgrade Storage", "getCredits" : "Get up to 40€ of credits for your cloud storage by inviting your friends!", "openAnAccount" : "For every friend who opens an account, you will earn 2€ to be used for cloud storage on Murena cloud.", - "Invite Your Friends" : "Invite Your Friends" + "Invite Your Friends" : "Invite Your Friends", + "untitled" : "untitled" },"pluralForm" :"nplurals=2; plural=n != 1;" } \ No newline at end of file diff --git a/l10n/es.js b/l10n/es.js index ce2e185..c8d204e 100644 --- a/l10n/es.js +++ b/l10n/es.js @@ -8,6 +8,7 @@ OC.L10N.register( "Upgrade Storage" : "Actualizar almacenamiento", "getCredits" : "¡Obtenga hasta 40€ de créditos para su almacenamiento en la nube invitando a sus amigos!", "openAnAccount" : "Por cada amigo que abra una cuenta, ambos ganarán 2 € que se utilizarán para el almacenamiento en la nube en Murena cloud.", - "Invite Your Friends" : "Invita a tus amigos" + "Invite Your Friends" : "Invita a tus amigos", + "untitled": "sin título" }, ""); diff --git a/l10n/es.json b/l10n/es.json index 684e18d..09b1216 100644 --- a/l10n/es.json +++ b/l10n/es.json @@ -6,6 +6,7 @@ "Upgrade Storage" : "Actualizar almacenamiento", "getCredits" : "¡Obtenga hasta 40€ de créditos para su almacenamiento en la nube invitando a sus amigos!", "openAnAccount" : "Por cada amigo que abra una cuenta, ambos ganarán 2 € que se utilizarán para el almacenamiento en la nube en Murena cloud.", - "Invite Your Friends" : "Invita a tus amigos" + "Invite Your Friends" : "Invita a tus amigos", + "untitled": "sin título" },"pluralForm" :"" } \ No newline at end of file diff --git a/l10n/fr.js b/l10n/fr.js index 51ef612..c0a1be0 100644 --- a/l10n/fr.js +++ b/l10n/fr.js @@ -13,6 +13,7 @@ OC.L10N.register( "Upgrade Storage" : "Obtenez plus de stockage", "getCredits" : "Obtenez jusqu'à 40€ de crédits pour votre stockage cloud en invitant vos amis !", "openAnAccount" : "Pour chaque ami qui ouvre un compte, vous gagnerez tous les deux 2€ à utiliser pour le stockage cloud sur Murena cloud.", - "Invite Your Friends" : "Parrainez vos amis" + "Invite Your Friends" : "Parrainez vos amis", + "untitled": "sans titre" }, "nplurals=2; plural=n > 1;"); diff --git a/l10n/fr.json b/l10n/fr.json index 224803a..ed781e8 100644 --- a/l10n/fr.json +++ b/l10n/fr.json @@ -11,6 +11,7 @@ "Upgrade Storage" : "Obtenez plus de stockage", "getCredits" : "Obtenez jusqu'à 40€ de crédits pour votre stockage cloud en invitant vos amis !", "openAnAccount" : "Pour chaque ami qui ouvre un compte, vous gagnerez tous les deux 2€ à utiliser pour le stockage cloud sur Murena cloud.", - "Invite Your Friends" : "Parrainez vos amis" + "Invite Your Friends" : "Parrainez vos amis", + "untitled": "sans titre" },"pluralForm" :"nplurals=2; plural=n > 1;" } \ No newline at end of file diff --git a/l10n/it.js b/l10n/it.js index 01a0b06..258496e 100644 --- a/l10n/it.js +++ b/l10n/it.js @@ -13,6 +13,7 @@ OC.L10N.register( "Upgrade Storage" : "Ingrandisci lo Spazio Disco", "getCredits" : "ottieni Crediti", "openAnAccount" : "apri un Account", - "Invite Your Friends" : "Invita gli Amici" + "Invite Your Friends" : "Invita gli Amici", + "untitled" : "senza titolo" }, "nplurals=2; plural=n != 1;"); diff --git a/l10n/it.json b/l10n/it.json index 21dc002..74bd738 100644 --- a/l10n/it.json +++ b/l10n/it.json @@ -11,6 +11,7 @@ "Upgrade Storage" : "Ingrandisci lo Spazio Disco", "getCredits" : "ottieni Crediti", "openAnAccount" : "apri un Account", - "Invite Your Friends" : "Invita gli Amici" + "Invite Your Friends" : "Invita gli Amici", + "untitled" : "senza titolo" },"pluralForm" :"nplurals=2; plural=n != 1;" } \ No newline at end of file diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index d93ded2..12745fb 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -50,24 +50,26 @@ class AppsService { public function getOnlyOfficeEntries() { $l = $this->l10nFac->get("onlyoffice"); + $l_dashboard = $this->l10nFac->get("murena-dashboard"); + $untitled = $l_dashboard->t("untitled"); $onlyOfficeEntries = array( array( "id" => "onlyoffice_docx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), "name" => $l->t("Document"), - "default_filename" => 'untitled.docx' + "default_filename" => $untitled.'.docx' ), array( "id" => "onlyoffice_xlsx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), "name" => $l->t("Spreadsheet"), - "default_filename" => 'untitled.xlsx' + "default_filename" => $untitled.'.xlsx' ), array( "id" => "onlyoffice_pptx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), "name" => $l->t("Presentation"), - "default_filename" => 'untitled.pptx' + "default_filename" => $untitled.'.pptx' ), ); $baseDirectory = $this->getDocumentsFolder(); -- GitLab From 06cb7599ad4c5025fa245e050975af91b2b583ea Mon Sep 17 00:00:00 2001 From: Ronak Date: Thu, 13 Jul 2023 00:50:18 -0700 Subject: [PATCH 17/22] change in onlyoffice array --- lib/Service/AppsService.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 12745fb..0095e4f 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -50,36 +50,38 @@ class AppsService { public function getOnlyOfficeEntries() { $l = $this->l10nFac->get("onlyoffice"); - $l_dashboard = $this->l10nFac->get("murena-dashboard"); - $untitled = $l_dashboard->t("untitled"); + $lDashboard = $this->l10nFac->get("murena-dashboard"); + $untitled = $lDashboard->t("untitled"); + $baseDirectory = $this->getDocumentsFolder(); $onlyOfficeEntries = array( array( "id" => "onlyoffice_docx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), "name" => $l->t("Document"), - "default_filename" => $untitled.'.docx' + "default_filename" => $untitled.'.docx', + "type" => "link", + "active" => false, + "href" => "/apps/onlyoffice/new?id=onlyoffice_docx&name=" . $untitled.".docx&dir=" . $baseDirectory ), array( "id" => "onlyoffice_xlsx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), "name" => $l->t("Spreadsheet"), - "default_filename" => $untitled.'.xlsx' + "default_filename" => $untitled.'.xlsx', + "type" => "link", + "active" => false, + "href" => "/apps/onlyoffice/new?id=onlyoffice_xlsx&name=" . $untitled.".xlsx&dir=" . $baseDirectory ), array( "id" => "onlyoffice_pptx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), "name" => $l->t("Presentation"), - "default_filename" => $untitled.'.pptx' + "default_filename" => $untitled.'.pptx', + "type" => "link", + "active" => false, + "href" => "/apps/onlyoffice/new?id=onlyoffice_pptx&name=" . $untitled.".pptx&dir=" . $baseDirectory ), ); - $baseDirectory = $this->getDocumentsFolder(); - $onlyOfficeEntries = array_map(function ($entry) use ($baseDirectory) { - $entry["type"] = "link"; - $entry["active"] = false; - $entry["href"] = "/apps/onlyoffice/new?id=" . $entry["id"] . "&name=" . $entry["default_filename"] . "&dir=" . $baseDirectory; - return $entry; - }, $onlyOfficeEntries); - return $onlyOfficeEntries; } -- GitLab From 8a9a5ece5eac58951ce63fa8c9ff0d04b3a90110 Mon Sep 17 00:00:00 2001 From: Ronak Date: Thu, 13 Jul 2023 01:04:38 -0700 Subject: [PATCH 18/22] removed folder null --- lib/Service/AppsService.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 0095e4f..9c02107 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -165,11 +165,10 @@ class AppsService { $userPath = $this->rootFolder->getUserFolder($userId)->getPath(); $filePath = $userPath . '/' . $folderName; - $folder = null; + $folder = $this->rootFolder->get($userPath); if ($this->rootFolder->nodeExists($filePath)) { $folder = $this->rootFolder->get($filePath); } else { - $folder = $this->rootFolder->get($userPath); $filePath = $userPath; } return $filePath === $userPath ? '/' : $folder->getName(); -- GitLab From be0c91f2da2794f80357cc0274b5dca57eef3da2 Mon Sep 17 00:00:00 2001 From: Ronak Date: Thu, 13 Jul 2023 01:06:29 -0700 Subject: [PATCH 19/22] removed folder null --- lib/Service/AppsService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 9c02107..40fbc96 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -50,8 +50,8 @@ class AppsService { public function getOnlyOfficeEntries() { $l = $this->l10nFac->get("onlyoffice"); - $lDashboard = $this->l10nFac->get("murena-dashboard"); - $untitled = $lDashboard->t("untitled"); + $l10nDashboard = $this->l10nFac->get("murena-dashboard"); + $untitled = $l10nDashboard->t("untitled"); $baseDirectory = $this->getDocumentsFolder(); $onlyOfficeEntries = array( array( -- GitLab From 114b33b80c524ab86129054332cb2b290fde9b2e Mon Sep 17 00:00:00 2001 From: Ronak Date: Thu, 13 Jul 2023 01:09:43 -0700 Subject: [PATCH 20/22] removed defaultname --- lib/Service/AppsService.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 40fbc96..5142743 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -58,7 +58,6 @@ class AppsService { "id" => "onlyoffice_docx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'docx/app-color.svg'), "name" => $l->t("Document"), - "default_filename" => $untitled.'.docx', "type" => "link", "active" => false, "href" => "/apps/onlyoffice/new?id=onlyoffice_docx&name=" . $untitled.".docx&dir=" . $baseDirectory @@ -67,7 +66,6 @@ class AppsService { "id" => "onlyoffice_xlsx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'xlsx/app-color.svg'), "name" => $l->t("Spreadsheet"), - "default_filename" => $untitled.'.xlsx', "type" => "link", "active" => false, "href" => "/apps/onlyoffice/new?id=onlyoffice_xlsx&name=" . $untitled.".xlsx&dir=" . $baseDirectory @@ -76,7 +74,6 @@ class AppsService { "id" => "onlyoffice_pptx", "icon" => $this->urlGenerator->imagePath('onlyoffice', 'pptx/app-color.svg'), "name" => $l->t("Presentation"), - "default_filename" => $untitled.'.pptx', "type" => "link", "active" => false, "href" => "/apps/onlyoffice/new?id=onlyoffice_pptx&name=" . $untitled.".pptx&dir=" . $baseDirectory -- GitLab From b7c1510dcf26eb082f1ecb7d6f5a9222771236ca Mon Sep 17 00:00:00 2001 From: Ronak Date: Tue, 18 Jul 2023 00:24:07 -0700 Subject: [PATCH 21/22] removed handleclick event --- src/components/AllApps.vue | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index 50de872..59bd1fb 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -38,7 +38,7 @@ :class="{ 'beta-app': entry.is_beta, 'item': true }" :href="entry.href" :target="entry.target" - @click="handleOfficeClick(entry, $event)"> + >
+ >