Skip to content

Commit 62f5813

Browse files
[Rebase] [ENG-9177] Removed ember (#11531)
* removed ember mentions of ember in docker and readme * removed ember-related constants, flags, tests and functionality * fixed redirects to unexisting index and dashboard flask views * fixed redirects * added redirect for removed views * removed assert for duplicated redirect as it'll be handled by angular * fix imports after notification refactor * fix tests * remove edit_draft_registration_page and new_draft_registration views --------- Co-authored-by: Ihor Sokhan <isokhan@exoft.net>
1 parent 2ef7a53 commit 62f5813

54 files changed

Lines changed: 110 additions & 1404 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README-docker-compose.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
- 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.
172172
6. Start the OSF Web, API Server, and Preprints (Detached)
173173
```bash
174-
docker compose up -d worker web api admin preprints ember_osf_web gv
174+
docker compose up -d worker web api admin preprints gv
175175
```
176176
7. View the OSF at [http://localhost:5000](http://localhost:5000).
177177

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

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

187187
- To view the logs for a given container:
@@ -270,20 +270,10 @@
270270
```bash
271271
docker compose run --rm web python3 -m scripts.parse_citation_styles
272272
```
273-
- Populate Notification Types
274-
- Needed for notifications.
275-
```bash
276-
docker compose run --rm web python3 manage.py populate_notification_types
277-
```
278-
- _NOTE: The waffle switch `POPULATE_NOTIFICATION_TYPES` needs to be turned on.
279-
- Start ember_osf_web
280-
- Needed for ember app:
281-
- `docker-compose up -d ember_osf_web`
282273
- OPTIONAL: Register OAuth Scopes
283-
- Needed for things such as the ember-osf dummy app
284-
```bash
285-
docker compose run --rm web python3 -m scripts.register_oauth_scopes
286-
```
274+
```bash
275+
docker compose run --rm web python3 -m scripts.register_oauth_scopes
276+
```
287277
- OPTIONAL: Create migrations:
288278
- 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.
289279
```bash
@@ -506,4 +496,4 @@ wb:
506496
507497
### Running Collections
508498
509-
To run collections, you must uncomment COLLECTIONS_ENABLED=true in docker-compose.yml under ember_osf_web, then recreate your ember and web containers.
499+
To run collections, you must uncomment COLLECTIONS_ENABLED=true in docker-compose.yml, then recreate web container.

addons/base/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,12 +929,12 @@ def addon_view_or_download_file(auth, path, provider, **kwargs):
929929
)
930930
)
931931

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

addons/osfstorage/tests/test_views.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
from osf_tests.factories import ProjectFactory, ApiOAuth2PersonalTokenFactory, PreprintFactory
3838
from website.files.utils import attach_versions
39-
from website.settings import EXTERNAL_EMBER_APPS
4039
from api_tests.draft_nodes.views.test_draft_node_files_lists import prepare_mock_wb_response
4140

4241

@@ -1413,28 +1412,17 @@ def test_file_view_updates_history(self):
14131412
{'name': 'testpath', 'path': '/testpath', 'materialized': '/testpath', 'kind': 'file'},
14141413
]
14151414
)
1416-
with override_flag(features.EMBER_FILE_PROJECT_DETAIL, active=True):
1417-
url = self.node.web_url_for('addon_view_or_download_file', path='testpath', provider='github')
1418-
self.app.get(url, auth=self.user.auth)
1419-
file = GithubFile.objects.get(_path='/testpath', provider='github')
1420-
assert file.history
1421-
1422-
@mock.patch('website.views.stream_emberapp')
1423-
def test_file_views(self, mock_ember):
1424-
with override_flag(features.EMBER_FILE_PROJECT_DETAIL, active=True):
1425-
file = create_test_file(target=self.node, user=self.user)
1426-
url = self.node.web_url_for('addon_view_or_download_file', path=file._id, provider=file.provider)
1427-
res = self.app.get(url, auth=self.user.auth)
1428-
assert res.status_code == 302
1429-
assert res.headers['Location'] == f'{settings.DOMAIN}{file.get_guid()._id}/'
1430-
assert not mock_ember.called
1431-
res = self.app.get(url, auth=self.user.auth, follow_redirects=True)
1432-
assert res.status_code == 200
1433-
assert mock_ember.called
1434-
args, kwargs = mock_ember.call_args
1435-
1436-
assert args[0] == EXTERNAL_EMBER_APPS['ember_osf_web']['server']
1437-
assert args[1] == EXTERNAL_EMBER_APPS['ember_osf_web']['path'].rstrip('/')
1415+
url = self.node.web_url_for('addon_view_or_download_file', path='testpath', provider='github')
1416+
self.app.get(url, auth=self.user.auth)
1417+
file = GithubFile.objects.get(_path='/testpath', provider='github')
1418+
assert file.history
1419+
1420+
def test_file_views(self):
1421+
file = create_test_file(target=self.node, user=self.user)
1422+
url = self.node.web_url_for('addon_view_or_download_file', path=file._id, provider=file.provider)
1423+
res = self.app.get(url, auth=self.user.auth)
1424+
assert res.status_code == 302
1425+
assert res.headers['Location'] == f'{settings.DOMAIN}{file.get_guid()._id}/'
14381426

14391427
def test_download_file(self):
14401428
file = create_test_file(target=self.node, user=self.user)

addons/wiki/views.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
from addons.wiki import settings
1414
from addons.wiki import utils as wiki_utils
1515
from addons.wiki.models import WikiPage, WikiVersion
16-
from osf import features
1716
from website.profile.utils import get_profile_image_url
1817
from website.project.views.node import _view_project
1918
from website.project.model import has_anonymous_link
20-
from website.ember_osf_web.decorators import ember_flag_is_active
2119
from website.project.decorators import (
2220
must_be_contributor_or_public,
2321
must_have_addon, must_not_be_registration,
@@ -358,7 +356,6 @@ def get_node_wiki_permissions(node, auth, **kwargs):
358356

359357
@must_be_valid_project
360358
@must_have_addon('wiki', 'node')
361-
@ember_flag_is_active(features.EMBER_PROJECT_WIKI)
362359
def project_wiki_home(**kwargs):
363360
node = kwargs['node'] or kwargs['project']
364361
return redirect(node.web_url_for('project_wiki_view', wname='home', _guid=True))

api/sparse/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class SparseNodeSerializer(NodeSerializer):
2323
'contributors',
2424
])
2525
links = LinksField({
26-
'self': 'get_absolute_url', # self links will break ember data unless we make a specific sparse detail serializer
26+
'self': 'get_absolute_url',
2727
'html': 'get_absolute_html_url',
2828
})
2929
detail = RelationshipField(
@@ -109,7 +109,7 @@ class SparseRegistrationSerializer(RegistrationSerializer):
109109
])
110110

111111
links = LinksField({
112-
'self': 'get_absolute_url', # self links will break ember data unless we make a specific sparse detail serializer
112+
'self': 'get_absolute_url',
113113
'html': 'get_absolute_html_url',
114114
})
115115
detail = RelationshipField(

api_tests/users/views/test_user_confirm_external_login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def payload(self, user_one):
3434
'attributes': {
3535
'uid': user_one._id,
3636
'token': user_one.get_confirmation_token(user_one.username),
37-
'destination': 'dashboard',
37+
'destination': 'my_projects',
3838
}
3939
}
4040
}

docker-compose-dist.override.yml

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -29,80 +29,6 @@
2929
# volumes:
3030
# - ../modular-file-renderer:/code:cached
3131

32-
# preprints:
33-
# volumes:
34-
# - ../ember-osf-preprints:/code:cached
35-
#
36-
## # Use this for ember-osf linked development:
37-
## - preprints_dist_vol:/code/dist
38-
## - ../ember-osf:/ember-osf
39-
## depends_on:
40-
## - emberosf
41-
## command:
42-
## - /bin/bash
43-
## - -c
44-
## - cd /ember-osf &&
45-
## yarn link &&
46-
## cd /code &&
47-
## (rm -r node_modules || true) &&
48-
## yarn --frozen-lockfile &&
49-
## yarn link @centerforopenscience/ember-osf &&
50-
## (rm -r bower_components || true) &&
51-
## ./node_modules/.bin/bower install --allow-root --config.interactive=false &&
52-
## yarn start --host 0.0.0.0 --port 4201 --live-reload-port 41954
53-
54-
# registries:
55-
# volumes:
56-
# - ../ember-osf-registries:/code:cached
57-
#
58-
## # Use this for ember-osf linked development:
59-
## - registries_dist_vol:/code/dist
60-
## - ../ember-osf:/ember-osf
61-
## depends_on:
62-
## - emberosf
63-
## command:
64-
## - /bin/bash
65-
## - -c
66-
## - cd /ember-osf &&
67-
## yarn link &&
68-
## cd /code &&
69-
## (rm -r node_modules || true) &&
70-
## yarn --frozen-lockfile &&
71-
## yarn link @centerforopenscience/ember-osf &&
72-
## yarn start --host 0.0.0.0 --port 4202 --live-reload-port 41955
73-
74-
# reviews:
75-
# volumes:
76-
# - ../ember-osf-reviews:/code:cached
77-
#
78-
## # Use this for ember-osf linked development:
79-
## - reviews_dist_vol:/code/dist
80-
## - ../ember-osf:/ember-osf
81-
## depends_on:
82-
## - emberosf
83-
## command:
84-
## - /bin/bash
85-
## - -c
86-
## - cd /ember-osf &&
87-
## yarn link &&
88-
## cd /code &&
89-
## yarn link @centerforopenscience/ember-osf &&
90-
## yarn --frozen-lockfile &&
91-
## yarn start --host 0.0.0.0 --port 4203 --live-reload-port 41956
92-
93-
# # Use this for ember-osf linked development:
94-
# emberosf:
95-
# build: ../ember-osf
96-
# command:
97-
# - /bin/bash
98-
# - -c
99-
# - (rm -r node_modules || true) &&
100-
# yarn --frozen-lockfile --ignore-engines &&
101-
# (rm -r bower_components || true) &&
102-
# ./node_modules/.bin/bower install --allow-root --config.interactive=false
103-
# volumes:
104-
# - ../ember-osf/:/code:nocopy
105-
10632
# ####################
10733
# # RabbitMQ SSL
10834
# # Enable this, place the certs in ./ssl, and uncomment the BROKER_USE_SSL dictionary in local.py

docker-compose.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ volumes:
1515
external: false
1616
rabbitmq_vol:
1717
external: false
18-
ember_osf_web_dist_vol:
19-
external: false
2018
preprints_dist_vol:
2119
external: false
2220
reviews_dist_vol:
@@ -255,35 +253,6 @@ services:
255253
- postgres
256254
stdin_open: true
257255

258-
259-
#################
260-
# Ember OSF Web #
261-
#################
262-
263-
ember_osf_web:
264-
image: quay.io/centerforopenscience/osf-web:develop-local
265-
command: yarn run start --path dist --host 0.0.0.0 --port 4200 --live-reload-port 41953
266-
restart: unless-stopped
267-
depends_on:
268-
- api
269-
- web
270-
environment:
271-
# Uncomment below to enable collections on ember
272-
# - COLLECTIONS_ENABLED=true
273-
- BACKEND=local
274-
- SHARE_BASE_URL=http://localhost:8003/
275-
- SHARE_API_URL=http://localhost:8003/api/v2
276-
- SHARE_SEARCH_URL=http://localhost:8003/api/v2/search/creativeworks/_search
277-
expose:
278-
- 4200
279-
- 41953
280-
ports:
281-
- 4200:4200
282-
- 41953:41953
283-
volumes:
284-
- ember_osf_web_dist_vol:/code/dist
285-
stdin_open: true
286-
287256
#############
288257
# Preprints #
289258
#############
@@ -523,7 +492,6 @@ services:
523492
- osf_requirements_3_12_vol:/usr/local/lib/python3.12/
524493
- osf_bower_components_vol:/code/website/static/vendor/bower_components
525494
- osf_node_modules_vol:/code/node_modules
526-
- ember_osf_web_dist_vol:/ember_osf_web
527495
- preprints_dist_vol:/preprints
528496
- reviews_dist_vol:/reviews
529497
stdin_open: true

framework/auth/campaigns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def get_campaigns():
9595
newest_campaigns.update({
9696
'agu_conference_2023': {
9797
'system_tag': CampaignSourceTags.AguConference2023.value,
98-
'redirect_url': furl(DOMAIN).add(path='dashboard/').url,
98+
'redirect_url': furl(DOMAIN).add(path='my_projects/').url,
9999
'confirmation_email_template': NotificationType.Type.USER_CAMPAIGN_CONFIRM_EMAIL_AGU_CONFERENCE_2023,
100100
'login_type': 'native',
101101
}
@@ -104,7 +104,7 @@ def get_campaigns():
104104
newest_campaigns.update({
105105
'agu_conference': {
106106
'system_tag': CampaignSourceTags.AguConference.value,
107-
'redirect_url': furl(DOMAIN).add(path='dashboard/').url,
107+
'redirect_url': furl(DOMAIN).add(path='my_projects/').url,
108108
'confirmation_email_template': NotificationType.Type.USER_CAMPAIGN_CONFIRM_EMAIL_AGU_CONFERENCE,
109109
'login_type': 'native',
110110
}

0 commit comments

Comments
 (0)