forked from avniproject/avni-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avniproject#762 | Added FieldAttributes Enum , used it in MQB , Renam…
…ed createQuestionForIndividualTable method , Deleted MetabaseJoin
- Loading branch information
1 parent
dbef075
commit 381d921
Showing
9 changed files
with
51 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
1 change: 1 addition & 0 deletions
1
avni-server-api/src/main/java/org/avni/server/domain/metabase/CardType.java
This file contains 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
31 changes: 31 additions & 0 deletions
31
avni-server-api/src/main/java/org/avni/server/domain/metabase/FieldAttribute.java
This file contains 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,31 @@ | ||
package org.avni.server.domain.metabase; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.node.ObjectNode; | ||
|
||
public enum FieldAttribute { | ||
FIELD("field"), | ||
FIELDS("fields"), | ||
SOURCE_TABLE("source-table"), | ||
ALIAS("alias"), | ||
CONDITION("condition"), | ||
JOINS("joins"), | ||
JOIN_ALIAS("join-alias"), | ||
BASE_TYPE("base-type"); | ||
|
||
private final String attributeName; | ||
|
||
FieldAttribute(String attributeName) { | ||
this.attributeName = attributeName; | ||
} | ||
|
||
public String getAttributeName() { | ||
return attributeName; | ||
} | ||
|
||
public ObjectNode toJson(ObjectMapper objectMapper, Object value) { | ||
ObjectNode attributeNode = objectMapper.createObjectNode(); | ||
attributeNode.put(attributeName, value.toString()); | ||
return attributeNode; | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
...avni/server/domain/metabase/BaseType.java → ...vni/server/domain/metabase/FieldType.java
This file contains 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
39 changes: 0 additions & 39 deletions
39
avni-server-api/src/main/java/org/avni/server/domain/metabase/MetabaseJoin.java
This file was deleted.
Oops, something went wrong.
This file contains 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 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
1 change: 1 addition & 0 deletions
1
avni-server-api/src/main/java/org/avni/server/domain/metabase/VisualizationType.java
This file contains 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 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