diff --git a/src/assets/logo_markdown_template.svg b/src/assets/logo_markdown_template.svg new file mode 100644 index 0000000000..865a71372e --- /dev/null +++ b/src/assets/logo_markdown_template.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/src/assets/logo_markdown_template_old2.svg b/src/assets/logo_markdown_template_old2.svg new file mode 100644 index 0000000000..9175aef11e --- /dev/null +++ b/src/assets/logo_markdown_template_old2.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/logo_markdown_templateold.svg b/src/assets/logo_markdown_templateold.svg new file mode 100644 index 0000000000..d173cbec65 --- /dev/null +++ b/src/assets/logo_markdown_templateold.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/documentation/documentation-management.component.ts b/src/components/documentation/documentation-management.component.ts index d5c2efe4b6..a4ef54f331 100644 --- a/src/components/documentation/documentation-management.component.ts +++ b/src/components/documentation/documentation-management.component.ts @@ -15,7 +15,12 @@ */ import NotificationService from '../../services/notification.service'; -import DocumentationService, {DocumentationQuery, FolderSituation, SystemFolderName} from '../../services/documentation.service'; +import DocumentationService, { + DocumentationQuery, + FolderSituation, + PageType, + SystemFolderName +} from '../../services/documentation.service'; import {StateService} from '@uirouter/core'; import _ = require('lodash'); import {IScope} from 'angular'; @@ -53,12 +58,20 @@ const DocumentationManagementComponent: ng.IComponentOptions = { this.systemFoldersById = _.keyBy(this.systemFolders, 'id'); this.currentFolder = this.getFolder(this.rootDir); - this.supportedTypes = DocumentationService.supportedTypes(this.getFolderSituation(this.rootDir)); + this.supportedTypes = DocumentationService + .supportedTypes(this.getFolderSituation(this.rootDir)) + .filter(type => !this.apiId || type !== PageType.MARKDOWN_TEMPLATE); this.breadcrumb = this.generateBreadcrumb(); $scope.renameFolder = false; $scope.translateFolder = false; }; + this.isFolder = (type: string): boolean => PageType.FOLDER === type; + this.isLink = (type: string): boolean => PageType.LINK === type; + this.isSwagger = (type: string): boolean => PageType.SWAGGER === type; + this.isMarkdown = (type: string): boolean => PageType.MARKDOWN === type; + this.isMarkdownTemplate = (type: string): boolean => PageType.MARKDOWN_TEMPLATE === type; + this.getFolderSituation = (folderId: string) => { if (!folderId) { return FolderSituation.ROOT; @@ -302,7 +315,10 @@ const DocumentationManagementComponent: ng.IComponentOptions = { } else { page.published = !page.published; DocumentationService.partialUpdate('published', page.published, page.id, this.apiId).then( () => { - NotificationService.show('Page ' + page.name + ' has been ' + (page.published ? '' : 'un') + 'published with success'); + const message = this.isMarkdownTemplate(page.type) ? + 'Template ' + page.name + ' has been made ' + (page.published ? '' : 'un') + 'available with success' + : 'Page ' + page.name + ' has been ' + (page.published ? '' : 'un') + 'published with success'; + NotificationService.show(message); }); } }; diff --git a/src/components/documentation/documentation-management.html b/src/components/documentation/documentation-management.html index a89e250b8e..cc6ba77b60 100644 --- a/src/components/documentation/documentation-management.html +++ b/src/components/documentation/documentation-management.html @@ -110,7 +110,7 @@

- +
- - Publish this page + + {{$ctrl.isMarkdownTemplate(page.type) ? 'Make template available' : 'Publish this page'}} + - - Unpublish this page + + {{$ctrl.isMarkdownTemplate(page.type) ? 'Make template unavailable' : 'Unpublish this page'}} + diff --git a/src/components/documentation/edit-page.component.ts b/src/components/documentation/edit-page.component.ts index e1b7b45588..6341c48bb3 100644 --- a/src/components/documentation/edit-page.component.ts +++ b/src/components/documentation/edit-page.component.ts @@ -15,7 +15,11 @@ */ import NotificationService from '../../services/notification.service'; -import DocumentationService, { FolderSituation, SystemFolderName } from '../../services/documentation.service'; +import DocumentationService, { + FolderSituation, + PageType, + SystemFolderName +} from '../../services/documentation.service'; import { StateService } from '@uirouter/core'; import { IScope } from 'angular'; import UserService from '../../services/user.service'; @@ -126,6 +130,13 @@ const EditPageComponent: ng.IComponentOptions = { }; + this.isFolder = (): boolean => PageType.FOLDER === this.page.type; + this.isLink = (): boolean => PageType.LINK === this.page.type; + this.isSwagger = (): boolean => PageType.SWAGGER === this.page.type; + this.isMarkdown = (): boolean => PageType.MARKDOWN === this.page.type; + this.isMarkdownTemplate = (): boolean => PageType.MARKDOWN_TEMPLATE === this.page.type; + + this.usedAsGeneralConditions = () => { return this.page.generalConditions; }; @@ -143,7 +154,7 @@ const EditPageComponent: ng.IComponentOptions = { parentId: this.page.id, configuration: {} }; - if (this.page.type === 'MARKDOWN' || this.page.type === 'SWAGGER') { + if (this.isMarkdown() || this.isSwagger() || this.isMarkdownTemplate()) { this.currentTranslation.configuration.inheritContent = 'true'; } }; diff --git a/src/components/documentation/edit-page.html b/src/components/documentation/edit-page.html index e07a823774..76dc1e7c05 100644 --- a/src/components/documentation/edit-page.html +++ b/src/components/documentation/edit-page.html @@ -20,7 +20,7 @@

{{$ctrl.page.name}}

- + Inherited @@ -35,7 +35,7 @@

{{$ctrl.page.name}}

class="md-raised md-primary" ng-click="$ctrl.toggleRename()" aria-label="Rename" - ng-if="'LINK' !== $ctrl.page.type || ('LINK' === $ctrl.page.type && (!$ctrl.page.configuration.inherit || $ctrl.page.configuration.inherit === 'false')) "> + ng-if="!$ctrl.isLink() || ($ctrl.isLink() && (!$ctrl.page.configuration.inherit || $ctrl.page.configuration.inherit === 'false')) "> Rename {{$ctrl.page.name}}

-
+

@@ -250,7 +250,7 @@

-
+

@@ -266,7 +266,7 @@

-
+