diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts index 381ed2b0..a09b1996 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-action-box.ts @@ -10,20 +10,19 @@ import { SyncActionGroup } from '../api' import { UUIButtonState } from '@umbraco-cms/backoffice/external/uui' /** - * @exports - * @class uSyncActionBox - * @fires perform-action - when the user clicks the buttons. + * displays the action buttons for a given group */ @customElement('usync-action-box') export class uSyncActionBox extends LitElement { /** - * @type: {uSyncActionGroup} - * @memberof uSyncActionBox - * @description collection of buttons to display. + * Collection of buttons to display. */ @property({ type: Object }) group!: SyncActionGroup + /** + * state to display on buttons + */ @property({ type: String }) state?: UUIButtonState diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts index 892e877a..b4401311 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/components/usync-progress-box.ts @@ -13,8 +13,7 @@ import { USYNC_SIGNALR_CONTEXT_TOKEN } from '../signalr/signalr.context.token' import type { SyncUpdateMessage } from '../signalr/types' /** - * @class uSyncProcessBox - * @description provides the progress box while things happen. + * Provides the progress box while things happen. */ @customElement('usync-progress-box') export class uSyncProcessBox extends UmbElementMixin(LitElement) { diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/repository/SyncAction.respositoy.ts b/uSync.Backoffice.Management.Client/usync-assets/src/repository/SyncAction.respositoy.ts index bab2f3ee..757e42e7 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/repository/SyncAction.respositoy.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/repository/SyncAction.respositoy.ts @@ -4,21 +4,37 @@ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api' import { uSyncSettingsDataSource } from './sources/SyncSettings.source' import { uSyncMigrationDataSource } from './sources/SyncMigration.source' +/** + * Request object when peforming an action. + */ export type SyncPerformRequest = { + /** Id of the request */ id: string + + /** group (e.g settings, content) */ group: string + + /** action (report, export, etc) */ action: string + + /** current step number */ step: number + + /** force (import) */ force?: boolean + + /** clean disk first (export) */ clean?: boolean + + /** name of the set to use */ set?: string + + /** signalR client id */ clientId: string } /** - * @export - * @class uSyncActionRepository - * @description repository for all things actions. + * Repository for all things actions. */ export class uSyncActionRepository extends UmbControllerBase { #actionDataSource: uSyncActionDataSource @@ -33,8 +49,7 @@ export class uSyncActionRepository extends UmbControllerBase { } /** - * @method getActions - * @description get the list of possible actions from the server + * Get the list of possible actions from the server * @returns Promise */ async getActions() { @@ -42,8 +57,7 @@ export class uSyncActionRepository extends UmbControllerBase { } /** - * @method performAction - * @param request request of the action to perform + * Request of the action to perform * @returns PerformActionResponse. */ async performAction(request: SyncPerformRequest) { @@ -62,8 +76,7 @@ export class uSyncActionRepository extends UmbControllerBase { } /** - * @method getSettings - * @description retreives the current uSync settings + * Retreives the current uSync settings * @returns the current uSync settings */ async getSettings() { @@ -71,7 +84,7 @@ export class uSyncActionRepository extends UmbControllerBase { } /** - * @method getHandlerSetSettings + * Get the handler settings based on the set. * @param setName name of the handler set in the configuration * @returns the settings for the named handler set. */ @@ -80,8 +93,7 @@ export class uSyncActionRepository extends UmbControllerBase { } /** - * @method checkLegacy - * @description checks to see if there are legacy datatypes on disk. + * Checks to see if there are legacy datatypes on disk. * @returns results of a check for legacy files */ async checkLegacy() { diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/tree/types.ts b/uSync.Backoffice.Management.Client/usync-assets/src/tree/types.ts index e82bb051..6131604b 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/tree/types.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/tree/types.ts @@ -5,7 +5,7 @@ import { } from '@umbraco-cms/backoffice/extension-registry' /** - * @description defines a sub menu item extension for the uSync menu + * Defines a sub menu item extension for the uSync menu */ export interface ManifestuSyncMenuItem extends ManifestElement { diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/manifest.ts b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/manifest.ts index 1fed8cda..67b8fb3b 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/manifest.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/manifest.ts @@ -28,9 +28,6 @@ const context: ManifestWorkspaceContext = { js: () => import('./workspace.context.js'), } -/** - * this isn't working, don't know why :( - going to go hardwired for now - */ const workspaceViews: Array = [ { type: 'workspaceView', diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/types.ts b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/types.ts index f73d360b..4db3b19d 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/types.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/types.ts @@ -1,7 +1,7 @@ import { SyncActionGroup } from '../api' /** - * @description options passed to the performAction method on the workspace context + * Options passed to the performAction method on the workspace context */ export type SyncPerformActionOptions = { group: SyncActionGroup diff --git a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/workspace.context.ts b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/workspace.context.ts index ca99ce1b..f5ab7477 100644 --- a/uSync.Backoffice.Management.Client/usync-assets/src/workspace/workspace.context.ts +++ b/uSync.Backoffice.Management.Client/usync-assets/src/workspace/workspace.context.ts @@ -27,9 +27,7 @@ import { uSyncIconRegistry } from '../icons' import { SyncPerformActionOptions } from './types' /** - * @exports - * @class uSyncWorkspaceActionContext - * @description context for getting and seting up actions. + * Context for getting and seting up actions. */ export class uSyncWorkspaceContext extends UmbControllerBase @@ -46,50 +44,43 @@ export class uSyncWorkspaceContext #signalRContext: uSyncSignalRContext | null = null /** - * @type Array - * @description list of actions that have been returned + * list of actions that have been returned from the process */ #actions = new UmbArrayState([], (x) => x.key) public readonly actions = this.#actions.asObservable() /** - * @type Array - * @description the summary objects that show the handler boxes + * The summary objects that show the handler boxes */ #workingActions = new UmbArrayState([], (x) => x.name) public readonly currentAction = this.#workingActions.asObservable() /** - * @type Boolean - * @description flag to say if things are currently being processed + * Flag to say if things are currently being processed */ #working = new UmbBooleanState(false) public readonly working = this.#working.asObservable() /** - * @type Boolean - * @description flat to say that the last run has been completed (so results will show) + * Flag to say that the last run has been completed (so results will show) */ #completed = new UmbBooleanState(false) public readonly completed = this.#completed.asObservable() /** - * @type Array - * @description the results of a run. + * The results of a run. */ #results = new UmbArrayState([], (x) => x.name) public readonly results = this.#results.asObservable() /** - * @type uSyncSettings - * @description current settings for uSync + * Current settings for uSync */ #settings = new UmbObjectState(undefined) public readonly settings = this.#settings?.asObservable() /** - * @type uSyncHandlerSettings - * @description handler settings object + * Handler settings object */ #handlerSettings = new UmbObjectState( undefined, @@ -112,6 +103,9 @@ export class uSyncWorkspaceContext this.#signalRContext = new uSyncSignalRContext(this) } + /** + * Return the current actions from the repository + */ async getActions() { const { data } = await this.#repository.getActions() @@ -120,6 +114,9 @@ export class uSyncWorkspaceContext } } + /** + * Get the current uSync settings + */ async getSettings() { const { data } = await this.#repository.getSettings() @@ -128,6 +125,9 @@ export class uSyncWorkspaceContext } } + /** + * Check to see if there is a legacy uSync folder on disk. + */ async checkLegacy() { const { data } = await this.#repository.checkLegacy() if (data) { @@ -135,6 +135,9 @@ export class uSyncWorkspaceContext } } + /** + * Get handler defaults. + */ async getDefaultHandlerSetSettings() { const { data } = await this.#repository.getHandlerSettings('Default') @@ -143,6 +146,10 @@ export class uSyncWorkspaceContext } } + /** + * Perform an action (e.g import, export, etc) with options + * @param options options for the action + */ async performAction(options: SyncPerformActionOptions) { var clientId = this.#signalRContext?.getClientId() ?? ''