From 02102f9bf3a0772e82b4af34ec717941ad9a814c Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Wed, 12 Dec 2018 13:35:16 +0000 Subject: [PATCH] Provide icon rendering framework --- gui/app/components/spaces/space-list.js | 45 +--- gui/app/components/ui/ui-spacer.js | 47 ++++ gui/app/constants/constants.js | 19 ++ gui/app/pods/auth/login/template.hbs | 2 +- gui/app/pods/folders/controller.js | 25 ++ gui/app/pods/folders/route.js | 28 +- gui/app/pods/folders/template.hbs | 34 ++- gui/app/styles/core/all.scss | 7 +- gui/app/styles/core/base.scss | 196 -------------- gui/app/styles/core/icon.scss | 34 +-- gui/app/styles/core/layout/all.scss | 8 +- .../core/layout/{common.scss => grid.scss} | 64 +++-- gui/app/styles/core/layout/headings.scss | 12 + gui/app/styles/core/layout/sidebar.scss | 59 +++++ gui/app/styles/core/layout/spacing.scss | 71 +++++ gui/app/styles/core/mixins.scss | 13 +- gui/app/styles/core/reset.scss | 57 ++++ gui/app/styles/core/text.scss | 42 +++ gui/app/styles/core/util.scss | 88 ++++++ gui/app/styles/core/view/spaces.scss | 123 ++++++--- .../components/customize/change-log.hbs | 12 +- .../components/customize/general-settings.hbs | 2 +- .../customize/integration-settings.hbs | 2 +- .../components/customize/license-key.hbs | 2 +- .../components/customize/user-list.hbs | 250 +++++++++--------- .../components/document/settings-general.hbs | 2 +- .../components/document/settings-meta.hbs | 2 +- .../components/document/view-attachment.hbs | 2 +- .../components/document/view-content.hbs | 4 +- .../components/folder/documents-list.hbs | 2 +- .../components/folder/settings-category.hbs | 2 +- .../folder/settings-permissions.hbs | 6 +- .../components/folder/space-view.hbs | 2 +- .../components/layout/master-sidebar.hbs | 16 +- .../templates/components/layout/top-bar.hbs | 6 +- .../components/search/search-results.hbs | 2 +- .../components/section/jira/type-editor.hbs | 4 +- .../components/section/trello/type-editor.hbs | 2 +- .../components/spaces/space-list.hbs | 70 ++--- .../components/toolbar/for-space.hbs | 2 +- gui/app/templates/components/ui/ui-spacer.hbs | 0 .../components/user/forgot-password.hbs | 2 +- .../components/user/password-reset.hbs | 2 +- gui/public/assets/font/dmzui.eot | Bin 14432 -> 13904 bytes gui/public/assets/font/dmzui.svg | 27 +- gui/public/assets/font/dmzui.ttf | Bin 14276 -> 13748 bytes gui/public/assets/font/dmzui.woff | Bin 7508 -> 7332 bytes gui/public/assets/font/dmzui.woff2 | Bin 6100 -> 6004 bytes 48 files changed, 851 insertions(+), 546 deletions(-) create mode 100644 gui/app/components/ui/ui-spacer.js delete mode 100644 gui/app/styles/core/base.scss rename gui/app/styles/core/layout/{common.scss => grid.scss} (54%) create mode 100644 gui/app/styles/core/layout/headings.scss create mode 100644 gui/app/styles/core/layout/sidebar.scss create mode 100644 gui/app/styles/core/layout/spacing.scss create mode 100644 gui/app/styles/core/reset.scss create mode 100644 gui/app/styles/core/text.scss create mode 100644 gui/app/styles/core/util.scss create mode 100644 gui/app/templates/components/ui/ui-spacer.hbs diff --git a/gui/app/components/spaces/space-list.js b/gui/app/components/spaces/space-list.js index 14178693..9429c89f 100644 --- a/gui/app/components/spaces/space-list.js +++ b/gui/app/components/spaces/space-list.js @@ -9,51 +9,8 @@ // // https://documize.com -import NotifierMixin from '../../mixins/notifier'; import AuthMixin from '../../mixins/auth'; import Component from '@ember/component'; -export default Component.extend(NotifierMixin, AuthMixin, { - hasPublicFolders: false, - hasProtectedFolders: false, - hasPrivateFolders: false, - - init() { - this._super(...arguments); - this.publicFolders = []; - this.protectedFolders = []; - this.privateFolders = []; - }, - - didReceiveAttrs() { - this._super(...arguments); - - let constants = this.get('constants'); - let folders = this.get('spaces'); - let publicFolders = []; - let protectedFolders = []; - let privateFolders = []; - - _.each(folders, folder => { - if (folder.get('spaceType') === constants.SpaceType.Public) { - publicFolders.pushObject(folder); - } - if (folder.get('spaceType') === constants.SpaceType.Private) { - privateFolders.pushObject(folder); - } - if (folder.get('spaceType') === constants.SpaceType.Protected) { - protectedFolders.pushObject(folder); - } - }); - - this.set('publicFolders', publicFolders); - this.set('protectedFolders', protectedFolders); - this.set('privateFolders', privateFolders); - this.set('hasPublicFolders', this.get('publicFolders.length') > 0); - this.set('hasPrivateFolders', this.get('privateFolders.length') > 0); - this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0); - }, - - actions: { - } +export default Component.extend(AuthMixin, { }); diff --git a/gui/app/components/ui/ui-spacer.js b/gui/app/components/ui/ui-spacer.js new file mode 100644 index 00000000..6469b559 --- /dev/null +++ b/gui/app/components/ui/ui-spacer.js @@ -0,0 +1,47 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import { computed } from '@ember/object'; +import Component from '@ember/component'; + +export default Component.extend({ + classNames: [], + classNameBindings: ['calcClass'], + + size: 500, + + calcClass: computed(function() { + switch(this.size) { + case 100: + return 'spacer-100'; + + case 200: + return 'spacer-200'; + + case 300: + return 'spacer-300'; + + case 400: + return 'spacer-400'; + + case 500: + return 'spacer-500'; + + case 600: + return 'spacer-600'; + + case 700: + return 'spacer-700'; + } + + return 'spacer-100'; + }), +}); diff --git a/gui/app/constants/constants.js b/gui/app/constants/constants.js index 66e77bf7..108ae893 100644 --- a/gui/app/constants/constants.js +++ b/gui/app/constants/constants.js @@ -195,11 +195,30 @@ let constants = EmberObject.extend({ }, Icon: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects + All: 'dicon-menu-8', + ArrowUp: 'dicon-arrow-up', + ArrowDown: 'dicon-arrow-down', + ArrowLeft: 'dicon-arrow-left', + ArrowRight: 'dicon-arrow-right', + Attachment: 'dicon-attachment', + BarChart: 'dicon-chart-bar-2', + Bookmark: 'dicon-bookmark', Delete: 'dicon-bin', + Edit: 'dicon-pen-2', + Filter: 'dicon-sort-tool', + Grid1: 'dicon-grid-interface', + Index: 'dicon-align-justify', + ListBullet: 'dicon-list-bullet-2', Print: 'dicon-print', + Pulse: 'dicon-pulse', Plus: 'dicon-e-add', Person: 'dicon-single-01', + People: 'dicon-multiple-19', + Remove: 'dicon-i-remove', + Search: 'dicon-magnifier', Settings: 'dicon-settings-gear', + Tag: 'dicon-delete-key', + World: 'dicon-globe', }, Color: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects diff --git a/gui/app/pods/auth/login/template.hbs b/gui/app/pods/auth/login/template.hbs index 75eaeb72..eca653c7 100644 --- a/gui/app/pods/auth/login/template.hbs +++ b/gui/app/pods/auth/login/template.hbs @@ -26,7 +26,7 @@ {{input type="password" value=password id="authPassword" class="form-control" autocomplete="current-password"}} {{/if}} - +
Invalid credentials
{{#if isAuthProviderDocumize}} {{#link-to "auth.forgot"}}Forgot your password?{{/link-to}} diff --git a/gui/app/pods/folders/controller.js b/gui/app/pods/folders/controller.js index 186f87e4..ab096d4f 100644 --- a/gui/app/pods/folders/controller.js +++ b/gui/app/pods/folders/controller.js @@ -27,6 +27,12 @@ export default Controller.extend(AuthMixin, Modals, { hasClone: notEmpty('clonedSpace.id'), clonedSpace: null, + selectedView: 'all', + selectedSpaces: null, + publicSpaces: null, + protectedSpaces: null, + personalSpaces: null, + actions: { onShowModal() { this.modalOpen('#add-space-modal', {'show': true}, '#new-space-name'); @@ -65,6 +71,25 @@ export default Controller.extend(AuthMixin, Modals, { this.get('folderService').setCurrentFolder(sp); this.transitionToRoute('folder', sp.get('id'), sp.get('slug')); }); + }, + + onSelect(view) { + this.set('selectedView', view); + + switch(view) { + case 'all': + this.set('selectedSpaces', this.get('model')); + break; + case 'public': + this.set('selectedSpaces', this.get('publicSpaces')); + break; + case 'protected': + this.set('selectedSpaces', this.get('protectedSpaces')); + break; + case 'personal': + this.set('selectedSpaces', this.get('personalSpaces')); + break; + } } } }); diff --git a/gui/app/pods/folders/route.js b/gui/app/pods/folders/route.js index 8864538d..60d563d0 100644 --- a/gui/app/pods/folders/route.js +++ b/gui/app/pods/folders/route.js @@ -29,7 +29,33 @@ export default Route.extend(AuthenticatedRouteMixin, { return this.get('folderService').getAll(); }, + setupController(controller, model) { + this._super(controller, model); + controller.set('selectedSpaces', model); + + let constants = this.get('constants'); + let publicSpaces = []; + let protectedSpaces = []; + let personalSpaces = []; + + _.each(model, space => { + if (space.get('spaceType') === constants.SpaceType.Public) { + publicSpaces.pushObject(space); + } + if (space.get('spaceType') === constants.SpaceType.Private) { + personalSpaces.pushObject(space); + } + if (space.get('spaceType') === constants.SpaceType.Protected) { + protectedSpaces.pushObject(space); + } + }); + + controller.set('publicSpaces', publicSpaces); + controller.set('protectedSpaces', protectedSpaces); + controller.set('personalSpaces', personalSpaces); + }, + activate() { this.get('browser').setTitle('Spaces'); - } + } }); diff --git a/gui/app/pods/folders/template.hbs b/gui/app/pods/folders/template.hbs index 756dda08..fdaf7134 100644 --- a/gui/app/pods/folders/template.hbs +++ b/gui/app/pods/folders/template.hbs @@ -1,4 +1,33 @@ {{#layout/master-sidebar selectedItem="spaces"}} + + {{#unless session.isMobile}} + {{ui/ui-spacer size=300}} + {{/unless}} + +
+
filter
+
+
+ +
All ({{model.length}})
+
+
+ +
Public ({{publicSpaces.length}})
+
+ {{#if session.authenticated}} +
+ +
Protected ({{protectedSpaces.length}})
+
+
+ +
Personal ({{personalSpaces.length}})
+
+ {{/if}} +
+
+ {{/layout/master-sidebar}} {{#layout/master-content}} @@ -7,7 +36,7 @@ {{layout/page-heading title=appMeta.title}} {{layout/page-desc desc=appMeta.message}} -
+
{{#if (or session.isEditor session.isAdmin)}} {{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}} {{#if session.isEditor}} @@ -21,8 +50,9 @@
+ {{ui/ui-spacer size=400}} - {{spaces/space-list spaces=model}} + {{spaces/space-list spaces=selectedSpaces}} \ No newline at end of file diff --git a/gui/app/templates/components/customize/integration-settings.hbs b/gui/app/templates/components/customize/integration-settings.hbs index 24542f8a..50c181aa 100644 --- a/gui/app/templates/components/customize/integration-settings.hbs +++ b/gui/app/templates/components/customize/integration-settings.hbs @@ -46,7 +46,7 @@ {{/if}} -
Save
+
Save
\ No newline at end of file diff --git a/gui/app/templates/components/customize/license-key.hbs b/gui/app/templates/components/customize/license-key.hbs index 73e401cb..af1543d2 100644 --- a/gui/app/templates/components/customize/license-key.hbs +++ b/gui/app/templates/components/customize/license-key.hbs @@ -139,7 +139,7 @@

Let us know if you would like to close your account or cancel your subscription.

-

WARNING: All data will be deleted so please download a complete backup of all your data.

+

WARNING: All data will be deleted so please download a complete backup of all your data.

Requests can take up to 24 hours to process.

{{#link-to "customize.backup" class="btn btn-success"}}PERFORM BACKUP{{/link-to}}
diff --git a/gui/app/templates/components/customize/user-list.hbs b/gui/app/templates/components/customize/user-list.hbs index 720354f2..02a90b1f 100644 --- a/gui/app/templates/components/customize/user-list.hbs +++ b/gui/app/templates/components/customize/user-list.hbs @@ -1,37 +1,38 @@
{{#if isAuthProviderKeycloak}} - {{#if syncInProgress}} -
Keycloak user sync running...
- {{else}} -
Sync with Keycloak
- {{/if}} + {{#if syncInProgress}} +
Keycloak user sync running...
+ {{else}} +
Sync with Keycloak
+ {{/if}} {{/if}} {{#if isAuthProviderLDAP}} - {{#if syncInProgress}} -
LDAP user sync running...
- {{else}} -
Sync with LDAP
- {{/if}} + {{#if syncInProgress}} +
LDAP user sync running...
+ {{else}} +
Sync with LDAP
+ {{/if}} {{/if}}
- Spaces + Spaces   — can add spaces, both personal and shared with others
- Visible -   — can see names of users and groups, can disable for external users like customers/partners + Visible +   — can see names of users and groups, can disable for external users + like customers/partners
- Admin + Admin   — can manage all aspects of Documize, like this screen
- Analytics + Analytics   — can view analytical reports
- Active + Active   — can login and use Documize
@@ -78,7 +79,8 @@ {{#if hasSelectedUsers}} - + {{/if}} Spaces @@ -92,83 +94,86 @@ {{#each users key="id" as |user|}} - - -
- {{#if user.me}} - check_box_outline_blank - {{else if user.selected}} - check_box + + +
+ {{#if user.me}} + check_box_outline_blank + {{else if user.selected}} + check_box + {{else}} + check_box_outline_blank + {{/if}} +
+
+
{{user.fullname}} +
+
+ {{#each user.groups as |group|}} + + {{group.name}}{{#if (not-eq group user.groups.lastObject)}}, {{/if}} + {{else}} - check_box_outline_blank - {{/if}} + <no groups> + {{/each}}
-
-
{{user.fullname}}
-
- {{#each user.groups as |group|}} - - {{group.name}}{{#if (not-eq group user.groups.lastObject)}}, {{/if}} - - {{else}} - <no groups> - {{/each}} -
-
- - - {{#if user.editor}} - check_box - {{else}} - check_box_outline_blank - {{/if}} - - - {{#if user.viewUsers}} - check_box - {{else}} - check_box_outline_blank - {{/if}} - - - {{#if user.me}} - check_box - {{else if user.admin}} - check_box - {{else}} - check_box_outline_blank - {{/if}} - - - {{#if user.analytics}} - check_box - {{else}} - check_box_outline_blank - {{/if}} - - - {{#if user.me}} - check_box - {{else if user.active}} - check_box - {{else}} - check_box_outline_blank - {{/if}} - - -
- mode_edit - {{#attach-tooltip showDelay=1000}}Edit user{{/attach-tooltip}} -
- {{#unless user.me}} -
-
- delete - {{#attach-tooltip showDelay=1000}}Delete user{{/attach-tooltip}} -
- {{/unless}} - - +
+ + + {{#if user.editor}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + + + {{#if user.viewUsers}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + + + {{#if user.me}} + check_box + {{else if user.admin}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + + + {{#if user.analytics}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + + + {{#if user.me}} + check_box + {{else if user.active}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + + +
+ mode_edit + {{#attach-tooltip showDelay=1000}}Edit user{{/attach-tooltip}} +
+ {{#unless user.me}} +
+
+ delete + {{#attach-tooltip showDelay=1000}}Delete user{{/attach-tooltip}} +
+ {{/unless}} + + {{/each}} @@ -193,22 +198,22 @@ {{input id="edit-email" type="text" class="form-control" value=editUser.email}}
{{#if isAuthProviderDocumize}} -
-
-
- - {{input id="edit-password" type="password" class="form-control" value=password.password}} - Optional new password -
-
-
-
- - {{input id="edit-confirmPassword" type="password" class="form-control" value=password.confirmation}} - Confirm new password -
+
+
+
+ + {{input id="edit-password" type="password" class="form-control" value=password.password}} + Optional new password
+
+
+ + {{input id="edit-confirmPassword" type="password" class="form-control" value=password.confirmation}} + Confirm new password +
+
+
{{/if}}
@@ -220,8 +225,9 @@
-{{#ui/ui-dialog title="Delete User" confirmCaption="Delete" buttonType="btn-danger" show=showDeleteDialog onAction=(action "onDelete")}} -

Are you sure you want to delete {{deleteUser.fullname}}?

+{{#ui/ui-dialog title="Delete User" confirmCaption="Delete" buttonType="btn-danger" show=showDeleteDialog +onAction=(action "onDelete")}} +

Are you sure you want to delete {{deleteUser.fullname}}?

{{/ui/ui-dialog}}
-
\ No newline at end of file +
diff --git a/gui/app/templates/components/document/settings-general.hbs b/gui/app/templates/components/document/settings-general.hbs index bb252a36..ed03ab0b 100644 --- a/gui/app/templates/components/document/settings-general.hbs +++ b/gui/app/templates/components/document/settings-general.hbs @@ -15,7 +15,7 @@ Optional description explaining content
- +
diff --git a/gui/app/templates/components/document/settings-meta.hbs b/gui/app/templates/components/document/settings-meta.hbs index eb245c65..4de916ef 100644 --- a/gui/app/templates/components/document/settings-meta.hbs +++ b/gui/app/templates/components/document/settings-meta.hbs @@ -25,6 +25,6 @@

This space has no categories defined yet.

{{/unless}} - + diff --git a/gui/app/templates/components/document/view-attachment.hbs b/gui/app/templates/components/document/view-attachment.hbs index 7f10ae9e..c55aab41 100644 --- a/gui/app/templates/components/document/view-attachment.hbs +++ b/gui/app/templates/components/document/view-attachment.hbs @@ -1,7 +1,7 @@
{{#if canEdit}}
-
+ Attachments
+
+ Attachments
{{else}}
diff --git a/gui/app/templates/components/document/view-content.hbs b/gui/app/templates/components/document/view-content.hbs index f6f6285f..c0f16aa6 100644 --- a/gui/app/templates/components/document/view-content.hbs +++ b/gui/app/templates/components/document/view-content.hbs @@ -47,8 +47,8 @@ {{folder.likes}}
-    - +    +
{{else}}
Thanks for the feedback!
diff --git a/gui/app/templates/components/folder/documents-list.hbs b/gui/app/templates/components/folder/documents-list.hbs index 5a1fa0bb..5fc7a5b5 100644 --- a/gui/app/templates/components/folder/documents-list.hbs +++ b/gui/app/templates/components/folder/documents-list.hbs @@ -8,7 +8,7 @@
{{ document.excerpt }}
{{folder/document-tags documentTags=document.tags}} {{#if (not-eq document.lifecycle constants.Lifecycle.Live)}} - + {{/if}} {{/link-to}} diff --git a/gui/app/templates/components/folder/settings-category.hbs b/gui/app/templates/components/folder/settings-category.hbs index 522d27a9..1224d1c6 100644 --- a/gui/app/templates/components/folder/settings-category.hbs +++ b/gui/app/templates/components/folder/settings-category.hbs @@ -5,7 +5,7 @@
{{focus-input id="new-category-name" type="text" class="form-control mousetrap" placeholder="Category name" value=newCategory}}
- +
diff --git a/gui/app/templates/components/folder/settings-permissions.hbs b/gui/app/templates/components/folder/settings-permissions.hbs index 694d7f37..d28641f6 100644 --- a/gui/app/templates/components/folder/settings-permissions.hbs +++ b/gui/app/templates/components/folder/settings-permissions.hbs @@ -4,9 +4,9 @@
- +    - +
@@ -88,7 +88,7 @@
- +
diff --git a/gui/app/templates/components/folder/space-view.hbs b/gui/app/templates/components/folder/space-view.hbs index c6dd3a20..f41a6083 100644 --- a/gui/app/templates/components/folder/space-view.hbs +++ b/gui/app/templates/components/folder/space-view.hbs @@ -29,7 +29,7 @@ {{#if spaceSettings}}
- {{#link-to "folder.settings" space.id space.slug (query-params tab="categories") class="btn btn-secondary font-weight-bold"}}{{categoryLinkName}}{{/link-to}} + {{#link-to "folder.settings" space.id space.slug (query-params tab="categories") class="btn btn-secondary bold-700"}}{{categoryLinkName}}{{/link-to}}
{{/if}}
\ No newline at end of file diff --git a/gui/app/templates/components/layout/master-sidebar.hbs b/gui/app/templates/components/layout/master-sidebar.hbs index 5aeb2bf2..4b62075a 100644 --- a/gui/app/templates/components/layout/master-sidebar.hbs +++ b/gui/app/templates/components/layout/master-sidebar.hbs @@ -2,29 +2,29 @@