Skip to content

Commit

Permalink
v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
unchidev committed Oct 15, 2022
1 parent c125caf commit 94c9a54
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
rails-mermaid_erd (0.4.0)
rails-mermaid_erd (0.4.1)
rails (>= 5.2)

GEM
Expand Down
27 changes: 25 additions & 2 deletions docs/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["options"]["title"]}
</label>
</div>

<div class="min-w-0 flex-1 text-sm">
<label class="relative flex items-start cursor-pointer hover:bg-gray-100 rounded">
<input
type="checkbox"
class="h-4 w-4 rounded border-gray-300 text-red-600 mr-2 focus:ring-red-600"
v-model="isShowRelationComment"
@change="updateHash"
/>
<span class="text-xs text-gray-900">{{i18n[language]["options"]["show_relationship_comment"]}}</span>
</label>
</div>

<div class="min-w-0 flex-1 text-sm">
<label class="relative flex items-start cursor-pointer hover:bg-gray-100 rounded">
<input
Expand Down Expand Up @@ -271,7 +283,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
<footer class="bg-gray-100">
<p class="text-center text-xs text-gray-600 py-2">
<a href="https://github.com/koedame/rails-mermaid_erd" class="hover:text-gray-400" target="_blank" rel="noopener noreferrer">
Rails Mermaid ERD v0.4.0
Rails Mermaid ERD v0.4.1
</a>
</p>
</footer>
Expand Down Expand Up @@ -300,6 +312,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
options: {
title: 'Options',
preview_relationships: 'Preview Relationships',
show_relationship_comment: 'Show Relationship Comment',
show_key: 'Show Key',
show_column_comment: 'Show Column Comment',
hide_columns: 'Hide Columns',
Expand Down Expand Up @@ -333,6 +346,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
options: {
title: '設定',
preview_relationships: 'リレーションをプレビュー',
show_relationship_comment: 'リレーションのコメントを表示',
show_key: 'キーを表示',
show_column_comment: 'コメントを表示',
hide_columns: 'カラムを非表示',
Expand Down Expand Up @@ -366,6 +380,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
}
const selectModels = Vue.ref([])
const isPreviewRelations = Vue.ref(false)
const isShowRelationComment = Vue.ref(false)
const isShowKey = Vue.ref(false)
const isShowComment = Vue.ref(false)
const isHideColumns = Vue.ref(false)
Expand All @@ -376,6 +391,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
const parsedData = JSON.parse(atob(h))
selectModels.value = parsedData.selectModels || []
isPreviewRelations.value = !!parsedData.isPreviewRelations
isShowRelationComment.value = !!parsedData.isShowRelationComment
isShowKey.value = !!parsedData.isShowKey
isShowComment.value = !!parsedData.isShowComment
isHideColumns.value = !!parsedData.isHideColumns
Expand All @@ -390,6 +406,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
selectModels.value.push(model.ModelName)
})
isPreviewRelations.value = false
isShowRelationComment.value = false
isShowKey.value = false
isShowComment.value = false
isHideColumns.value = false
Expand All @@ -400,6 +417,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
location.hash = btoa(JSON.stringify({
selectModels: selectModels.value,
isPreviewRelations: isPreviewRelations.value,
isShowRelationComment: isShowRelationComment.value,
isShowKey: isShowKey.value,
isShowComment: isShowComment.value,
isHideColumns: isHideColumns.value,
Expand Down Expand Up @@ -469,7 +487,11 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
});

filteredData.value.Relations.forEach(relation => {
lines.push(` ${relation.LeftModelName.replace(/:/g, '-')} ${relation.LeftValue}${relation.Line}${relation.RightValue} ${relation.RightModelName.replace(/:/g, '-')} : "${relation.Comment}"`)
if (isShowRelationComment.value) {
lines.push(` ${relation.LeftModelName.replace(/:/g, '-')} ${relation.LeftValue}${relation.Line}${relation.RightValue} ${relation.RightModelName.replace(/:/g, '-')} : "${relation.Comment}"`)
} else {
lines.push(` ${relation.LeftModelName.replace(/:/g, '-')} ${relation.LeftValue}${relation.Line}${relation.RightValue} ${relation.RightModelName.replace(/:/g, '-')} : ""`)
}
});

return lines.join("\n")
Expand Down Expand Up @@ -602,6 +624,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
isCopiedUrl,
isExistsNoModelTable,
isPreviewRelations,
isShowRelationComment,
isShowComment,
isShowKey,
language,
Expand Down
Binary file modified docs/screen_shot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/rails-mermaid_erd/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RailsMermaidErd
VERSION = "0.4.0"
VERSION = "0.4.1"
end

0 comments on commit 94c9a54

Please sign in to comment.