Skip to content

Commit

Permalink
Rename project to Collaboration app.
Browse files Browse the repository at this point in the history
  • Loading branch information
redblom committed Jul 19, 2024
1 parent e4cf100 commit db10dc3
Show file tree
Hide file tree
Showing 63 changed files with 473 additions and 476 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app_name=invitation
app_name=collaboration
# VERSION=please_set_version
version=$(version)
app_dir_name=$(notdir $(CURDIR))
Expand Down
10 changes: 5 additions & 5 deletions appinfo/Migrations/Version20231130102037.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace OCA\invitation\Migrations;
namespace OCA\Collaboration\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
Expand All @@ -21,13 +21,13 @@ public function changeSchema(Schema $schema, array $options)
$prefix = $options['tablePrefix'];

try {
$schema->getTable("{$prefix}invitation_invitations");
$schema->getTable("{$prefix}collaboration_invitations");
} catch (Exception $e) {
if ($e->getCode() == SchemaException::TABLE_DOESNT_EXIST) {
//----------------------
// The invitations table
//----------------------
$table = $schema->createTable("{$prefix}invitation_invitations");
$table = $schema->createTable("{$prefix}collaboration_invitations");
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'unsigned' => true,
Expand Down Expand Up @@ -100,13 +100,13 @@ public function changeSchema(Schema $schema, array $options)
}
}
try {
$schema->getTable("{$prefix}invitation_invitation_service_providers");
$schema->getTable("{$prefix}collaboration_invitation_service_providers");
} catch (Exception $e) {
if ($e->getCode() == SchemaException::TABLE_DOESNT_EXIST) {
//---------------------------------------
// the invitation_service_providers table
//---------------------------------------
$table = $schema->createTable("{$prefix}invitation_invitation_service_providers");
$table = $schema->createTable("{$prefix}collaboration_invitation_service_providers");
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'unsigned' => true,
Expand Down
8 changes: 4 additions & 4 deletions appinfo/Migrations/Version20231130125300.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace OCA\invitation\Migrations;
namespace OCA\Collaboration\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
Expand All @@ -21,13 +21,13 @@ public function changeSchema(Schema $schema, array $options)
$prefix = $options['tablePrefix'];

//----------------------
// The invitations constants table
// The collaboration constants table
//----------------------
try {
$schema->getTable("{$prefix}invitation_constants");
$schema->getTable("{$prefix}collaboration_constants");
} catch (Exception $e) {
if ($e->getCode() == SchemaException::TABLE_DOESNT_EXIST) {
$table = $schema->createTable("{$prefix}invitation_constants");
$table = $schema->createTable("{$prefix}collaboration_constants");
$table->addColumn('name', Types::STRING, [
'length' => 255,
'notnull' => true,
Expand Down
40 changes: 20 additions & 20 deletions appinfo/Migrations/Version20240209130007.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<?php

namespace OCA\invitation\Migrations;
namespace OCA\Collaboration\Migrations;

use OCP\IDBConnection;
use OCP\Migration\ISqlMigration;

/**
* Adds constants to oc_invitation_constants table
* Adds constants to oc_collaboration_constants table
* Adds views: invitation_view_invitations, invitation_view_remote_users
*/
class Version20240209130007 implements ISqlMigration
{
public function sql(IDBConnection $connection)
{
$stmnt = $connection->prepare(
"INSERT INTO `oc_invitation_constants` (`name`, `value`)
"INSERT INTO `oc_collaboration_constants` (`name`, `value`)
SELECT * FROM (SELECT 'invitation.received', 'received') AS tmp
WHERE NOT EXISTS (
SELECT name FROM oc_invitation_constants WHERE name = 'invitation.received'
SELECT name FROM oc_collaboration_constants WHERE name = 'invitation.received'
) LIMIT 1;
INSERT INTO `oc_invitation_constants` (`name`, `value`)
INSERT INTO `oc_collaboration_constants` (`name`, `value`)
SELECT * FROM (SELECT 'invitation.sent', 'sent') AS tmp
WHERE NOT EXISTS (
SELECT name FROM oc_invitation_constants WHERE name = 'invitation.sent'
SELECT name FROM oc_collaboration_constants WHERE name = 'invitation.sent'
) LIMIT 1;
drop view if exists invitation_view_invitations;
create view invitation_view_invitations as
drop view if exists collaboration_view_invitations;
create view collaboration_view_invitations as
select distinct
s.id, s.token, s.timestamp, s.status,
s.user_cloud_id, s.user_provider_endpoint, s.sent_received,
Expand All @@ -37,53 +37,53 @@ public function sql(IDBConnection $connection)
from (
select
i.id as id, i.token as token, i.timestamp as timestamp, i.status as status,
i.sender_cloud_id as user_cloud_id, i.provider_endpoint as user_provider_endpoint, (select value from oc_invitation_constants where name='invitation.sent') as sent_received,
i.sender_cloud_id as user_cloud_id, i.provider_endpoint as user_provider_endpoint, (select value from oc_collaboration_constants where name='invitation.sent') as sent_received,
i.provider_endpoint as provider_endpoint, i.recipient_endpoint as recipient_endpoint,
i.sender_cloud_id as sender_cloud_id, i.sender_name as sender_name, i.sender_email as sender_email,
i.recipient_cloud_id as recipient_cloud_id, i.recipient_name as recipient_name, i.recipient_email as recipient_email,
i.recipient_cloud_id as remote_user_cloud_id, i.recipient_name as remote_user_name, i.recipient_email as remote_user_email, i.recipient_endpoint as remote_user_provider_endpoint
from oc_invitation_invitations i
from oc_collaboration_invitations i
union all
select
ii.id as id, ii.token as token, ii.timestamp as timestamp, ii.status as status,
ii.recipient_cloud_id as user_cloud_id, ii.recipient_endpoint as user_provider_endpoint, (select value from oc_invitation_constants where name='invitation.received') as sent_received,
ii.recipient_cloud_id as user_cloud_id, ii.recipient_endpoint as user_provider_endpoint, (select value from oc_collaboration_constants where name='invitation.received') as sent_received,
ii.provider_endpoint as provider_endpoint, ii.recipient_endpoint as recipient_endpoint,
ii.sender_cloud_id as sender_cloud_id, ii.sender_name as sender_name, ii.sender_email as sender_email,
ii.recipient_cloud_id as recipient_cloud_id, ii.recipient_name as recipient_name, ii.recipient_email as recipient_email,
ii.sender_cloud_id as remote_user_cloud_id, ii.sender_name as remote_user_name, ii.sender_email as remote_user_email, ii.provider_endpoint as remote_user_provider_endpoint
from oc_invitation_invitations ii
from oc_collaboration_invitations ii
) s
left join oc_invitation_invitation_service_providers as isp
left join oc_collaboration_invitation_service_providers as isp
on isp.endpoint=s.remote_user_provider_endpoint
join oc_appconfig c
on c.configvalue=s.user_provider_endpoint
where c.appid='invitation' and c.configkey='endpoint'
where c.appid='collaboration' and c.configkey='endpoint'
group by s.id;
drop view if exists invitation_view_remote_users;
create view invitation_view_remote_users as
drop view if exists collaboration_view_remote_users;
create view collaboration_view_remote_users as
select distinct
s.invitation_id, s.user_cloud_id, s.user_name, s.remote_user_cloud_id, s.remote_user_name, s.remote_user_email, s.remote_provider_endpoint as remote_user_provider_endpoint, isp.name as remote_user_provider_name
from (
select
i.id as invitation_id, i.provider_endpoint as provider_endpoint,
i.sender_cloud_id as user_cloud_id, i.sender_name as user_name,
i.recipient_cloud_id as remote_user_cloud_id, i.recipient_name as remote_user_name, i.recipient_email as remote_user_email, i.recipient_endpoint as remote_provider_endpoint
from oc_invitation_invitations i
from oc_collaboration_invitations i
where i.status='accepted'
union all
select
ii.id as invitation_id, ii.recipient_endpoint as provider_endpoint,
ii.recipient_cloud_id as user_cloud_id, ii.recipient_name as user_name,
ii.sender_cloud_id as remote_user_cloud_id, ii.sender_name as remote_user_name, ii.sender_email as remote_user_email, ii.provider_endpoint as remote_provider_endpoint
from oc_invitation_invitations ii
from oc_collaboration_invitations ii
where ii.status='accepted'
) s
join oc_invitation_invitation_service_providers as isp
join oc_collaboration_invitation_service_providers as isp
on isp.endpoint=s.remote_provider_endpoint
join oc_appconfig c
on c.configvalue=s.provider_endpoint
where c.appid='invitation' and c.configkey='endpoint'
where c.appid='collaboration' and c.configkey='endpoint'
group by s.invitation_id;"
);
$stmnt->execute();
Expand Down
20 changes: 11 additions & 9 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

use OCA\Invitation\AppInfo\InvitationApp;
use OCA\Collaboration\AppInfo\CollaborationApp;
use OCP\Util;

require __DIR__ . '/../vendor/autoload.php';
Expand All @@ -20,29 +20,31 @@ function () {

return [
// The string under which your app will be referenced in owncloud
'id' => InvitationApp::APP_NAME,
'id' => CollaborationApp::APP_NAME,

// The sorting weight for the navigation.
// The higher the number, the higher will it be listed in the navigation
'order' => 10,

// The route that will be shown on startup
'href' => $urlGenerator->linkToRoute(InvitationApp::APP_NAME . '.invitation.index'),
'href' => $urlGenerator->linkToRoute(CollaborationApp::APP_NAME . '.invitation.index'),

// The icon that will be shown in the navigation, located in img/
'icon' => $urlGenerator->imagePath(InvitationApp::APP_NAME, 'handshake.svg'),
'icon' => $urlGenerator->imagePath(CollaborationApp::APP_NAME, 'handshake.svg'),

// The application's title, used in the navigation & the settings page of your app
'name' => OC::$server->getL10N(InvitationApp::APP_NAME)->t('Invitation'),
'name' => OC::$server->getL10N(CollaborationApp::APP_NAME)->t('Invitation'),
];
}
);
$app = \OC::$server->query(\OCA\Invitation\AppInfo\InvitationApp::class);
$app = \OC::$server->query(\OCA\Collaboration\AppInfo\CollaborationApp::class);
// this overrides the OC core sharedialogview.js file.
Util::addScript(InvitationApp::APP_NAME, 'oc/sharedialogview');
Util::addScript(CollaborationApp::APP_NAME, 'oc/sharedialogview');
Util::addStyle(CollaborationApp::APP_NAME, 'pure-min-css-3.0.0');
Util::addStyle(CollaborationApp::APP_NAME, 'collaboration');
} else {
\OC::$server->getLogger()->error('Error: not installed. Invitations app requires: Federated File Sharing app, Notifications app', ['app' => InvitationApp::APP_NAME]);
\OC::$server->getLogger()->error('Error: not installed. Collaboration app requires: Federated File Sharing app, Notifications app', ['app' => CollaborationApp::APP_NAME]);
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', function () {
script(InvitationApp::APP_NAME, 'app-install-error');
script(CollaborationApp::APP_NAME, 'app-install-error');
});
}
14 changes: 7 additions & 7 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<info>
<!-- Mandatory fields -->
<id>invitation</id>
<name>Invitation App</name>
<description>Invitation App</description>
<id>collaboration</id>
<name>Collaboration</name>
<description>Collaboration</description>
<version>0.003</version>
<!-- TODO: check licence-->
<licence>mit</licence>
<!-- <screenshot small-thumbnail="https://raw.githubusercontent.com/foo/yourapp/master/screenshots/thumb.png">https://raw.githubusercontent.com/foo/yourapp/master/screenshots/big.png</screenshot> -->
<!-- Category values available at: https://marketplace.owncloud.com/ajax/categories -->
<category>Integration.</category>
<category>Collaboration</category>
<summary>Enhances federated sharing between Owncloud instances by implementing an invitation workflow.</summary>
<types>
</types>
Expand All @@ -23,7 +23,7 @@


<author>Antoon Prins</author>
<namespace>Invitation</namespace>
<namespace>Collaboration</namespace>
<website>https://github.com/sara-nl/oc-invitation</website>
<bugs>https://github.com/sara-nl/oc-invitation/issues</bugs>
<repository type="git">https://github.com/sara-nl/oc-invitation.git</repository>
Expand All @@ -33,11 +33,11 @@
</dependencies>

<settings>
<admin>OCA\Invitation\Settings\Admin</admin>
<admin>OCA\Collaboration\Settings\Admin</admin>
</settings>

<background-jobs>
<job>OCA\Invitation\Job\CleanupInvitations</job>
<job>OCA\Collaboration\Job\CleanupInvitations</job>
</background-jobs>

<use-migrations>true</use-migrations>
Expand Down
2 changes: 1 addition & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
return [
'routes' => [
// bespoke API - invitation
// unprotected endpoint /invitation
// unprotected endpoint /collaboration
['name' => 'invitation#invitation', 'url' => '/invite/{token}', 'verb' => 'GET'],
['name' => 'invitation#invitation_form', 'url' => '/invitation-form', 'verb' => 'GET'],
['name' => 'invitation#generate_invite', 'url' => '/generate-invite', 'verb' => 'POST'],
Expand Down
14 changes: 7 additions & 7 deletions css/invitation.css → css/collaboration.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ span.settings-error {
color: red;
}

div.app-invitation div.error a {
div.app-collaboration div.error a {
color: darkblue !important;
}

Expand Down Expand Up @@ -260,16 +260,16 @@ div.wayf div.institute-logo img {
max-height: 2.5em;
}

div.app-invitation>div.oc-dialog {
div.app-collaboration>div.oc-dialog {
width: 50%;
z-index: 10000;
}

div.app-invitation>div.oc-dialog h3.oc-dialog-title {
div.app-collaboration>div.oc-dialog h3.oc-dialog-title {
font-size: larger;
}

div.app-invitation>div.oc-dialog legend {
div.app-collaboration>div.oc-dialog legend {
font-weight: normal;
}

Expand All @@ -295,15 +295,15 @@ div.invitation-form div.invitation-form-button-row {
padding-top: .7em;
}

div.app-invitation div.oc-dialog {
div.app-collaboration div.oc-dialog {
z-index: 900;
}

div.app-invitation>div.oc-dialog-dim {
div.app-collaboration>div.oc-dialog-dim {
z-index: 899;
}

div.app-invitation>div.oc-dialog-dim.confirmation {
div.app-collaboration>div.oc-dialog-dim.confirmation {
z-index: 999;
}

Expand Down
2 changes: 1 addition & 1 deletion js/invitation-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
*/
let _call = function (route, method, paramsObject, successCallback, errorCallback) {
var path = trimSlashes(route);
var endpoint = OC.generateUrl('/apps/invitation/' + path);
var endpoint = OC.generateUrl('/apps/collaboration/' + path);
var options = {
method: method,
headers: {
Expand Down
Loading

0 comments on commit db10dc3

Please sign in to comment.