-
Notifications
You must be signed in to change notification settings - Fork 0
20 tags #74
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
Merged
20 tags #74
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
54d67a2
Add Tag entity with JPA annotations for custom_tags table
chiar17 8355c86
Add ManyToMany relationship for custom tags in TestCase entity
chiar17 483bce5
Add TagRepository interface for managing Tag entities
chiar17 eef0a16
Add TagResponse DTO for representing Tag data
chiar17 a6a31f5
Add TagRequest DTO for representing Tag creation data
chiar17 c193162
Implement TagService for managing tags, including creation, deletion,…
chiar17 7cc2a8e
Refactor TagService and add custom exception classes for tag operations
chiar17 9ee80c2
Add custom tag management endpoints to WorkspaceMetadataController an…
chiar17 b235fc0
Add buildCustomTagBadges function and integrate custom tags into grid…
chiar17 b3512b0
Add click and keydown event handlers for custom tags in grid rows
chiar17 4cacf55
Add workspace tags component with tag management functionality
chiar17 de82a11
Add custom tag filter to workspace header component
chiar17 10d6a6b
Add import for workspace tags component and update custom tag filter …
chiar17 8497a53
Add filterCustomTag to uiState input hydration
chiar17 b9459a1
Add tagsController to manage tag updates and integrate with dataContr…
chiar17 f9cc201
Add filterCustomTag event listener to apply filters on change
chiar17 dc6722c
Add populateCustomTagSelect function and updateTestCaseTags to manage…
chiar17 2954407
Add fetchCustomTags function to retrieve custom tags and integrate wi…
chiar17 e6f81f0
Add pending value handling for custom tags in workspace UI state
chiar17 5eb3991
Add customTagId handling in workspace UI state for filter queries
chiar17 2eed4c2
Fix tag name input focus restoration in workspace tags component
chiar17 3e0982d
Add onTagListChanged parameter to createWorkspaceTags function
chiar17 a78ab12
Add onTagListChanged callback invocation in createWorkspaceTags function
chiar17 b236505
Invoke onTagListChanged callback after updating tags in createWorkspa…
chiar17 9ed3e65
Invoke onTagListChanged callback to load filter options in createWork…
chiar17 b1fc479
Rename "Tags" to "Type" in various components for improved clarity
chiar17 e1032bd
Enhance Tag functionality: add usage count to TagResponse, implement …
chiar17 6a40e20
Implement custom tag update functionality, enhance tag editing UI, an…
chiar17 7a9515d
Add custom tag display in inline preview row and update UI for clarity
chiar17 cf0581e
Add custom tags to test case details model for improved display
chiar17 a750c3a
Add tags section to test case details for improved organization and d…
chiar17 6f1c0e2
Import createWorkspaceTags component for tag management integration
chiar17 e1bd04e
Implement tag management functions to handle assigned tags and update UI
chiar17 b5c9ef7
Add method to find test cases by team key and work keys for enhanced …
chiar17 16cfd68
Add bulk custom tags endpoint to WorkspaceMetadataController for enha…
chiar17 cb7fe7a
Add BulkTagRequest class for handling bulk tag operations
chiar17 d48986b
Add bulkSetTag method to TagService for managing tags across multiple…
chiar17 52fa0e4
Add workspace bulk tag assignment functionality with popover UI
chiar17 eac2c85
Add bulk tag assignment functionality to workspace page
chiar17 5c210ce
Add Tag button to bulk action bar for enhanced tag management
chiar17 9246473
Add color swatches and create tag functionality to bulk tag assignmen…
chiar17 8dcf97f
Add query method to retrieve TestCase with custom tags by team and wo…
chiar17 4477371
Add integration tests for custom tag API endpoints
chiar17 e27e492
Refactor test assertions to use updated repository method for retriev…
chiar17 e9eddc7
Merge branch 'main' into 20-tags
chiar17 9d4ba0b
Update src/main/java/com/formswim/teststream/workspace/services/TagSe…
kendymann f28c8e9
Update src/main/java/com/formswim/teststream/shared/domain/TagReposit…
kendymann 3d42445
Fixed merge conflicts
Bazinator 7ab4634
Changed to export All, and square button
Bazinator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
src/main/java/com/formswim/teststream/shared/domain/Tag.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package com.formswim.teststream.shared.domain; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.GeneratedValue; | ||
| import jakarta.persistence.GenerationType; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.Table; | ||
| import jakarta.persistence.UniqueConstraint; | ||
|
|
||
| @Entity | ||
| @Table( | ||
| name = "custom_tags", | ||
| uniqueConstraints = { | ||
| @UniqueConstraint(name = "uk_custom_tags_team_name", columnNames = { "team_key", "name" }) | ||
| } | ||
| ) | ||
| public class Tag { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @Column(nullable = false, length = 50) | ||
| private String name; | ||
|
|
||
| @Column(nullable = false, length = 7) | ||
| private String color; | ||
|
|
||
| @Column(name = "team_key", nullable = false, length = 100) | ||
| private String teamKey; | ||
|
|
||
| protected Tag() { | ||
| } | ||
|
|
||
| public Tag(String name, String color, String teamKey) { | ||
| this.name = name; | ||
| this.color = color; | ||
| this.teamKey = teamKey; | ||
| } | ||
|
|
||
| public Long getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public String getColor() { | ||
| return color; | ||
| } | ||
|
|
||
| public void setColor(String color) { | ||
| this.color = color; | ||
| } | ||
|
|
||
| @JsonIgnore | ||
| public String getTeamKey() { | ||
| return teamKey; | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/formswim/teststream/shared/domain/TagRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package com.formswim.teststream.shared.domain; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Optional; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Modifying; | ||
| import org.springframework.data.jpa.repository.Query; | ||
| import org.springframework.data.repository.query.Param; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| @Repository | ||
| public interface TagRepository extends JpaRepository<Tag, Long> { | ||
|
|
||
| List<Tag> findByTeamKeyOrderByNameAsc(String teamKey); | ||
|
|
||
| Optional<Tag> findByTeamKeyAndId(String teamKey, Long id); | ||
|
|
||
| boolean existsByTeamKeyAndName(String teamKey, String name); | ||
|
|
||
| @Query(value = "SELECT tag_id, COUNT(*) FROM test_case_custom_tags WHERE tag_id IN (:tagIds) GROUP BY tag_id", nativeQuery = true) | ||
| List<Object[]> countUsageByTagIds(@Param("tagIds") List<Long> tagIds); | ||
|
|
||
| @Modifying | ||
| @Query(value = "DELETE FROM test_case_custom_tags WHERE tag_id = :tagId", nativeQuery = true) | ||
| void deleteFromJoinTableByTagId(@Param("tagId") Long tagId); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,10 @@ public interface TestCaseRepository extends JpaRepository<TestCase, Long> { | |
| and (:tag is null or :tag = '' | ||
| or lower(coalesce(testCase.components, '')) like lower(concat('%', :tag, '%')) | ||
| or lower(coalesce(testCase.testCaseType, '')) like lower(concat('%', :tag, '%'))) | ||
| and ( | ||
| and (:customTagId is null or exists ( | ||
| select 1 from testCase.customTags ct where ct.id = :customTagId | ||
| )) | ||
| and ( | ||
| :folder is null or :folder = '' | ||
| or lower(trim(function('replace', coalesce(testCase.folder, ''), '\\', '/'))) = lower(:folder) | ||
| or lower(trim(function('replace', coalesce(testCase.folder, ''), '\\', '/'))) like lower(concat(:folder, '/%')) | ||
|
|
@@ -45,6 +48,10 @@ or exists ( | |
| where testStep.testCase = testCase | ||
| and lower(coalesce(testStep.stepSummary, '')) like lower(concat('%', :search, '%')) | ||
| ) | ||
| or exists ( | ||
| select 1 from testCase.customTags ct | ||
| where lower(ct.name) like lower(concat('%', :search, '%')) | ||
| ) | ||
|
Comment on lines
49
to
+54
|
||
| ) | ||
| order by testCase.id desc | ||
| """, | ||
|
|
@@ -57,7 +64,10 @@ select count(distinct testCase.id) | |
| and (:tag is null or :tag = '' | ||
| or lower(coalesce(testCase.components, '')) like lower(concat('%', :tag, '%')) | ||
| or lower(coalesce(testCase.testCaseType, '')) like lower(concat('%', :tag, '%'))) | ||
| and ( | ||
| and (:customTagId is null or exists ( | ||
| select 1 from testCase.customTags ct where ct.id = :customTagId | ||
| )) | ||
| and ( | ||
| :folder is null or :folder = '' | ||
| or lower(trim(function('replace', coalesce(testCase.folder, ''), '\\', '/'))) = lower(:folder) | ||
| or lower(trim(function('replace', coalesce(testCase.folder, ''), '\\', '/'))) like lower(concat(:folder, '/%')) | ||
|
|
@@ -75,6 +85,10 @@ or exists ( | |
| where testStep.testCase = testCase | ||
| and lower(coalesce(testStep.stepSummary, '')) like lower(concat('%', :search, '%')) | ||
| ) | ||
| or exists ( | ||
| select 1 from testCase.customTags ct | ||
| where lower(ct.name) like lower(concat('%', :search, '%')) | ||
| ) | ||
| ) | ||
| """ | ||
| ) | ||
|
|
@@ -83,6 +97,7 @@ Page<Long> findWorkspaceCaseIdsByFilters(@Param("teamKey") String teamKey, | |
| @Param("status") String status, | ||
| @Param("component") String component, | ||
| @Param("tag") String tag, | ||
| @Param("customTagId") Long customTagId, | ||
| @Param("folder") String folder, | ||
| Pageable pageable); | ||
|
|
||
|
|
@@ -133,6 +148,15 @@ int bulkMoveToFolderByTeamKeyAndWorkKeys(@Param("teamKey") String teamKey, | |
| List<TestCase> findAllWithStepsByTeamKeyAndWorkKeyIn(String teamKey, | ||
| Collection<String> workKeys); | ||
|
|
||
| @Query(""" | ||
| select distinct testCase | ||
| from TestCase testCase | ||
| left join fetch testCase.customTags | ||
| where testCase.teamKey = :teamKey and testCase.workKey = :workKey | ||
| """) | ||
| Optional<TestCase> findWithCustomTagsByTeamKeyAndWorkKey(@Param("teamKey") String teamKey, | ||
| @Param("workKey") String workKey); | ||
|
|
||
| @Query(""" | ||
| select distinct trim(function('replace', testCase.folder, '\\', '/')) | ||
| from TestCase testCase | ||
|
|
@@ -235,4 +259,6 @@ int bulkRepathDescendants(@Param("teamKey") String teamKey, | |
| @Param("suffixStartIndex") int suffixStartIndex); | ||
|
|
||
| List<TestCase> findByTeamKeyAndStatus(String teamKey, String status); | ||
|
|
||
| List<TestCase> findByTeamKeyAndWorkKeyIn(String teamKey, Collection<String> workKeys); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.