Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cedar integration #2143

Merged
merged 127 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 122 commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
e9a4f35
[ENG-4908] Prototype CEE (#2050)
adlius Nov 13, 2023
99a6796
[ENG-4843] [ENG-5056] [ENG-5057] [ENG-5058] [ENG-5059] Feature/cedar …
bp-cos Dec 15, 2023
9437bb8
[ENG-4845] Updates to convert the currect guid-metadata to tab based …
bp-cos Jan 2, 2024
d6a352a
[ENG-5065] Add a new metadata details (view only) component (#2095)
bp-cos Jan 2, 2024
85b9c92
Merge remote-tracking branch 'upstream/develop' into feature/cedar-in…
adlius Jan 3, 2024
f806510
Inital metadata add route
bp-cos Jan 3, 2024
0575bff
Added more information to select a schema
bp-cos Jan 3, 2024
d22d6d4
Added missing files
bp-cos Jan 3, 2024
1eb91e8
Fixed the pagination on read-only templates
bp-cos Jan 3, 2024
4495728
Fixed some tests
bp-cos Jan 3, 2024
dba5b8c
Fixed a typo
bp-cos Jan 3, 2024
8f85910
Updates per PR comments
bp-cos Jan 4, 2024
4462e3a
Updates per PR requests
bp-cos Jan 4, 2024
e798aa9
Initial commit to add the cedar template
bp-cos Jan 4, 2024
c06919a
Added a new component to handle the cedar editor
bp-cos Jan 4, 2024
6b8dc35
Styling of the cedar editor
bp-cos Jan 4, 2024
73fd7b4
For debugging added the configuration to the component
bp-cos Jan 4, 2024
b704394
Template rendering
bp-cos Jan 5, 2024
a304ee8
Added more cedar templates and updated the config
bp-cos Jan 5, 2024
244bece
Fixes per the PR
bp-cos Jan 5, 2024
d020c57
Updates based on the PR
bp-cos Jan 5, 2024
2bb2a0a
Removed the unnecessary metadata-select component and passed in isMobile
bp-cos Jan 5, 2024
736d611
Added metadata information to the tabs
bp-cos Jan 5, 2024
61951aa
Fixed the title
bp-cos Jan 5, 2024
bb5f0a1
add cedar assets (#2104)
adlius Jan 8, 2024
8677a35
artifact viewer prototype
adlius Jan 9, 2024
39c9e33
Added biosample record, removed unnecessary components and hooked up …
bp-cos Jan 9, 2024
7774cfc
fixed the types by adding singular and plurals and updated the save t…
bp-cos Jan 10, 2024
d23cea4
Updates from the PR based on comments. Much better with consistent na…
bp-cos Jan 11, 2024
a4a3e90
Updates for PR
bp-cos Jan 11, 2024
e576f59
Updates for the PR
bp-cos Jan 11, 2024
6dc1e92
Added a loading indicator, disabled the button and redirected the route
bp-cos Jan 12, 2024
9f009ce
Router changes for Yuhuai
bp-cos Jan 12, 2024
6e0b750
modify route structure
adlius Jan 16, 2024
0d14638
Added a draft status
bp-cos Jan 12, 2024
daee3f7
Added visualization for draft metadata
bp-cos Jan 16, 2024
0052eca
Added better text for published metadata and analytics
bp-cos Jan 16, 2024
887a525
Added the final touch to get the recordId and display the correct record
bp-cos Jan 17, 2024
a9f18e8
Fixed two tests
bp-cos Jan 17, 2024
6f2ee89
Fixed another test
bp-cos Jan 17, 2024
0c7ce9b
Initial PR comment updates
bp-cos Jan 18, 2024
f3cabbf
Additional PR comment updates
bp-cos Jan 18, 2024
4e72a9f
The last of the PR comments
bp-cos Jan 18, 2024
3353cd6
Updates from PR requests
bp-cos Jan 18, 2024
2a76822
Added visualization for draft metadata
bp-cos Jan 16, 2024
bf2687b
Added more edit flow components
bp-cos Jan 17, 2024
172b564
Additional updates
bp-cos Jan 17, 2024
5dcd672
Updates to make a better flow and have the editor display persisted data
bp-cos Jan 18, 2024
68a193e
Finishing touches on the edit flow
bp-cos Jan 18, 2024
721f35a
Added a toast message to handle saving errors
bp-cos Jan 18, 2024
76ec5a7
Added a cancel button
bp-cos Jan 18, 2024
b11b7fc
Editted a merge mistake
bp-cos Jan 18, 2024
009a09d
A linting issue
bp-cos Jan 18, 2024
6f604cf
Updates for the linter and PR comments
bp-cos Jan 18, 2024
05d1e9b
Additional updates
bp-cos Jan 18, 2024
3641fc9
Updates based on the PR
bp-cos Jan 18, 2024
8f49552
Removed the async
bp-cos Jan 18, 2024
53185e8
Added a better isPersisting handler
bp-cos Jan 18, 2024
c2a88e0
Update to the cedar metadata editor flow
bp-cos Jan 19, 2024
00aa2a2
update versions (#2114)
adlius Jan 23, 2024
8b658ef
Initial updates to port node::metadata to registration
bp-cos Jan 19, 2024
490bb36
Updated the routes
bp-cos Jan 19, 2024
452df15
Initial commit for registrations and mirage scenarios
bp-cos Jan 22, 2024
71449c6
Updates to some files, mostly mirage
bp-cos Jan 22, 2024
697d88f
Moved metadata components to osf-components, removed the guid-node me…
bp-cos Jan 23, 2024
ffcf6c7
Added a component for the detail page
bp-cos Jan 23, 2024
2497a6c
Converted the metadata add page to be a component
bp-cos Jan 23, 2024
1870988
Fixed a test
bp-cos Jan 23, 2024
fc63c50
Fixed additional tests
bp-cos Jan 23, 2024
58f9ecf
Fixed a flaky test
bp-cos Jan 23, 2024
ae22381
Okay ... to similar tests
bp-cos Jan 23, 2024
a4a68a7
Refactored based on PR comments
bp-cos Jan 23, 2024
9695978
One last PR Suggestions
bp-cos Jan 24, 2024
037f2e7
Initial conversion to add cedar metadata to files
bp-cos Jan 24, 2024
ece3a9c
More component creation
bp-cos Jan 24, 2024
f0e8ff9
Updates to get files to work
bp-cos Jan 25, 2024
1360d17
fix relationship
adlius Jan 26, 2024
bed5dfa
The tabs are displaying and the cedar artifact viewer is working
bp-cos Jan 27, 2024
db9d4dd
Typo for a test failue
bp-cos Jan 29, 2024
76bb317
Updates for the PR
bp-cos Jan 30, 2024
dc8a884
Fixed a camel-case class names
bp-cos Jan 30, 2024
101c8b8
Added the ability to add a cedar template to a file
bp-cos Jan 29, 2024
b6f8ab6
Added updates for navigation, scenarios and mobile
bp-cos Jan 30, 2024
f5d4b5d
Additional mobile formatting
bp-cos Jan 30, 2024
6930ddf
Fixed two tests
bp-cos Jan 30, 2024
0a137d7
Removed a test that did nothing
bp-cos Jan 30, 2024
d1afd57
Updates for the PR
bp-cos Jan 31, 2024
a560cbf
Added everything to fix publish
bp-cos Jan 31, 2024
2ff3136
Hopeful fix for the tests
bp-cos Jan 31, 2024
08e082c
Added permissions
bp-cos Jan 31, 2024
213610a
Updated the if statement for permissions
bp-cos Jan 31, 2024
c375bd3
Another quick update to make mirage scenarios more realistic
bp-cos Jan 31, 2024
72f2fa5
Updates for PR suggestions
bp-cos Feb 1, 2024
7d74386
Missed a suggestion
bp-cos Feb 1, 2024
01ac060
Updates for Yuhuais comments
bp-cos Feb 1, 2024
b1fbb54
New flow for downloading a cedar template
bp-cos Feb 1, 2024
6d0a348
Updates to flow, css and verbiage
bp-cos Feb 2, 2024
237f564
One more tooltip
bp-cos Feb 2, 2024
b945b31
Updates to fix the guid-file tabs
bp-cos Feb 2, 2024
46cb264
Added initial update for guid-file
bp-cos Feb 2, 2024
0d2a93c
Added the title updates to registries
bp-cos Feb 2, 2024
65eb157
Updates to display the name of the file
bp-cos Feb 2, 2024
f965542
add terminologyIntegratedSearchUrl (#2126)
adlius Feb 5, 2024
e83612c
Change `findAll` to `query` to hide inactive templates (#2128)
adlius Feb 6, 2024
50e2c5e
Added a share icon and fixed the routing to reflect the current tab (…
bp-cos Feb 6, 2024
a84e5db
upgrade CEE to 1.0.15
adlius Feb 6, 2024
ce784c3
Fixed some issues
bp-cos Feb 7, 2024
244e3c7
Another quick fix for mobile
bp-cos Feb 7, 2024
545486c
Another quick mobile css fix
bp-cos Feb 7, 2024
476a112
Another quick mobile css fix
bp-cos Feb 7, 2024
2cf312a
Quick naming convention fix
bp-cos Feb 7, 2024
3e1b2f7
Oops missing translation update
bp-cos Feb 7, 2024
0a92395
A late addition to fix a flow issue when adding
bp-cos Feb 7, 2024
8b5f687
Removed the async/await on the cancel button
bp-cos Feb 7, 2024
ca67c9f
upgrade CEE to 1.0.16 (#2135)
adlius Feb 8, 2024
0415942
Updates for Cedar Requests from Product (#2136)
bp-cos Feb 9, 2024
6379acf
upgrade CEE to 1.1.0
adlius Feb 9, 2024
1233b56
Fixed the persist because the parent route was not run on an add or edit
bp-cos Feb 9, 2024
202d67e
Add an aria label
bp-cos Feb 12, 2024
c6e3047
Fix color contrast issue
futa-ikeda Feb 12, 2024
8d94b16
Enabled the embedding of templates on cedar records (#2141)
bp-cos Feb 13, 2024
146c541
Merge branch 'develop' into feature/cedar-integration
futa-ikeda Feb 13, 2024
40b2760
Overwrite white-space rule for tooltips from cedar (#2146)
futa-ikeda Feb 16, 2024
e98d69a
Go to page not found when encountering errors. (#2147)
adlius Feb 20, 2024
e72c519
Update styling (#2149)
futa-ikeda Feb 20, 2024
0cf078c
Upgrade cee version to 1.2.1. Listen to more events to trigger valida…
adlius Feb 21, 2024
88eaee9
Merge branch 'develop' into feature/cedar-integration
futa-ikeda Feb 22, 2024
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
11 changes: 11 additions & 0 deletions app/adapters/cedar-metadata-record.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import OsfAdapter from './osf-adapter';

export default class CedarMetadataRecordAdapter extends OsfAdapter {
namespace = '_';
}

declare module 'ember-data/types/registries/adapter' {
export default interface AdapterRegistry {
'cedar-metadata-record': CedarMetadataRecordAdapter;
} // eslint-disable-line semi
}
11 changes: 11 additions & 0 deletions app/adapters/cedar-metadata-template.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import OsfAdapter from './osf-adapter';

export default class CedarMetadataTemplateAdapter extends OsfAdapter {
namespace = '_';
}

declare module 'ember-data/types/registries/adapter' {
export default interface AdapterRegistry {
'cedar-metadata-template': CedarMetadataTemplateAdapter;
} // eslint-disable-line semi
}
34 changes: 34 additions & 0 deletions app/config/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ declare const config: {
WATER_BUTLER_ENABLED: boolean;
plauditWidgetUrl: string,
environment: any;
cedarConfig: any;
lintOnBuild: boolean;
testsEnabled: boolean;
sourcemapsEnabled: boolean;
Expand All @@ -31,6 +32,39 @@ declare const config: {
assetsPrefix: string;
sentryDSN: string | null;
googleTagManagerId: string | null;
cedarConfig: {
viewerConfig: {
showHeader: boolean,
showFooter: boolean,
expandedSampleTemplateLinks: boolean,
showSampleTemplateLinks: boolean,
defaultLanguage: string,
showTemplateData: boolean,
showInstanceData: boolean,
}
editorConfig: {
sampleTemplateLocationPrefix: string,
loadSampleTemplateName: string,
expandedSampleTemplateLinks: boolean,
showTemplateRenderingRepresentation: boolean,
showMultiInstanceInfo: boolean,
expandedInstanceDataFull: boolean,
expandedInstanceDataCore: boolean,
expandedMultiInstanceInfo: boolean,
expandedTemplateRenderingRepresentation: boolean,
showInstanceDataFull: boolean,
showTemplateSourceData: boolean,
expandedTemplateSourceData: boolean,
collapseStaticComponents: boolean,
showStaticText: boolean,
showInstanceDataCore: boolean,
showHeader: boolean,
showFooter: boolean,
showInstanceDataFull: boolean,
showTemplateSourceData: boolean,
terminologyIntegratedSearchUrl: string,
},
}
sentryOptions: {
release?: string;
ignoreErrors: string[];
Expand Down
33 changes: 24 additions & 9 deletions app/guid-file/-components/file-detail-layout/styles.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
// stylelint-disable max-nesting-depth, selector-max-compound-selectors

.container {
display: flex;
flex-direction: row;
flex-grow: 1;
}

.main-column {
flex-grow: 3;
z-index: 1;
width: 70%;
min-width: 300px;

&.mobile {
width: 100%;
}

&.is-closed {
flex: 1;
width: calc(100% - 72px);
}

h3 {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 70vw;
width: 70%;
}
}

Expand All @@ -22,25 +34,28 @@
flex-basis: 300px;
flex-direction: column;
flex-grow: 1;
width: 28vw;
width: calc(30% - 72px);
min-width: 400px;

&.is-closed {
display: none;
}
}

.right-buttons {
@media (max-width: 767px) {
display: flex;
flex-direction: row;
justify-content: space-evenly;
border-top: 1px solid #ddd;
}
flex-grow: 0;
display: flex;
flex-direction: column;
border-left: 1px solid #ddd;
z-index: 1;
width: 72px;
min-width: 72px;

&.mobile {
flex-direction: row;
width: 100%;
margin-bottom: 10px;
}
}

.slide-in {
Expand Down
7 changes: 4 additions & 3 deletions app/guid-file/-components/file-detail-layout/template.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div local-class='container'>
{{#if @isMobile}}
<div local-class='main-column'>
<div local-class='main-column mobile'>
{{yield to='header'}}
<div local-class='right-buttons'>
<div local-class='right-buttons mobile'>
{{yield to='rightButtons'}}
</div>
<div>
Expand All @@ -14,7 +14,8 @@
</div>
</div>
{{else}}
<div local-class='main-column'>

<div local-class='main-column {{if @rightColumnClosed 'is-closed'}}'>
{{yield to='header'}}
{{yield to='body'}}
</div>
Expand Down
64 changes: 64 additions & 0 deletions app/guid-file/-components/file-header/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// stylelint-disable max-nesting-depth, selector-max-compound-selectors

.file-header-container {
width: 100%;

.flex-container-row {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0 20px 20px;

h2 {
height: 40px;
width: 70%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.return-container {
width: 30%;
height: 70px;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
}
}

.project-link-header {
padding-bottom: 5px;

.project-link {
margin: 20px;
}
}

&.mobile {
padding: 0;

.flex-container-row {
padding: 0;
flex-direction: column;

h2,
.return-container {
width: 100%;
height: fit-content;
justify-content: flex-start;
}

h2 {
margin-top: 0;
}
}

.project-link-header {
.project-link {
margin: 0;
}
}
}
}
40 changes: 40 additions & 0 deletions app/guid-file/-components/file-header/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<div local-class='file-header-container {{if @isMobile 'mobile'}}'>
<h3 local-class='project-link-header'>
<OsfLink
data-test-project-link
data-analytics-name='Linked project'
local-class='project-link'
@route={{if (eq @model.fileModel.target.type 'registrations') 'guid-registration' 'guid-node'}}
@models={{array @model.fileModel.target.id}}
>
{{@model.fileModel.target.title}}
</OsfLink>
</h3>
<div local-class='flex-container-row'>
<h2 data-test-filename>
{{@model.displayName}}
{{#if @viewedVersion}}
({{t 'general.version'}}: {{@viewedVersion}})
{{/if}}
</h2>
<div local-class='return-container'>
{{#if @displayFileActions}}
<FileActionsMenu
@item={{@model}}
@onDelete={{@onDelete}}
@allowRename={{false}}
@addonsEnabled={{@model.fileModel.target.addonsEnabled}}
/>
{{else}}
<OsfLink
data-test-return-to-metadata
data-analytics-name='Return from cedar metadata template selection'
@route='guid-file.index'
@models={{array @model.fileModel.id}}
>
{{ t 'file-detail.metadata.return-to-file' [email protected]}}
</OsfLink>
{{/if}}
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default class GuidFile extends Controller {

@action
toggleRevisions() {
if (!this.model.waterButlerRevisions) {
taskFor(this.model.getRevisions).perform();
if (!this.model.file.waterButlerRevisions) {
taskFor(this.model.file.getRevisions).perform();
}
if (this.isMobile) {
this.revisionsOpened = true;
Expand Down Expand Up @@ -113,6 +113,6 @@ export default class GuidFile extends Controller {

@action
onDelete() {
this.router.transitionTo('guid-node.files', this.model.fileModel.target.get('id'));
this.router.transitionTo('guid-node.files', this.model.file.fileModel.target.get('id'));
}
}
38 changes: 38 additions & 0 deletions app/guid-file/index/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import Store from '@ember-data/store';
import Route from '@ember/routing/route';
import RouterService from '@ember/routing/router-service';
import { inject as service } from '@ember/service';
import CedarMetadataRecordModel from 'ember-osf-web/models/cedar-metadata-record';
import CedarMetadataTemplateModel from 'ember-osf-web/models/cedar-metadata-template';


export default class MetadataDetailRoute extends Route {
@service store!: Store;
@service router!: RouterService;

async model() {
const file = this.modelFor('guid-file');
const defaultIndex = 0;
const cedarMetadataRecords = await file.fileModel.queryHasMany('cedarMetadataRecords', {
'page[size]': 20,
});

for(const cedarMetadataRecord of cedarMetadataRecords) {
const template = await cedarMetadataRecord.template as CedarMetadataTemplateModel;
template.recordCreated = true;
cedarMetadataRecord.templateName = template.schemaName;
}

cedarMetadataRecords.sort(
(a: CedarMetadataRecordModel, b: CedarMetadataRecordModel) =>
a.templateName > b.templateName ? 1 : -1,
);


return {
file,
cedarMetadataRecords,
defaultIndex,
};
}
}
Loading
Loading