mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-10461] Fix license header checker (#7823)
* [AAE-10461] Fix license header checker * trigger travis * fix license headers for cli lib * rebase
This commit is contained in:
@@ -30,7 +30,8 @@
|
||||
"plugins": [
|
||||
"eslint-plugin-unicorn",
|
||||
"eslint-plugin-rxjs",
|
||||
"ban"
|
||||
"ban",
|
||||
"license-header"
|
||||
],
|
||||
"rules": {
|
||||
"ban/ban": [
|
||||
@@ -130,7 +131,8 @@
|
||||
"allowShortCircuit": true,
|
||||
"allowTernary": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"license-header/header": ["error", "./license-community.txt"]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { CloudLayoutService } from './services/cloud-layout.service';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
AuthenticationService,
|
||||
AppConfigService,
|
||||
|
17
demo-shell/src/typings.d.ts
vendored
17
demo-shell/src/typings.d.ts
vendored
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* SystemJS module definition */
|
||||
declare const module: NodeModule;
|
||||
interface NodeModule {
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { PluginTarget } from './plugins/plugin-model';
|
||||
import { CheckEnv } from './plugins/check-env';
|
||||
import program = require('commander');
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
const alfrescoApi = require('@alfresco/js-api');
|
||||
const program = require('commander');
|
||||
const fs = require ('fs');
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
const alfrescoApi = require('@alfresco/js-api');
|
||||
const program = require('commander');
|
||||
const fs = require ('fs');
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { logger } from './logger';
|
||||
import { exec } from './exec';
|
||||
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { logger } from './../logger';
|
||||
import alfrescoApi = require('@alfresco/js-api');
|
||||
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { PluginInterface } from './plugin-model';
|
||||
import { GovernanceHealth } from './governance-health';
|
||||
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { logger } from '../logger';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { PluginInterface } from './plugin-model';
|
||||
import { logger } from '../logger';
|
||||
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
export enum PluginTarget {
|
||||
processService = 'processService',
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { PluginInterface } from './plugin-model';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { PluginInterface } from './plugin-model';
|
||||
import { logger } from '../logger';
|
||||
import { PluginConfiguration } from './plugin-config';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { PluginInterface } from './plugin-model';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { PluginInterface } from './plugin-model';
|
||||
import { logger } from '../logger';
|
||||
import { PluginConfiguration } from './plugin-config';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { AlfrescoApi, PeopleApi, NodesApi, GroupsApi, SitesApi, SearchApi, AlfrescoApiConfig } from '@alfresco/js-api';
|
||||
import program from 'commander';
|
||||
import { logger } from './logger';
|
||||
|
@@ -14,4 +14,5 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './new-version-uploader.model';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MinimalNodeEntryEntity, Version, NodeChildAssociation, Node } from '@alfresco/js-api';
|
||||
import { NodeEntityEvent } from '../../document-list';
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Subject } from 'rxjs';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
export const domSanitizerMock = {
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { MatIconRegistry } from '@angular/material/icon';
|
||||
|
||||
export const matIconRegistryMock = {
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export * from './activiti/activiti-client.types';
|
||||
export * from './alfresco-js-clients.module';
|
||||
export * from './discovery/discovery-client.types';
|
||||
|
@@ -1,2 +1,19 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
||||
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export * from './api-client.factory';
|
||||
export * from './api-clients.service';
|
||||
export * from './clients';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { API_CLIENT_FACTORY_TOKEN } from '@alfresco/adf-core/api';
|
||||
import { LegacyClientFactory } from './legacy-api-client.factory';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, SecurityContext } from '@angular/core';
|
||||
import { animate, style, transition, trigger } from '@angular/animations';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ComponentRef, Directive, ElementRef, HostListener, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Overlay, OverlayPositionBuilder, OverlayRef } from '@angular/cdk/overlay';
|
||||
import { ComponentPortal } from '@angular/cdk/portal';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { DebugElement } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { FormFieldModel } from '../core/form-field.model';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export const mockTabText = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam urna odio, sagittis vel nulla vel, condimentum egestas dolor.
|
||||
Interdum et malesuada fames ac ante ipsum primis in faucibus. Mauris eu hendrerit lectus. Aliquam et ex imperdiet, sodales tellus finibus, malesuada eros.
|
||||
Vestibulum aliquet eros sed diam euismod tincidunt.
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { DataColumn } from '../datatable/data/data-column.model';
|
||||
|
||||
export const getDataColumnMock = <T = unknown>(column: Partial<DataColumn<T>> = {}): DataColumn<T> => ({
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
export const domSanitizerMock = {
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LanguageServiceInterface } from '../services/language.service.interface';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { MatIconRegistry } from '@angular/material/icon';
|
||||
|
||||
export const matIconRegistryMock = {
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export class IdentityRoleModel {
|
||||
id: string;
|
||||
name: string;
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import moment, { Moment } from 'moment';
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import moment, { Moment } from 'moment';
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2022 Alfresco Software, Ltd.
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2022 Alfresco Software, Ltd.
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Meta, moduleMetadata, Story } from '@storybook/angular';
|
||||
import { ErrorContentComponent } from './error-content.component';
|
||||
import { CoreStoryModule } from '../../testing/core.story.module';
|
||||
|
@@ -1,4 +1,6 @@
|
||||
/* Copyright 2012 Mozilla Foundation
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, HostListener, Output, EventEmitter, OnInit, OnDestroy, ElementRef } from '@angular/core';
|
||||
import { ProcessCloudService } from '../services/process-cloud.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, SimpleChange, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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 { DataColumn, DataRow, ObjectDataTableAdapter } from '@alfresco/adf-core';
|
||||
import { ProcessListDataColumnCustomData, PROCESS_LIST_CUSTOM_VARIABLE_COLUMN } from '../../../models/data-column-custom-data';
|
||||
import { ProcessInstanceCloudListViewModel } from '../models/perocess-instance-cloud-view.model';
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
export enum ProcessListCloudPreferences {
|
||||
columnOrder = 'processes-cloud-list-columns-order',
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { ProcessListCloudService } from './process-list-cloud.service';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
||||
import { ProcessQueryCloudRequestModel } from '../models/process-cloud-query-request.model';
|
||||
|
@@ -2,14 +2,14 @@
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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,
|
||||
* 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.
|
||||
|
@@ -2,14 +2,14 @@
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the 'License');
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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,
|
||||
* 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.
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ContentChildren, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, Input, HostListener, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { IdentityUserService } from '../../people/services/identity-user.service';
|
||||
import { TaskCloudService } from '../services/task-cloud.service';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewChild, ContentChildren } from '@angular/core';
|
||||
import { CompleteTaskDirective } from './complete-task.directive';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, Input, HostListener, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { TaskCloudService } from '../services/task-cloud.service';
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ContentChildren, ViewChild } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, Input, HostListener, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { TaskCloudService } from '../services/task-cloud.service';
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
||||
import moment, { Moment } from 'moment';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export class StartTaskCloudRequestModel {
|
||||
|
||||
name: string;
|
||||
|
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
export enum TasksListCloudPreferences {
|
||||
columnOrder = 'tasks-list-cloud-columns-order',
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ElementFinder, protractor } from 'protractor';
|
||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, ElementFinder } from 'protractor';
|
||||
|
||||
import * as path from 'path';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, $$, $, by, element } from 'protractor';
|
||||
import { EditProcessFilterDialogPage } from './dialog/edit-process-filter-dialog.page';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Logger } from '../../core/utils/logger';
|
||||
import { ApiService } from '../../../shared/api/api.service';
|
||||
import { ModelsApi } from '@alfresco/js-api';
|
||||
|
9
package-lock.json
generated
9
package-lock.json
generated
@@ -29033,6 +29033,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-plugin-license-header": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-license-header/-/eslint-plugin-license-header-0.6.0.tgz",
|
||||
"integrity": "sha512-IEywStBWaDBDMkogYoKUAdaOuomZ+YaQmdoSD2vHmXobekM+XuP6SWLlvwUUhIbdocn3MTlb5CUJ8E4VHz1c/w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"requireindex": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"eslint-plugin-prefer-arrow": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz",
|
||||
|
@@ -153,6 +153,7 @@
|
||||
"eslint-plugin-ban": "^1.6.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"eslint-plugin-jsdoc": "39.3.3",
|
||||
"eslint-plugin-license-header": "0.6.0",
|
||||
"eslint-plugin-prefer-arrow": "1.2.3",
|
||||
"eslint-plugin-rxjs": "^5.0.2",
|
||||
"eslint-plugin-unicorn": "^43.0.1",
|
||||
|
@@ -1,46 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const Lint = require("tslint");
|
||||
const minimatch = require("minimatch");
|
||||
const fs = require("fs");
|
||||
class Rule extends Lint.Rules.AbstractRule {
|
||||
apply(sourceFile) {
|
||||
return this.applyWithWalker(new ADFEnterpriseLicenseBannerRule(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-enterprise-license-banner',
|
||||
type: 'maintainability',
|
||||
description: ``,
|
||||
descriptionDetails: ``,
|
||||
rationale: ``,
|
||||
options: null,
|
||||
optionsDescription: `Not configurable.`,
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'Missing license header in this TypeScript ' +
|
||||
'file Every TypeScript file of the library needs to have the Alfresco license banner at the top.';
|
||||
exports.Rule = Rule;
|
||||
class ADFEnterpriseLicenseBannerRule extends Lint.RuleWalker {
|
||||
constructor(sourceFile, options) {
|
||||
super(sourceFile, options);
|
||||
const fileGlobs = options.ruleArguments;
|
||||
this.licensePath = options.ruleArguments[1];
|
||||
const relativeFilePath = path.relative(process.cwd(), sourceFile.fileName);
|
||||
this._enabled = fileGlobs.some(p => minimatch(relativeFilePath, p));
|
||||
}
|
||||
visitSourceFile(sourceFile) {
|
||||
if (!this._enabled) {
|
||||
return;
|
||||
}
|
||||
const fileContent = sourceFile.getFullText();
|
||||
const licenseBanner = fs.readFileSync(this.licensePath, 'utf8');
|
||||
const licenseCommentPos = fileContent.indexOf(licenseBanner);
|
||||
const tslintFix = Lint.Replacement.appendText(0, licenseBanner + '\n\n');
|
||||
if (licenseCommentPos !== 0) {
|
||||
return this.addFailureAt(0, 0, Rule.FAILURE_STRING, tslintFix);
|
||||
}
|
||||
super.visitSourceFile(sourceFile);
|
||||
}
|
||||
}
|
@@ -1,69 +0,0 @@
|
||||
import * as path from 'path';
|
||||
import * as ts from 'typescript';
|
||||
import * as Lint from 'tslint';
|
||||
import * as minimatch from 'minimatch';
|
||||
import * as fs from 'fs';
|
||||
|
||||
/**
|
||||
* Rule that walks through all TypeScript files of public packages and shows failures if a
|
||||
* file does not have the license banner at the top of the file.
|
||||
*/
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-enterprise-license-banner',
|
||||
type: 'maintainability',
|
||||
description: ``,
|
||||
descriptionDetails: ``,
|
||||
rationale: ``,
|
||||
options: null,
|
||||
optionsDescription: `Not configurable.`,
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
static FAILURE_STRING: string = 'Missing license header in this TypeScript ' +
|
||||
'file Every TypeScript file of the library needs to have the Alfresco license banner at the top.';
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(
|
||||
new ADFEnterpriseLicenseBannerRule(sourceFile,
|
||||
this.getOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
class ADFEnterpriseLicenseBannerRule extends Lint.RuleWalker {
|
||||
|
||||
/** Whether the walker should check the current source file. */
|
||||
private _enabled: boolean;
|
||||
private licensePath: string;
|
||||
|
||||
constructor(sourceFile: ts.SourceFile, options: Lint.IOptions) {
|
||||
super(sourceFile, options);
|
||||
|
||||
// Globs that are used to determine which files to lint.
|
||||
const fileGlobs = options.ruleArguments;
|
||||
this.licensePath = options.ruleArguments[1];
|
||||
|
||||
// Relative path for the current TypeScript source file.
|
||||
const relativeFilePath = path.relative(process.cwd(), sourceFile.fileName);
|
||||
// Whether the file should be checked at all.
|
||||
this._enabled = fileGlobs.some(p => minimatch(relativeFilePath, p));
|
||||
}
|
||||
|
||||
visitSourceFile(sourceFile: ts.SourceFile) {
|
||||
if (!this._enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fileContent = sourceFile.getFullText();
|
||||
const licenseBanner = fs.readFileSync(this.licensePath,'utf8');
|
||||
const licenseCommentPos = fileContent.indexOf(licenseBanner);
|
||||
|
||||
const tslintFix = Lint.Replacement.appendText(0, licenseBanner + '\n\n');
|
||||
if (licenseCommentPos !== 0) {
|
||||
return this.addFailureAt(0, 0, Rule.FAILURE_STRING, tslintFix);
|
||||
}
|
||||
|
||||
super.visitSourceFile(sourceFile);
|
||||
}
|
||||
}
|
@@ -1,46 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const Lint = require("tslint");
|
||||
const minimatch = require("minimatch");
|
||||
const fs = require("fs");
|
||||
class Rule extends Lint.Rules.AbstractRule {
|
||||
apply(sourceFile) {
|
||||
return this.applyWithWalker(new ADFLicenseBannerRule(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-license-banner',
|
||||
type: 'maintainability',
|
||||
description: ``,
|
||||
descriptionDetails: ``,
|
||||
rationale: ``,
|
||||
options: null,
|
||||
optionsDescription: `Not configurable.`,
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'Missing license header in this TypeScript ' +
|
||||
'file Every TypeScript file of the library needs to have the Alfresco license banner at the top.';
|
||||
exports.Rule = Rule;
|
||||
class ADFLicenseBannerRule extends Lint.RuleWalker {
|
||||
constructor(sourceFile, options) {
|
||||
super(sourceFile, options);
|
||||
const fileGlobs = options.ruleArguments;
|
||||
this.licensePath = options.ruleArguments[1];
|
||||
const relativeFilePath = path.relative(process.cwd(), sourceFile.fileName);
|
||||
this._enabled = fileGlobs.some(p => minimatch(relativeFilePath, p));
|
||||
}
|
||||
visitSourceFile(sourceFile) {
|
||||
if (!this._enabled) {
|
||||
return;
|
||||
}
|
||||
const fileContent = sourceFile.getFullText();
|
||||
const licenseBanner = fs.readFileSync(this.licensePath, 'utf8');
|
||||
const licenseCommentPos = fileContent.indexOf(licenseBanner);
|
||||
const tslintFix = Lint.Replacement.appendText(0, licenseBanner + '\n\n');
|
||||
if (licenseCommentPos !== 0) {
|
||||
return this.addFailureAt(0, 0, Rule.FAILURE_STRING, tslintFix);
|
||||
}
|
||||
super.visitSourceFile(sourceFile);
|
||||
}
|
||||
}
|
@@ -1,69 +0,0 @@
|
||||
import * as path from 'path';
|
||||
import * as ts from 'typescript';
|
||||
import * as Lint from 'tslint';
|
||||
import * as minimatch from 'minimatch';
|
||||
import * as fs from 'fs';
|
||||
|
||||
/**
|
||||
* Rule that walks through all TypeScript files of public packages and shows failures if a
|
||||
* file does not have the license banner at the top of the file.
|
||||
*/
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-license-banner',
|
||||
type: 'maintainability',
|
||||
description: ``,
|
||||
descriptionDetails: ``,
|
||||
rationale: ``,
|
||||
options: null,
|
||||
optionsDescription: `Not configurable.`,
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
static FAILURE_STRING: string = 'Missing license header in this TypeScript ' +
|
||||
'file Every TypeScript file of the library needs to have the Alfresco license banner at the top.';
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(
|
||||
new ADFLicenseBannerRule(sourceFile,
|
||||
this.getOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
class ADFLicenseBannerRule extends Lint.RuleWalker {
|
||||
|
||||
/** Whether the walker should check the current source file. */
|
||||
private _enabled: boolean;
|
||||
private licensePath: string;
|
||||
|
||||
constructor(sourceFile: ts.SourceFile, options: Lint.IOptions) {
|
||||
super(sourceFile, options);
|
||||
|
||||
// Globs that are used to determine which files to lint.
|
||||
const fileGlobs = options.ruleArguments;
|
||||
this.licensePath = options.ruleArguments[1];
|
||||
|
||||
// Relative path for the current TypeScript source file.
|
||||
const relativeFilePath = path.relative(process.cwd(), sourceFile.fileName);
|
||||
// Whether the file should be checked at all.
|
||||
this._enabled = fileGlobs.some(p => minimatch(relativeFilePath, p));
|
||||
}
|
||||
|
||||
visitSourceFile(sourceFile: ts.SourceFile) {
|
||||
if (!this._enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const fileContent = sourceFile.getFullText();
|
||||
const licenseBanner = fs.readFileSync(this.licensePath,'utf8');
|
||||
const licenseCommentPos = fileContent.indexOf(licenseBanner);
|
||||
|
||||
const tslintFix = Lint.Replacement.appendText(0, licenseBanner + '\n\n');
|
||||
if (licenseCommentPos !== 0) {
|
||||
return this.addFailureAt(0, 0, Rule.FAILURE_STRING, tslintFix);
|
||||
}
|
||||
|
||||
super.visitSourceFile(sourceFile);
|
||||
}
|
||||
}
|
@@ -6,6 +6,4 @@ var adfFileNameRule_1 = require("./adfFileNameRule");
|
||||
exports.ADFComponentSelectorRule = adfFileNameRule_1.Rule;
|
||||
var adfPrefixNameRule_1 = require("./adfPrefixNameRule");
|
||||
exports.ADFOutputPrefixNameRule = adfPrefixNameRule_1.Rule;
|
||||
var adfLicenseBannerRule_1 = require("./adfLicenseBannerRule");
|
||||
exports.ADFLicenseBannerRule = adfLicenseBannerRule_1.Rule;
|
||||
exports.rulesDirectory = '.';
|
||||
|
@@ -1,6 +1,5 @@
|
||||
export { Rule as ADFClassNameRule } from './adfClassNameRule';
|
||||
export { Rule as ADFComponentSelectorRule } from './adfFileNameRule';
|
||||
export { Rule as ADFOutputPrefixNameRule } from './adfPrefixNameRule';
|
||||
export { Rule as ADFLicenseBannerRule } from './adfLicenseBannerRule';
|
||||
|
||||
export const rulesDirectory = '.';
|
||||
|
Reference in New Issue
Block a user