Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
6789496
Merge pull request #114 from inrupt/release/0.4.4
james-martin-jd Aug 14, 2019
b0c77ee
UI Mapping, OnChange
pablo-rodriguez-jd Sep 5, 2019
af4ac52
Adding Control Groups
pablo-rodriguez-jd Sep 6, 2019
a7f8016
Input Form Controls
pablo-rodriguez-jd Sep 9, 2019
279f31a
added delete fields formModel object functionality
Sep 10, 2019
4253561
merge
Sep 10, 2019
ec6ada7
added props
Sep 10, 2019
1283892
fixed onChange formObject values
Sep 10, 2019
8c18230
updates
Sep 11, 2019
3cd3448
added autosave
Sep 13, 2019
9030115
fixed autosave functionality
Sep 13, 2019
6d5df34
fixed classifier
Sep 16, 2019
dea3487
fixed classifier component
Sep 17, 2019
698df39
radio buttons changes
jairo-campos-JD Sep 25, 2019
6721b01
Initial commit of ProfileViewer component
james-martin-jd Sep 26, 2019
3e9c27e
Fixing typo in all instances and usages, and updated Readme (#117)
james-martin-jd Sep 26, 2019
9ceb227
added parent label
jairo-campos-JD Sep 26, 2019
adb387e
change radio button to checkbox
jairo-campos-JD Sep 30, 2019
0e8bffd
added theme on FormModel
jairo-campos-JD Oct 1, 2019
0860a6d
Dropdown values
pablo-rodriguez-jd Oct 1, 2019
1f80caa
Feature/form viewer (#118)
pablo-rodriguez-jd Oct 2, 2019
71fa7d4
added class on buttons and package version change
jairo-campos-JD Oct 2, 2019
539592a
HTML structure matching styleguide
pablo-rodriguez-jd Oct 2, 2019
44821e2
Merge branch 'feature/form-model' of github.com:inrupt/solid-react-co…
jairo-campos-JD Oct 2, 2019
fcee185
Removing code warnings
pablo-rodriguez-jd Oct 2, 2019
545b5f6
Fixing some undefined classes
pablo-rodriguez-jd Oct 2, 2019
ba54566
added onInit and onLoaded
jairo-campos-JD Oct 2, 2019
e8889ef
Merge branch 'feature/form-model' of github.com:inrupt/solid-react-co…
jairo-campos-JD Oct 2, 2019
566fce2
Merge branch 'feature/form-model' of https://github.com/inrupt/solid-…
pablo-rodriguez-jd Oct 3, 2019
d549516
Adding in onError and onSuccess functions (#121)
james-martin-jd Oct 7, 2019
74d33f6
feedback from team
jairo-campos-JD Oct 9, 2019
4a17d0b
Merge pull request #120 from inrupt/feature/form-model
james-martin-jd Oct 9, 2019
475ae34
Save button only on no auto save
pablo-rodriguez-jd Oct 9, 2019
50b3449
Cancel Function
pablo-rodriguez-jd Oct 9, 2019
493c2ae
Heading is using h3
pablo-rodriguez-jd Oct 10, 2019
068e1a0
added datepiker
jairo-campos-JD Oct 10, 2019
304a58c
Updating form version and using a new form model for the app page
james-martin-jd Oct 10, 2019
cee0d9a
Re-adding in the lib alias
james-martin-jd Oct 10, 2019
b708ecf
Merge pull request #124 from inrupt/feature/branch-labels
james-martin-jd Oct 10, 2019
90a88c0
fixed format datetime
jairo-campos-JD Oct 10, 2019
fe5f8c1
Merge branch 'develop' into feature/datepicker
jairo-campos-JD Oct 10, 2019
0d4c52e
feedback from team
jairo-campos-JD Oct 10, 2019
9547c4d
Merge branch 'feature/datepicker' of github.com:inrupt/solid-react-co…
jairo-campos-JD Oct 10, 2019
999a0eb
Updating packages
james-martin-jd Oct 10, 2019
1ec621b
Adding and updating a profile viewer control
james-martin-jd Oct 11, 2019
741b02f
Code cleanup
james-martin-jd Oct 11, 2019
cf648d7
Merge branch 'develop' into feature/profile-component
james-martin-jd Oct 11, 2019
0f1c5ed
Use correct capitalisation of props.webId in docs
Vinnl Oct 15, 2019
ac4c5b8
Merge pull request #122 from inrupt/feature/form-model-cancel-function
james-martin-jd Oct 16, 2019
d2c100b
Merge branch 'develop' into feature/datepicker
james-martin-jd Oct 16, 2019
1edd7d8
Merge pull request #123 from inrupt/feature/datepicker
james-martin-jd Oct 16, 2019
1e10d2c
Live Update
pablo-rodriguez-jd Oct 17, 2019
4be8920
progress
jairo-campos-JD Oct 17, 2019
f25f90d
merged
jairo-campos-JD Oct 17, 2019
bacaad9
feature/form-model-conflict-resolution
jairo-campos-JD Oct 17, 2019
2ee671b
Adding comments for the conflict resolution feature
pablo-rodriguez-jd Oct 18, 2019
4a820ca
Updating notification code to include the new shape and data types
james-martin-jd Oct 18, 2019
437243c
Solid Forms nexus version
pablo-rodriguez-jd Oct 18, 2019
997c7f3
Updating package-lock
james-martin-jd Oct 18, 2019
8ef6ddb
Merge pull request #127 from inrupt/feature/form-model-conflict-resol…
james-martin-jd Oct 18, 2019
bde7082
Updating notification code to discover inboxes from resources
james-martin-jd Oct 21, 2019
33c780c
Updating version
james-martin-jd Oct 21, 2019
bee313d
Updating notification code to include the new shape and data types
james-martin-jd Oct 18, 2019
d5e3cc5
Updating notification code to discover inboxes from resources
james-martin-jd Oct 21, 2019
e2e766c
added required validate on input text
jairo-campos-JD Oct 21, 2019
3182686
Updating notification code and adding in ability to add a type to a n…
james-martin-jd Oct 22, 2019
e06f523
Merge
james-martin-jd Oct 22, 2019
f1df493
Merge pull request #126 from inrupt/Vinnl-patch-1
james-martin-jd Oct 22, 2019
66737c1
Updatting package number
james-martin-jd Oct 22, 2019
203b313
added form validation components
jairo-campos-JD Oct 22, 2019
bfb4bfa
merge
jairo-campos-JD Oct 22, 2019
d23501f
updated component version
jairo-campos-JD Oct 22, 2019
d2e3474
Merge pull request #129 from inrupt/feature/form-validation
james-martin-jd Oct 22, 2019
8d00bb1
Inline "saving in progress" message
pablo-rodriguez-jd Oct 23, 2019
0af48de
Merge pull request #130 from inrupt/feature/form-model-saving-spinner
james-martin-jd Oct 23, 2019
b7964de
Date Line Fix (#131)
pablo-rodriguez-jd Oct 23, 2019
4c0d36b
Adding Saving Component as a prop to FormModel
pablo-rodriguez-jd Oct 24, 2019
9942d9a
Merge pull request #132 from inrupt/feature/form-model-saving-spinner
james-martin-jd Oct 24, 2019
e24493d
Adding in feature that allows a fallback for when the notification ac…
james-martin-jd Oct 24, 2019
f79eb3b
Updating notification code to include the new shape and data types
james-martin-jd Oct 18, 2019
7c1527c
Merge
james-martin-jd Oct 24, 2019
19b384e
Merge pull request #134 from inrupt/fix/notification-shape
james-martin-jd Oct 24, 2019
e2bde42
fixed validation onSuccess
jairo-campos-JD Oct 25, 2019
c75fad0
Updating version and forms
james-martin-jd Oct 28, 2019
ac6f4ee
Merge branch 'develop' into fix/added-validation-onSucess
jairo-campos-JD Oct 29, 2019
c755b53
Merge pull request #135 from inrupt/fix/added-validation-onSucess
james-martin-jd Oct 29, 2019
ebe5650
Fixing build
james-martin-jd Oct 29, 2019
3d88be4
Updating versions
james-martin-jd Oct 30, 2019
b293f68
Fixing issue where two : were used for prefixes of local files, and r…
james-martin-jd Oct 31, 2019
f4be151
Update README.md
james-martin-jd Oct 31, 2019
44ece25
Merge pull request #136 from inrupt/fix/notifications
james-martin-jd Nov 1, 2019
7d846f9
Fixing issue where content wasn't being grabbed properly for the Head…
james-martin-jd Nov 1, 2019
ce1b7a4
Adding labels and styles in for Classifier
james-martin-jd Nov 1, 2019
d36b14c
Updating Classifier to use the inputText theme
james-martin-jd Nov 1, 2019
3ceb207
Updating select and label styles to be consistent
james-martin-jd Nov 1, 2019
ffb53fb
Updating solid-forms version and re-enabling the test conversion on t…
james-martin-jd Nov 4, 2019
4209fdc
Updating forms version
james-martin-jd Nov 4, 2019
3d8595c
Updating forms version
james-martin-jd Nov 4, 2019
a34bae2
Update time conversions depending on source type
Nov 11, 2019
b351c7a
Restrict the datepicker options based on the form model data
Nov 12, 2019
4ccd84c
Fix typo: FromModelUI -> FormModelUI
Nov 12, 2019
f431e7c
Merge pull request #139 from inrupt/feature/restrict-date-options
james-martin-jd Nov 12, 2019
b66c9a4
github issue #30 - display proper error message when the POD provider…
Eliamar Nov 11, 2019
93b0a8a
Merge pull request #138 from inrupt/bug/fix-unknown-request-error
james-martin-jd Nov 12, 2019
d1318a5
Fixing problems with notification shape, sorting, and adding in ShEx …
james-martin-jd Nov 12, 2019
c155c27
Merge branch 'develop' into feature/profile-component
james-martin-jd Nov 12, 2019
d93b6ac
Merge pull request #125 from inrupt/feature/profile-component
james-martin-jd Nov 12, 2019
6645c6b
Merge pull request #140 from inrupt/fix/notification-format
james-martin-jd Nov 13, 2019
b6dc993
Removing dependency on nexus-based packages
james-martin-jd Nov 13, 2019
bdf5081
Beginning to wire up the textarea with form model functions and valid…
james-martin-jd Nov 14, 2019
0719d33
fixed an issue with the text area component where the value was not b…
james-martin-jd Nov 14, 2019
e25086a
Updating vulnerability issue
james-martin-jd Nov 14, 2019
4a8942e
Merge pull request #144 from inrupt/feature/textarea
angelaraya Nov 15, 2019
8685f33
- display a checkbox when there is a boolean field from the form mode…
Eliamar Nov 15, 2019
8d7c622
Merge pull request #145 from inrupt/bug/form-language-render-boolean-…
james-martin-jd Nov 15, 2019
a0089f0
Remove changeRaw event handler
Nov 15, 2019
da25c1a
Updating forms version
james-martin-jd Nov 15, 2019
6fc0084
Merge pull request #146 from inrupt/fix/datetimepicker-manualinput
james-martin-jd Nov 15, 2019
71a2208
Updating package version
james-martin-jd Nov 15, 2019
a5e73d3
Merge branch 'develop' of github.com:inrupt/solid-react-components in…
james-martin-jd Nov 15, 2019
e55f10f
Don't conflict min,maxdates and offsets in the datetime picker
Nov 18, 2019
fa8b769
Updating the login url regex to include some more configurations incl…
james-martin-jd Nov 18, 2019
b471363
Merge pull request #147 from inrupt/fix/login-urls
angelaraya Nov 18, 2019
1fdeed8
Show the AM/PM indicators in the time and datetime pickers
Nov 18, 2019
c7fb19b
Save date as a UTC string
Nov 18, 2019
24d9b3c
Add getLocale helper
Nov 18, 2019
67bbaac
Clean from the old locale system
Nov 18, 2019
cc566bd
Merge pull request #148 from inrupt/fix/datetime-pickers
james-martin-jd Nov 18, 2019
5c1d700
Replace momentjs with date-fns in the datepicker
Nov 19, 2019
4bb8612
Merge pull request #149 from inrupt/fix/replace-moment-with-datefns
james-martin-jd Nov 19, 2019
d6fda53
Updating form version and fixing security audit issues
james-martin-jd Nov 19, 2019
c4096ee
Fix timepicker not displaying
Nov 20, 2019
b63c9ff
Merge pull request #151 from inrupt/fix/invisible-time-picker
james-martin-jd Nov 20, 2019
a70b6b7
changes in multiline textfield:
Eliamar Nov 25, 2019
e2f54dd
Merge pull request #152 from inrupt/bug/form-renderer-display-multili…
james-martin-jd Nov 25, 2019
958db54
Update datepicker to save and read values according to the form-model…
Nov 25, 2019
97bcef1
Add minimal test cases
Nov 25, 2019
cac092a
Add tests for datestimes
Nov 25, 2019
32a0787
Add comment
Nov 26, 2019
0208076
Fix login default error text typo
yakca Nov 26, 2019
71af5d7
Add validation for invalid data stored in the pod
Nov 26, 2019
191afe7
Merge pull request #153 from inrupt/fix/datepicker-save-format
james-martin-jd Nov 26, 2019
3e71e98
Updating version number and forms package
james-martin-jd Nov 26, 2019
99bbff2
Merge pull request #154 from yakca/bug/error-text-typo
james-martin-jd Nov 26, 2019
3ffe88a
`acl:defaultForNew` is deprecated
michielbdejong Nov 29, 2019
f7e0f21
Same here
michielbdejong Nov 29, 2019
7a8e39e
Fix off-by-one index error when checking if the locale has a second part
Dec 2, 2019
458e716
Remove logging
Dec 2, 2019
1e44375
Merge pull request #155 from inrupt/michielbdejong-patch-3
james-martin-jd Dec 2, 2019
2c9b7ee
Fix for when locale does not have a second part.
angelaraya Dec 2, 2019
8387495
Merge pull request #156 from inrupt/fix/expanded-locale
james-martin-jd Dec 2, 2019
dd6c26b
Adding Decimal, Float and Integer inputs
Dec 3, 2019
b745652
Keeping only one styles
Dec 3, 2019
6759b6f
Merge pull request #158 from inrupt/feature/numeric/inputs
james-martin-jd Dec 3, 2019
97a9529
Check if there is a min,max value before trying to use it
Dec 4, 2019
c57bb25
Default to 00:00 for minTime and 23:59 for maxTime
Dec 4, 2019
c7c7c61
Test that the min,maxValue adheres to HH:mm
Dec 4, 2019
569cf6f
Merge pull request #159 from inrupt/fix/missing-minmax-values
james-martin-jd Dec 4, 2019
d8d2876
Add color picker to the exposed form children components
Dec 2, 2019
689920d
Initial color picker implementation
Dec 4, 2019
e103a65
Register picker as theme context consumer
Dec 4, 2019
7f48249
Add text with the hex code next to the swatch
Dec 4, 2019
39d2105
Remove conflicting styling
Dec 4, 2019
a7cbc44
Updating forms version
james-martin-jd Dec 5, 2019
ce80529
Save when the picker is closed (autosave on)
Dec 5, 2019
5b8fa34
Remove logging
angelaraya Dec 5, 2019
95e2062
Merge pull request #160 from inrupt/feature/color-fields
james-martin-jd Dec 5, 2019
8280611
Fixing minor issue with datepicker and updating tests
james-martin-jd Dec 5, 2019
8f39702
Removing logging message
james-martin-jd Dec 5, 2019
cbb3c84
Merge pull request #161 from inrupt/fix/datetime-tests
james-martin-jd Dec 5, 2019
530896f
Removing some empty test files, and removing the components from the …
james-martin-jd Dec 5, 2019
2c2fb6a
Initial form viewer update
Dec 5, 2019
7a411d4
Add color line viewer
Dec 5, 2019
999c3d2
Render bool value if line is missing with false as default
Dec 5, 2019
e22f870
SingleLine: default to empty string when no value is found
Dec 5, 2019
0d51b87
Multiline: default to empty string when value is missing
Dec 5, 2019
0447a36
Bool line: Use predicate from constants
Dec 5, 2019
2169e99
DateLine: Use empty string when there is no value set
Dec 5, 2019
b60adce
Merge pull request #163 from inrupt/feature/form-viewer
james-martin-jd Dec 5, 2019
bc2b775
Merge pull request #162 from inrupt/bug/broken-tests
angelaraya Dec 5, 2019
150390b
Updating package number for deployment
james-martin-jd Dec 5, 2019
27b29a0
Updating and fixing a build issue and configuring the versions
james-martin-jd Dec 5, 2019
3b4dd6a
Updating dependencies
james-martin-jd Dec 5, 2019
a852b97
Fixing references to ProfileViewer and properly exporting it:
james-martin-jd Dec 6, 2019
50a7418
Map headings and comments with the propper components in the viewer
Dec 9, 2019
3180b9c
Merge pull request #164 from inrupt/fix/viewer-headers
james-martin-jd Dec 9, 2019
761c9e3
Bumping package version
james-martin-jd Dec 9, 2019
9a724cc
Upgrading components
james-martin-jd Dec 9, 2019
3c92159
Un-bold the datetime labels in view mode
Dec 9, 2019
723bb98
Merge pull request #165 from inrupt/fix/bold-accents-in-viewer
james-martin-jd Dec 9, 2019
6c0b0e3
Fixing the input length
Dec 9, 2019
e2d0cb4
Merge pull request #167 from inrupt/bugfix/input-numbers-length
james-martin-jd Dec 9, 2019
e8315df
Extract the locale transformation into a util function
Dec 10, 2019
b39437d
Update DateLine to use the closest system locale
Dec 10, 2019
1a1ae43
Updte date picker to use to properly register the locale'
Dec 10, 2019
a1b3198
Remove bold attr from all SingleLine components in view mode
Dec 10, 2019
18c2ae3
Updating form package and version number
james-martin-jd Dec 10, 2019
cdf8a14
Use correct type predicate.
RubenVerborgh Dec 11, 2019
8a6fe76
Refactoring how the notification and settings files are created to be…
james-martin-jd Dec 11, 2019
3d80e75
PhoneField and EmailField renderer and pattern
Dec 11, 2019
9f454e1
Merge pull request #174 from inrupt/phone-email-field
james-martin-jd Dec 11, 2019
d33d26a
Merge pull request #172 from inrupt/fix/acl-type-statement
james-martin-jd Dec 11, 2019
59ee2cb
Merge pull request #169 from inrupt/fix/float-bolds
james-martin-jd Dec 11, 2019
d756684
Merge pull request #173 from inrupt/bug/notification-names
james-martin-jd Dec 12, 2019
c7815d9
Update component to properly save and fetch values
Dec 12, 2019
9bd689d
Remove aliased prop
Dec 12, 2019
0b3b9e7
Check if the length will allow a second index
Dec 12, 2019
20d5644
Merge pull request #168 from inrupt/fix/viewer-locale
james-martin-jd Dec 12, 2019
fc79324
Merge pull request #175 from inrupt/fix/checkbox
james-martin-jd Dec 12, 2019
de47bfe
Updating forms and version number
james-martin-jd Dec 13, 2019
14851da
Updating version to rc
james-martin-jd Dec 13, 2019
cae16e0
Fixing issue with pattern
Dec 13, 2019
e3a34e0
Reverting notification changes
james-martin-jd Dec 16, 2019
9ac462e
Merge pull request #178 from inrupt/bugfix/email-phone
james-martin-jd Dec 16, 2019
210355b
Bumping RC version and updating forms
james-martin-jd Dec 16, 2019
3bfb48f
Updating version number and forms version
james-martin-jd Dec 16, 2019
9ac5c4d
Updating readme and changelog
james-martin-jd Dec 17, 2019
7778a66
Document the `theme` object
Dec 17, 2019
5c2f90a
Updates to readme and changelog from review
james-martin-jd Dec 17, 2019
cd875a2
Merge branch 'docs/changelog' of github.com:inrupt/solid-react-compon…
james-martin-jd Dec 17, 2019
0208a40
Merge pull request #179 from inrupt/docs/changelog
james-martin-jd Dec 18, 2019
9774597
Updating release date
james-martin-jd Dec 18, 2019
944170a
Updating package and forms version
james-martin-jd Dec 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"import/no-cycle": [0],
"quotes": [1, "single"],
"react/no-array-index-key": [1],
"react/jsx-one-expression-per-line": [0]
"react/jsx-one-expression-per-line": [0],
"jsx-a11y/label-has-for": [0]
},
"settings": {
"import/resolver": { "babel-module": {} }
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Solid React Components Library

## 0.5.0 ( December 18, 2019 )

### Added

- FormModel component:
- New component that renders a form from a Form Model
- New components added to support the form model. The following list of components are all compatible with the Form Model:
- Textbox
- TextArea
- Date / DateTime / Time fields, using [react-datepicker](https://reactdatepicker.com/)
- Dropdown
- Checkbox (Boolean, not tri-state)
- ColorPicker, using [react-color](https://casesandberg.github.io/react-color/)
- Header (an `<h2>` tag rendered inside of the form)
- Comment (a `<p>` tag rendered inside of the form)
- Decimal / Float / Integer fields
- Email field
- Phone field
- Multiple, a custom Form Model field that indicates the child element is repeatable
- Group, an ordered set of fields that can be treated as a single sub-form

### Updated

- Notification class was updated to validate notifications when being read from an inbox. This way only compatible notifications are retrieved and the data is more predictable for display purposes
- Updated ACL class predicate from `acl:defaultForNew`, which is deprecated, to `acl:default`
- Renamed the rdf predicate prefix from `a` to `rdf` to align with standard convention

### Deprecated

- The ShExFormBuilder component is now deprecated in favor of the new FormModel component. The component remains in the library for now, but the documentation has been removed

## 0.4.4 ( August 14, 2019 )

### Added
Expand Down
148 changes: 92 additions & 56 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/webpack.config.demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ module.exports = {
'@hooks': path.resolve(__dirname, '../src/lib/hooks'),
'@context': path.resolve(__dirname, '../src/lib/context'),
'@classes': path.resolve(__dirname, '../src/lib/classes'),
'@lib': path.resolve(__dirname, '../src/lib'),
'@constants': path.resolve(__dirname, '../src/lib/constants')
},
plugins: [
Expand Down
1 change: 1 addition & 0 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ module.exports = {
'@hooks': path.resolve(paths.appLibSrc, './hooks'),
'@context': path.resolve(paths.appLibSrc, './context'),
'@classes': path.resolve(__dirname, '../src/lib/classes'),
'@lib': path.resolve(__dirname, '../src/lib'),
'@constants': path.resolve(__dirname, '../src/lib/constants')
}
}
Expand Down
1 change: 1 addition & 0 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ module.exports = {
'@hooks': path.resolve(__dirname, '../src/lib/hooks'),
'@context': path.resolve(__dirname, '../src/lib/context'),
'@classes': path.resolve(__dirname, '../src/lib/classes'),
'@lib': path.resolve(__dirname, '../src/lib'),
'@constants': path.resolve(__dirname, '../src/lib/constants')
},
plugins: [
Expand Down
12,393 changes: 6,617 additions & 5,776 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 22 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inrupt/solid-react-components",
"version": "0.4.4",
"version": "0.5.0",
"description": "Solid React Components",
"scripts": {
"start": "node scripts/start.js",
Expand All @@ -23,7 +23,7 @@
"type": "git",
"url": "git+https://github.com/Inrupt-inc/solid-react-components"
},
"homepage": "https://solid.inrupt.com/docs",
"homepage": "https://solidproject.org",
"contributors": [
{
"name": "Justin Bingham",
Expand All @@ -35,35 +35,49 @@
},
{
"name": "Pablo Rodriguez",
"email": "pablo.rodriguez@janeirodigital.com"
"email": ""
},
{
"name": "Jairo Campos",
"email": "jairo.campos@janeirodigital.com"
"email": ""
},
{
"name": "Arne Hassel",
"email": "arneh@inrupt.com"
},
{
"name": "Angel Araya",
"email": "angel.araya@janeirodigital.com"
},
{
"name": "Eliamar Agüero",
"email": "eliamar.aguero@janeirodigital.com"
}
],
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.1.2",
"@inrupt/solid-sdk-forms": "0.1.0",
"@rdfjs/data-model": "^1.1.1",
"@shexjs/core": "^1.0.0-alpha.4",
"@shexjs/loader": "^1.0.0-alpha.5",
"@shexjs/parser": "^1.0.0-alpha.4",
"@solid/react": "^1.6.0",
"@solid/query-ldflex": "^2.6.0",
"@solid/react": "^1.8.0",
"date-fns": "^2.8.0",
"file-type": "^10.7.1",
"html-webpack-include-assets-plugin": "^1.0.6",
"jsonld": "^1.6.2",
"ldflex": "^2.4.0",
"lodash": "^4.17.15",
"mime-types": "^2.1.24",
"moment": "^2.24.0",
"n3": "^1.1.1",
"rdflib": "^0.20.1",
"react-color": "^2.17.3",
"react-datepicker": "^2.9.6",
"react-router-dom": "^4.3.1",
"react-select": "^2.2.0",
"request-promise": "^4.2.5",
"solid-auth-client": "^2.3.0",
"unique": "0.0.1",
"unique-string": "^1.0.0"
Expand Down Expand Up @@ -143,7 +157,7 @@
"terser-webpack-plugin": "1.1.0",
"uglify-js": "^3.6.0",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack": "^4.41.2",
"webpack-dev-server": "3.1.14",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3"
Expand Down Expand Up @@ -200,6 +214,7 @@
"@contex": "<rootDir>/src/lib/context",
"@testSetup": "<rootDir>/src/test/setup",
"@classes": "<rootDir>/src/lib/classes",
"@lib": "<rootDir>/src/lib",
"@constants": "<rootDir>/src/lib/constants",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
},
Expand Down
171 changes: 128 additions & 43 deletions src/demo/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import React, { useEffect, useState, useCallback } from 'react';
import { useWebId } from '@solid/react';
import styled from 'styled-components';
// import { FormModel as FormModelClass } from '@inrupt/solid-sdk-forms';
import SolidImg from '../assets/solid_logo.png';
import { ProviderLogin, Uploader, ProfileUploader, useNotification } from '../lib';
import {
ProviderLogin,
Uploader,
ProfileUploader,
useNotification,
FormModel,
AutoSaveDefaultSpinner,
ProfileViewer
} from '@lib';
import { AccessControlList } from '@classes';
import HandleShexForm from './components';
import { NotificationTypes } from '@constants';

const HeaderWrapper = styled.section`
margin-top: 60px;
Expand All @@ -23,17 +32,6 @@ const Headline = styled.h1`
font-weight: 300;
`;

const ShexFormComponent = styled.div`
border-top: 1px solid black;

input {
margin: 20px 0;
padding: 10px;
width: 100%
box-sizing: border-box;
}
`;

const NotificationSection = styled.div`
button {
&:disabled {
Expand All @@ -59,21 +57,46 @@ const Header = () => {
};

const App = () => {
const [userInbox, setUserInbox] = useState(null);
const [userWebID, setUserWebID] = useState('');

const webId = useWebId();
const { fetchNotification, notification, createNotification, discoverInbox } = useNotification(
const { notification, createNotification, discoverInbox, fetchNotification } = useNotification(
webId
);

const onChange = useCallback((event: Event) => {
const onWebIDChange = useCallback((event: Event) => {
const { target } = event;
setUserInbox(target.value);
setUserWebID(target.value);
});

const init = async () => {
const result = await discoverInbox(webId);
/*
* This code snippet will fetch notifications of a given inbox, running the full ShEx validation and everything
* Comment out if you want to speed up App.js rendering
*/
/*
const inboxes = [{ path: 'https://jmartin.inrupt.net/public/games/tictactoe/inbox/', inboxName: 'Global Inbox', shape: 'default' }];
await fetchNotification(inboxes);
console.log(notification);
*/
/*
* This code snippet will run a form model conversion on a given shex shape.
* Comment this out if you want to increase App.js performance. To enable, uncomment this
* section and also the import statement for FormModelClass
*/
/*
const formModel = new FormModelClass(
'https://solidsdk.inrupt.net/public/FormLanguage/examples/ShEx/decimal.shex',
'https://jmartin.inrupt.net/profile/card#me'
);
const schema = await formModel.parseSchema(
'https://solidsdk.inrupt.net/public/FormLanguage/examples/ShEx/decimal.shex'
);
const formModelOutput = await formModel.parseShEx(schema);

fetchNotification([{ path: result, inboxName: 'Global App' }]);
// eslint-disable-next-line no-console
console.log(formModelOutput, 'model new');
*/
};

const createAcl = async () => {
Expand All @@ -87,18 +110,98 @@ const App = () => {
}
};

const sendSampleNotification = async () => {
try {
// Discover the inbox url from the resource, using ldp:inbox predicate
const inboxUrl = await discoverInbox(userWebID);
// The actor in this case is the current application, so we can use the current URL
// Removing actor temporarily until we figure out how to link applications
// const actor = window.location.href;

if (!inboxUrl) {
throw new Error('Inbox not found');
}

createNotification(
{
title: 'Notification Example',
summary: 'This is a basic solid notification example.',
actor: 'https://solidsdk.inrupt.net/profile/card#me'
},
inboxUrl,
NotificationTypes.ANNOUNCE
);
} catch (ex) {
// eslint-disable-next-line no-console
console.log(ex);
}
};

useEffect(() => {
if (webId) init();
}, [notification.notify, webId]);

return (
<DemoWrapper>
<Header />
<ProfileViewer
{...{
webId: 'https://jmartin.inrupt.net/profile/card#me',
direction: 'down',
viewMoreText: 'See Profile',
onError: error => {
// eslint-disable-next-line no-console
console.log('ERROR', error.statusText);
},
onClick: false
}}
>
<span>James</span>
</ProfileViewer>

<br />
<button type="button" onClick={createAcl}>
Create ACL
</button>
<p>{JSON.stringify(notification && notification.notifications)}</p>
<ProviderLogin callbackUri={`${window.location.origin}/`} />
<FormModel
{...{
modelPath: 'https://khoward.dev.inrupt.net/public/FormModel/datetime.ttl#formRoot',
podPath: 'https://jmartin.inrupt.net/profile/card#me',
settings: {
theme: {
inputText: 'sdk-input',
inputCheckbox: 'sdk-checkbox checkbox',
inputTextArea: 'sdk-textarea'
},
savingComponent: AutoSaveDefaultSpinner
},
viewer: false,
onError: error => {
// eslint-disable-next-line no-console
console.log(error, 'error');
},
onSuccess: success => {
// eslint-disable-next-line no-console
console.log(success);
},
onSave: response => {
// eslint-disable-next-line no-console
console.log(response);
},
onAddNewField: response => {
// eslint-disable-next-line no-console
console.log(response);
},
onDelete: response => {
// eslint-disable-next-line no-console
console.log(response);
}
}}
autoSave
liveUpdate
/>
<Uploader
{...{
fileBase: 'Your POD folder here',
Expand All @@ -116,34 +219,16 @@ const App = () => {
render: props => <ProfileUploader {...{ ...props }} />
}}
/>
{webId && (
<ShexFormComponent>
<HandleShexForm {...{ webId }} />
</ShexFormComponent>
)}
<NotificationSection>
<h3>Create notification example using your inbox</h3>
<h3>Create notification example using a WebID or Resource path</h3>
<input
type="text"
placeholder="Inbox Path"
name="userInbox"
defaultValue=""
onChange={onChange}
value={userInbox}
placeholder="WebID or Resource"
name="userWebID"
onChange={onWebIDChange}
value={userWebID}
/>
<button
type="button"
disabled={!userInbox}
onClick={() =>
createNotification(
{
title: 'Notification Example',
summary: 'This is a basic solid notification example.'
},
userInbox
)
}
>
<button type="button" disabled={!userWebID} onClick={sendSampleNotification}>
Create notification
</button>
</NotificationSection>
Expand Down
Loading