Skip to content

Commit

Permalink
After CR
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Sep 4, 2023
1 parent aeafecd commit 7895476
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const renderPreview = (title, contentId) => {
<span
class="ibexa-embed-content__title"
data-ibexa-update-content-id="${contentId}"
data-ibexa-update-source-data-path="Content.Name">${title}</span>
data-ibexa-update-source-data-path="Content.Name"
>
${title}
</span>
<span>
<button
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ class IbexaEmbedContentInlineUI extends IbexaEmbedBaseUI {
}

getCommandOptions(items) {
const location = items[0];
const content = location.ContentInfo.Content;

return {
contentId: items[0].ContentInfo.Content._id,
contentName: items[0].ContentInfo.Content.TranslatedName,
locationId: items[0].id,
languageCodes: items[0].ContentInfo.Content.CurrentVersion.Version.VersionInfo.VersionTranslationInfo.Language.map(
contentId: content._id,
contentName: content.TranslatedName,
locationId: location.id,
languageCodes: content.CurrentVersion.Version.VersionInfo.VersionTranslationInfo.Language.map(
(language) => language.languageCode,
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const renderPreview = (title, contentId) => {
<span
class="ibexa-embed-content__title"
data-ibexa-update-content-id="${contentId}"
data-ibexa-update-source-data-path="Content.Name">${title}</span>
data-ibexa-update-source-data-path="Content.Name"
>
${title}
</span>
<span>
<button
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ class IbexaEmbedContentUI extends IbexaEmbedBaseUI {
}

getCommandOptions(items) {
const location = items[0];
const content = location.ContentInfo.Content;

return {
contentId: items[0].ContentInfo.Content._id,
contentName: items[0].ContentInfo.Content.TranslatedName,
locationId: items[0].id,
languageCodes: items[0].ContentInfo.Content.CurrentVersion.Version.VersionInfo.VersionTranslationInfo.Language.map(
contentId: content._id,
contentName: content.TranslatedName,
locationId: location.id,
languageCodes: content.CurrentVersion.Version.VersionInfo.VersionTranslationInfo.Language.map(
(language) => language.languageCode,
),
};
Expand Down

0 comments on commit 7895476

Please sign in to comment.