diff --git a/src/common/datasource.ts b/src/common/datasource.ts index 530b361..9c6fc06 100644 --- a/src/common/datasource.ts +++ b/src/common/datasource.ts @@ -214,16 +214,18 @@ export interface DataSourceCompareFile export interface DataSourceCompare { - AddedFiles: DataSourceCompareFile[] - RemovedFiles: DataSourceCompareFile[] + Added: DataSourceCompareFile[] + Removed: DataSourceCompareFile[] + Changed: DataSourceCompareFile[] } export async function retrieveCompare(fromCommit:string, toCommit:string) : Promise { const compare:DataSourceCompare = { - AddedFiles: [], - RemovedFiles: [], + Added: [], + Removed: [], + Changed:[], } await compareProcessTree(compare, fromCommit, toCommit, 'Config/ConfigAbility') await compareProcessTree(compare, fromCommit, toCommit, 'Config/ConfigGlobalModifier') @@ -246,8 +248,9 @@ async function compareProcessTree(compare:DataSourceCompare, fromCommit:string, const filesTo = to.filter(fileFilter) const convert = (f:DataSourceTreeItem) => { Path: `${path}/${f.path}` } - compare.AddedFiles = compare.AddedFiles.concat(filesTo.filter(f => !filesFrom.some(f2 => f.path == f2.path)).map(convert)) - compare.RemovedFiles = compare.RemovedFiles.concat(filesFrom.filter(f => !filesTo.some(f2 => f.path == f2.path)).map(convert)) + compare.Added = compare.Added.concat(filesTo.filter(f => !filesFrom.some(f2 => f.path == f2.path)).map(convert)) + compare.Removed = compare.Removed.concat(filesFrom.filter(f => !filesTo.some(f2 => f.path == f2.path)).map(convert)) + compare.Changed = compare.Changed.concat(filesFrom.filter(f => filesTo.some(f2 => f.path == f2.path && f.sha != f2.sha)).map(convert)) } function getHeaders(accept?:string) diff --git a/src/views/pages/changes/Files.vue b/src/views/pages/changes/Files.vue index 5a62aa3..b20dc6c 100644 --- a/src/views/pages/changes/Files.vue +++ b/src/views/pages/changes/Files.vue @@ -25,15 +25,20 @@ -

{{ compare.AddedFiles.length }} Added

-