Merge Request #39

Merged
noosfero-themes/angular-theme!39
Created by Ábner Oliveira

Design mode - Added 'inDesign' Toggler

Added 'inDesign' Toggler to allow users with permission to edit to profile to change the profile layout dispositions and customizations

issue #91

Assignee: Michel Felipe
Milestone: 2016.06

Merged by Ábner Oliveira

Source branch has been removed
Commits (7)
2 participants
  • Me
    Michel Felipe @mfdeveloper

    Reassigned to @mfdeveloper

    Choose File ...   File name...
    Cancel
  • Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/admin/layout-edit/designModeToggler.component.spec.ts 0 → 100644
      3 +import {DesignModeTogglerComponent} from './designModeToggler.component';
      4 +import {DesignModeService} from './designMode.service';
      5 +
      6 +describe('DesignModeToggler Component', () => {
      7 + const htmlTemplate: string = '<noosfero-design-toggler></noosfero-design-toggler>';
      8 +
      9 + let helper: ComponentTestHelper<DesignModeTogglerComponent>;
      10 + beforeEach(() => {
      11 + angular.mock.module('templates');
      12 + angular.mock.module('ngSanitize');
      13 + angular.mock.module('toggle-switch');
      14 + });
      15 +
      16 + let designModeService: DesignModeService;
      17 + beforeEach((done) => {
      18 + designModeService = new DesignModeService();
    2
    • Me
      Michel Felipe @mfdeveloper (Edited )

      Pq não utilizar um mock deste serviço nesse teste? Algum motivo em especial? Em linhas gerais, temos mocado todas as dependências nos outros testes, correto?

      Talvez seja interessante padronizar uma abordagem geral, para que todos nós saibamos quando (ou não) utilizar mocks para as dependências. Principalmente nesse caso q este serviço utiliza um EventEmitter internamente :)

      Choose File ...   File name...
      Cancel
    • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
      Ábner Oliveira @abner

      a idéia é fazer mock das dependências e não do próprio componente "under test". Nesse caso como ele não tem dependências não precisei criar mocks. Apenas utilizei "stubs" onde precisei

      Choose File ...   File name...
      Cancel
    Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/admin/layout-edit/designModeToggler.component.ts 0 → 100644
      1 +import {Component, Inject} from 'ng-forward';
      2 +import {DesignModeService} from './designMode.service';
      3 +@Component({
      4 + selector: 'noosfero-design-toggler',
      5 + templateUrl: 'app/admin/layout-edit/designModeToggler.html'
      6 +})
      7 +@Inject(DesignModeService)
      8 +export class DesignModeTogglerComponent {
      9 +
      10 + icon: string = "&nbsp;<i class='glyphicon glyphicon-wrench'></i>&nbsp;";
    2
    • Me
      Michel Felipe @mfdeveloper

      Não seria mais interessante passar somente as classes css aq neste atributo e mover o HTML para o template? Me pareceu meio "poluído" este HTML dentro do componente.

      Choose File ...   File name...
      Cancel
    • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
      Ábner Oliveira @abner

      OK, Feito

      Choose File ...   File name...
      Cancel
    Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/admin/layout-edit/designModeToggler.component.ts 0 → 100644
      2 +import {DesignModeService} from './designMode.service';
      3 +@Component({
      4 + selector: 'noosfero-design-toggler',
      5 + templateUrl: 'app/admin/layout-edit/designModeToggler.html'
      6 +})
      7 +@Inject(DesignModeService)
      8 +export class DesignModeTogglerComponent {
      9 +
      10 + icon: string = "&nbsp;<i class='glyphicon glyphicon-wrench'></i>&nbsp;";
      11 +
      12 + constructor(private designModeService: DesignModeService) {
      13 + }
      14 +
      15 + private _inDesignMode: boolean = false;
      16 +
      17 + get inDesignMode(): boolean {
    2
    • Me
      Michel Felipe @mfdeveloper

      Outros componentes que quiserem utilizar o serviço DesignModeService precisariam criar um get/set dessa forma?

      Choose File ...   File name...
      Cancel
    • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
      Ábner Oliveira @abner

      Não. utilizado apenas para bind com o componente visual

      Choose File ...   File name...
      Cancel
    Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/layout/navbar/navbar.html
    26 26 <span ng-bind="ctrl.currentUser.person.name"></span> <b class="caret"></b>
    27 27 </a>
    28 28 <ul class="dropdown-menu" uib-dropdown-menu>
    29   - <li>
    3
    Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/layout/scss/_layout.scss
    35 35 padding: 0 20px 20px 20px;
    36 36 }
    37 37 }
      38 +
      39 +
      40 +body.noosfero-design-on {
      41 +
      42 + div.content-wrapper {
      43 + opacity: 0.5;
      44 + }
      45 +}
      46 +
      47 +ul.nav > li.toggler-container {
    2
    Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/layout/scss/skins/_whbl.scss
    289 289 .pace .pace-progress {
    290 290 background-color: #fff;
    291 291 }
      292 +
      293 + noosfero-design-toggler .ats-switch .knob i {
    2
    Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/profile/profile-toolbar.component.ts 0 → 100644
      1 +import {Component, Inject, provide} from "ng-forward";
      2 +import {ProfileService} from "../../lib/ng-noosfero-api/http/profile.service";
      3 +
      4 +@Component({
      5 + selector: "profile-toolbar",
      6 + templateUrl: "app/profile/toolbar.html",
      7 + providers: [
      8 + provide('profileService', { useClass: ProfileService })
      9 + ]
      10 +})
      11 +@Inject(ProfileService)
      12 +export class ProfileToolbarComponent {
    2
    • Me
      Michel Felipe @mfdeveloper

      Essa nova toolbar é especifica do profile ou do contexto geral da aplicação? Ela só será exibida ao acessar profiles (pessoas, comunidades...) ?

      Choose File ...   File name...
      Cancel
    • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
      Ábner Oliveira @abner

      A idéia é que possa apresentar botões relativos aos profiles e de contexto geral. No momento existe apenas um botão (toggler) que é comum mas a idéia é ter opções diferenciadas se for profile ou se for environment

      Segui o que é feito com o navbar-actions.

      Choose File ...   File name...
      Cancel
    Me
    Michel Felipe started a discussion on the diff
    last updated by Michel Felipe
    themes/angular-participa-consulta/app/participa-consulta.scss
    33 33 background-color: #7E7E7E;
    34 34 }
    35 35 }
      36 +
      37 +.ats-switch {
    1
    • Me
      Michel Felipe @mfdeveloper

      Subtemas deveriam sobrescrever os arquivos .scss do tema principal n? Não entendi muito bem como está essa estrutura de modificações de sass em subtemas, mas colocar tdo isso em um único sass me parece "quebrar" a organização do tema principal :(

      Choose File ...   File name...
      Cancel
    Me
    Michel Felipe started a discussion on the diff
    last updated by Ábner Oliveira
    src/app/shared/components/interfaces.ts 0 → 100644
      1 +
      2 +
      3 +export interface IComponentWithPermissions {
    2
    • Me
      Michel Felipe @mfdeveloper

      Quem usa essa interface? Não consegui encontrar o seu uso

      Choose File ...   File name...
      Cancel
    • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
      Ábner Oliveira @abner

      Para uso futuro. A idéia é ter uma interface para componentes com controles de permissões na exibição.

      Choose File ...   File name...
      Cancel
    Me
    Michel Felipe started a discussion on the outdated diff
    last updated by Michel Felipe
    src/app/shared/components/bootstrap-switcher/bootstrap-switcher.component.ts 0 → 100644
      9 + selector: 'noosfero-bootstrap-switcher',
      10 + template: `
      11 + <span class="switcher-label" ng-bind="ctrl.label | translate"></span>
      12 + <div class="btn-group switcher">
      13 + <button ng-repeat="option in ctrl.options track by $index"
      14 + (click)="ctrl.switcherClick(option)"
      15 + ng-class="ctrl.getCssClassForItem(option)"
      16 + class="btn btn-xs" ng-bind="option.label | translate">
      17 + </button>
      18 + </div>
      19 + `,
      20 + inputs: ['label', 'options', 'defaultOption'],
      21 + outputs: ['onSwitch']
      22 +})
      23 +export class BootstrapSwitcherComponent {
      24 + @Input('activeClass') activeClass: string = 'active btn-danger';
    1
    • Me
      Michel Felipe @mfdeveloper

      Pq está repetido o mesmo nome do atributo na anotação @Input() ? Por padrão ele não utiliza o mesmo nome do atributo?

      Choose File ...   File name...
      Cancel
  • Me
    Michel Felipe @mfdeveloper (Edited )

    Algumas sugestões de alteração visual:

    • O botão de toggle está com uma borda forte quando está em foco (:focus). Talvez igualar o mesmo estilo do :hover já melhore bastante!

    toggle-focus

    • Sugiro remover o gradiente da nova toolbar e ajustar a cor de fundo para um cinza claro e sucinto: #edecec

    background-grey

    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner

    Added 14 new commits:

    • a8b16135 - Fix application startup process
    • dc8c43fd - adding KNOWN ISSUES section to README.md
    • 6a66f44b - Merge branch 'master' of softwarepublico.gov.br:noosfero-themes/angular-theme
    • 63a0a102 - Fix application startup process
    • d00c6e8c - Added export comments button on comment paragraph plugin
    • ba519042 - Display button to export comments only to users with permission to edit article
    • 36e4d9d9 - Merge branch 'export-comments' into 'master'
    • f276722d - New npm config 'skin' to allow sass by theme skins
    • 04a99db3 - Merge branch 'theme-skin-yellow'
    • 69ff070c - Component to search for articles in the environment
    • 5bc45a30 - fixed pt translation
    • 575daccf - changed search.component and the search-form.component to fill the query field w…
    • d0fa7823 - Merge branch 'search' into 'master'
    • f4964918 - merge with master. fixed toolbar background-color. small fixes on BootstrapSwitcherItem
    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner

    melhorias e ajustes finos serão feitos em nova issue #95

    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner

    Status changed to closed

    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner

    Status changed to reopened

    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner
    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner
    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner

    mentioned in merge request !42

    Choose File ...   File name...
    Cancel
  • 0deafa1501ec8dd687ee70f90488d592?s=40&d=identicon
    Ábner Oliveira @abner
    Choose File ...   File name...
    Cancel
  • Me
    Michel Felipe @mfdeveloper
    Choose File ...   File name...
    Cancel