How to use the @alfresco/adf-core.CoreModule.forRoot function in @alfresco/adf-core

To help you get started, we’ve selected a few @alfresco/adf-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Alfresco / alfresco-content-app / src / app / directives / library-membership.directive.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [AppTestingModule, DirectivesModule, CoreModule.forRoot()],
      schemas: [NO_ERRORS_SCHEMA]
    });
    alfrescoApiService = new AlfrescoApiServiceMock(
      new AppConfigService(null),
      new StorageService()
    );
    peopleApi = alfrescoApiService.getInstance().core.peopleApi;
    directive = new LibraryMembershipDirective(alfrescoApiService);
  });
github Alfresco / generator-ng2-alfresco-app / app / templates / adf-cli-activiti-template / src / app / tasks / tasks.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        BrowserAnimationsModule,
        RouterTestingModule,
        CoreModule.forRoot(),
        ContentModule.forRoot(),
        ProcessServicesCloudModule
      ],
      declarations: [TasksComponent],
      providers: [
        { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
      ]
    })
      .compileComponents();
  }));
github Activiti / activiti-modeling-app / src / app / common / adf.module.ts View on Github external
*
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { NgModule } from '@angular/core';

import { CoreModule, AppConfigService, DebugAppConfigService, TRANSLATION_PROVIDER } from '@alfresco/adf-core';

@NgModule({
    imports: [ CoreModule.forRoot() ],
    exports: [ CoreModule ],
    providers: [
        { provide: AppConfigService, useClass: DebugAppConfigService },
        { provide: TRANSLATION_PROVIDER, multi: true, useValue: { name: 'app', source: 'resources' } }
    ]
})
export class AdfModule {}
github Alfresco / generator-ng2-alfresco-app / app / templates / adf-cli-activiti-cloud-acs-template / src / app / tasks / tasks.component.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        BrowserAnimationsModule,
        CoreModule.forRoot(),
        ContentModule.forRoot(),
        ProcessServicesCloudModule,
        TranslateModule.forRoot({
          loader: { provide: TranslateLoader, useClass: TranslateLoaderService }
        })
      ],
      declarations: [TasksComponent],
      providers: [
        { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
        { provide: AppConfigService, useClass: AppConfigServiceMock }
      ]
    });

    fixture = TestBed.createComponent(TasksComponent);
    alfrescoApiService = TestBed.get(AlfrescoApiService);
    component = fixture.componentInstance;
github Alfresco / generator-ng2-alfresco-app / app / templates / adf-cli-activiti-template / src / app / login / login.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        BrowserAnimationsModule,
        CoreModule.forRoot(),
        ContentModule.forRoot(),
        ProcessServicesCloudModule
      ],
      providers: [
        { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
     ],
      declarations: [ LoginComponent ]
    })
    .compileComponents();
  }));
github Alfresco / generator-ng2-alfresco-app / app / templates / adf-cli-acs-aps-template / src / app / documentlist / documentlist.component.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        CoreModule.forRoot(),
        ContentModule.forRoot(),
        ProcessModule.forRoot(),
        TranslateModule.forRoot({
            loader: { provide: TranslateLoader, useClass: TranslateLoaderService }
        })
      ],
      declarations: [DocumentlistComponent],
      providers: [
        PreviewService,
        { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
        { provide: AppConfigService, useClass: AppConfigServiceMock },
        { provide: Location, useClass: SpyLocation }
      ]
    });

    fixture = TestBed.createComponent(DocumentlistComponent);
github Alfresco / alfresco-ng2-components / lib / content-services / src / lib / dialogs / library / library.dialog.spec.ts View on Github external
describe('LibraryDialogComponent', () => {
    let fixture;
    let component;
    let alfrescoApi;
    let findSitesSpy;
    const findSitesResponse = { list: { entries: [] } };
    const dialogRef = {
        close: jasmine.createSpy('close')
    };

    setupTestBed({
        imports: [NoopAnimationsModule, CoreModule.forRoot(), ReactiveFormsModule],
        declarations: [LibraryDialogComponent],
        providers: [
            {
                provide: AlfrescoApiService,
                useClass: AlfrescoApiServiceMock
            },
            { provide: MatDialogRef, useValue: dialogRef }
        ],
        schemas: [NO_ERRORS_SCHEMA]
    });

    beforeEach(() => {
        fixture = TestBed.createComponent(LibraryDialogComponent);
        component = fixture.componentInstance;
        alfrescoApi = TestBed.get(AlfrescoApiService);
        findSitesSpy = spyOn(alfrescoApi.getInstance().core.queriesApi, 'findSites');
github Alfresco / alfresco-ng2-components / demo-shell / src / app / app.module.ts View on Github external
registerLocaleData(localeFi);
registerLocaleData(localeDa);
registerLocaleData(localeSv);

@NgModule({
    imports: [
        BrowserModule,
        environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
        ReactiveFormsModule,
        routing,
        FormsModule,
        HttpClientModule,
        MaterialModule,
        AppExtensionsModule,
        FlexLayoutModule,
        CoreModule.forRoot(),
        ContentModule.forRoot(),
        InsightsModule.forRoot(),
        ProcessModule.forRoot(),
        ProcessServicesCloudModule,
        ExtensionsModule.forRoot(),
        ThemePickerModule,
        ChartsModule,
        AppCloudSharedModule,
        MonacoEditorModule.forRoot()
    ],
    declarations: [
        AppComponent,
        LogoutComponent,
        AppLayoutComponent,
        HomeComponent,
        SearchBarComponent,
github Alfresco / alfresco-ng2-components / lib / process-services-cloud / src / lib / process / process-filters / services / process-filter-cloud.service.spec.ts View on Github external
describe('Inject [UserPreferenceCloudService] into the ProcessFilterCloudService', () => {
    let service: ProcessFilterCloudService;
    let preferenceCloudService: PreferenceCloudServiceInterface;
    let identityUserService: IdentityUserService;

    const identityUserMock = { username: 'mock-username', firstName: 'fake-identity-first-name', lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' };

    setupTestBed({
        imports: [
            CoreModule.forRoot()
        ],
        providers: [
            ProcessFilterCloudService,
            IdentityUserService,
            UserPreferenceCloudService,
            { provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService }
        ]
    });

    beforeEach(async(() => {
        service = TestBed.get(ProcessFilterCloudService);
        preferenceCloudService = service.preferenceService;
        identityUserService = TestBed.get(IdentityUserService);
        spyOn(identityUserService, 'getCurrentUserInfo').and.returnValue(identityUserMock);
    }));
github Alfresco / generator-ng2-alfresco-app / app / templates / adf-cli-activiti-acs-template / src / app / tasks / tasks.component.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        BrowserAnimationsModule,
        CoreModule.forRoot(),
        ContentModule.forRoot(),
        ProcessServicesCloudModule,
        TranslateModule.forRoot({
          loader: { provide: TranslateLoader, useClass: TranslateLoaderService }
        })
      ],
      declarations: [TasksComponent],
      providers: [
        { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
        { provide: AppConfigService, useClass: AppConfigServiceMock }
      ]
    });

    fixture = TestBed.createComponent(TasksComponent);
    alfrescoApiService = TestBed.get(AlfrescoApiService);
    component = fixture.componentInstance;