0.1 #1

Merged
armin merged 30 commits from 0.1 into master 2020-07-26 00:51:55 +00:00
7 changed files with 25 additions and 23 deletions
Showing only changes of commit 0c1fe8efce - Show all commits

View file

@ -41,8 +41,22 @@ steps:
- openapi-generator generate - openapi-generator generate
-i http://runservice:8080/v3/api-docs -i http://runservice:8080/v3/api-docs
-g python -g python
--additional-properties packageName=flingclient
-o flingclient.py -o flingclient.py
--enable-post-process-file --enable-post-process-file
- cd flingclient.py
- |+
cat << EOF
[distutils]
index-servers =
nexus
[private-repository]
repository = <private-repository URL>
username = <private-repository username>
password = <private-repository password>
EOF >> .pypirc
- cat .pypirc
- cd ..
# JavaScript client # JavaScript client
- openapi-generator generate - openapi-generator generate
-i http://runservice:8080/v3/api-docs -i http://runservice:8080/v3/api-docs

View file

@ -18,7 +18,6 @@ import lombok.NoArgsConstructor;
@Schema(name = "Artifact") @Schema(name = "Artifact")
public class ArtifactDto { public class ArtifactDto {
@Schema(accessMode = AccessMode.READ_ONLY, type = "string") @Schema(accessMode = AccessMode.READ_ONLY, type = "string")
@NotNull
private UUID id; private UUID id;
@Schema(type = "string", @Schema(type = "string",

View file

@ -17,7 +17,6 @@ import lombok.NoArgsConstructor;
@Schema(name = "Fling") @Schema(name = "Fling")
public class FlingDto { public class FlingDto {
@Schema(accessMode = AccessMode.READ_ONLY, type = "string") @Schema(accessMode = AccessMode.READ_ONLY, type = "string")
@NotNull
private UUID id; private UUID id;
@Schema(description = "Name of the fling") @Schema(description = "Name of the fling")
@ -26,7 +25,6 @@ public class FlingDto {
@Schema(type = "integer", format = "int64", accessMode = AccessMode.READ_ONLY, @Schema(type = "integer", format = "int64", accessMode = AccessMode.READ_ONLY,
description = "Creation time in milliseconds since the unix epoch 01.01.1970 00:00:00 UTC") description = "Creation time in milliseconds since the unix epoch 01.01.1970 00:00:00 UTC")
@NotNull
private Instant creationTime; private Instant creationTime;
@Schema(description = "Share id of the fling. Used in the share link.") @Schema(description = "Share id of the fling. Used in the share link.")

View file

@ -22,7 +22,7 @@ public class ArtifactDtoTest {
private Validator validator; private Validator validator;
@Test @Test
void testSetId_null_validationFails() { void testSetId_null_validationOk() {
ArtifactDto artifactDto = ArtifactDto.builder() ArtifactDto artifactDto = ArtifactDto.builder()
.id(null) .id(null)
.path(Paths.get("test")) .path(Paths.get("test"))
@ -31,10 +31,7 @@ public class ArtifactDtoTest {
Set<ConstraintViolation<ArtifactDto>> constraintViolations = validator.validate(artifactDto); Set<ConstraintViolation<ArtifactDto>> constraintViolations = validator.validate(artifactDto);
assertThat(constraintViolations).hasSize(1); assertThat(constraintViolations).hasSize(0);
ConstraintViolation<ArtifactDto> violation = constraintViolations.iterator().next();
assertThat(violation.getPropertyPath().toString()).isEqualTo("id");
assertThat(violation.getMessage()).isEqualTo("must not be null");
} }
@Test @Test

View file

@ -22,7 +22,7 @@ public class FlingDtoTest {
private Validator validator; private Validator validator;
@Test @Test
void testSetId_null_validationFails() { void testSetId_null_validationOk() {
FlingDto flingDto = FlingDto.builder() FlingDto flingDto = FlingDto.builder()
.id(null) .id(null)
.name("test") .name("test")
@ -33,10 +33,7 @@ public class FlingDtoTest {
Set<ConstraintViolation<FlingDto>> constraintViolations = validator.validate(flingDto); Set<ConstraintViolation<FlingDto>> constraintViolations = validator.validate(flingDto);
assertThat(constraintViolations).hasSize(1); assertThat(constraintViolations).hasSize(0);
ConstraintViolation<FlingDto> violation = constraintViolations.iterator().next();
assertThat(violation.getPropertyPath().toString()).isEqualTo("id");
assertThat(violation.getMessage()).isEqualTo("must not be null");
} }
@Test @Test
@ -58,7 +55,7 @@ public class FlingDtoTest {
} }
@Test @Test
void testSetCreationTime_null_validationFails() { void testSetCreationTime_null_validationOk() {
FlingDto flingDto = FlingDto.builder() FlingDto flingDto = FlingDto.builder()
.id(new UUID(0L, 0L)) .id(new UUID(0L, 0L))
.name("test") .name("test")
@ -69,10 +66,7 @@ public class FlingDtoTest {
Set<ConstraintViolation<FlingDto>> constraintViolations = validator.validate(flingDto); Set<ConstraintViolation<FlingDto>> constraintViolations = validator.validate(flingDto);
assertThat(constraintViolations).hasSize(1); assertThat(constraintViolations).hasSize(0);
ConstraintViolation<FlingDto> violation = constraintViolations.iterator().next();
assertThat(violation.getPropertyPath().toString()).isEqualTo("creationTime");
assertThat(violation.getMessage()).isEqualTo("must not be null");
} }

View file

@ -1210,7 +1210,7 @@
"@fling/flingclient": { "@fling/flingclient": {
"version": "0.1.0-snapshot", "version": "0.1.0-snapshot",
"resolved": "https://nexus.friedl.net/repository/npm-private/@fling/flingclient/-/flingclient-0.1.0-snapshot.tgz", "resolved": "https://nexus.friedl.net/repository/npm-private/@fling/flingclient/-/flingclient-0.1.0-snapshot.tgz",
"integrity": "sha512-KXeJE/tTCi+IRBZ8pBeFLFEn7GDBWw/aIDj4xaofjw6S0DFEpw5TwW+Oh45NALk/SEiR4DKBuG/sfgiHrpZwLA==", "integrity": "sha512-Ws4M0st41sb8gQz07k3ygEXoqx5GtSmH9rr/RzrJhQELt0dVxNi8qJY3VcJxV6svpYvwKDacRyy+aXnNnOG6/w==",
"requires": { "requires": {
"@babel/cli": "^7.0.0", "@babel/cli": "^7.0.0",
"superagent": "3.7.0" "superagent": "3.7.0"

View file

@ -16,16 +16,16 @@ function TileAction(props) {
<ul className="menu text-left"> <ul className="menu text-left">
<li className="menu-item input-group"> <li className="menu-item input-group">
<div className="input-group"> <div className="input-group">
<input type="text" ref={shareUrlRef} className="form-input input-sm input-share-id" readOnly value={props.fling.sharing.shareUrl} /> <input type="text" ref={shareUrlRef} className="form-input input-sm input-share-id" readOnly value={props.fling.shareId} />
<span className="input-group-addon addon-sm input-group-addon-sm" onClick={copyShareUrl} ><i className="icon icon-copy" /></span> <span className="input-group-addon addon-sm input-group-addon-sm" onClick={copyShareUrl} ><i className="icon icon-copy" /></span>
</div> </div>
</li> </li>
<li className="menu-item"> <li className="menu-item">
<div className="form-group"> <div className="form-group">
<label className="form-switch"> <label className="form-switch">
<input type="checkbox" checked={props.fling.sharing.shared} onChange={toggleShared} /> <input type="checkbox" checked={props.fling.shared} onChange={toggleShared} />
<i className="form-icon" /> <i className="form-icon" />
{props.fling.sharing.shared ? "Shared":"Private"} {props.fling.shared ? "Shared":"Private"}
</label> </label>
</div> </div>
</li> </li>
@ -57,7 +57,7 @@ function TileAction(props) {
} }
async function toggleShared() { async function toggleShared() {
await flingClient.putFling(props.fling.id, {"sharing": {"shared": !props.fling.sharing.shared}}); await flingClient.putFling(props.fling.id, {"sharing": {"shared": !props.fling.shared}});
await props.refreshFlingListFn(); await props.refreshFlingListFn();
} }
} }