mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
#100346 move manual sync view to separate file
This commit is contained in:
@@ -30,7 +30,6 @@ import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IViewsService, ViewContainerLocation, IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IDecorationsProvider, IDecorationData, IDecorationsService } from 'vs/workbench/services/decorations/browser/decorations';
|
||||
|
||||
type UserAccountClassification = {
|
||||
id: { classification: 'EndUserPseudonymizedInformation', purpose: 'BusinessInsight' };
|
||||
@@ -104,7 +103,6 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IViewsService private readonly viewsService: IViewsService,
|
||||
@IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService,
|
||||
@IDecorationsService decorationsService: IDecorationsService,
|
||||
) {
|
||||
super();
|
||||
this.authenticationProviders = getUserDataSyncStore(productService, configurationService)?.authenticationProviders || [];
|
||||
@@ -114,8 +112,6 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
||||
this.activityViewsEnablementContext = CONTEXT_ENABLE_ACTIVITY_VIEWS.bindTo(contextKeyService);
|
||||
this.manualSyncViewEnablementContext = CONTEXT_ENABLE_MANUAL_SYNC_VIEW.bindTo(contextKeyService);
|
||||
|
||||
decorationsService.registerDecorationsProvider(this.userDataSyncPreview);
|
||||
|
||||
if (this.authenticationProviders.length) {
|
||||
|
||||
this.syncStatusContext.set(this.userDataSyncService.status);
|
||||
@@ -560,12 +556,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
|
||||
|
||||
}
|
||||
|
||||
class UserDataSyncPreview extends Disposable implements IUserDataSyncPreview, IDecorationsProvider {
|
||||
|
||||
readonly label: string = localize('label', "UserDataSyncResources");
|
||||
|
||||
private readonly _onDidChange = this._register(new Emitter<URI[]>());
|
||||
readonly onDidChange = this._onDidChange.event;
|
||||
class UserDataSyncPreview extends Disposable implements IUserDataSyncPreview {
|
||||
|
||||
private _onDidChangeChanges = this._register(new Emitter<ReadonlyArray<IUserDataSyncResourceGroup>>());
|
||||
readonly onDidChangeChanges = this._onDidChangeChanges.event;
|
||||
@@ -627,26 +618,6 @@ class UserDataSyncPreview extends Disposable implements IUserDataSyncPreview, ID
|
||||
this.updatePreview([]);
|
||||
}
|
||||
|
||||
provideDecorations(resource: URI): IDecorationData | undefined {
|
||||
const changeResource = this.changes.find(c => isEqual(c.remote, resource)) || this.conflicts.find(c => isEqual(c.remote, resource));
|
||||
if (changeResource) {
|
||||
if (changeResource.localChange === Change.Modified || changeResource.remoteChange === Change.Modified) {
|
||||
return {
|
||||
letter: 'M',
|
||||
};
|
||||
}
|
||||
if (changeResource.localChange === Change.Added
|
||||
|| changeResource.localChange === Change.Deleted
|
||||
|| changeResource.remoteChange === Change.Added
|
||||
|| changeResource.remoteChange === Change.Deleted) {
|
||||
return {
|
||||
letter: 'A',
|
||||
};
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private updatePreview(preview: [SyncResource, ISyncResourcePreview][]) {
|
||||
if (this.manualSync) {
|
||||
this.manualSync.preview = preview;
|
||||
|
||||
Reference in New Issue
Block a user