Skip to content

Commit

Permalink
feat: Rename circles to teams in a few more places
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Mar 6, 2024
1 parent 5a704f8 commit 85d6522
Show file tree
Hide file tree
Showing 24 changed files with 123 additions and 123 deletions.
12 changes: 6 additions & 6 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ The following tools are required for app development:
* php `dom` and `sqlite` extension
* composer for installing php dependencies
* nextcloud server for running php tests
* circles app for passing some php tests that depend on it
* teams app for passing some php tests that depend on it
* gh, the Github console command, for releasing to Github

## Developer installation

To install the app manually:

0. Install a [development setup](https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html#setup) of nextcloud.
1. Install the circles, text and viewer apps by cloning them to the `apps` folder
1. Install the teams, text and viewer apps by cloning them to the `apps` folder
2. Clone this repository into the `apps` folder of your Nextcloud
3. Install build tools and dependencies by running `make setup-dev`
4. Compile NodeJS assets by running `make build`
Expand Down Expand Up @@ -50,7 +50,7 @@ available in the `nextcloud-docker-dev` repo.
### Development environment

Development environments often do not use proper hostnames and are not
using ssl. In order to make the circles API work in such environments,
using ssl. In order to make the teams API work in such environments,
a few configuration settings need to be adjusted.

You can do so by running the following commands on the nextcloud server:
Expand Down Expand Up @@ -84,10 +84,10 @@ we want the collective pages to be owned and maintained by the collective.
That's why the Collectives app implements an own storage and uses mountpoints
to mount the collective folders to members home directories.

## Development Background: Circles integration
## Development Background: Teams integration

Every collective is bound to a circle. Currently, the app automatically creates
a new secret circle with every new collective.
Every collective is bound to a team. Currently, the app automatically creates
a new secret team with every new collective.

## Prepare a release

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Collectives is a Nextcloud App for activist and community projects to
organize together. Come and gather in collectives to build shared knowledge.

* 👥 **Collective and non-hierarchical workflow by heart**: Collectives are
tied to a [Nextcloud Circle](https://github.com/nextcloud/circles) and
tied to a [Nextcloud Team](https://github.com/nextcloud/circles) and
owned by the collective.
* 📝 **Collaborative page editing** like known from Etherpad thanks to the
[Text app](https://github.com/nextcloud/text).
Expand All @@ -17,7 +17,7 @@ organize together. Come and gather in collectives to build shared knowledge.
## Installation

In your Nextcloud instance, simply navigate to **»Apps«**, find the
**»Circles«** and **»Collectives«** apps and enable them.
**»Teams«** and **»Collectives«** apps and enable them.

## Requirements

Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Collectives is a Nextcloud App for activist and community projects to organize t
Come and gather in collectives to build shared knowledge.
* 👥 **Collective and non-hierarchical workflow by heart**: Collectives are
tied to a [Nextcloud Circle](https://github.com/nextcloud/circles) and
tied to a [Nextcloud Team](https://github.com/nextcloud/circles) and
owned by the collective.
* 📝 **Collaborative page editing** like known from Etherpad thanks to the
[Text app](https://github.com/nextcloud/text).
Expand All @@ -19,7 +19,7 @@ Come and gather in collectives to build shared knowledge.
## Installation
In your Nextcloud instance, simply navigate to **»Apps«**, find the
**»Circles«** and **»Collectives«** apps and enable them.
**»Teams«** and **»Collectives«** apps and enable them.
]]></description>
<version>2.10.0</version>
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/apps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ describe('The apps', function() {

/**
* Regression test for #110 and #117.
* Without the circles app the whole server became unresponsive.
* Without the teams app the whole server became unresponsive.
* If we have this regression this test will not only fail
* it will also break all following tests.
*
*/
describe('Disabled circles app does not break files view', function() {
describe('Disabled teams app does not break files view', function() {

before(function() {
cy.loginAs('admin')
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/circle-with-group.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

/**
* Regression test for #121.
* When user is not a direct member of a circle,
* but is a member of a group linked to the circle,
* When user is not a direct member of a team,
* but is a member of a group linked to the team,
* then access to the collective only works half-way:
* You can see the collective on the list,
* but you can't see a list of pages or access any page.
*
*/
describe('Pages are accessible via group membership to circle', function() {
describe('Pages are accessible via group membership to team', function() {
before(function() {
cy.loginAs('jane')
cy.deleteAndSeedCollective('Group Collective')
Expand Down
30 changes: 15 additions & 15 deletions cypress/e2e/collective.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ describe('Collective', function() {

before(function() {
cy.loginAs('bob')
cy.deleteCollective('Preexisting Circle')
cy.deleteCollective('Preexisting Team')
cy.deleteCollective('History Club')
cy.deleteCollective(specialCollective)
cy.deleteAndSeedCollective('Preexisting Collective')
cy.circleFind('Preexisting Collective')
.circleAddMember('jane')
cy.seedCircle('Preexisting Circle')
cy.seedCircle('Preexisting Team')
cy.seedCircle('History Club', { visible: true, open: true })
cy.loginAs('jane')
cy.deleteCollective('Foreign Circle')
cy.seedCircle('Foreign Circle', { visible: true, open: true })
cy.deleteCollective('Foreign Team')
cy.seedCircle('Foreign Team', { visible: true, open: true })
})

describe('in the files app', function() {
Expand All @@ -57,10 +57,10 @@ describe('Collective', function() {
})

describe('name conflicts', function() {
it('Reports existing circle', function() {
it('Reports existing team', function() {
cy.loginAs('bob')
cy.visit('apps/collectives')
cy.createCollective('Foreign Circle')
cy.createCollective('Foreign Team')
cy.get('.modal-collective-name-error').should('contain', 'A collective with this name already exists')
})
it('Reports existing collective', function() {
Expand All @@ -71,40 +71,40 @@ describe('Collective', function() {
cy.get('.toast-warning').should('contain', 'Could not create the collective')
cy.get('.toast-warning').should('contain', 'Collective already exists')
})
it('creates collectives by picking circle',
it('creates collectives by picking team',
function() {
cy.loginAs('bob')
cy.visit('apps/collectives')
cy.get('button').contains('New collective').click()
cy.get('button span.circles-icon').click()
cy.get('button span.teams-icon').click()
// cy.get('.circle-selector ul').should('not.contain', 'Foreign')
cy.get('.circle-selector li [title*=History]').click()
cy.get('button').contains('Add members').click()
cy.get('button').contains('Create').click()

cy.get('#titleform input').invoke('val').should('contain', 'History Club')
cy.get('.toast-info').should('contain',
'Created collective "History Club" for existing circle.',
'Created collective "History Club" for existing team.',
)
})
it('collectives of visible circles only show for members',
it('collectives of visible teams only show for members',
function() {
cy.loginAs('jane')
cy.visit('apps/collectives')
cy.get('.app-navigation-entry').should('not.contain', 'History Club')
})
it('creates collectives for admins of corresponding circle',
it('creates collectives for admins of corresponding team',
function() {
cy.loginAs('bob')
cy.visit('apps/collectives')
cy.createCollective('Preexisting Circle')
cy.get('#titleform input').invoke('val').should('contain', 'Preexisting Circle')
cy.createCollective('Preexisting Team')
cy.get('#titleform input').invoke('val').should('contain', 'Preexisting Team')
cy.get('.toast-info').should('contain',
'Created collective "Preexisting Circle" for existing circle.',
'Created collective "Preexisting Team" for existing team.',
)
})
after(function() {
cy.deleteCollective('Preexisting Circle')
cy.deleteCollective('Preexisting Team')
cy.deleteCollective('History Club')
})
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/collectives-trash.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Collectives trash', function() {
cy.get('.collectives_trash_list_item')
.should('contain', 'Delete me')
})
it('Allows deleting the collective and circle from trash', function() {
it('Allows deleting the collective and team from trash', function() {
cy.loginAs('bob')
cy.visit('apps/collectives')
cy.get('#collectives-trash')
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Cypress.Commands.add('uploadContent', (path, content, mimetype = 'text/markdown'
})

/**
* Create a circle (optionally with given config)
* Create a team (optionally with given config)
*/
Cypress.Commands.add('seedCircle', (name, config = null) => {
Cypress.log()
Expand Down Expand Up @@ -397,7 +397,7 @@ Cypress.Commands.add('circleFind', (name) => {
})

/**
* Add someone to a circle
* Add someone to a team
*/
Cypress.Commands.add('circleAddMember',
{ prevSubject: true },
Expand Down
2 changes: 1 addition & 1 deletion docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ organize together. Come and gather in collectives to build shared knowledge.
## Features

* 👥 **Collective and non-hierarchical workflow by heart**: Collectives are
tied to a [Nextcloud Circle](https://github.com/nextcloud/circles) and
tied to a [Nextcloud Team](https://github.com/nextcloud/circles) and
owned by the collective.
* 📝 **Collaborative page editing** like known from Etherpad thanks to the
[Text app](https://github.com/nextcloud/text).
Expand Down
12 changes: 6 additions & 6 deletions docs/content/administration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ alwaysopen = false

This app requires the following apps to be enabled:

* [**Circles**](https://apps.nextcloud.com/apps/circles)
* [**Teams**](https://apps.nextcloud.com/apps/circles)
* [**Text**](https://apps.nextcloud.com/apps/text)
* **Viewer**
* **files_versions**
Expand All @@ -33,7 +33,7 @@ limitations](https://docs.nextcloud.com/server/latest/admin_manual/configuration
## Collectives and guest users

In order to allow guest users (as provided by the [guests](https://github.com/nextcloud/guests/)
app) to access collectives, add the Collectives and Circles apps to the list
app) to access collectives, add the Collectives and Teams apps to the list
of enabled apps for guest users in admin settings.

Please note that this enables guest users to create new collectives.
Expand Down Expand Up @@ -70,9 +70,9 @@ collectives directory instead.

### Allow for groups in your collectives

You can configure the circles app to allow adding groups to circles.
Since the collectives app relies on the circles app for user management
You can configure the teams app to allow adding groups to teams.
Since the collectives app relies on the teams app for user management
this also allows adding entire groups to collectives.

Keep in mind thought that in contrast to circles
groups can only be managed by server admins.
Keep in mind thought that in contrast to teams, groups can only be
managed by server admins.
4 changes: 2 additions & 2 deletions docs/content/usage/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ to adjust it to your collectives needs.
Follow the "manage members" link that you find in the action menu inside
the collectives list on the left to manage members.

If your Nextcloud instance is configured to allow groups in circles
you can even add entire groups to your collectives.
If your Nextcloud instance is configured to allow groups in teams you
can even add entire groups to your collectives.

## Also good to know

Expand Down
2 changes: 1 addition & 1 deletion lib/Command/ExpirePageVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 0;
} catch (MissingDependencyException $e) {
$output->writeln('');
$output->writeln('<error> Looks like the circles app is not active. </error>');
$output->writeln('<error> Looks like the teams app is not active. </error>');
$output->writeln('<info> Please enable it: </info>');
$output->writeln('<info> occ app:enable circles </info>');
$output->writeln($e->getMessage());
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/IndexCollectives.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<info>Creating index for ' . $circleName . ' ... </info>');
$this->searchService->indexCollective($collective);
} catch (MissingDependencyException|NotFoundException|NotPermittedException) {
$output->writeln("<error>Failed to find circle associated with collective with ID={$collective->getId()}</error>");
$output->writeln("<error>Failed to find team associated with collective with ID={$collective->getId()}</error>");
return 1;
} catch (FileSearchException) {
$output->writeln('<error>Failed to save the indices to the collectives folder.</error>');
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/CircleHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(ContainerInterface $appContainer) {
try {
$this->circlesManager = $appContainer->get(CirclesManager::class);
} catch (QueryException|AutoloadNotAllowedException $e) {
// Could not instantiate - probably circles app is disabled
// Could not instantiate - probably teams app is disabled
$this->dependencyInjectionError = $e->getMessage();
}
}
Expand Down Expand Up @@ -169,7 +169,7 @@ private function existsCircle(string $name): bool {
public function createCircle(string $name, string $userId): Circle {
try {
if ($this->existsCircle($name)) {
throw new CircleExistsException('A circle with that name exists');
throw new CircleExistsException('A team with that name exists');
}
$this->startSession($userId);
$circle = $this->circlesManager->createCircle($name, null, false, false);
Expand Down Expand Up @@ -221,7 +221,7 @@ public function unflagCircleAsAppManaged(string $circleId): void {
*/
public function destroyCircle(string $circleId, string $userId): void {
if (!$this->isOwner($circleId, $userId)) {
throw new NotPermittedException('Not allowed to destroy circle ' . $circleId);
throw new NotPermittedException('Not allowed to destroy team ' . $circleId);
}
try {
$this->unflagCircleAsAppManaged($circleId);
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/CollectiveService.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,19 @@ public function createCollective(string $userId,
throw new UnprocessableEntityException('Empty collective name is not allowed');
}

// Create a new circle
// Create a new team
$message = '';
try {
$circle = $this->circleHelper->createCircle($safeName, $userId);
} catch (CircleExistsException $e) {
$circle = $this->circleHelper->findCircle($safeName, $userId, Member::LEVEL_ADMIN);
if ($circle === null) {
// We don't have admin access to the circle
// We don't have admin access to the team
throw $e;
}
$this->circleHelper->flagCircleAsAppManaged($circle->getSingleId());
$message = $this->l10n->t(
'Created collective "%s" for existing circle.',
'Created collective "%s" for existing team.',
[$safeName]
);
}
Expand Down
36 changes: 0 additions & 36 deletions src/components/Icon/CirclesIcon.vue

This file was deleted.

Loading

0 comments on commit 85d6522

Please sign in to comment.