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

Added a share icon and fixed the routing to reflect the current tab #2127

Conversation

bp-cos
Copy link
Contributor

@bp-cos bp-cos commented Feb 5, 2024

  • Ticket: [https://www.notion.so/cos/Changing-tabs-does-not-change-the-URL-4edd6f28eb6746c888e0eb31dc50da4e]
  • Feature flag: n/a

Purpose

When clicking on the tabs, the uri was not changing. Also add a share button

Summary of Changes

Added some code to replace the browser history when the tab was clicked.

Also added a "share" icon to copy the current uri to the clipboard on projects and registrations.

I will add it to files, once I figure out the routing.

Screenshots

Screenshot 2024-02-05 at 11 33 54 AM

Screenshot 2024-02-05 at 11 34 31 AM

Screenshot 2024-02-05 at 11 34 44 AM

Side Effects

Numerous when messing around with the browser history

QA Notes

Click on the tabs and the uri should change.

@bp-cos bp-cos requested review from adlius and futa-ikeda February 5, 2024 18:35
Copy link
Contributor

@adlius adlius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try using Ember.js Location API to achieve this?

Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with Yuhuai about using Ember's Location API and one very minor nit

Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for now. The replaceHistory is a bit of a smell, but I think addressing it would be non-trivial and possibly delay things at this stage. May be an easy fix if we use query-params for the active metadataRecord, but I haven't dug into the code to really tell.

@bp-cos bp-cos force-pushed the feature/cedar-share branch from 85a8f38 to 4c8746c Compare February 6, 2024 19:37
@adlius adlius merged commit 50e2c5e into CenterForOpenScience:feature/cedar-integration Feb 6, 2024
9 checks passed
adlius added a commit that referenced this pull request Feb 22, 2024
* [ENG-4908] Prototype CEE (#2050)

* prototype CEEE

* CR followup

* fix args names

* [ENG-4843] [ENG-5056] [ENG-5057] [ENG-5058] [ENG-5059] Feature/cedar integration (#2091)

* Added the cedar metadata template model

* Added the new models for cedar-metadata-template and record

* Fixed some linting issues

* Added the adapters and serializers for cedar metadata template and record

* Fixed some typos and ignorance with serializers, api-contracts, etc

* Fixed the namespace

* Fixed the all the relationships

* [ENG-4845] Updates to convert the currect guid-metadata to tab based (#2093)

* Updates to convert the currect guid-metadata to tab based

* Added the tabbing system to the metadata page

* Initial commit for geting the mirage serializers to work for cedar-metadata-records

* Updates from PR comments

* [ENG-5065] Add a new metadata details (view only) component (#2095)

* Added the initial metadata-detail component

* Added some more touches to the detail template

* Removed unnecessary mobile styling and actually the component.

* Much cleaner look and feel for the read-only view

* Added more randomness

* Inital metadata add route

* Added more information to select a schema

* Added missing files

* Fixed the pagination on read-only templates

* Fixed some tests

* Fixed a typo

* Updates per PR comments

* Updates per PR requests

* Initial commit to add the cedar template

* Added a new component to handle the cedar editor

* Styling of the cedar editor

* For debugging added the configuration to the component

* Template rendering

* Added more cedar templates and updated the config

* Fixes per the PR

* Updates based on the PR

* Removed the unnecessary metadata-select component and passed in isMobile

* Added metadata information to the tabs

* Fixed the title

* add cedar assets (#2104)

* artifact viewer prototype

* Added biosample record, removed unnecessary components and hooked up the initial editor post on save

* fixed the types by adding singular and plurals and updated the save to work for create and patch

* Updates from the PR based on comments. Much better with consistent naming of variables

* Updates for PR

* Updates for the PR

* Added a loading indicator, disabled the button and redirected the route

* Router changes for Yuhuai

* modify route structure

* Added a draft status

* Added visualization for draft metadata

* Added better text for published metadata and analytics

* Added the final touch to get the recordId and display the correct record

* Fixed two tests

* Fixed another test

* Initial PR comment updates

* Additional PR comment updates

* The last of the PR comments

* Updates from PR requests

* Added visualization for draft metadata

* Added more edit flow components

* Additional updates

* Updates to make a better flow and have the editor display persisted data

* Finishing touches on the edit flow

* Added a toast message to handle saving errors

* Added a cancel button

* Editted a merge mistake

* A linting issue

* Updates for the linter and PR comments

* Additional updates

* Updates based on the PR

* Removed the async

* Added a better isPersisting handler

* Update to the cedar metadata editor flow

* update versions (#2114)

* Initial updates to port node::metadata to registration

* Updated the routes

* Initial commit for registrations and mirage scenarios

* Updates to some files, mostly mirage

* Moved metadata components to osf-components, removed the guid-node metadata components, generized some components

* Added a component for the detail page

* Converted the metadata add page to be a component

* Fixed a test

* Fixed additional tests

* Fixed a flaky test

* Okay ... to similar tests

* Refactored based on PR comments

* One last PR Suggestions

* Initial conversion to add cedar metadata to files

* More component creation

* Updates to get files to work

* fix relationship

* The tabs are displaying and the cedar artifact viewer is working

* Typo for a test failue

* Updates for the PR

* Fixed a camel-case class names

* Added the ability to add a cedar template to a file

* Added updates for navigation, scenarios and mobile

* Additional mobile formatting

* Fixed two tests

* Removed a test that did nothing

* Updates for the PR

* Added everything to fix publish

* Hopeful fix for the tests

* Added permissions

* Updated the if statement for permissions

* Another quick update to make mirage scenarios more realistic

* Updates for PR suggestions

* Missed a suggestion

* Updates for Yuhuais comments

* New flow for downloading a cedar template

* Updates to flow, css and verbiage

* One more tooltip

* Updates to fix the guid-file tabs

* Added initial update for guid-file

* Added the title updates to registries

* Updates to display the name of the file

* add terminologyIntegratedSearchUrl (#2126)

* Change `findAll` to `query` to hide inactive templates (#2128)

* change findAll to query

* use schema:description and fallback to description when schema:description is not available

* use schema:description and fallback to description when schema:description is not available--amend

* metadataDownload to metadata_download

* Added a share icon and fixed the routing to reflect the current tab (#2127)

* Added a share icon and fixed the routing to reflect the current tab

* Removed from files

* Style updates based on PR suggestions from Futa

* Fixed for an issue between mirage and BE

* Fixes for the file page overrunning

* Fixed a translations for a notion issue

* Updates to translations

* upgrade CEE to 1.0.15

* Fixed some issues

* Another quick fix for mobile

* Another quick mobile css fix

* Another quick mobile css fix

* Quick naming convention fix

* Oops missing translation update

* A late addition to fix a flow issue when adding

* Removed the async/await on the cancel button

* upgrade CEE to 1.0.16 (#2135)

* Updates for Cedar Requests from Product (#2136)

* Moved the "Select a different template" button

* Fixed a typo on including a component

* Added the async on route transition

* Updates to disable adding a duplicate record

* Added select disable functionality to registries

* Finished the disable feature for files and fixed some other nuisances

* Added sorting and moved the selected tab to the first

* upgrade CEE to 1.1.0

* Fixed the persist because the parent route was not run on an add or edit

* Add an aria label

* Fix color contrast issue

* Enabled the embedding of templates on cedar records (#2141)

* Enabled the embedding of templates on cedar records

* Fixed a discepancy on the tab views

* More one fix for consistency

* Overwrite white-space rule for tooltips from cedar (#2146)

* Go to page not found when encountering errors. (#2147)

* fixes

* fix test errors

* Update styling (#2149)

* Upgrade cee version to 1.2.1. Listen to more events to trigger validation (#2150)

* upgrade cee version. listen to more events to trigger validation

* change to pointerover

---------

Co-authored-by: Lord Business <[email protected]>
Co-authored-by: Brian Pilati <[email protected]>
Co-authored-by: Futa Ikeda <[email protected]>
Co-authored-by: futa-ikeda <[email protected]>
@adlius adlius added this to the 24.03.0 milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants