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

[sap.m.upload.UploadSet] sap.m.IllustratedMessage does not bind i18n text, and illustrationType requires special prefix #4037

Open
henriquemattos opened this issue Apr 29, 2024 · 4 comments

Comments

@henriquemattos
Copy link

OpenUI5 version: 1.123.1 (actually it's SAPUI5, not OpenUI5)

Browser/version (+device/version): (irrelevant, but Firefox Developer Edition latest on macOS)

Any other tested browsers/devices(OK/FAIL): (yes, Chrome and Safari on macOS)

Steps to reproduce the problem:

  1. Add aggregation illustratedMessage to sap.m.upload.UploadSet
  2. Define title and description with i18n variable i.e. title="{i18n>myText}"
  3. Define illustrationType="SearchEarth"
  4. Define additionalContent with a button and text="{i18n>uploadButton}"

What is the expected result?
I would expect the texts and the illustrated message to be rendered.

What happens instead?
The title and description fallback to the default text since they are "empty". The button has no text, and no illustration message is displayed. I've tried to use the other pattern like illustrationType="tnt-SearchEarth" but an error occurs, the image is not found.

Any other information? (attach screenshot if possible)

After reading the source code from latest commits, I've found this QUnit test where the illustration type has a prefix sapIllus-. This has worked, so illustrationType="sapIllus-SearchEarth" is displayed correctly. The text can be hardcoded and are displayed, but I miss the internationalization feature.

Here's a sample code of how I expected it to be:

<upload:UploadSet
        instantUpload="true"
        showIcons="true"
        uploadEnabled="true"
        terminationEnabled="true"
        fileTypes="txt,doc,pdf,docx,xls,xlsx"
        maxFileNameLength="30"
        maxFileSize="200"
        mediaTypes="text/plain,application/msword,image/png"
        multiple="true"
        uploadUrl="/upload"
        items="{path: '/items', templateShareable: false}"
        mode="MultiSelect"
        selectionChanged="onSelectionChange">
    <upload:toolbar>
        <OverflowToolbar>
            <ToolbarSpacer/>
            <upload:UploadSetToolbarPlaceholder/>
        </OverflowToolbar>
    </upload:toolbar>
    <upload:illustratedMessage>
        <!-- here's the problem -->
        <IllustratedMessage illustrationType="SearchEarth" title="{i18n>myUploadCollectionText}"
                            description="{i18n>myUploadCollectionDescription}">
            <additionalContent>
                <Button text="{i18n>myUploadCollectionButton}" press=".onPressAccountCreate" type="Emphasized"/>
            </additionalContent>
        </IllustratedMessage>
    </upload:illustratedMessage>
    <upload:items>
        <upload:UploadSetItem
                fileName="{fileName}"
                mediaType="{mediaType}"
                url="{url}"
                thumbnailUrl="{thumbnailUrl}"
                markers="{path: 'markers', templateShareable: false}"
                statuses="{path: 'statuses', templateShareable: false}"
                uploadState="{uploadState}">
            <upload:markers>
                <ObjectMarker
                        type="{type}"
                        visibility="{visibility}"/>
            </upload:markers>
            <upload:statuses>
                <ObjectStatus
                        title="{title}"
                        text="{text}"
                        state="{state}"
                        icon="{icon}"
                        active="{active}"/>
            </upload:statuses>
        </upload:UploadSetItem>
    </upload:items>
</upload:UploadSet>
@henriquemattos henriquemattos changed the title sap.m.upload.UploadSet with sap.m.IllustratedMessage does not bind {i18n>myText}, and illustrationType requires special naming [sap.m.upload.UploadSet] sap.m.IllustratedMessage does not bind i18n text, and illustrationType requires special naming Apr 29, 2024
@henriquemattos henriquemattos changed the title [sap.m.upload.UploadSet] sap.m.IllustratedMessage does not bind i18n text, and illustrationType requires special naming [sap.m.upload.UploadSet] sap.m.IllustratedMessage does not bind i18n text, and illustrationType requires special prefix Apr 29, 2024
@PetyaMarkovaBogdanova PetyaMarkovaBogdanova self-assigned this Apr 29, 2024
@PetyaMarkovaBogdanova
Copy link
Contributor

Hi @henriquemattos ,
here is what is documented about property of the sap.m.IllustratedMessage ** illustrationType** :

Determines which illustration type is displayed.

Note: The [sap.m.IllustratedMessageType](https://sapui5.hana.ondemand.com/api/sap.m.IllustratedMessageType) enumeration contains a default illustration set. If you want to use another illustration set, you have to register it in the [sap.m.IllustrationPool](https://sapui5.hana.ondemand.com/api/sap.m.IllustrationPool).

Example input for the illustrationType property is sapIllus-UnableToLoad. The logic behind this format is as follows:

First is the the illustration set - sapIllus
Second is the illustration type - UnableToLoad

About the i18n model values, can I ask you to set-up an example of how your view is designed the model is binded?
Thank you!

Best regards,
Petya Markova.
(UI5 Dispatcher)

@henriquemattos
Copy link
Author

Hi, @PetyaMarkovaBogdanova . Took me some time to understand and process your comment.

Thank you for explaining about the registration of IllustrationPool. I have done it for IconPool, but not for IllustrationMessageType, and still it was working for "high-level" IllustrationMessage. It does not work specifically for the UploadSet, and that was my confusion. I will try registering, but maybe it's worth to highlight this in the documentation? Or have I missed the information there?

About the i18n models, I use the manifest.json to bind the models, and then I only need to access it using "{i18n>MY_TEXT_VARIABLE}". If I use this pattern for the UploadSet, it gets an empty string. I'm using in every view and component the same style, but for UploadSet it didn't work. Please note that he binding of /items for the path works properly, which is also a binding from the manifest.json.

Thank you once again for explaining the registering of the IllustrationPool, I missed it before.

Kind regards,
Henrique

@PetyaMarkovaBogdanova
Copy link
Contributor

Hello @henriquemattos ,
Thank you for sharing this finding. I've created an internal incident DINC0145671. The status of the issue will be updated here in GitHub.
Regards,
Petya Markova.
(UI5 Dispatcher)

@AshwinKumarBolar
Copy link
Contributor

Hello @henriquemattos,

The created incident: DINC0145671 is with the UploadSet Development team. In order to better process the issue would it be possible to provide us with an Application URL, where we can retest the similar behavior Or any location where we can test the above mentioned behavior?

Thanks,
Ashwin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants