Branding not working using Admin Interface

Hi team,

I am following documentation on Configuring CHT Application Graphics . I tried methods shown in Using the admin interface but it does not work. CHT version is 4.0.1. I can not see any changes and I am not sure if submission has any error as it does not show any message. Could someone please advise? thanks

Hi @niraj

I’m trying adding partner images through the admin app and I’m not seeing any errors, and then seeing the partner images appear on the about page.

Are you seeing the uploaded partner images in the admin interface after uploading them?

Hi @diana,
I am trying with branding tab and do not see error nor any changes.

Can you please open dev tools and the browser console logs that appear when you click the submit button?

When I click on branding tab, I see following in console:

> Error fetching resources file TypeError: e.resources is undefined
There is no response when I click on submit button.

Can you check and share how your branding document looks like? Are you familiar with using fauxton to search for a document with the branding id?

The code is indeed expecting a property resources to exist in this document on read, and expects an _attachments property to exist on write.

Hi @diana I am not familiar using fauxton to search for ad document with the branding id. I did try using branding.json file (using the same image) and was able to see changes but same did not work using the admin interface.

After updating branding with cht-conf, are you able to use the admin interface?
what I’m wondering is whether your initial branding document was malformed somehow.

I am not sure what might be the issue. I just tried uploading the same image in Partners tab using the admin interface and it works fine but does not work for Branding.

Does the branding admin page work if you try to upload a different image?

Hi @diana just tried using Admin Interface after uploading partners info using cht-conf and now I see the Partners does not work too. However, in this case I can see error message
There was an error saving your settings, please try again. but do not know what might be the issue.

Can you please open the browser devtools and share the error that gets logged?

sure, it does not seem to take same image that was successfully uploaded earlier.

TypeError: can't convert undefined to object
    getDocResources https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    $digest https://localhost/admin/js/main.js:3
    evalAsync https://localhost/admin/js/main.js:3
    completeTask https://localhost/admin/js/main.js:3
    r https://localhost/admin/js/main.js:3
    setTimeout handler*require<[94]</gn/this.$get</</i.defer https://localhost/admin/js/main.js:3
    $evalAsync https://localhost/admin/js/main.js:3
    get https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    e https://localhost/admin/js/main.js:3
    i https://localhost/admin/js/main.js:3
    promise callback*e https://localhost/admin/js/main.js:3
    d https://localhost/admin/js/main.js:3
    v https://localhost/admin/js/main.js:3
    qify https://localhost/admin/js/main.js:3
    getDocResources https://localhost/admin/js/main.js:3
    i https://localhost/admin/js/main.js:3
    require<[674]</</< https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    $digest https://localhost/admin/js/main.js:3
    evalAsync https://localhost/admin/js/main.js:3
    completeTask https://localhost/admin/js/main.js:3
    r https://localhost/admin/js/main.js:3
    setTimeout handler*require<[94]</gn/this.$get</</i.defer https://localhost/admin/js/main.js:3
    $evalAsync https://localhost/admin/js/main.js:3
    get https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    e https://localhost/admin/js/main.js:3
    i https://localhost/admin/js/main.js:3
    promise callback*e https://localhost/admin/js/main.js:3
    d https://localhost/admin/js/main.js:3
    v https://localhost/admin/js/main.js:3
    qify https://localhost/admin/js/main.js:3
    a https://localhost/admin/js/main.js:3
    require<[674]</< https://localhost/admin/js/main.js:3
    instantiate https://localhost/admin/js/main.js:3
    get https://localhost/admin/js/main.js:3
    compile https://localhost/admin/js/main.js:3
    pe https://localhost/admin/js/main.js:3
    je https://localhost/admin/js/main.js:3
    ie https://localhost/admin/js/main.js:3
    ce https://localhost/admin/js/main.js:3
    ae https://localhost/admin/js/main.js:3
    ve https://localhost/admin/js/main.js:3
    T https://localhost/admin/js/main.js:3
    configUpdated https://localhost/admin/js/main.js:3
    sync https://localhost/admin/js/main.js:3
    sync https://localhost/admin/js/main.js:3
    registerUIView https://localhost/admin/js/main.js:3
    compile https://localhost/admin/js/main.js:3
    pe https://localhost/admin/js/main.js:3
    je https://localhost/admin/js/main.js:3
    ie https://localhost/admin/js/main.js:3
    ce https://localhost/admin/js/main.js:3
    ae https://localhost/admin/js/main.js:3
    compile https://localhost/admin/js/main.js:3
 Possibly unhandled rejection: {} main.js:3:396524
    a https://localhost/admin/js/main.js:3
    get https://localhost/admin/js/main.js:3
    c https://localhost/admin/js/main.js:3
    $digest https://localhost/admin/js/main.js:3
    evalAsync https://localhost/admin/js/main.js:3
    completeTask https://localhost/admin/js/main.js:3
    r https://localhost/admin/js/main.js:3
    (Async: setTimeout handler)
    defer https://localhost/admin/js/main.js:3
    $evalAsync https://localhost/admin/js/main.js:3
    get https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    e https://localhost/admin/js/main.js:3
    i https://localhost/admin/js/main.js:3
    (Async: promise callback)
    e https://localhost/admin/js/main.js:3
    d https://localhost/admin/js/main.js:3
    v https://localhost/admin/js/main.js:3
    qify https://localhost/admin/js/main.js:3
    getDocResources https://localhost/admin/js/main.js:3
    i https://localhost/admin/js/main.js:3
    require<[674]</</< https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    $digest https://localhost/admin/js/main.js:3
    evalAsync https://localhost/admin/js/main.js:3
    completeTask https://localhost/admin/js/main.js:3
    r https://localhost/admin/js/main.js:3
    (Async: setTimeout handler)
    defer https://localhost/admin/js/main.js:3
    $evalAsync https://localhost/admin/js/main.js:3
    get https://localhost/admin/js/main.js:3
    l https://localhost/admin/js/main.js:3
    e https://localhost/admin/js/main.js:3
    i https://localhost/admin/js/main.js:3
    (Async: promise callback)
    e https://localhost/admin/js/main.js:3
    d https://localhost/admin/js/main.js:3
    v https://localhost/admin/js/main.js:3
    qify https://localhost/admin/js/main.js:3
    a https://localhost/admin/js/main.js:3
    require<[674]</< https://localhost/admin/js/main.js:3
    instantiate https://localhost/admin/js/main.js:3
    get https://localhost/admin/js/main.js:3
    compile https://localhost/admin/js/main.js:3
    pe https://localhost/admin/js/main.js:3
    je https://localhost/admin/js/main.js:3
    ie https://localhost/admin/js/main.js:3
    ce https://localhost/admin/js/main.js:3
    ae https://localhost/admin/js/main.js:3
    ve https://localhost/admin/js/main.js:3
    T https://localhost/admin/js/main.js:3
    configUpdated https://localhost/admin/js/main.js:3
    sync https://localhost/admin/js/main.js:3
    sync https://localhost/admin/js/main.js:3
    registerUIView https://localhost/admin/js/main.js:3
    compile https://localhost/admin/js/main.js:3
    pe https://localhost/admin/js/main.js:3
    je https://localhost/admin/js/main.js:3
    ie https://localhost/admin/js/main.js:3
    ce https://localhost/admin/js/main.js:3
    ae https://localhost/admin/js/main.js:3
    compile https://localhost/admin/js/main.js:3

Hi @niraj

Thanks for sharing these logs. I’m pretty convinced your partner / branding docs are malformed.
To confirm this, I need you to go to fauxton and search for these documents.

Please access your instance in your browser. Then, manually edit the url to /_utils (so your url should look like http(s)://<host>/_utils). Once there, you will see the list of databases, please click on medic.

Once open, you’ll find a search bar on top, where you can enter the id of a document:

Please enter branding and share the contents that is then loaded. Same for partners.

Thanks!

thank you very much for guiding me, @diana.

For Branding below is the result:

{
  "_id": "branding",
  "_rev": "9-321eeb2fd2d3eaa43508a42563129182",
  "title": "My App Name",
  "resources": {
    "logo": "CHT_Image.png",
    "favicon": "CHT_Image.png"
  }
}

For Partners below is the result:

{
  "_id": "partners",
  "_rev": "12-15a742356c6ab81de4cb8d8554bad290"
}

Please let me know if there is any other information I can provide.

Hi @niraj

Thanks for sharing.
These docs are definitely malformed.
The branding doc is missing the _attachments property that should contain the images referred by resources, and the partners document is missing resources and attachments.

Is this your local installation of the CHT? Can you share the config you are using or what steps you followed to generate these docs?

Thanks!

Hi @diana ,
This is from my local installation. So, first I used the cht-conf process i.e. create branding.json file and added following:

  "title": "My App Name",
  "resources":{
    "logo": "CHT_Image.png",
    "favicon":"CHT_Image.png"
  }
}

Then created branding folder and added CHT_Image.png. To upload the changes I used: upload-branding command. I could see the changes. Then, next I removed the contents of branding.json file and re-run the command (to remove the existing branding). Next, when I tried using admin interface it does not respond.

Thanks for sharing @niraj

When creating branding.json, I assume you also created the branding folder where you placed your images?

thanks @diana, yes I forgot to mention that I created a folder named branding and placed the image which was then used in branding.json.

Thanks @niraj

I’m going to try to replicate this locally today and I’ll follow up on this thread with what I’m observing.

1 Like