Merge pull request #233 from vran-dev/issue-231
feat: remove table column commnet page
This commit is contained in:
commit
1c08145486
|
@ -36,7 +36,7 @@
|
|||
|
||||
微信扫码加入 Databasir 交流群,获取第一手版本内容。
|
||||
|
||||
<img src="https://s2.loli.net/2022/05/30/7V4HNUKoDsuGZRS.jpg" width="250px" />
|
||||
<img src="https://s2.loli.net/2022/06/09/vTmf9saldS6ehGw.jpg" width="250px" />
|
||||
|
||||
[点击查看更多联系方式](https://doc.databasir.com/#/?id=联系)
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
@-webkit-keyframes running-line{to{stroke-dashoffset:-1000}}@keyframes running-line{to{stroke-dashoffset:-1000}}.text{font-size:14px;line-height:1.3rem}.item{margin-top:10px;margin-right:40px}.remark-card{margin-bottom:30px}.remark-header{display:flex;justify-content:space-between;align-items:center}.remark-header .remark-user{color:#6d6d6d}.remark-header .remark-time{color:#6d6d6d;font-size:.8rem;margin-left:10px}.remark-content{white-space:pre-wrap;text-align:left}.badge-item{margin-top:18px}.removed-item{background-color:#fef0f0!important;color:#f56c6c}.added-item{background-color:#f0f9eb!important;color:#67c23a}.modified-item{background-color:#fdf6ec!important;color:#e6a23c}.modified-original-item{background-color:#fdf6ec!important;color:#a8abb2}.copy-button{position:absolute;right:12px;top:16px;color:#fff}.copy-button:hover{position:absolute;right:12px;top:12px;color:#67c23a}.table-quote{padding-left:8px;margin:12px 0 6px 0;font-size:16px}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px;min-height:100px}/*!
|
||||
@-webkit-keyframes running-line{to{stroke-dashoffset:-1000}}@keyframes running-line{to{stroke-dashoffset:-1000}}.text{font-size:14px;line-height:1.3rem}.item{margin-top:10px;margin-right:40px}.remark-card{margin-bottom:30px}.remark-header{display:flex;justify-content:space-between;align-items:center}.remark-header .remark-user{color:#6d6d6d}.remark-header .remark-time{color:#6d6d6d;font-size:.8rem;margin-left:10px}.remark-content{white-space:pre-wrap;text-align:left}.badge-item{margin-top:18px}.removed-item{background-color:#fef0f0!important;color:#f56c6c}.added-item{background-color:#f0f9eb!important;color:#67c23a}.modified-item{background-color:#fdf6ec!important;color:#e6a23c}.modified-original-item{background-color:#fdf6ec!important;color:#a8abb2}.copy-button{position:absolute;right:12px;top:16px;color:#fff}.copy-button:hover{position:absolute;right:12px;top:12px;color:#67c23a}.table-quote{padding-left:8px;margin-top:1.25rem;margin-bottom:6px;font-size:16px;color:#909399}.table-document-block{margin-bottom:48px}.row-item{margin-right:8px;margin-bottom:3px}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px;min-height:100px}
|
||||
|
||||
/*!
|
||||
Theme: Agate
|
||||
Author: (c) Taufik Nurrohman <hi@taufik-nurrohman.com>
|
||||
Maintainer: @taufik-nurrohman
|
|
@ -1,4 +1,6 @@
|
|||
@-webkit-keyframes running-line{to{stroke-dashoffset:-1000}}@keyframes running-line{to{stroke-dashoffset:-1000}}.text{font-size:14px;line-height:1.3rem}.item{margin-top:10px;margin-right:40px}.remark-card{margin-bottom:30px}.remark-header{display:flex;justify-content:space-between;align-items:center}.remark-header .remark-user{color:#6d6d6d}.remark-header .remark-time{color:#6d6d6d;font-size:.8rem;margin-left:10px}.remark-content{white-space:pre-wrap;text-align:left}.badge-item{margin-top:18px}.removed-item{background-color:#fef0f0!important;color:#f56c6c}.added-item{background-color:#f0f9eb!important;color:#67c23a}.modified-item{background-color:#fdf6ec!important;color:#e6a23c}.modified-original-item{background-color:#fdf6ec!important;color:#a8abb2}.copy-button{position:absolute;right:12px;top:16px;color:#fff}.copy-button:hover{position:absolute;right:12px;top:12px;color:#67c23a}.table-quote{padding-left:8px;margin:12px 0 6px 0;font-size:16px}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px;min-height:100px}/*!
|
||||
@-webkit-keyframes running-line{to{stroke-dashoffset:-1000}}@keyframes running-line{to{stroke-dashoffset:-1000}}.text{font-size:14px;line-height:1.3rem}.item{margin-top:10px;margin-right:40px}.remark-card{margin-bottom:30px}.remark-header{display:flex;justify-content:space-between;align-items:center}.remark-header .remark-user{color:#6d6d6d}.remark-header .remark-time{color:#6d6d6d;font-size:.8rem;margin-left:10px}.remark-content{white-space:pre-wrap;text-align:left}.badge-item{margin-top:18px}.removed-item{background-color:#fef0f0!important;color:#f56c6c}.added-item{background-color:#f0f9eb!important;color:#67c23a}.modified-item{background-color:#fdf6ec!important;color:#e6a23c}.modified-original-item{background-color:#fdf6ec!important;color:#a8abb2}.copy-button{position:absolute;right:12px;top:16px;color:#fff}.copy-button:hover{position:absolute;right:12px;top:12px;color:#67c23a}.table-quote{padding-left:8px;margin-top:1.25rem;margin-bottom:6px;font-size:16px;color:#909399}.table-document-block{margin-bottom:48px}.row-item{margin-right:8px;margin-bottom:3px}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px;min-height:100px}
|
||||
|
||||
/*!
|
||||
Theme: Agate
|
||||
Author: (c) Taufik Nurrohman <hi@taufik-nurrohman.com>
|
||||
Maintainer: @taufik-nurrohman
|
|
@ -1 +1 @@
|
|||
.left-menu:not(.el-menu--collapse){height:100vh}.search-item{padding:10px;width:95%;margin-bottom:12px;margin-right:12px;border-radius:8px;border-width:0 0 1px 0;border-color:#ddd;border-style:solid}.search-item:hover{background-color:#f0f2f5;border-color:transparent}.search-item .jump{margin-right:8px}.search-item .header{display:flex;justify-content:space-between}.search-item .content{padding:10px}.search-item .content .item{margin-right:8px}.search-container{max-height:420px;margin-top:12px;overflow-y:auto;overflow-x:hidden}.badge{margin-top:12px;margin-right:20px}.search-container .el-tabs__item{line-height:unset}.second-title{color:#909399;font-size:14px}.databasir-nav{left:0;bottom:0}.databasir-main-header,.databasir-nav{position:fixed;transform:scale(1);top:0}.databasir-main-header{display:flex;justify-content:space-between;align-items:center;right:0;left:50px;padding:30px;margin-left:33px;background:#fff;z-index:100;border-color:#eee;border-width:0 0 1px 0;border-style:solid}.databasir{display:block}.databasir-main{position:relative;margin-left:60px;margin-top:80px;--el-main-padding:0px 20px 20px 20px}.databasir-main-expand{margin-left:50px}.databasir-main-content{max-width:95%;--el-main-padding:0px 20px 20px 20px}.h2{font-size:24px;color:#606266;margin-top:13px;margin-bottom:13px}.h2,.h3{font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif}.h3{font-size:20px;color:#909399;margin-top:18px;margin-bottom:18px}
|
||||
.left-menu:not(.el-menu--collapse){height:100vh}.search-item{padding:10px;width:95%;margin-bottom:12px;margin-right:12px;border-radius:8px;border-width:0 0 1px 0;border-color:#ddd;border-style:solid}.search-item:hover{background-color:#f0f2f5;border-color:transparent}.search-item .jump{margin-right:8px}.search-item .header{display:flex;justify-content:space-between}.search-item .content{padding:10px}.search-item .content .item{margin-right:8px}.search-container{max-height:420px;margin-top:12px;overflow-y:auto;overflow-x:hidden}.badge{margin-top:12px;margin-right:20px}.search-container .el-tabs__item{line-height:unset}.second-title{color:#909399;font-size:14px}.databasir-nav{left:0;bottom:0}.databasir-main-header,.databasir-nav{position:fixed;transform:scale(1);top:0}.databasir-main-header{display:flex;justify-content:space-between;align-items:center;right:0;left:50px;padding:30px;margin-left:33px;background:#fff;z-index:100;border-color:#eee;border-width:0 0 1px 0;border-style:solid}.databasir{display:block}.databasir-main{position:relative;margin-left:60px;margin-top:80px;--el-main-padding:0px 20px 20px 20px}.databasir-main-expand{margin-left:50px}.databasir-main-content{max-width:95%;--el-main-padding:0px 20px 20px 20px}.h2{font-size:24px;margin-top:13px;margin-bottom:13px}.h2,.h3{color:#303133;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif}.h3{font-size:20px;margin-top:18px;margin-bottom:18px}
|
|
@ -0,0 +1,4 @@
|
|||
<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.48864 0.818182H1.63636C1.18449 0.818182 0.818182 1.18449 0.818182 1.63636V7.36364C0.818182 7.81551 1.18449 8.18182 1.63636 8.18182H8.48864C8.94051 8.18182 9.30682 7.81551 9.30682 7.36364V1.63636C9.30682 1.18449 8.94051 0.818182 8.48864 0.818182ZM1.63636 0C0.732625 0 0 0.732625 0 1.63636V7.36364C0 8.26737 0.732625 9 1.63636 9H8.48864C9.39237 9 10.125 8.26737 10.125 7.36364V1.63636C10.125 0.732625 9.39237 0 8.48864 0H1.63636Z" fill="#555555"/>
|
||||
<path d="M0 1.63636C0 0.732625 0.732625 0 1.63636 0H8.48864C9.39237 0 10.125 0.732625 10.125 1.63636V2.25H0V1.63636Z" fill="#555555"/>
|
||||
</svg>
|
After Width: | Height: | Size: 734 B |
|
@ -1 +1 @@
|
|||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.661f96f0.js"></script><script defer="defer" type="module" src="/js/app.b2e9e033.js"></script><link href="/css/chunk-vendors.113af7af.css" rel="stylesheet"><link href="/css/app.52ed2769.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fc4c9525.js" nomodule></script><script defer="defer" src="/js/app-legacy.66479081.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.661f96f0.js"></script><script defer="defer" type="module" src="/js/app.3f904766.js"></script><link href="/css/chunk-vendors.113af7af.css" rel="stylesheet"><link href="/css/app.7cd6f647.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fc4c9525.js" nomodule></script><script defer="defer" src="/js/app-legacy.621ce6c1.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -41,19 +41,16 @@ public interface DocumentResponseConverter {
|
|||
List<TableTriggerDocument> triggers);
|
||||
|
||||
TableDocumentResponse.ColumnDocumentResponse of(TableColumnDocument pojo,
|
||||
Integer discussionCount,
|
||||
String description);
|
||||
|
||||
default List<TableDocumentResponse.ColumnDocumentResponse> of(
|
||||
List<TableColumnDocument> columns,
|
||||
String tableName,
|
||||
Map<String, Integer> discussionCountMapByJoinName,
|
||||
Map<String, String> descriptionMapByJoinName) {
|
||||
return columns.stream()
|
||||
.map(column -> {
|
||||
Integer count = discussionCountMapByJoinName.get(tableName + "." + column.getName());
|
||||
String description = descriptionMapByJoinName.get(tableName + "." + column.getName());
|
||||
return of(column, count, description);
|
||||
return of(column, description);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
@ -70,7 +67,7 @@ public interface DocumentResponseConverter {
|
|||
default TableDocumentResponse ofDiff(TableDocDiff table,
|
||||
Map<String, Integer> discussionCountMap,
|
||||
Map<String, String> descriptionMap) {
|
||||
List<TableDocumentResponse.ColumnDocumentResponse> cols = toColumns(table, discussionCountMap, descriptionMap);
|
||||
List<TableDocumentResponse.ColumnDocumentResponse> cols = toColumns(table, descriptionMap);
|
||||
return ofDiff(table, cols, discussionCountMap, descriptionMap);
|
||||
}
|
||||
|
||||
|
@ -83,30 +80,26 @@ public interface DocumentResponseConverter {
|
|||
Map<String, String> descriptionMap);
|
||||
|
||||
default List<TableDocumentResponse.ColumnDocumentResponse> toColumns(TableDocDiff table,
|
||||
Map<String, Integer> discussionCountMap,
|
||||
Map<String, String> descriptionMap) {
|
||||
return table.getColumns()
|
||||
.stream()
|
||||
.map(col -> toColumn(table.getName(), col, discussionCountMap, descriptionMap))
|
||||
.map(col -> toColumn(table.getName(), col, descriptionMap))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Mapping(target = "description", expression = "java(descriptionMap.get(tableName+\".\"+diff.getName()))")
|
||||
@Mapping(target = "discussionCount", expression = "java(discussionCountMap.get(tableName+\".\"+diff.getName()))")
|
||||
@Mapping(target = "original",
|
||||
expression = "java(toOriginalColumn(tableName, diff.getOriginal(), discussionCountMap, descriptionMap))")
|
||||
expression = "java(toOriginalColumn(tableName, diff.getOriginal(), descriptionMap))")
|
||||
TableDocumentResponse.ColumnDocumentResponse toColumn(String tableName,
|
||||
ColumnDocDiff diff,
|
||||
Map<String, Integer> discussionCountMap,
|
||||
Map<String, String> descriptionMap);
|
||||
|
||||
default TableDocumentResponse.ColumnDocumentResponse toOriginalColumn(String tableName,
|
||||
ColumnDocDiff diff,
|
||||
Map<String, Integer> discussionCountMap,
|
||||
Map<String, String> descriptionMap) {
|
||||
if (diff == null) {
|
||||
return null;
|
||||
}
|
||||
return toColumn(tableName, diff, discussionCountMap, descriptionMap);
|
||||
return toColumn(tableName, diff, descriptionMap);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,8 +74,6 @@ public class TableDocumentResponse implements DiffAble<TableDocumentResponse> {
|
|||
|
||||
private String defaultValue;
|
||||
|
||||
private Integer discussionCount;
|
||||
|
||||
private LocalDateTime createAt;
|
||||
|
||||
private DiffType diffType;
|
||||
|
|
|
@ -5,10 +5,7 @@ import com.databasir.core.domain.document.data.diff.*;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -37,6 +34,7 @@ public class DocumentDiffChecker {
|
|||
.map(curr -> {
|
||||
List<ColumnDocDiff> columnDiffs =
|
||||
doDiff(Collections.emptyList(), curr.getColumns(), ColumnDocDiff::getName);
|
||||
columnDiffs.sort(Comparator.comparingInt(c -> c.getId()));
|
||||
List<IndexDocDiff> indexDiffs =
|
||||
doDiff(Collections.emptyList(), curr.getIndexes(), IndexDocDiff::getName);
|
||||
List<TriggerDocDiff> triggerDiffs =
|
||||
|
@ -65,6 +63,7 @@ public class DocumentDiffChecker {
|
|||
.map(old -> {
|
||||
List<ColumnDocDiff> columnDiffs =
|
||||
doDiff(old.getColumns(), Collections.emptyList(), ColumnDocDiff::getName);
|
||||
columnDiffs.sort(Comparator.comparingInt(c -> c.getId()));
|
||||
List<IndexDocDiff> indexDiffs =
|
||||
doDiff(old.getIndexes(), Collections.emptyList(), IndexDocDiff::getName);
|
||||
List<TriggerDocDiff> triggerDiffs =
|
||||
|
@ -98,6 +97,7 @@ public class DocumentDiffChecker {
|
|||
|
||||
List<ColumnDocDiff> columnDiffs =
|
||||
doDiff(originalTable.getColumns(), currentTable.getColumns(), ColumnDocDiff::getName);
|
||||
columnDiffs.sort(Comparator.comparingInt(c -> c.getId()));
|
||||
List<IndexDocDiff> indexDiffs =
|
||||
doDiff(originalTable.getIndexes(), currentTable.getIndexes(), IndexDocDiff::getName);
|
||||
List<TriggerDocDiff> triggerDiffs =
|
||||
|
|
|
@ -82,7 +82,7 @@ public class DocumentService {
|
|||
|
||||
return documentOption.map(document -> {
|
||||
var discussionCountMapByTableName =
|
||||
documentDiscussionDao.selectTableDiscussionCount(projectId)
|
||||
documentDiscussionDao.selectAllDiscussionCount(projectId)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(d -> d.getTableName(), d -> d.getCount(), (a, b) -> a));
|
||||
var descriptionMapByTableName =
|
||||
|
@ -218,9 +218,7 @@ public class DocumentService {
|
|||
var discussions = documentDiscussionDao.selectAllDiscussionCount(projectId);
|
||||
Map<String, Integer> discussionCountMapByJoinName = discussions.stream()
|
||||
.collect(Collectors.toMap(
|
||||
d -> String.join(".",
|
||||
d.getTableName(),
|
||||
StringUtils.defaultIfBlank(d.getColumnName(), "")),
|
||||
d -> d.getTableName(),
|
||||
DocumentDiscussionCountPojo::getCount,
|
||||
(a, b) -> a));
|
||||
|
||||
|
@ -246,7 +244,6 @@ public class DocumentService {
|
|||
var columnResponses = documentResponseConverter.of(
|
||||
subColumns,
|
||||
table.getName(),
|
||||
discussionCountMapByJoinName,
|
||||
descriptionMapByJoinName);
|
||||
return documentResponseConverter.of(
|
||||
table,
|
||||
|
@ -276,7 +273,7 @@ public class DocumentService {
|
|||
var discussions = documentDiscussionDao.selectAllDiscussionCount(projectId);
|
||||
Map<String, Integer> discussionCountMapByJoinName = discussions.stream()
|
||||
.collect(Collectors.toMap(
|
||||
d -> String.join(".", d.getTableName(), d.getColumnName()),
|
||||
d -> d.getTableName(),
|
||||
DocumentDiscussionCountPojo::getCount,
|
||||
(a, b) -> a));
|
||||
|
||||
|
|
|
@ -32,21 +32,16 @@ public class DocumentDiscussionDao extends BaseDao<DocumentDiscussion> {
|
|||
.fetchOptionalInto(DocumentDiscussion.class);
|
||||
}
|
||||
|
||||
public List<DocumentDiscussionCountPojo> selectTableDiscussionCount(Integer projectId) {
|
||||
return this.selectDiscussionCount(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId)
|
||||
.and(DOCUMENT_DISCUSSION.COLUMN_NAME.isNull()));
|
||||
}
|
||||
|
||||
public List<DocumentDiscussionCountPojo> selectAllDiscussionCount(Integer projectId) {
|
||||
return this.selectDiscussionCount(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId));
|
||||
}
|
||||
|
||||
public List<DocumentDiscussionCountPojo> selectDiscussionCount(Condition condition) {
|
||||
return this.getDslContext()
|
||||
.select(DSL.count(), DOCUMENT_DISCUSSION.TABLE_NAME, DOCUMENT_DISCUSSION.COLUMN_NAME)
|
||||
.select(DSL.count(), DOCUMENT_DISCUSSION.TABLE_NAME)
|
||||
.from(DOCUMENT_DISCUSSION)
|
||||
.where(condition)
|
||||
.groupBy(DOCUMENT_DISCUSSION.TABLE_NAME, DOCUMENT_DISCUSSION.COLUMN_NAME)
|
||||
.groupBy(DOCUMENT_DISCUSSION.TABLE_NAME)
|
||||
.fetchInto(DocumentDiscussionCountPojo.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,5 @@ public class DocumentDiscussionCountPojo {
|
|||
|
||||
private String tableName;
|
||||
|
||||
private String columnName;
|
||||
|
||||
private Integer count;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 3f0d2cad61516ae83a96ab14931f9c0a818b7dbe
|
||||
Subproject commit b7b23841a73f26be9f02233a6a6418ff1d3bab58
|
Loading…
Reference in New Issue