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

Uri Value Component #22

Merged
merged 6 commits into from
Feb 24, 2020
Merged

Uri Value Component #22

merged 6 commits into from
Feb 24, 2020

Conversation

mdelez
Copy link
Contributor

@mdelez mdelez commented Feb 14, 2020

closes #17

…: don't do that. Also added the rest of the tests for the UriValueComponent.
@tobiasschweizer
Copy link
Contributor

Thanks, I try to have a look at that today.

@mdelez
Copy link
Contributor Author

mdelez commented Feb 17, 2020

I think the validator could use some work but I'm not entirely sure what Knora accepts as a valid url

@tobiasschweizer
Copy link
Contributor

tobiasschweizer commented Feb 17, 2020

I think the validator could use some work but I'm not entirely sure what Knora accepts as a valid url

any valid xsd:URI (https://docs.knora.org/paradox/02-knora-ontologies/knora-base.html#subclasses-of-value, https://github.com/dasch-swiss/knora-api/blob/ccb64bbcf16b80d55423ff44b28c89d34bf39581/webapi/src/main/scala/org/knora/webapi/util/StringFormatter.scala#L713-L714).

I think it would be a good idea to put the validators in a central place so they could be reused. Also then the regex would only be created once and not with every instance of a value component.

@mdelez
Copy link
Contributor Author

mdelez commented Feb 17, 2020

any valid xsd:URI (https://docs.knora.org/paradox/02-knora-ontologies/knora-base.html#subclasses-of-value, https://github.com/dasch-swiss/knora-api/blob/ccb64bbcf16b80d55423ff44b28c89d34bf39581/webapi/src/main/scala/org/knora/webapi/util/StringFormatter.scala#L713-L714).

I'm a little lost on how I can use this. Do we have validation functions set up already for uri's or will we still need to use regex?

I think it would be a good idea to put the validators in a central place so they could be reused. Also then the regex would only be created once and not with every instance of a value component.

I can work on this. It would probably be good to implement it before we create all of the other components. Should I make a new issue for this?

@mdelez mdelez changed the title feature (value): base implementation of UriValueComponent Uri Value Component Feb 20, 2020
@mdelez mdelez added the enhancement New feature or request label Feb 20, 2020

it('should set a new display value', () => {

const newInt = new ReadUriValue();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you adapt the variable name? Just for reasons of clarity, doesn't make any technical difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in b228083

});
});

describe('create an integer value', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

please adapt the test's name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in b228083

Copy link
Contributor

@tobiasschweizer tobiasschweizer left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@mdelez mdelez merged commit 90fb858 into master Feb 24, 2020
@mdelez mdelez deleted the wip/17-UriValueComponent branch February 24, 2020 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Viewer Value Component: UriValueComponent
2 participants