Remove unused files

pull/8051/head
Oliver Günther 5 years ago
parent 1e2de3a52e
commit 86c7c4647d
  1. 1
      frontend/package.json
  2. 43
      frontend/src/app/components/states/switch-state.ts
  3. 40
      frontend/src/app/components/wp-table-store/TableStore.ts
  4. 22
      frontend/src/app/helpers/rxjs/with-loading-toggle.ts
  5. 43
      frontend/src/app/modules/common/path-helper/path-helper.functions.ts
  6. 55
      frontend/src/app/modules/hal/resources/resources.ts
  7. 15
      frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-inline-highlighting.service.ts
  8. 1
      frontend/src/tsconfig.app.json
  9. 0
      modules/documents/frontend/module/openproject-documents.module.ts

@ -128,6 +128,7 @@
"zone.js": "~0.10.2"
},
"scripts": {
"analyze": "ng build --prod --stats-json && webpack-bundle-analyzer -p 9999 ../public/assets/frontend/stats.json",
"prebuild": "./scripts/link_plugin_placeholder.js",
"build": "ng build --prod --named-chunks --source-map",
"preserve": "./scripts/link_plugin_placeholder.js",

@ -1,43 +0,0 @@
import {derive, IfThen, input, InputState, State} from 'reactivestates';
import {filter} from 'rxjs/operators';
import {debugLog} from '../../helpers/debug_output';
export class SwitchState<StateName> {
private readonly contextSwitch$:InputState<StateName> = input<StateName>();
public transition(context:StateName) {
if (this.validTransition(context)) {
this.contextSwitch$.putValue(context);
}
}
public validTransition(to:StateName) {
return (this.contextSwitch$.value !== to);
}
public get current():StateName | undefined {
return this.contextSwitch$.value;
}
public reset(reason?:string) {
this.contextSwitch$.clear(reason);
}
public doAndTransition(context:StateName, callback:() => PromiseLike<any>):PromiseLike<void> {
this.reset('Clearing before transitioning to ' + context);
const promise = callback();
return promise.then(() => this.transition(context));
}
public fireOnTransition<T>(cb:State<T>, ...context:StateName[]):State<T> {
return IfThen(this.contextSwitch$, s => context.indexOf(s) > -1, cb);
}
public fireOnStateChange<T>(state:State<T>, ...context:StateName[]):State<T> {
return derive(state, $ => $
.pipe(
filter(() => this.contextSwitch$.hasValue() && context.indexOf(this.contextSwitch$.value!) > -1))
);
}
}

@ -1,40 +0,0 @@
// -- copyright
// OpenProject is an open source project management software.
// Copyright (C) 2012-2020 the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See docs/COPYRIGHT.rdoc for more details.
// ++
import {Injectable} from '@angular/core';
import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";
@Injectable()
export class TableStore {
constructor(readonly querySpace:IsolatedQuerySpace) {
}
}

@ -1,22 +0,0 @@
import {Observable} from "rxjs";
import {tap} from "rxjs/operators";
/**
* Manipulate a loading flag on the given component while loading
*
* @param component
* @param attribute The attribute to toggle
*/
export function withLoadingToggle<T>(component:any, attribute:string):(source:Observable<T>) => Observable<T> {
return (source$:Observable<T>) => {
component[attribute] = true;
return source$.pipe(
tap(
() => component[attribute] = false,
() => component[attribute] = false,
() => component[attribute] = false
)
);
};
}

@ -1,43 +0,0 @@
// -- copyright
// OpenProject is an open source project management software.
// Copyright (C) 2012-2020 the OpenProject GmbH
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See docs/COPYRIGHT.rdoc for more details.
// ++
export namespace PathHelperFunctions {
export function removeBasePathFromLink(link:string) {
const basePath = (window as any).appBasePath;
const url = URI(link);
if (basePath && `/${url.segment(0)}` === basePath) {
// Remove the first segment
url.segment(0, '');
return url.toString();
}
return link;
}
}

@ -1,55 +0,0 @@
import {ConfigurationResource} from 'core-app/modules/hal/resources/configuration-resource';
import {HelpTextResource} from 'core-app/modules/hal/resources/help-text-resource';
import {QueryFilterInstanceSchemaResource} from 'core-app/modules/hal/resources/query-filter-instance-schema-resource';
import {QueryFormResource} from 'core-app/modules/hal/resources/query-form-resource';
import {QueryFilterResource} from 'core-app/modules/hal/resources/query-filter-resource';
import {QueryOperatorResource} from 'core-app/modules/hal/resources/query-operator-resource';
import {HalResource} from 'core-app/modules/hal/resources/hal-resource';
import {ProjectResource} from 'core-app/modules/hal/resources/project-resource';
import {QueryResource} from 'core-app/modules/hal/resources/query-resource';
import {ErrorResource} from 'core-app/modules/hal/resources/error-resource';
import {CollectionResource} from 'core-app/modules/hal/resources/collection-resource';
import {AttachmentCollectionResource} from 'core-app/modules/hal/resources/attachment-collection-resource';
import {QueryFilterInstanceResource} from 'core-app/modules/hal/resources/query-filter-instance-resource';
import {FormResource} from 'core-app/modules/hal/resources/form-resource';
import {QueryGroupByResource} from 'core-app/modules/hal/resources/query-group-by-resource';
import {CustomActionResource} from 'core-app/modules/hal/resources/custom-action-resource';
import {QuerySortByResource} from 'core-app/modules/hal/resources/query-sort-by-resource';
import {RelationResource} from 'core-app/modules/hal/resources/relation-resource';
import {RootResource} from 'core-app/modules/hal/resources/root-resource';
import {SchemaDependencyResource} from 'core-app/modules/hal/resources/schema-dependency-resource';
import {SchemaResource} from 'core-app/modules/hal/resources/schema-resource';
import {TypeResource} from 'core-app/modules/hal/resources/type-resource';
import {UserResource} from 'core-app/modules/hal/resources/user-resource';
import {WorkPackageResource} from 'core-app/modules/hal/resources/work-package-resource';
import {WorkPackageCollectionResource} from 'core-app/modules/hal/resources/wp-collection-resource';
import {GridResource} from "core-app/modules/hal/resources/grid-resource";
export const coreHalResources = [
AttachmentCollectionResource,
CollectionResource,
ConfigurationResource,
CustomActionResource,
ErrorResource,
FormResource,
HalResource,
HelpTextResource,
ProjectResource,
QueryFilterInstanceResource,
QueryFilterInstanceSchemaResource,
QueryFilterResource,
QueryFormResource,
QueryGroupByResource,
QueryOperatorResource,
QueryResource,
QuerySortByResource,
RelationResource,
RootResource,
SchemaDependencyResource,
SchemaResource,
TypeResource,
UserResource,
WorkPackageResource,
WorkPackageCollectionResource,
GridResource
];

@ -1,15 +0,0 @@
import {Injectable} from '@angular/core';
import {WorkPackageViewHighlightingService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-highlighting.service";
@Injectable()
export class WorkPackageInlineHighlightingService extends WorkPackageViewHighlightingService {
public get isInline() {
return true;
}
public get isDisabled() {
return false;
}
}

@ -7,6 +7,7 @@
},
"exclude": [
"test.ts",
"test/*",
"**/*.spec.ts"
]
}

Loading…
Cancel
Save