Skip to content
Open
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
16 changes: 6 additions & 10 deletions README-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
- When starting with an empty database you will need to run migrations and populate preprint providers. See the [Running arbitrary commands](#running-arbitrary-commands) section below for instructions.
6. Start the OSF Web, API Server, and Preprints (Detached)
```bash
docker compose up -d worker web api admin preprints ember_osf_web gv
docker compose up -d worker web api admin preprints gv
```
7. View the OSF at [http://localhost:5000](http://localhost:5000).

Expand All @@ -181,7 +181,7 @@
- Once the requirements have all been installed, you can start the OSF in the background with

```bash
docker compose up -d assets admin_assets mfr wb fakecas sharejs worker web api admin preprints ember_osf_web gv
docker compose up -d assets admin_assets mfr wb fakecas sharejs worker web api admin preprints gv
```

- To view the logs for a given container:
Expand Down Expand Up @@ -270,14 +270,10 @@
```bash
docker compose run --rm web python3 -m scripts.parse_citation_styles
```
- Start ember_osf_web
- Needed for ember app:
- `docker-compose up -d ember_osf_web`
- OPTIONAL: Register OAuth Scopes
- Needed for things such as the ember-osf dummy app
```bash
docker compose run --rm web python3 -m scripts.register_oauth_scopes
```
```bash
docker compose run --rm web python3 -m scripts.register_oauth_scopes
```
- OPTIONAL: Create migrations:
- After changing a model you will need to create migrations and apply them. Migrations are python code that changes either the structure or the data of a database. This will compare the django models on disk to the database, find the differences, and create migration code to change the database. If there are no changes this command is a noop.
```bash
Expand Down Expand Up @@ -500,4 +496,4 @@ wb:

### Running Collections

To run collections, you must uncomment COLLECTIONS_ENABLED=true in docker-compose.yml under ember_osf_web, then recreate your ember and web containers.
To run collections, you must uncomment COLLECTIONS_ENABLED=true in docker-compose.yml, then recreate web container.
6 changes: 3 additions & 3 deletions addons/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,12 @@ def addon_view_or_download_file(auth, path, provider, **kwargs):
)
)

# There's no download action redirect to the Ember front-end file view and create guid.
# There's no download action redirect to the front-end file view and create guid.
if action != 'download':
if isinstance(target, Node) and flag_is_active(request, features.EMBER_FILE_PROJECT_DETAIL):
if isinstance(target, Node):
guid = file_node.get_guid(create=True)
return redirect(f'{settings.DOMAIN}{guid._id}/')
if isinstance(target, Registration) and flag_is_active(request, features.EMBER_FILE_REGISTRATION_DETAIL):
if isinstance(target, Registration):
guid = file_node.get_guid(create=True)
return redirect(f'{settings.DOMAIN}{guid._id}/')

Expand Down
34 changes: 11 additions & 23 deletions addons/osfstorage/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

from osf_tests.factories import ProjectFactory, ApiOAuth2PersonalTokenFactory, PreprintFactory
from website.files.utils import attach_versions
from website.settings import EXTERNAL_EMBER_APPS
from api_tests.draft_nodes.views.test_draft_node_files_lists import prepare_mock_wb_response


Expand Down Expand Up @@ -1413,28 +1412,17 @@ def test_file_view_updates_history(self):
{'name': 'testpath', 'path': '/testpath', 'materialized': '/testpath', 'kind': 'file'},
]
)
with override_flag(features.EMBER_FILE_PROJECT_DETAIL, active=True):
url = self.node.web_url_for('addon_view_or_download_file', path='testpath', provider='github')
self.app.get(url, auth=self.user.auth)
file = GithubFile.objects.get(_path='/testpath', provider='github')
assert file.history

@mock.patch('website.views.stream_emberapp')
def test_file_views(self, mock_ember):
with override_flag(features.EMBER_FILE_PROJECT_DETAIL, active=True):
file = create_test_file(target=self.node, user=self.user)
url = self.node.web_url_for('addon_view_or_download_file', path=file._id, provider=file.provider)
res = self.app.get(url, auth=self.user.auth)
assert res.status_code == 302
assert res.headers['Location'] == f'{settings.DOMAIN}{file.get_guid()._id}/'
assert not mock_ember.called
res = self.app.get(url, auth=self.user.auth, follow_redirects=True)
assert res.status_code == 200
assert mock_ember.called
args, kwargs = mock_ember.call_args

assert args[0] == EXTERNAL_EMBER_APPS['ember_osf_web']['server']
assert args[1] == EXTERNAL_EMBER_APPS['ember_osf_web']['path'].rstrip('/')
url = self.node.web_url_for('addon_view_or_download_file', path='testpath', provider='github')
self.app.get(url, auth=self.user.auth)
file = GithubFile.objects.get(_path='/testpath', provider='github')
assert file.history

def test_file_views(self):
file = create_test_file(target=self.node, user=self.user)
url = self.node.web_url_for('addon_view_or_download_file', path=file._id, provider=file.provider)
res = self.app.get(url, auth=self.user.auth)
assert res.status_code == 302
assert res.headers['Location'] == f'{settings.DOMAIN}{file.get_guid()._id}/'

def test_download_file(self):
file = create_test_file(target=self.node, user=self.user)
Expand Down
3 changes: 0 additions & 3 deletions addons/wiki/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
from addons.wiki import settings
from addons.wiki import utils as wiki_utils
from addons.wiki.models import WikiPage, WikiVersion
from osf import features
from website.profile.utils import get_profile_image_url
from website.project.views.node import _view_project
from website.project.model import has_anonymous_link
from website.ember_osf_web.decorators import ember_flag_is_active
from website.project.decorators import (
must_be_contributor_or_public,
must_have_addon, must_not_be_registration,
Expand Down Expand Up @@ -358,7 +356,6 @@ def get_node_wiki_permissions(node, auth, **kwargs):

@must_be_valid_project
@must_have_addon('wiki', 'node')
@ember_flag_is_active(features.EMBER_PROJECT_WIKI)
def project_wiki_home(**kwargs):
node = kwargs['node'] or kwargs['project']
return redirect(node.web_url_for('project_wiki_view', wname='home', _guid=True))
Expand Down
4 changes: 2 additions & 2 deletions api/sparse/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SparseNodeSerializer(NodeSerializer):
'contributors',
])
links = LinksField({
'self': 'get_absolute_url', # self links will break ember data unless we make a specific sparse detail serializer
'self': 'get_absolute_url',
'html': 'get_absolute_html_url',
})
detail = RelationshipField(
Expand Down Expand Up @@ -109,7 +109,7 @@ class SparseRegistrationSerializer(RegistrationSerializer):
])

links = LinksField({
'self': 'get_absolute_url', # self links will break ember data unless we make a specific sparse detail serializer
'self': 'get_absolute_url',
'html': 'get_absolute_html_url',
})
detail = RelationshipField(
Expand Down
2 changes: 1 addition & 1 deletion api_tests/users/views/test_user_confirm_external_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def payload(self, user_one):
'attributes': {
'uid': user_one._id,
'token': user_one.get_confirmation_token(user_one.username),
'destination': 'dashboard',
'destination': 'my_projects',
}
}
}
Expand Down
74 changes: 0 additions & 74 deletions docker-compose-dist.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,80 +29,6 @@
# volumes:
# - ../modular-file-renderer:/code:cached

# preprints:
# volumes:
# - ../ember-osf-preprints:/code:cached
#
## # Use this for ember-osf linked development:
## - preprints_dist_vol:/code/dist
## - ../ember-osf:/ember-osf
## depends_on:
## - emberosf
## command:
## - /bin/bash
## - -c
## - cd /ember-osf &&
## yarn link &&
## cd /code &&
## (rm -r node_modules || true) &&
## yarn --frozen-lockfile &&
## yarn link @centerforopenscience/ember-osf &&
## (rm -r bower_components || true) &&
## ./node_modules/.bin/bower install --allow-root --config.interactive=false &&
## yarn start --host 0.0.0.0 --port 4201 --live-reload-port 41954

# registries:
# volumes:
# - ../ember-osf-registries:/code:cached
#
## # Use this for ember-osf linked development:
## - registries_dist_vol:/code/dist
## - ../ember-osf:/ember-osf
## depends_on:
## - emberosf
## command:
## - /bin/bash
## - -c
## - cd /ember-osf &&
## yarn link &&
## cd /code &&
## (rm -r node_modules || true) &&
## yarn --frozen-lockfile &&
## yarn link @centerforopenscience/ember-osf &&
## yarn start --host 0.0.0.0 --port 4202 --live-reload-port 41955

# reviews:
# volumes:
# - ../ember-osf-reviews:/code:cached
#
## # Use this for ember-osf linked development:
## - reviews_dist_vol:/code/dist
## - ../ember-osf:/ember-osf
## depends_on:
## - emberosf
## command:
## - /bin/bash
## - -c
## - cd /ember-osf &&
## yarn link &&
## cd /code &&
## yarn link @centerforopenscience/ember-osf &&
## yarn --frozen-lockfile &&
## yarn start --host 0.0.0.0 --port 4203 --live-reload-port 41956

# # Use this for ember-osf linked development:
# emberosf:
# build: ../ember-osf
# command:
# - /bin/bash
# - -c
# - (rm -r node_modules || true) &&
# yarn --frozen-lockfile --ignore-engines &&
# (rm -r bower_components || true) &&
# ./node_modules/.bin/bower install --allow-root --config.interactive=false
# volumes:
# - ../ember-osf/:/code:nocopy

# ####################
# # RabbitMQ SSL
# # Enable this, place the certs in ./ssl, and uncomment the BROKER_USE_SSL dictionary in local.py
Expand Down
32 changes: 0 additions & 32 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ volumes:
external: false
rabbitmq_vol:
external: false
ember_osf_web_dist_vol:
external: false
preprints_dist_vol:
external: false
reviews_dist_vol:
Expand Down Expand Up @@ -255,35 +253,6 @@ services:
- postgres
stdin_open: true


#################
# Ember OSF Web #
#################

ember_osf_web:
image: quay.io/centerforopenscience/osf-web:develop-local
command: yarn run start --path dist --host 0.0.0.0 --port 4200 --live-reload-port 41953
restart: unless-stopped
depends_on:
- api
- web
environment:
# Uncomment below to enable collections on ember
# - COLLECTIONS_ENABLED=true
- BACKEND=local
- SHARE_BASE_URL=http://localhost:8003/
- SHARE_API_URL=http://localhost:8003/api/v2
- SHARE_SEARCH_URL=http://localhost:8003/api/v2/search/creativeworks/_search
expose:
- 4200
- 41953
ports:
- 4200:4200
- 41953:41953
volumes:
- ember_osf_web_dist_vol:/code/dist
stdin_open: true

#############
# Preprints #
#############
Expand Down Expand Up @@ -523,7 +492,6 @@ services:
- osf_requirements_3_12_vol:/usr/local/lib/python3.12/
- osf_bower_components_vol:/code/website/static/vendor/bower_components
- osf_node_modules_vol:/code/node_modules
- ember_osf_web_dist_vol:/ember_osf_web
- preprints_dist_vol:/preprints
- reviews_dist_vol:/reviews
stdin_open: true
Expand Down
4 changes: 2 additions & 2 deletions framework/auth/campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_campaigns():
newest_campaigns.update({
'agu_conference_2023': {
'system_tag': CampaignSourceTags.AguConference2023.value,
'redirect_url': furl(DOMAIN).add(path='dashboard/').url,
'redirect_url': furl(DOMAIN).add(path='my_projects/').url,
'confirmation_email_template': mails.CONFIRM_EMAIL_AGU_CONFERENCE_2023,
'login_type': 'native',
}
Expand All @@ -103,7 +103,7 @@ def get_campaigns():
newest_campaigns.update({
'agu_conference': {
'system_tag': CampaignSourceTags.AguConference.value,
'redirect_url': furl(DOMAIN).add(path='dashboard/').url,
'redirect_url': furl(DOMAIN).add(path='my_projects/').url,
'confirmation_email_template': mails.CONFIRM_EMAIL_AGU_CONFERENCE,
'login_type': 'native',
}
Expand Down
Loading
Loading