Skip to content

Conversation

@filipeotero
Copy link
Contributor

@filipeotero filipeotero commented Aug 22, 2022

In this PR, instead of requesting the back-end API, we insert the notifications as a parameter to the notifications panel.
Also, the notifications-panel is updated according to dynamods organization.

FYI: @QilongTang

@QilongTang
Copy link
Contributor

@filipeotero It looks like after your change, launching the webApp alone, folks can no longer test the display of message from our backend endpoint. Anyway we can preserve both options?

@filipeotero
Copy link
Contributor Author

@filipeotero It looks like after your change, launching the webApp alone, folks can no longer test the display of message from our backend endpoint. Anyway we can preserve both options?

We can set an env variable that gets the notifications by itself or waits to get the notifications from the setNotifications function

"": {
"name": "@dynamods/notifications-center",
"version": "0.0.9",
"version": "0.0.13",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still behind

"@babel/preset-env": "^7.18.6",
"@babel/preset-react": "^7.18.6",
"@filipeop/notifications-panel": "^0.0.2",
"@dynamods/notifications-panel": "^0.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

@filipeotero
Copy link
Contributor Author

Hi @QilongTang, notice that in this new commit I added a verification before fulfilling the notifications list. If the env URL is empty, we set the setNotifications function from outside the webApp. Otherwise, we grab the notifications by the backend.

@QilongTang
Copy link
Contributor

QilongTang commented Aug 23, 2022

Hi @QilongTang, notice that in this new commit I added a verification before fulfilling the notifications list. If the env URL is empty, we set the setNotifications function from outside the webApp. Otherwise, we grab the notifications by the backend.

In this case, you probably want to move the value in https://github.com/DynamoDS/NotificationCenter/blob/master/config/.env to .env.dev so that when this package is bundled in prod and used inside Dynamo, the WebApp is used for purely displaying notifications passed in by Dynamo. But when building it locally, it will grab notifications from dev end point. What do you think @zeusongit ?

@avidit
Copy link
Contributor

avidit commented Aug 23, 2022

In this case, you probably want to move the value in https://github.com/DynamoDS/NotificationCenter/blob/master/config/.env to .env.dev so that when this package is bundled in prod and used inside Dynamo, the WebApp is used for purely displaying notifications passed in by Dynamo. But when building it locally, it will grab notifications from dev end point. What do you think @zeusongit ?

@QilongTang I have made these changes and updated package.json with --env parameters in https://github.com/DynamoDS/NotificationCenter/pull/23/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R24-R25

@zeusongit
Copy link
Contributor

Hi @QilongTang, notice that in this new commit I added a verification before fulfilling the notifications list. If the env URL is empty, we set the setNotifications function from outside the webApp. Otherwise, we grab the notifications by the backend.

In this case, you probably want to move the value in https://github.com/DynamoDS/NotificationCenter/blob/master/config/.env to .env.dev so that when this package is bundled in prod and used inside Dynamo, the WebApp is used for purely displaying notifications passed in by Dynamo. But when building it locally, it will grab notifications from dev end point. What do you think @zeusongit ?

Makes sense, with @avidit's changes we will get different URL's based on the environment used.

@QilongTang
Copy link
Contributor

Thanks, with the other PR in progress, is this one good to go? @zeusongit @avidit

@zeusongit
Copy link
Contributor

Looks good, just one comment, maybe unrelated to this PR, but we include this script tag:

<script src="index.bundle.js"></script>

which is understandable if we are working on notification center alone but inside dynamo mainJs is replaced by the same file we are including from the script tag, therefore are we including the bundle file twice, when running inside Dynamo?

@QilongTang
Copy link
Contributor

QilongTang commented Aug 23, 2022

@zeusongit Ah this is something I forgot to mention to you, when launching in Dynamo, <script src="index.bundle.js"></script> will fail to load. This only works for dev build here in this repo. Maybe we should use different html for differernt build instead of mixing things..

@QilongTang QilongTang merged commit 858f76a into DynamoDS:master Aug 24, 2022
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.

4 participants