Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACS-8320, ACS-8321: move content/process user info to demo shell #9918

Merged
merged 6 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added demo-shell/resources/images/bpm-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion demo-shell/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ import { CustomEditorComponent, CustomWidgetComponent } from './components/cloud
import { SearchFilterChipsComponent } from './components/search/search-filter-chips.component';
import { UserInfoComponent } from './components/app-layout/user-info/user-info.component';
import { FolderDirectiveModule } from './folder-directive';
import { ContentUserInfoModule } from './components/app-layout/user-info/content-user-info';
import { PROCESS_USER_INFO_DIRECTIVES } from './components/app-layout/user-info/process-user-info';

@NgModule({
imports: [
Expand All @@ -89,7 +91,9 @@ import { FolderDirectiveModule } from './folder-directive';
AppCloudSharedModule,
MonacoEditorModule.forRoot(),
FolderDirectiveModule,
ShowDiagramComponent
ShowDiagramComponent,
ContentUserInfoModule,
...PROCESS_USER_INFO_DIRECTIVES
],
declarations: [
AppComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,51 @@ import { CoreTestingModule, IdentityUserModel, InitialUsernamePipe, UserInfoMode
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatMenuModule } from '@angular/material/menu';
import { By, DomSanitizer } from '@angular/platform-browser';
import { fakeEcmEditedUser, fakeEcmUser, fakeEcmUserNoImage } from '../common/mocks/ecm-user.service.mock';
import { ContentTestingModule } from '../testing/content.testing.module';

import { fakeEcmUser, ContentTestingModule } from '@alfresco/adf-content-services';
import { ContentUserInfoComponent } from './content-user-info.component';

const fakeEcmEditedUser = {
id: 'fake-id',
firstName: null,
lastName: 'fake-last-name',
description: 'i am a fake user for test',
avatarId: 'fake-avatar-id',
email: '[email protected]',
skypeId: 'fake-skype-id',
googleId: 'fake-googleId-id',
instantMessageId: 'fake-instantMessageId-id',
company: null,
jobTitle: 'test job',
location: 'fake location',
mobile: '000000000',
telephone: '11111111',
statusUpdatedAt: 'fake-date',
userStatus: 'active',
enabled: true,
emailNotificationsEnabled: true
};

export const fakeEcmUserNoImage = {
id: 'fake-id',
firstName: 'fake-first-name',
lastName: 'fake-last-name',
description: 'i am a fake user for test',
avatarId: null,
email: '[email protected]',
skypeId: 'fake-skype-id',
googleId: 'fake-googleId-id',
instantMessageId: 'fake-instantMessageId-id',
company: null,
jobTitle: null,
location: 'fake location',
mobile: '000000000',
telephone: '11111111',
statusUpdatedAt: 'fake-date',
userStatus: 'active',
enabled: true,
emailNotificationsEnabled: true
};

class FakeSanitizer extends DomSanitizer {
constructor() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import { IdentityUserModel, UserInfoMode } from '@alfresco/adf-core';
import { Component, Input, OnDestroy, ViewChild, ViewEncapsulation } from '@angular/core';
import { MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
import { Subject } from 'rxjs';
import { EcmUserModel } from '../common/models/ecm-user.model';
import { PeopleContentService } from '../common/services/people-content.service';
import { EcmUserModel, PeopleContentService } from '@alfresco/adf-content-services';

@Component({
selector: 'adf-content-user-info',
Expand All @@ -29,7 +28,6 @@ import { PeopleContentService } from '../common/services/people-content.service'
encapsulation: ViewEncapsulation.None
})
export class ContentUserInfoComponent implements OnDestroy {

@ViewChild(MatMenuTrigger) trigger: MatMenuTrigger;

/** Determines if user is logged in. */
Expand All @@ -50,11 +48,11 @@ export class ContentUserInfoComponent implements OnDestroy {

/** Custom path for the background banner image for ACS users. */
@Input()
ecmBackgroundImage: string = './assets/images/ecm-background.png';
ecmBackgroundImage: string = './resources/images/ecm-background.png';

/** Custom path for the background banner image for APS users. */
@Input()
bpmBackgroundImage: string = './assets/images/bpm-background.png';
bpmBackgroundImage: string = './resources/images/bpm-background.png';

/** Custom choice for opening the menu at the bottom. Can be `before` or `after`. */
@Input()
Expand All @@ -79,8 +77,7 @@ export class ContentUserInfoComponent implements OnDestroy {

private destroy$ = new Subject();

constructor(private peopleContentService: PeopleContentService) {
}
constructor(private peopleContentService: PeopleContentService) {}

ngOnDestroy(): void {
this.destroy$.next(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { EcmUserModel, PeopleContentService } from '@alfresco/adf-content-servic
import { Component, Input, OnDestroy, ViewChild, ViewEncapsulation } from '@angular/core';
import { MatMenuModule, MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
import { Subject } from 'rxjs';
import { PeopleProcessService } from '../services/people-process.service';
import { PeopleProcessService } from '@alfresco/adf-process-services';
import { UserRepresentation } from '@alfresco/js-api';
import { CommonModule } from '@angular/common';
import { MatButtonModule } from '@angular/material/button';
Expand Down Expand Up @@ -57,11 +57,11 @@ export class ProcessUserInfoComponent implements OnDestroy {

/** Custom path for the background banner image for APS users. */
@Input()
bpmBackgroundImage: string = './assets/images/bpm-background.png';
bpmBackgroundImage: string = './resources/images/bpm-background.png';

/** Custom path for the background banner image for ACS users. */
@Input()
ecmBackgroundImage: string = './assets/images/ecm-background.png';
ecmBackgroundImage: string = './resources/images/ecm-background.png';

/** Custom choice for opening the menu at the bottom. Can be `before` or `after`. */
@Input()
Expand Down
2 changes: 0 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ for more information about installing and using the source code.
| [Content Node Selector Panel component](content-services/components/content-node-selector-panel.component.md) | Opens a Content Node Selector in its own dialog window. | [Source](../lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts) |
| [Content Node Selector component](content-services/components/content-node-selector.component.md) | Allows a user to select items from a Content Services repository. | [Source](../lib/content-services/src/lib/content-node-selector/content-node-selector.component.ts) |
| [Content Type Dialog component](content-services/components/content-type-dialog.component.md) | Confirm dialog when user changes content type of a node. | [Source](../lib/content-services/src/lib/content-type/content-type-dialog.component.ts) |
| [Content User Info component](content-services/components/content-user-info.component.md) | Shows user information for CONTENT and CONTENT_SSO mode. | [Source](../lib/content-services/src/lib/content-user-info/content-user-info.component.ts) |
| [Document List component](content-services/components/document-list.component.md) | Displays the documents from a repository. | [Source](../lib/content-services/src/lib/document-list/components/document-list.component.ts) |
| [Dropdown Breadcrumb Component](content-services/components/dropdown-breadcrumb.component.md) | Indicates the current position within a navigation hierarchy using a dropdown menu. | [Source](../lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts) |
| [File Uploading Dialog Component](content-services/components/file-uploading-dialog.component.md) | Shows a dialog listing all the files uploaded with the Upload Button or Drag Area components. | [Source](../lib/content-services/src/lib/upload/components/file-uploading-dialog.component.ts) |
Expand Down Expand Up @@ -429,7 +428,6 @@ for more information about installing and using the source code.
| [Process Instance Details Header component](process-services/components/process-instance-header.component.md) | Sub-component of the process details component, which renders some general information about the selected process. | [Source](../lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.ts) |
| [Process Instance Tasks component](process-services/components/process-instance-tasks.component.md) | Lists both the active and completed tasks associated with a particular process instance | [Source](../lib/process-services/src/lib/process-list/components/process-instance-tasks/process-instance-tasks.component.ts) |
| [Process Instance List](process-services/components/process-list.component.md) | Renders a list containing all the process instances matched by the parameters specified. | [Source](../lib/process-services/src/lib/process-list/components/process-list/process-list.component.ts) |
| [Process User Info component](process-services/components/process-user-info.component.md) | Shows user information for PROCESS and ALL mode. | [Source](../lib/process-services/src/lib/process-user-info/process-user-info.component.ts) |
| [Select App Component](process-services/components/select-apps-dialog.component.md) | Shows all available apps and returns the selected app. | [Source](../lib/process-services/src/lib/app-list/select-apps-dialog/select-apps-dialog.component.ts) |
| [Start Process component](process-services/components/start-process.component.md) | Starts a process. | [Source](../lib/process-services/src/lib/process-list/components/start-process/start-process.component.ts) |
| [Start Task Component](process-services/components/start-task.component.md) | Creates/Starts a new task for the specified app. | [Source](../lib/process-services/src/lib/task-list/components/start-task/start-task.component.ts) |
Expand Down
38 changes: 0 additions & 38 deletions docs/content-services/components/content-user-info.component.md

This file was deleted.

38 changes: 0 additions & 38 deletions docs/process-services/components/process-user-info.component.md

This file was deleted.

113 changes: 1 addition & 112 deletions lib/content-services/src/lib/common/mocks/ecm-user.service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { PersonEntry, Person, PersonPaging } from '@alfresco/js-api';
import { Person } from '@alfresco/js-api';

export const fakeEcmUser: Person = {
id: 'fake-id',
Expand All @@ -37,114 +37,3 @@ export const fakeEcmUser: Person = {
enabled: true,
emailNotificationsEnabled: true
};

export const fakeEcmAdminUser = {
...fakeEcmUser,
capabilities: {
isAdmin: true
}
};

export const fakeEcmUser2 = {
id: 'another-fake-id',
firstName: 'another-fake-first-name',
lastName: 'another',
displayName: 'admin.adf User',
email: '[email protected]',
company: null,
enabled: true,
emailNotificationsEnabled: true
};

export const fakeEcmUserNoImage = {
id: 'fake-id',
firstName: 'fake-first-name',
lastName: 'fake-last-name',
description: 'i am a fake user for test',
avatarId: null,
email: '[email protected]',
skypeId: 'fake-skype-id',
googleId: 'fake-googleId-id',
instantMessageId: 'fake-instantMessageId-id',
company: null,
jobTitle: null,
location: 'fake location',
mobile: '000000000',
telephone: '11111111',
statusUpdatedAt: 'fake-date',
userStatus: 'active',
enabled: true,
emailNotificationsEnabled: true
};

export const fakeEcmEditedUser = {
id: 'fake-id',
firstName: null,
lastName: 'fake-last-name',
description: 'i am a fake user for test',
avatarId: 'fake-avatar-id',
email: '[email protected]',
skypeId: 'fake-skype-id',
googleId: 'fake-googleId-id',
instantMessageId: 'fake-instantMessageId-id',
company: null,
jobTitle: 'test job',
location: 'fake location',
mobile: '000000000',
telephone: '11111111',
statusUpdatedAt: 'fake-date',
userStatus: 'active',
enabled: true,
emailNotificationsEnabled: true
};

export const fakeEcmUserList = new PersonPaging({
list: {
pagination: {
count: 2,
hasMoreItems: false,
totalItems: 2,
skipCount: 0,
maxItems: 100
},
entries: [
{
entry: fakeEcmUser
},
{
entry: fakeEcmUser2
}
]
}
});

export const createNewPersonMock = {
id: 'fake-id',
firstName: 'fake-ecm-first-name',
lastName: 'fake-ecm-last-name',
description: 'i am a fake user for test',
password: 'fake-avatar-id',
email: '[email protected]'
};

export const getFakeUserWithContentAdminCapability = (): PersonEntry => {
const fakeEcmUserWithAdminCapabilities = {
...fakeEcmUser,
capabilities: {
isAdmin: true
}
};
const mockPerson = new Person(fakeEcmUserWithAdminCapabilities);
return { entry: mockPerson };
};

export const getFakeUserWithContentUserCapability = (): PersonEntry => {
const fakeEcmUserWithAdminCapabilities = {
...fakeEcmUser,
capabilities: {
isAdmin: false
}
};
const mockPerson = new Person(fakeEcmUserWithAdminCapabilities);
return { entry: mockPerson };
};
Loading
Loading