11<script setup lang="ts">
22import type { Change } from ' diff'
3- import type { Action , ActionType , ApiLink , IFeature } from ' @/composables/useApi'
3+ import type { ApiLink , IFeature } from ' @/composables/useApi'
44import { diffChars } from ' diff'
55import { groupBy , sortBy , uniq } from ' underscore'
66import { computed } from ' vue'
@@ -29,10 +29,15 @@ const groupedTagKeys = computed((): string[][] => {
2929 ... Object .keys (props .src ?.tags || {}),
3030 ... Object .keys (props .dst ?.tags || {}),
3131 ]),
32- (key : string ) =>
33- props .diff ?.[key ]
34- ? - maxActionPriority (props .diff [key ])
35- : 0 ,
32+ (key : string ) => {
33+ return props .diff ?.[key ]
34+ && (
35+ ! props .src ?.tags || ! (key in props .src .tags )
36+ ? 0
37+ : props .dst && ! props .dst .tags [key ]
38+ ? 2
39+ : 1 )
40+ },
3641 )
3742
3843 return Object .values (
@@ -43,14 +48,6 @@ const groupedTagKeys = computed((): string[][] => {
4348 )
4449})
4550
46- function maxActionPriority(actions : Action []): number {
47- return Math .max (... actions .map (action => action2priority (action [1 ])))
48- }
49-
50- function action2priority(logAction : ActionType | null ): number {
51- return logAction ? { reject: 2 , accept: 0 }[logAction ] : 1
52- }
53-
5451function actionIcon(key : string ): string | undefined {
5552 if (props .src && ! props .dst )
5653 return undefined
0 commit comments