Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Team 14 - IDATT1002
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eirik Steira
Team 14 - IDATT1002
Commits
50cc4fc9
Commit
50cc4fc9
authored
5 years ago
by
Lars Brodin Østby
Browse files
Options
Downloads
Patches
Plain Diff
Validate album name and toString fix for album
parent
b9319a68
No related branches found
No related tags found
2 merge requests
!165
Weekly merge to Master
,
!132
Need valdig title at album
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/NTNU/IDATT1002/controllers/CreateAlbum.java
+8
-8
8 additions, 8 deletions
src/main/java/NTNU/IDATT1002/controllers/CreateAlbum.java
src/main/java/NTNU/IDATT1002/service/TagService.java
+14
-4
14 additions, 4 deletions
src/main/java/NTNU/IDATT1002/service/TagService.java
with
22 additions
and
12 deletions
src/main/java/NTNU/IDATT1002/controllers/CreateAlbum.java
+
8
−
8
View file @
50cc4fc9
...
...
@@ -24,7 +24,6 @@ import javafx.scene.layout.GridPane;
import
javafx.scene.layout.HBox
;
import
javafx.scene.layout.Pane
;
import
javafx.scene.layout.VBox
;
import
org.hibernate.boot.jaxb.internal.stax.HbmEventReader
;
import
javax.persistence.EntityManager
;
import
java.io.IOException
;
...
...
@@ -161,15 +160,16 @@ public class CreateAlbum implements Initializable {
String
title
=
album_title_field
.
getText
();
String
description
=
album_desc_field
.
getText
();
String
tags
=
album_tag_field
.
getText
();
if
(
tags
.
isEmpty
()){
tags
=
" "
;
}
List
<
Tag
>
tagsToAdd
=
TagService
.
getTagsFromString
(
tags
);
User
user
=
ApplicationState
.
getCurrentUser
();
//temporary solution for the toString problem with album log creation
//temporary solution for the toString problem with album log creation
, along with the if(tag) above
if
(
description
.
isEmpty
())
{
description
=
"No desripton"
;
}
if
(
tags
.
isEmpty
()){
tags
=
" "
;
}
description
=
"No desripton added"
;
}
List
<
Node
>
imageContainers
=
new
ArrayList
<>(
fileContainer
.
getChildren
());
List
<
String
>
checkedImagesId
=
new
ArrayList
<>();
...
...
@@ -192,7 +192,7 @@ public class CreateAlbum implements Initializable {
createdAlbum
.
ifPresent
(
album
->
{
App
.
ex
.
setChosenAlbumId
(
album
.
getId
());
try
{
App
.
setRoot
(
"
main
"
);
App
.
setRoot
(
"
view_album
"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -202,7 +202,7 @@ public class CreateAlbum implements Initializable {
createdAlbum
.
ifPresent
(
album
->
{
App
.
ex
.
setChosenAlbumId
(
album
.
getId
());
try
{
App
.
setRoot
(
"
main
"
);
App
.
setRoot
(
"
view_album
"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/NTNU/IDATT1002/service/TagService.java
+
14
−
4
View file @
50cc4fc9
...
...
@@ -55,13 +55,23 @@ public class TagService {
* @return the list of tag objects
*/
public
static
List
<
Tag
>
getTagsFromString
(
String
tagsAsString
)
{
String
[]
tags
=
tagsAsString
.
trim
()
.
split
(
"[, ?.@]+"
);
if
(
tagsAsString
.
isBlank
())
{
String
[]
tags
=
tagsAsString
.
split
(
" "
);
return
Stream
.
of
(
tags
)
return
Stream
.
of
(
tags
)
.
map
(
Tag:
:
new
)
.
collect
(
Collectors
.
toList
());
}
else
{
String
[]
tags
=
tagsAsString
.
trim
()
.
split
(
"[, ?.@]+"
);
return
Stream
.
of
(
tags
)
.
map
(
Tag:
:
new
)
.
collect
(
Collectors
.
toList
());
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment