-
Notifications
You must be signed in to change notification settings - Fork 9
Handle Updated Claims #389
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
Conversation
@jwicks31 @krobi64 @geoffturk what's the scope of this task? Should explorer-web be smart enough to parse the |
I am not sure that is required for mainnet. However, I do believe that we should look that way long term. jsonld can render the json and context with the appropriate schema references as the attribute name. For example:
This allows us to create a more flexible interface. |
I wasn't really sure of the scope either. I do think the scope for this PR should just be getting it functioning the way it was before, but with the new claim types. Then if we want to handle that change doing it separately. |
webpack.config.js
Outdated
@@ -125,13 +125,18 @@ module.exports = { | |||
resolve: { | |||
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js', '.json', '.css', '.scss'], | |||
alias: { | |||
Configuration: path.resolve(configurationPath) | |||
Configuration: path.resolve(configurationPath), | |||
jsonld$: path.resolve(__dirname, './node_modules/jsonld/dist/jsonld.min.js') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lautarodragan @krobi64 When using @po.et/poet-js package I'm running into several problems. First the json-ld package was causing the error:
ERROR in ./node_modules/jsonld/lib/jsonld.js
Module parse failed: Unexpected token (1040:2)
You may need an appropriate loader to handle this file type.
| function _setDefaults(options, {
| documentLoader = jsonld.documentLoader,
| ...defaults
| }) {
| if(typeof options === 'function') {
@ ./src/utils/JSONLD.ts 3:15-32
@ ./src/index.ts
Warning: Use --force to continue.
Aborted due to warnings.
I was able to fix this in my local build with this line, which I got from the issues page: digitalbazaar/jsonld.js#252 (comment)
webpack.config.js
Outdated
}, | ||
modules: [ | ||
path.join(__dirname, "src"), | ||
"node_modules" | ||
], | ||
}, | ||
|
||
node: { | ||
net: 'empty', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lautarodragan @krobi64 The joi dependency in poet-js was causing this error:
Module not found: Error: Cannot resolve module 'net' on node_modules/joi/lib @ ./~/joi/lib/string.js 3:10-24
I was able to fix this locally with this line, which I got from the joi issues: hapijs/joi#665 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhmm because joi
is not prepared to use in the front end. For this reason, I saw in several projects are using https://github.com/jquense/yup instead of joi
Maybe if we want to use poet-js
in the backend and frontend, we have to use a library that works fine on the two sides
@krobi64 @lautarodragan After making those changes to get everything building locally I was still getting a long list of errors in the Netlify Build that starts with:
Uninstalling the package and just copying the interfaces over solved the issue, but other than that I haven't been able to find a solution. Another issue is that after updating it to the newest version security/snyk started to fail with 3 errors, but I was unable to read what they were. @warrenv |
@jwicks31 For the build error, use this in the Dockerfile:
|
@krobi64 I'm not really sure, but I'm not finding anything on how to do it. |
This reverts commit 53bdca4.
Ok, for now, let's remove po.et and bring the interface. It may be that the frost api will have to eventually return the object already deconstructed... but that's out of scope |
@wzalazar @lautarodragan @krobi64 This one is ready for review now. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Process - PR Review Checklist
Description of Changes
Resolves #365 and Resolves #393 (If we are able to use it)
attributes
toclaim
poet-js
Claim
by defining an interface rather than using the object type. This was so that I could read the individual claim properties.poet-js
is that it breaks the build because we do not have the correct loaded for something with jsonldI wasn't sure how 'Dynamic' the claims needed to be.
Above the
Work/Claim
it will show an author, datePublished, dateModified, name, tags if they are available. If there is no author, it labels it "Unknown Author". If there is no name, it labels it "Untitled Work". It will not show anything for datePublished, dateModified, or tags if they aren't supplied.In the Content Section of the
Work/Claim
it will show any keys/values that are supplied and not empty. It filters out for "text" and "content" and displays whichever of those is supplied below the other key/value pairs.In the Technical Tab it lists all key/values form the
timestamp
attribute.An example work id to test that the claims are loading is :
a9cef68009c16fbaafabc2d423c269311a9392f2ce5a51f4944711bdfa73f1b7
The Netlify Deploy preview will open to regtest, but the work ID above is in testnet. Change the
regtest
in the link to saytestnet
eg:https://deploy-preview-389--explorer-web-qa-testnet.netlify.com/works/a9cef68009c16fbaafabc2d423c269311a9392f2ce5a51f4944711bdfa73f1b7