import './modules/service-module';
import './modules/view-model-module.ts';
import {SdcUiCommon, SdcUiComponents, SdcUiServices} from 'onap-ui-angular';
-import {
- CookieService,
- DataTypesService,
- EcompHeaderService,
- LeftPaletteLoaderService
-} from "./services";
+import {CookieService, DataTypesService, EcompHeaderService, LeftPaletteLoaderService} from "./services";
import {CacheService, CatalogService, HomeService} from "./services-ng2";
import {AuthenticationService} from "app/ng2/services/authentication.service";
import {CHANGE_COMPONENT_CSAR_VERSION_FLAG, PREVIOUS_CSAR_COMPONENT, States} from "./utils";
);
$stateProvider.state(
- 'workspace', {
+ States.TYPE_WORKSPACE, {
+ url: '/:previousState/type-workspace/:type/:id/:subPage',
+ template: '<app-type-workspace></app-type-workspace>',
+ }
+ );
+
+ $stateProvider.state(
+ States.WORKSPACE, {
url: '/:previousState/workspace/:id/:type/',
params: {
'importedFile': null,
controller: viewModelsModuleName + '.WorkspaceViewModel',
resolve: {
injectComponent: ['$stateParams', 'ComponentFactory', 'workspaceService', 'Sdc.Services.CacheService', function ($stateParams, ComponentFactory: ComponentFactory, workspaceService: WorkspaceService, cacheService: CacheService) {
-
if ($stateParams.id && $stateParams.id.length) { //need to check length in case ID is an empty string
return ComponentFactory.getComponentWithMetadataFromServer($stateParams.type.toUpperCase(), $stateParams.id).then(
(component: Component) => {
parent: 'workspace',
resolve: {
componentData: ['injectComponent', '$stateParams', function (injectComponent: Component, $stateParams) {
- //injectComponent.componentService = null; // this is for not passing the service so no one will use old api and start using new api
$stateParams.component = injectComponent;
return injectComponent;
}],
template: '<composition-page></composition-page>',
resolve: {
componentData: ['injectComponent', '$stateParams', function (injectComponent: Component, $stateParams) {
- //injectComponent.componentService = null; // this is for not passing the service so no one will use old api and start using new api
$stateParams.component = injectComponent;
return injectComponent;
}],
}
);
+ $stateProvider.state(
+ States.WORKSPACE_INTERFACE_DEFINITION, {
+ url: 'interfaceDefinition',
+ parent: 'workspace',
+ controller: viewModelsModuleName + '.InterfaceDefinitionViewModel',
+ templateUrl: './view-models/workspace/tabs/interface-definition/interface-definition-view.html',
+ data: {
+ bodyClass: 'interfaceDefinition'
+ }
+ }
+ );
+
$stateProvider.state(
'workspace.plugins', {
url: 'plugins/*path',
ng1appModule.value('ValidationPattern', /^[\s\w\&_.:-]{1,1024}$/);
ng1appModule.value('ComponentNameValidationPattern', /^(?=.*[^. ])[\s\w\&_.:-]{1,1024}$/); //DE250513 - same as ValidationPattern above, plus requirement that name not consist of dots and/or spaces alone.
-ng1appModule.value('PropertyNameValidationPattern', /^[a-zA-Z0-9_:-]{1,50}$/);// DE210977
+ng1appModule.value('PropertyNameValidationPattern', /^[a-zA-Z0-9_:-@]{1,100}$/);// DE210977
ng1appModule.value('TagValidationPattern', /^[\s\w_.-]{1,50}$/);
ng1appModule.value('VendorReleaseValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,25}$/);
ng1appModule.value('VendorNameValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,60}$/);
//handle http config
$http.defaults.withCredentials = true;
- // $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';
$http.defaults.headers.common[cookieService.getUserIdSuffix()] = cookieService.getUserId();
- DataTypesService.initDataTypes();
+ DataTypesService.loadDataTypesCache(null);
//handle stateChangeStart
let internalDeregisterStateChangeStartWatcher: Function = (): void => {
};
let onStateChangeStart: Function = (event, toState, toParams, fromState, fromParams): void => {
- console.info((new Date()).getTime());
- console.info('$stateChangeStart', toState.name);
+ console.debug((new Date()).getTime());
+ console.debug('$stateChangeStart', toState.name);
if (toState.name !== 'error-403' && !authService.getLoggedinUser()) {
authService.authenticate().subscribe((userInfo: IUserProperties) => {
if (!doesUserHasAccess(toState, userInfo)) {
$state.go('error-403');
- console.info('User has no permissions');
+ console.debug('User has no permissions');
return;
}
authService.setLoggedinUser(userInfo);
removeLoader();
if (authService.getLoggedinUser().role === 'ADMIN') {
- // toState.name = "adminDashboard";
$state.go("adminDashboard", toParams);
return;
}
if (!doesUserHasAccess(toState, authService.getLoggedinUser())) {
event.preventDefault();
$state.go('error-403');
- console.info('User has no permissions');
+ console.debug('User has no permissions');
}
if (authService.getLoggedinUser().role === 'ADMIN') {
- // toState.name = "adminDashboard";
$state.go("adminDashboard", toParams);
return;
}
};
let onStateChangeSuccess: Function = (event, toState, toParams, fromState, fromParams): void => {
- console.info('$stateChangeSuccess', toState.name);
+ console.debug('$stateChangeSuccess', toState.name);
// Workaround in case we are entering other state then workspace (user move to catalog)
// remove the changeComponentCsarVersion, user should open again the VSP list and select one for update.
let registerStateChangeStartWatcher: Function = (): void => {
internalDeregisterStateChangeStartWatcher();
- console.info('registerStateChangeStartWatcher $stateChangeStart');
+ console.debug('registerStateChangeStartWatcher $stateChangeStart');
deregisterStateChangeStartWatcher = $rootScope.$on('$stateChangeStart', (event, toState, toParams, fromState, fromParams): void => {
onStateChangeStart(event, toState, toParams, fromState, fromParams);
});