Skip to content
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

feat: add history details for not key-value type of namespace #3856

Merged
merged 7 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Apollo 1.9.0
* [fix the issue that release messages might be missed in certain scenarios](https://github.com/ctripcorp/apollo/pull/3819)
* [use official docker images for manual kubernetes deployment](https://github.com/ctripcorp/apollo/pull/3840)
* [fix size of create project button](https://github.com/ctripcorp/apollo/pull/3849)
* [feature: add history detail for not key-value type of namespace](https://github.com/ctripcorp/apollo/pull/3856)
------------------
All issues and pull requests are [here](https://github.com/ctripcorp/apollo/milestone/6?closed=1)

Original file line number Diff line number Diff line change
Expand Up @@ -538,20 +538,80 @@ <h3 class="media-heading" ng-bind="commits.dataChangeCreatedByDisplayName + '('
</table>

<!--not properties format-->
<div ng-if="!namespace.isPropertiesFormat">
<div ng-repeat="item in commits.changeSets.createItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.value">
</textarea>
</div>

<div ng-repeat="item in commits.changeSets.updateItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.newItem.value">
</textarea>
</div>
</div>
<table class="table table-bordered table-striped text-center table-hover"
style="margin-top: 5px;" ng-if="!namespace.isPropertiesFormat">
<thead>
<tr>
<th>
{{'Component.Namespace.Branch.History.ItemType' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemOldValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemNewValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemComment' | translate }}
</th>
</tr>
</thead>
<tbody>

<!--兼容老数据,不显示item类型为空行和注释的item-->
<tr ng-repeat="item in commits.changeSets.createItems" ng-show="item.key">
<td width="6%">
{{'Component.Namespace.Branch.History.NewAdded' | translate }}
</td>
<td width="28%">
</td>
<td width="28%" class="cursor-pointer" title="{{item.value}}"
ng-click="showText(item.value)">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.updateItems">
<td width="6%">
{{'Component.Namespace.Branch.History.Modified' | translate }}
</td>
<td width="28%" class="cursor-pointer" title="{{item.oldItem.value}}"
ng-click="showText(item.oldItem.value)">
<span ng-bind="item.oldItem.value | limitTo: 250"></span>
<span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%" class="cursor-pointer" title="{{item.newItem.value}}"
ng-click="showText(item.newItem.value)">
<span ng-bind="item.newItem.value | limitTo: 250"></span>
<span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.newItem.comment}}">
<span ng-bind="item.newItem.comment | limitTo: 250"></span>
<span ng-bind="item.newItem.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.deleteItems"
ng-show="item.key || item.comment">
<td width="6%">
{{'Component.Namespace.Branch.History.Deleted' | translate }}
</td>
<td width="28%" title="{{item.value}}">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%">
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
</tbody>
</table>

</div>
<hr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,20 +835,80 @@ <h5>{{'Component.Namespace.Master.Items.Body.NoPublished.Title' | translate }}</
</table>

<!--not properties format-->
<div ng-if="!namespace.isPropertiesFormat">
<div ng-repeat="item in commits.changeSets.createItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.value">
</textarea>
</div>

<div ng-repeat="item in commits.changeSets.updateItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.newItem.value">
</textarea>
</div>
</div>
<table class="table table-bordered table-striped text-center table-hover"
style="margin-top: 5px;" ng-if="!namespace.isPropertiesFormat">
<thead>
<tr>
<th>
{{'Component.Namespace.Master.Items.Body.HistoryView.ItemType' | translate }}
</th>
<th>
{{'Component.Namespace.Master.Items.Body.HistoryView.ItemOldValue' | translate }}
</th>
<th>
{{'Component.Namespace.Master.Items.Body.HistoryView.ItemNewValue' | translate }}
</th>
<th>
{{'Component.Namespace.Master.Items.Body.HistoryView.ItemComment' | translate }}
</th>
</tr>
</thead>
<tbody>

<!--兼容老数据,不显示item类型为空行和注释的item-->
<tr ng-repeat="item in commits.changeSets.createItems" ng-show="item.key">
<td width="6%">
{{'Component.Namespace.Master.Items.Body.HistoryView.NewAdded' | translate }}
</td>
<td width="28%">
</td>
<td width="28%" class="cursor-pointer" title="{{item.value}}"
ng-click="showText(item.value)">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.updateItems">
<td width="6%">
{{'Component.Namespace.Master.Items.Body.HistoryView.Updated' | translate }}
</td>
<td width="28%" class="cursor-pointer" title="{{item.oldItem.value}}"
ng-click="showText(item.oldItem.value)">
<span ng-bind="item.oldItem.value | limitTo: 250"></span>
<span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%" class="cursor-pointer" title="{{item.newItem.value}}"
ng-click="showText(item.newItem.value)">
<span ng-bind="item.newItem.value | limitTo: 250"></span>
<span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.newItem.comment}}">
<span ng-bind="item.newItem.comment | limitTo: 250"></span>
<span ng-bind="item.newItem.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.deleteItems"
ng-show="item.key || item.comment">
<td width="6%">
{{'Component.Namespace.Master.Items.Body.HistoryView.Deleted' | translate }}
</td>
<td width="28%" title="{{item.value}}">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%">
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
</tbody>
</table>

</div>
<hr>
Expand Down