Skip to content

Commit

Permalink
Merge basket branch into develop for Antimony release (CenterForOpenS…
Browse files Browse the repository at this point in the history
…cience#1819)

* [ENG-4333] Test file detail editing (CenterForOpenScience#1807)

-   Ticket: https://openscience.atlassian.net/browse/ENG-4333
-   Branch: feature/test-file-detail-view-only

## Purpose

The purpose of these changes is to test the edit functionality of the file detail page.

## Summary of Changes

-A test has been added to verify that changing the values and saving will result in appropriate changes in the view-only section for the file title, description, resource type, and resource language.

-A test has been added to verify that changing those fields and canceling the edit will result in the values not changing in the view-only section.

-A test has been added to verify that trying to save, getting an error, and canceling the save causes the values not to change for the view-only section.

- A test has been added to verify that, if you don’t have permission to edit, the edit capability is disabled.

* sort nested subjects (CenterForOpenScience#1810)

* Update youtube link for OSF 101 video (CenterForOpenScience#1812)

* [ENG-4040][ENG-4016] Deprecation/ember classic (CenterForOpenScience#1799)

-   Ticket: [ENG-4040] [ENG-4016]
-   Feature flag: n/a

## Purpose
- Update our app from ember classic edition to octane
- Remove usage of `this.$` that is no longer going to be supported

## Summary of Changes
- Run `npx @ember/octanify` https://github.com/emberjs/ember-octanify
- Remove use of ember jquery integration (`this.$()`) to just use imported jquery
   - https://rfcs.emberjs.com/id/0705-deprecate-jquery-optional-feature/
- Update `@ember/jquery` to newest version

* Fix page-change scroll behavior (CenterForOpenScience#1817)

* Hide additional fields and show state for AVOL registrations (CenterForOpenScience#1814)

* [ENG-3542] Percy 3.0 upgrade (CenterForOpenScience#1794)

-   Ticket: [ENG-3542]
-   Feature flag: n/a

## Purpose
Upgrade Percy from 1.x to 3.0

## Summary of Changes
Ran the `$ npx @percy/migrate` script and followed the prompts and did not update imports.

---------

Co-authored-by: Ashley Robinson <[email protected]>
Co-authored-by: Futa Ikeda <[email protected]>
Co-authored-by: futa-ikeda <[email protected]>
Co-authored-by: Lord Business <[email protected]>
  • Loading branch information
5 people authored Mar 16, 2023
1 parent 2ab03ee commit 125dccc
Show file tree
Hide file tree
Showing 22 changed files with 555 additions and 109 deletions.
42 changes: 28 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
CI: true
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
PERCY_PARALLEL_TOTAL: 4
PERCY_PARALLEL_TOTAL: -1

jobs:
fetch-dependencies:
Expand Down Expand Up @@ -77,9 +77,8 @@ jobs:
path: ./node_modules
key: cached_node_modules_${{ secrets.CACHE_VERSION }}_${{ hashFiles('**/yarn.lock') }}
restore-keys: cached_node_modules_${{ secrets.CACHE_VERSION }}_
- uses: percy/[email protected]
with:
custom-command: yarn test:ember --path ./dist --partition 1
- name: Run tests with percy snapshots
run: yarn percy exec --debug --parallel --verbose yarn test:ember --path ./dist --partition 1
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
Expand All @@ -102,9 +101,8 @@ jobs:
path: ./node_modules
key: cached_node_modules_${{ secrets.CACHE_VERSION }}_${{ hashFiles('**/yarn.lock') }}
restore-keys: cached_node_modules_${{ secrets.CACHE_VERSION }}_
- uses: percy/[email protected]
with:
custom-command: yarn test:ember --path ./dist --partition 2
- name: Run tests with percy snapshots
run: yarn percy exec --debug --parallel --verbose yarn test:ember --path ./dist --partition 2
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
Expand All @@ -127,9 +125,8 @@ jobs:
path: ./node_modules
key: cached_node_modules_${{ secrets.CACHE_VERSION }}_${{ hashFiles('**/yarn.lock') }}
restore-keys: cached_node_modules_${{ secrets.CACHE_VERSION }}_
- uses: percy/[email protected]
with:
custom-command: yarn test:ember --path ./dist --partition 3
- name: Run tests with percy snapshots
run: yarn percy exec --debug --parallel --verbose yarn test:ember --path ./dist --partition 3
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
Expand All @@ -152,9 +149,8 @@ jobs:
path: ./node_modules
key: cached_node_modules_${{ secrets.CACHE_VERSION }}_${{ hashFiles('**/yarn.lock') }}
restore-keys: cached_node_modules_${{ secrets.CACHE_VERSION }}_
- uses: percy/[email protected]
with:
custom-command: yarn test:ember --path ./dist --partition 4
- name: Run tests with percy snapshots
run: yarn percy exec --debug --parallel --verbose yarn test:ember --path ./dist --partition 4
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
Expand All @@ -177,4 +173,22 @@ jobs:
- name: Send coverage report to coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

finalize-percy:
needs: [test-partition-1, test-partition-2, test-partition-3, test-partition-4]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- id: cache-node-modules
uses: actions/cache@v2
with:
path: ./node_modules
key: cached_node_modules_${{ secrets.CACHE_VERSION }}_${{ hashFiles('**/yarn.lock') }}
restore-keys: cached_node_modules_${{ secrets.CACHE_VERSION }}_
- run: yarn percy build:finalize
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
15 changes: 15 additions & 0 deletions .percy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
snapshot:
widths:
- 375
- 1280
minHeight: 1024
percyCSS: ""
discovery:
allowedHostnames: []
disallowedHostnames: []
networkIdleTimeout: 100
upload:
files: ""
ignore: ""
stripExtensions: false
2 changes: 1 addition & 1 deletion app/dashboard/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<iframe
data-test-osf-video
local-class='osf-video'
src='https://www.youtube.com/embed/iebMBpi0prc'
src='https://www.youtube.com/embed/X07mBq2tnMg'
title={{t 'dashboard.osf_video'}}
alt='OSF 101 Video'
aria-hidden='true'
Expand Down
2 changes: 1 addition & 1 deletion app/home/-components/support-section/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<iframe
data-test-osf-video
local-class='osf-video'
src='https://www.youtube.com/embed/iebMBpi0prc'
src='https://www.youtube.com/embed/X07mBq2tnMg'
title={{t 'new-home.support-section.osf_video'}}
alt='OSF 101 Video'
aria-hidden='true'
Expand Down
1 change: 0 additions & 1 deletion config/deprecation-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ self.deprecationWorkflow.config = {
{ handler: 'silence', matchId: 'manager-capabilities.modifiers-3-13' },
{ handler: 'silence', matchId: 'this-property-fallback' },
{ handler: 'silence', matchId: 'ember-glimmer.link-to.positional-arguments' },
{ handler: 'silence', matchId: 'ember-views.curly-components.jquery-element' },
{ handler: 'silence', matchId: 'ember-runtime.deprecate-copy-copyable' },
{ handler: 'silence', matchId: 'ember-bootstrap.subclassing#Alert' },
{ handler: 'silence', matchId: 'routing.transition-methods' },
Expand Down
2 changes: 2 additions & 0 deletions config/optional-features.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": true,
"template-only-glimmer-components": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default class DiscoverPage extends Component {

scrollToResults() {
// Scrolls to top of search results
this.$('html, body').scrollTop(this.$('.results-top').position().top);
document.querySelector('.results-top')?.scrollIntoView({ behavior: 'smooth' });
}

search(): void {
Expand Down
4 changes: 2 additions & 2 deletions lib/collections/addon/components/discover-page/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<BsDropdown class='dropdown pull-right' as |dd|>
<dd.button
data-test-sort-by-button
class='btn btn-default'
class='btn btn-default results-top'
>
{{t 'collections.discover_page.sortBy'}}:
{{this.sortDisplay}}
Expand Down Expand Up @@ -183,7 +183,7 @@
{{else}}
{{#if this.numberOfResults}}
{{!RESULTS FOUND}}
<div class='results-top'>
<div>
{{#each this.results as |result|}}
{{component
this.searchResultComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<BsModal
@open={{@openModal}}
@open={{if @openModal true false}}
@onSubmit={{action @delete}}
@onHidden={{action @closeModal}}
as |modal|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,20 @@ export default class FileMetadataManagerComponent extends Component<Args> {
this.inEditMode = true;
}

@action
rollback() {
this.changeset.rollback();
}

@task
@waitFor
async cancel(){
if (this.saveErrored){
await this.metadataRecord.reload();
this.metadataRecord.rollbackAttributes();
this.saveErrored = false;
}
this.changeset.rollback();
this.rollback();
this.changeset.languageObject = {
code: this.metadataRecord.language,
name: this.languageFromCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default class SingleSubjectManagerComponent extends Component {
page: {
size: 150, // TODO: import const
},
sort: 'text',
related_counts: 'children',
});
this.setProperties({ children });
Expand Down
25 changes: 14 additions & 11 deletions lib/registries/addon/components/registries-metadata/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,21 @@
</div>
</div>

<div local-class='Field'>
<h4>{{t 'registries.registration_metadata.associated_project'}}</h4>
<div>
<OsfLink
data-analytics-name='Registered from'
@route='guid-node'
@models={{array this.registeredFromId}}
>
{{this.registeredFromDisplayUrl}}
</OsfLink>
{{#unless this.registration.isAnonymous}}
<div local-class='Field'>
<h4>{{t 'registries.registration_metadata.associated_project'}}</h4>
<div>
<OsfLink
data-analytics-name='Registered from'
@route='guid-node'
@models={{array this.registeredFromId}}
>
{{this.registeredFromDisplayUrl}}
</OsfLink>
</div>
</div>
</div>
{{/unless}}

{{#if this.registration.providerSpecificMetadata}}
<div local-class='Field'>
<EditableField::ProviderMetadataManager
Expand Down
38 changes: 21 additions & 17 deletions lib/registries/addon/components/registries-states/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,31 @@ export default class RegistriesStates extends Component {
}

get stateText() {
if (!this.registration || !this.registration.reviewsState || !this.registration.revisionState) {
return undefined;
}
let stateKey;
if (this.registration.pendingRegistrationApproval) {
stateKey = 'pendingRegistrationApproval';
} else if (this.registration.pendingEmbargoApproval) {
stateKey = 'pendingEmbargoApproval';
} else if (
[
RegistrationReviewStates.Embargo,
RegistrationReviewStates.Accepted,
].includes(this.registration.reviewsState)
) {
if (this.registration.revisionState !== RevisionReviewStates.Approved) {
stateKey = camelize(this.registration.revisionState);
if (!this.registration || !this.registration.reviewsState || !this.registration.revisionState) {
if (!this.registration.isAnonymous) {
return undefined;
}
stateKey = 'anonymous';
} else {
if (this.registration.pendingRegistrationApproval) {
stateKey = 'pendingRegistrationApproval';
} else if (this.registration.pendingEmbargoApproval) {
stateKey = 'pendingEmbargoApproval';
} else if (
[
RegistrationReviewStates.Embargo,
RegistrationReviewStates.Accepted,
].includes(this.registration.reviewsState)
) {
if (this.registration.revisionState !== RevisionReviewStates.Approved) {
stateKey = camelize(this.registration.revisionState);
} else {
stateKey = camelize(this.registration.reviewsState);
}
} else {
stateKey = camelize(this.registration.reviewsState);
}
} else {
stateKey = camelize(this.registration.reviewsState);
}
return {
short: this.intl.t(`registries.overview.${stateKey}.short_description`),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<div local-class='LeftWrapper'>
{{#unless @registration.isAnonymous}}
<div data-test-topbar-states>
<RegistriesStates
@registration={{@registration}}
@isModeratorMode={{@isModeratorMode}}
/>
</div>
{{/unless}}
<div data-test-topbar-states>
<RegistriesStates
@registration={{@registration}}
@isModeratorMode={{@isModeratorMode}}
/>
</div>

<Registries::UpdateDropdown
@registration={{@registration}}
Expand Down
41 changes: 23 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"name": "ember-osf-web",
"version": "23.04.0",
"private": true,
"description": "Ember front-end for the Open Science Framework",
"homepage": "https://github.com/CenterForOpenScience/ember-osf-web#readme",
"bugs": {
"url": "https://github.com/CenterForOpenScience/ember-osf-web/issues"
},
"repository": "https://github.com/CenterForOpenScience/ember-osf-web",
"license": "Apache-2.0",
"author": "Center for Open Science <[email protected]>",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "https://github.com/CenterForOpenScience/ember-osf-web",
"scripts": {
"build": "ember build --environment=production",
"build:test": "ember build --environment=test",
Expand Down Expand Up @@ -48,11 +53,18 @@
"vendor/*"
]
},
"resolutions": {
"@embroider/macros": "^1.0.0",
"ember-cli-clipboard": "0.9.0",
"ember-element-helper": "^0.6.1",
"ember-validators": "^4.1.1"
},
"dependencies": {},
"devDependencies": {
"@centerforopenscience/eslint-config": "3.0.0",
"@ember-intl/cp-validations": "^4.0.1",
"@ember-intl/decorators": "^1.0.0",
"@ember/jquery": "^0.6.0",
"@ember/jquery": "2.0.0",
"@ember/optional-features": "^2.0.0",
"@ember/render-modifiers": "^1.0.0",
"@ember/test-helpers": "^2.2.5",
Expand All @@ -63,6 +75,8 @@
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"@percy/cli": "^1.18.0",
"@percy/ember": "^3.0.0",
"@types/ace": "^0.0.42",
"@types/dropzone": "^5.0.4",
"@types/ember": "^3.1.1",
Expand Down Expand Up @@ -243,20 +257,16 @@
"typescript": "^4.2.3",
"wicg-inert": "^3.1.1"
},
"resolutions": {
"ember-cli-clipboard": "0.9.0",
"@embroider/macros": "^1.0.0",
"ember-element-helper": "^0.6.1",
"ember-validators": "^4.1.1"
},
"engines": {
"node": "10.* || >= 12"
},
"private": true,
"bugs": {
"url": "https://github.com/CenterForOpenScience/ember-osf-web/issues"
"volta": {
"node": "14.15.0",
"yarn": "1.21.1"
},
"ember": {
"edition": "octane"
},
"homepage": "https://github.com/CenterForOpenScience/ember-osf-web#readme",
"ember-addon": {
"paths": [
"lib/analytics-page",
Expand All @@ -265,10 +275,5 @@
"lib/osf-components",
"lib/registries"
]
},
"volta": {
"node": "14.15.0",
"yarn": "1.21.1"
},
"dependencies": {}
}
}
Loading

0 comments on commit 125dccc

Please sign in to comment.