Commit 19a7162cf22512d66a2ce1279bcabc64ef5787cf

Authored by Carlos Purificação
1 parent 356a616e

Fixed docs package configuration. Added documented files

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 "scripts": { 9 "scripts": {
10 "build": "webpack; gulp build", 10 "build": "webpack; gulp build",
11 "webpack": "webpack", 11 "webpack": "webpack",
  12 + "docs": "gulp ngdocs; static-server docs",
12 "karma": "karma", 13 "karma": "karma",
13 "coverage": "karma start --single-run; npm run remap-coverage", 14 "coverage": "karma start --single-run; npm run remap-coverage",
14 "remap-coverage": "ts-node --project ./dev-scripts ./dev-scripts/remapCoverage.ts", 15 "remap-coverage": "ts-node --project ./dev-scripts ./dev-scripts/remapCoverage.ts",
@@ -77,6 +78,7 @@ @@ -77,6 +78,7 @@
77 "reflect-metadata": "^0.1.3", 78 "reflect-metadata": "^0.1.3",
78 "remap-istanbul": "github:sitepen/remap-istanbul", 79 "remap-istanbul": "github:sitepen/remap-istanbul",
79 "replace": "^0.3.0", 80 "replace": "^0.3.0",
  81 + "static-server": "^2.0.1",
80 "ts-loader": "^0.8.1", 82 "ts-loader": "^0.8.1",
81 "ts-node": "^0.5.5", 83 "ts-node": "^0.5.5",
82 "tslint": "^3.5.0", 84 "tslint": "^3.5.0",
src/app/components/noosfero-activities/activities.component.ts
@@ -2,6 +2,13 @@ import {Component, Input} from "ng-forward"; @@ -2,6 +2,13 @@ import {Component, Input} from "ng-forward";
2 import {NoosferoActivity} from "./activity/activity.component"; 2 import {NoosferoActivity} from "./activity/activity.component";
3 import {Activity} from "../../models/interfaces"; 3 import {Activity} from "../../models/interfaces";
4 4
  5 +/**
  6 + * @ngdoc controller
  7 + * @name NoosferoActivities
  8 + * @description
  9 + * The controller responsible to retreive profile activities.
  10 + */
  11 +
5 @Component({ 12 @Component({
6 selector: "noosfero-activities", 13 selector: "noosfero-activities",
7 templateUrl: 'app/components/noosfero-activities/activities.html', 14 templateUrl: 'app/components/noosfero-activities/activities.html',
@@ -9,6 +16,12 @@ import {Activity} from "../../models/interfaces"; @@ -9,6 +16,12 @@ import {Activity} from "../../models/interfaces";
9 }) 16 })
10 export class NoosferoActivities { 17 export class NoosferoActivities {
11 18
  19 + /**
  20 + * @ngdoc property
  21 + * @propertyOf NoosferoActivities
  22 + * @name activities
  23 + * @returns {Activity[]} An array of {@link Activity}.
  24 + */
12 @Input() activities: Activity[]; 25 @Input() activities: Activity[];
13 26
14 } 27 }
src/app/components/noosfero-articles/article/article_view.ts
1 import { bundle, Input, Inject, Component, Directive } from 'ng-forward'; 1 import { bundle, Input, Inject, Component, Directive } from 'ng-forward';
2 import {ArticleBlog} from "../blog/blog.component"; 2 import {ArticleBlog} from "../blog/blog.component";
3 3
  4 +/**
  5 + * @ngdoc controller
  6 + * @name ArticleDefaultView
  7 + * @description
  8 + * A default view for Noosfero Articles. If the specific article view is
  9 + * not implemented, then this view is used.
  10 + */
4 @Component({ 11 @Component({
5 selector: 'noosfero-default-article', 12 selector: 'noosfero-default-article',
6 templateUrl: 'app/components/noosfero-articles/article/article.html' 13 templateUrl: 'app/components/noosfero-articles/article/article.html'
@@ -12,6 +19,13 @@ export class ArticleDefaultView { @@ -12,6 +19,13 @@ export class ArticleDefaultView {
12 19
13 } 20 }
14 21
  22 +/**
  23 + * @ngdoc controller
  24 + * @name ArticleView
  25 + * @description
  26 + * A dynamic view for articles. It uses the article type to replace
  27 + * the default template with the custom article directive.
  28 + */
15 @Component({ 29 @Component({
16 selector: 'noosfero-article', 30 selector: 'noosfero-article',
17 template: 'not-used', 31 template: 'not-used',
src/app/components/noosfero-articles/blog/blog.component.ts
@@ -3,6 +3,12 @@ import {Component, Input, Inject} from "ng-forward"; @@ -3,6 +3,12 @@ import {Component, Input, Inject} from "ng-forward";
3 import {Article, Profile} from "./../../../models/interfaces"; 3 import {Article, Profile} from "./../../../models/interfaces";
4 import {ArticleService} from "../../../../lib/ng-noosfero-api/http/article.service"; 4 import {ArticleService} from "../../../../lib/ng-noosfero-api/http/article.service";
5 5
  6 +/**
  7 + * @ngdoc controller
  8 + * @name ArticleBlog
  9 + * @description
  10 + * An specific {@link ArticleView} for Blog articles.
  11 + */
6 @Component({ 12 @Component({
7 selector: "noosfero-blog", 13 selector: "noosfero-blog",
8 templateUrl: "app/components/noosfero-articles/blog/blog.html" 14 templateUrl: "app/components/noosfero-articles/blog/blog.html"
src/app/components/noosfero/profile-image/index.ts
  1 +/**
  2 + * Module for the image component in the Noosfero Angular Theme
  3 + * @namespace components.noosfero.profile-image
  4 + */
1 /* Module Index Entry - generated using the script npm run generate-index */ 5 /* Module Index Entry - generated using the script npm run generate-index */
src/app/components/noosfero/profile-image/profile-image.component.spec.ts
  1 +/**
  2 + * @ngdoc overview
  3 + * @name components.noosfero.profile-image.ProfileImageSpec
  4 + * @description
  5 + * This file contains the tests for the {@link components.noosfero.profile-image.ProfileImage} component.
  6 + */
1 7
2 import {TestComponentBuilder, ComponentFixture} from 'ng-forward/cjs/testing/test-component-builder'; 8 import {TestComponentBuilder, ComponentFixture} from 'ng-forward/cjs/testing/test-component-builder';
3 import {Pipe, Input, provide, Component} from 'ng-forward'; 9 import {Pipe, Input, provide, Component} from 'ng-forward';
src/app/components/noosfero/profile-image/profile-image.component.ts
1 import {Inject, Input, Component} from "ng-forward"; 1 import {Inject, Input, Component} from "ng-forward";
2 import {Profile} from "./../../../models/interfaces"; 2 import {Profile} from "./../../../models/interfaces";
3 3
  4 +
  5 +/**
  6 + * @ngdoc controller
  7 + * @name components.noosfero.profile-image.ProfileImage
  8 + * @description The component responsible for rendering the profile image
  9 + * @exports ProfileImage
  10 + */
4 @Component({ 11 @Component({
5 selector: "noosfero-profile-image", 12 selector: "noosfero-profile-image",
6 templateUrl: 'app/components/noosfero/profile-image/profile-image.html', 13 templateUrl: 'app/components/noosfero/profile-image/profile-image.html',
7 }) 14 })
8 export class ProfileImage { 15 export class ProfileImage {
9 16
  17 +
  18 + /**
  19 + * @ngdoc property
  20 + * @name profile
  21 + * @propertyOf components.noosfero.profile-image.ProfileImage
  22 + * @description
  23 + * The Noosfero {@link models.Profile} holding the image.
  24 + */
10 @Input() profile: Profile; 25 @Input() profile: Profile;
  26 + /**
  27 + * @ngdoc property
  28 + * @name defaultIcon
  29 + * @propertyOf components.noosfero.profile-image.ProfileImage
  30 + * @descritpion
  31 + * The default icon used by this profile
  32 + */
11 defaultIcon: string; 33 defaultIcon: string;
12 34
  35 +
  36 + /**
  37 + * @ngdoc method
  38 + * @name ngOnInit
  39 + * @methodOf components.noosfero.profile-image.ProfileImage
  40 + * @description
  41 + * Initializes the icon names to their corresponding values depending on the profile type passed to the controller
  42 + */
13 ngOnInit() { 43 ngOnInit() {
14 this.defaultIcon = 'fa-users'; 44 this.defaultIcon = 'fa-users';
15 if (this.profile && this.profile.type === 'Person') { 45 if (this.profile && this.profile.type === 'Person') {
src/app/index.module.ts
  1 +
  2 +/**
  3 + * @ngdoc service
  4 + * @name NoosferoApp
  5 + * @description
  6 + * The main NoosferoApp module class. It provide helper static methods used by
  7 + * the module to initialize the application.
  8 + */
1 export class NoosferoApp { 9 export class NoosferoApp {
2 10
  11 + /**
  12 + * @ngdoc property
  13 + * @name appName
  14 + * @propertyOf NoosferoApp
  15 + * @returns {string} the name of this application ('noosferoApp')
  16 + */
3 static appName: string = "noosferoApp"; 17 static appName: string = "noosferoApp";
  18 +
  19 + /**
  20 + * @ngdoc property
  21 + * @name angularModule
  22 + * @propertyOf NoosferoApp
  23 + * @returns {any} all the modules installed for this application
  24 + */
4 static angularModule: any; 25 static angularModule: any;
5 - // static init(angularModule: any) {  
6 - // NoosferoApp.angularModule  
7 - // angular.module(NoosferoApp.appName, ["ngAnimate", "ngCookies", "ngStorage", "ngTouch",  
8 - // "ngSanitize", "ngMessages", "ngAria", "restangular",  
9 - // "ui.router", "ui.bootstrap", "toastr",  
10 - // "angularMoment", "angular.filter", "akoenig.deckgrid",  
11 - // "angular-timeline", "duScroll", "oitozero.ngSweetAlert"]);  
12 - // }  
13 26
  27 + /**
  28 + * @ngdoc method
  29 + * @name addConfig
  30 + * @methodOf NoosferoApp
  31 + * @param {Function} configFunc the configuration function to add
  32 + * @descprition adds a configuration function to
  33 + * the {@link NoosferoApp#angularModule}
  34 + */
14 static addConfig(configFunc: Function) { 35 static addConfig(configFunc: Function) {
15 NoosferoApp.angularModule.config(configFunc); 36 NoosferoApp.angularModule.config(configFunc);
16 } 37 }
17 38
  39 + /**
  40 + * @ngdoc method
  41 + * @name addConstants
  42 + * @methodOf NoosferoApp
  43 + * @param {string} constantName the constant name
  44 + * @param {any} value the constant value
  45 + * @description adds a constant to the {@link NoosferoApp#angularModule}
  46 + */
18 static addConstants(constantName: string, value: any) { 47 static addConstants(constantName: string, value: any) {
19 NoosferoApp.angularModule.constant(constantName, value); 48 NoosferoApp.angularModule.constant(constantName, value);
20 } 49 }
21 50
  51 + /**
  52 + * @ngdoc method
  53 + * @name addService
  54 + * @methodOf NoosferoApp
  55 + * @param {string} serviceName the service name
  56 + * @param {any} value the service value
  57 + * @description adds a service to the {@link NoosferoApp#angularModule}
  58 + */
22 static addService(serviceName: string, value: any) { 59 static addService(serviceName: string, value: any) {
23 NoosferoApp.angularModule.service(serviceName, value); 60 NoosferoApp.angularModule.service(serviceName, value);
24 } 61 }
25 62
  63 + /**
  64 + * @ngdoc method
  65 + * @name addFactory
  66 + * @methodOf NoosferoApp
  67 + * @param {string} factoryName the factory name
  68 + * @param {any} value the factory value
  69 + * @description adds a factory to the {@link NoosferoApp#angularModule}
  70 + */
26 static addFactory(factoryName: string, value: any) { 71 static addFactory(factoryName: string, value: any) {
27 NoosferoApp.angularModule.factory(factoryName, value); 72 NoosferoApp.angularModule.factory(factoryName, value);
28 } 73 }
29 74
  75 + /**
  76 + * @ngdoc method
  77 + * @name addController
  78 + * @methodOf NoosferoApp
  79 + * @param {string} controllerName the controller name
  80 + * @param {any} value the controller value
  81 + * @description adds a controller to the {@link NoosferoApp#angularModule}
  82 + */
30 static addController(controllerName: string, value: any) { 83 static addController(controllerName: string, value: any) {
31 NoosferoApp.angularModule.controller(controllerName, value); 84 NoosferoApp.angularModule.controller(controllerName, value);
32 } 85 }
33 86
  87 + /**
  88 + * @ngdoc method
  89 + * @name run
  90 + * @methodOf NoosferoApp
  91 + * @param {Function} runFunction the function to execute
  92 + * @description runs a function using the {@link NoosferoApp#angularModule}
  93 + */
34 static run(runFunction: Function) { 94 static run(runFunction: Function) {
35 NoosferoApp.angularModule.run(runFunction); 95 NoosferoApp.angularModule.run(runFunction);
36 } 96 }
src/app/main/main.component.ts
@@ -25,6 +25,16 @@ import {Navbar} from "../components/navbar/navbar"; @@ -25,6 +25,16 @@ import {Navbar} from "../components/navbar/navbar";
25 import {MainBlock} from "../components/noosfero-blocks/main-block/main-block.component"; 25 import {MainBlock} from "../components/noosfero-blocks/main-block/main-block.component";
26 26
27 27
  28 +/**
  29 + * @ngdoc controller
  30 + * @name main.MainContent
  31 + * @requires AuthService, Session
  32 + * @descrition
  33 + * This controller actually contains the main content of Noosfero Angular Theme:
  34 + * - the navbar
  35 + * - the {@link Main} view content
  36 + *
  37 + */
28 @Component({ 38 @Component({
29 selector: 'main-content', 39 selector: 'main-content',
30 templateUrl: "app/main/main.html", 40 templateUrl: "app/main/main.html",
@@ -34,6 +44,20 @@ export class MainContent { @@ -34,6 +44,20 @@ export class MainContent {
34 44
35 } 45 }
36 46
  47 +/**
  48 + * @ngdoc controller
  49 + * @name main.Main
  50 + * @requires AuthService, Session, Notification, ArticleBlog, ArticleView, Boxes, Block, LinkListBlock,
  51 + * MainBlock, RecentDocumentsBlock, Navbar, ProfileImageBlock, MembersBlock,
  52 + * NoosferoTemplate, DateFormat, RawHTMLBlock
  53 + * @description
  54 + * The Main controller for the Noosfero Angular Theme application.
  55 + *
  56 + * The main route '/' is defined as the URL for this controller, which routes
  57 + * requests to the {@link main.MainContent} controller and also, the '/profile' route,
  58 + * which routes requests to the {@link profile.Profile} controller. See {@link profile.Profile}
  59 + * for more details on how various Noosfero profiles are rendered.
  60 + */
37 @Component({ 61 @Component({
38 selector: 'main', 62 selector: 'main',
39 template: '<div ng-view></div>', 63 template: '<div ng-view></div>',
src/app/models/interfaces.ts
@@ -10,13 +10,53 @@ export interface Article { @@ -10,13 +10,53 @@ export interface Article {
10 id: number; 10 id: number;
11 } 11 }
12 12
  13 +/**
  14 + * @ngdoc interface
  15 + * @name models.Profile
  16 + * @description
  17 + * A representation of a Noosfero Profile.
  18 + */
13 export interface Profile { 19 export interface Profile {
  20 +
  21 + /**
  22 + * @ngdoc property
  23 + * @name id
  24 + * @propertyOf models.Profile
  25 + * @returns {number} The Profile id
  26 + */
14 id: number; 27 id: number;
  28 +
  29 + /**
  30 + * @ngdoc property
  31 + * @name identifier
  32 + * @propertyOf models.Profile
  33 + * @returns {string} The unque identifier for the Profile
  34 + */
15 identifier: string; 35 identifier: string;
  36 +
  37 + /**
  38 + * @ngdoc property
  39 + * @name type
  40 + * @propertyOf models.Profile
  41 + * @returns {string} The Profile type (e.g.: "Person", etc.)
  42 + */
16 type: string; 43 type: string;
17 } 44 }
18 45
  46 +
  47 +/**
  48 + * @ngdoc interface
  49 + * @name models.Person
  50 + * @description
  51 + * A representation of a Person in Noosfero.
  52 + */
19 export interface Person extends Profile { 53 export interface Person extends Profile {
  54 + /**
  55 + * @ngdoc property
  56 + * @name id
  57 + * @propertyOf models.Person
  58 + * @returns {number} The Person id
  59 + */
20 id: number; 60 id: number;
21 } 61 }
22 62
@@ -52,7 +92,19 @@ export interface Box { @@ -52,7 +92,19 @@ export interface Box {
52 position: number; 92 position: number;
53 } 93 }
54 94
  95 +/**
  96 + * @ngdoc interface
  97 + * @name models.Activity
  98 + * @description
  99 + * A representation of a {@link models.Profile} activity in Noosfero.
  100 + */
55 export interface Activity { 101 export interface Activity {
  102 + /**
  103 + * @ngdoc property
  104 + * @name verb
  105 + * @propertyOf models.Activity
  106 + * @returns {string} The activity verb.
  107 + */
56 verb: string; 108 verb: string;
57 } 109 }
58 110
src/app/profile/profile.component.ts
@@ -10,6 +10,12 @@ import {Notification} from &quot;../components/notification/notification.component&quot;; @@ -10,6 +10,12 @@ import {Notification} from &quot;../components/notification/notification.component&quot;;
10 10
11 import * as noosferoModels from "./../models/interfaces"; 11 import * as noosferoModels from "./../models/interfaces";
12 12
  13 +/**
  14 + * @ngdoc controller
  15 + * @name profile.Profile
  16 + * @description
  17 + * This is the profile controller. It provide routes to supported Noosfero Profiles.
  18 + */
13 @Component({ 19 @Component({
14 selector: 'profile', 20 selector: 'profile',
15 templateUrl: "app/profile/profile.html", 21 templateUrl: "app/profile/profile.html",