Skip to content

Commit

Permalink
add mediaOrigin component to media page
Browse files Browse the repository at this point in the history
  • Loading branch information
danielevalverde committed Jan 14, 2025
1 parent ca2788a commit 7ae94ac
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/app/components/media/MediaCardLargeFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FormattedMessage, FormattedDate } from 'react-intl';
import MediaCardLargeFooterContent from './MediaCardLargeFooterContent';
import MediaCardLargeActions from './MediaCardLargeActions';
import MediaSlug from './MediaSlug';
import MediaOrigin from './MediaOrigin';
import ExternalLink from '../ExternalLink';
import LastRequestDate from '../cds/media-cards/LastRequestDate';
import MediaIdentifier from '../cds/media-cards/MediaIdentifier';
Expand All @@ -20,6 +21,11 @@ const MediaCardLargeFooter = ({
}) => {
let footerTitle = null;

// eslint-disable-next-line
console.log("media_cluter_origin",projectMedia.media_cluster_origin, "User: ", projectMedia.media_cluster_origin_user?.name, "timestamp: ", projectMedia.media_cluster_origin_timestamp);
// eslint-disable-next-line
console.log("User !!: ", projectMedia.media_cluster_origin_user?.name);

const extractedText = projectMedia.extracted_text?.data?.text;
if (extractedText) {
footerTitle = (
Expand Down Expand Up @@ -122,6 +128,12 @@ const MediaCardLargeFooter = ({
variant="text"
/>
),
(
<MediaOrigin
type={projectMedia.media_cluster_origin}
user={projectMedia.media_cluster_origin_user?.name}
/>
),
]}
/>
: null
Expand Down Expand Up @@ -166,6 +178,11 @@ export default createFragmentContainer(MediaCardLargeFooter, graphql`
transcription: annotation(annotation_type: "transcription") {
data
}
media_cluster_origin
media_cluster_origin_user {
name
}
media_cluster_origin_timestamp
...MediaCardLargeActions_projectMedia
}
`);
12 changes: 11 additions & 1 deletion src/app/components/media/Similarity/MediaRelationship.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { getErrorMessage } from '../../../helpers';
import MediaIdentifier from '../../cds/media-cards/MediaIdentifier';
import LastRequestDate from '../../cds/media-cards/LastRequestDate';
import RequestsCount from '../../cds/media-cards/RequestsCount';
import MediaOrigin from '../MediaOrigin';
import styles from '../media.module.css';
import similarityStyles from './MediaSimilarities.module.css';

Expand Down Expand Up @@ -269,6 +270,8 @@ const MediaRelationship = ({
mainProjectMediaConfirmedSimilarCount,
mainProjectMediaDemand,
mainProjectMediaId,
media_cluster_origin,
media_cluster_origin_user,
relationship,
relationshipSourceId,
relationshipTargetId,
Expand Down Expand Up @@ -300,7 +303,14 @@ const MediaRelationship = ({
theme="lightText"
variant="text"
/>
)];
),
(
<MediaOrigin
type={media_cluster_origin}
user={media_cluster_origin_user?.name}
/>
),
];

const maskContent = relationship?.target?.show_warning_cover;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const MediaSimilaritiesComponent = ({ projectMedia }) => (
mainProjectMediaConfirmedSimilarCount={projectMedia.confirmedSimilarCount}
mainProjectMediaDemand={projectMedia.demand}
mainProjectMediaId={projectMedia.id}
media_cluster_origin={projectMedia.media_cluster_origin}
media_cluster_origin_user={projectMedia.media_cluster_origin_user}
relationship={relationship.node}
relationshipSourceId={relationship.node.source_id}
relationshipTargetId={relationship.node.target_id}
Expand Down Expand Up @@ -63,6 +65,10 @@ export default createFragmentContainer(MediaSimilaritiesComponent, graphql`
id
demand
permissions
media_cluster_origin
media_cluster_origin_user{
name
}
confirmedSimilarCount: confirmed_similar_items_count
confirmed_similar_relationships(first: 10000) {
edges {
Expand Down

0 comments on commit 7ae94ac

Please sign in to comment.