Skip to content

Commit

Permalink
feat: add history details for not key-value type of namespace (apollo…
Browse files Browse the repository at this point in the history
…config#3856)

* fix: size of create project button

* fix: add changes update for change button size

* feat: add history details for not key-value type

* fix: add changes

* fix: add changes link

Co-authored-by: Jared Tan <[email protected]>
  • Loading branch information
wilsonwu and JaredTan95 authored Jul 27, 2021
1 parent 8d227ff commit a44e251
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 26 deletions.
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

0 comments on commit a44e251

Please sign in to comment.