pull/7190/head
parent
f7c0d37bdb
commit
1ec96c006c
@ -0,0 +1,2 @@ |
||||
<h3 class="attributes-groupe header-text">BCF</h3> |
||||
<img src="{{workPackage.bcf.viewpoints[0]}}" *ngIf="workPackage.bcf.viewpoints.length > 0"> |
@ -0,0 +1,31 @@ |
||||
import {Component, Injector, Input, OnDestroy, OnInit} from "@angular/core"; |
||||
import {I18nService} from "core-app/modules/common/i18n/i18n.service"; |
||||
import {StateService} from "@uirouter/core"; |
||||
import {WorkPackageResource} from "core-app/modules/hal/resources/work-package-resource"; |
||||
|
||||
@Component({ |
||||
selector: 'bcf-wp-single-view', |
||||
templateUrl: './bcf-wp-single-view.component.html', |
||||
styleUrls: ['./bcf-wp-single-view.component.sass'] |
||||
}) |
||||
|
||||
export class BcfWpSingleViewComponent implements OnInit, OnDestroy { |
||||
@Input() workPackage:WorkPackageResource; |
||||
|
||||
public text = { |
||||
}; |
||||
|
||||
|
||||
constructor(public readonly state:StateService, |
||||
private readonly I18n:I18nService, |
||||
private readonly injector:Injector) { |
||||
} |
||||
|
||||
ngOnInit():void { |
||||
// TODO
|
||||
} |
||||
|
||||
ngOnDestroy():void { |
||||
// Nothing to do.
|
||||
} |
||||
} |
@ -0,0 +1,51 @@ |
||||
// -- copyright
|
||||
// OpenProject is a project management system.
|
||||
// Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License version 3.
|
||||
//
|
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
// Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// See doc/COPYRIGHT.rdoc for more details.
|
||||
// ++
|
||||
|
||||
import {NgModule} from '@angular/core'; |
||||
import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module"; |
||||
import {OpenprojectWorkPackagesModule} from "core-app/modules/work_packages/openproject-work-packages.module"; |
||||
import {BcfWpSingleViewComponent} from "core-app/modules/bcf/bcf-wp-single-view/bcf-wp-single-view.component"; |
||||
|
||||
@NgModule({ |
||||
imports: [ |
||||
OpenprojectCommonModule, |
||||
], |
||||
providers: [ |
||||
], |
||||
declarations: [ |
||||
BcfWpSingleViewComponent, |
||||
], |
||||
exports: [ |
||||
BcfWpSingleViewComponent, |
||||
], |
||||
entryComponents: [ |
||||
] |
||||
}) |
||||
export class OpenprojectBcfModule { |
||||
} |
||||
|
@ -0,0 +1,60 @@ |
||||
#-- copyright |
||||
# OpenProject Costs Plugin |
||||
# |
||||
# Copyright (C) 2009 - 2014 the OpenProject Foundation (OPF) |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# version 3. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
#++ |
||||
|
||||
require 'spec_helper' |
||||
|
||||
describe ::API::V3::WorkPackages::WorkPackageRepresenter do |
||||
include API::V3::Utilities::PathHelper |
||||
|
||||
let(:project) { FactoryBot.create(:project) } |
||||
let(:role) do |
||||
FactoryBot.create(:role, permissions: [:view_linked_issues, |
||||
:view_work_packages]) |
||||
end |
||||
let(:user) do |
||||
FactoryBot.create(:user, |
||||
member_in_project: project, |
||||
member_through_role: role) |
||||
end |
||||
let(:bcf_issue) do |
||||
FactoryBot.create(:bcf_issue) |
||||
end |
||||
let(:work_package) do |
||||
FactoryBot.create(:work_package, |
||||
project_id: project.id, |
||||
bcf_issue: bcf_issue) |
||||
end |
||||
let(:representer) do |
||||
described_class.new(work_package, |
||||
current_user: user, |
||||
embed_links: true) |
||||
end |
||||
|
||||
before(:each) do |
||||
allow(User).to receive(:current).and_return user |
||||
end |
||||
|
||||
subject(:generated) { representer.to_json } |
||||
|
||||
describe 'with BCF issues' do |
||||
it { is_expected.to have_json_path('bcf') } |
||||
it { is_expected.to have_json_path('bcf/viewpoints') } |
||||
it { is_expected.to be_json_eql(["/attachments/#{bcf_issue.viewpoints.first.id}"].to_json).at_path('bcf/viewpoints') } |
||||
end |
||||
end |
@ -0,0 +1,42 @@ |
||||
#-- copyright |
||||
# OpenProject Backlogs Plugin |
||||
# |
||||
# Copyright (C)2013-2014 the OpenProject Foundation (OPF) |
||||
# Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda |
||||
# Copyright (C)2010-2011 friflaj |
||||
# Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns |
||||
# Copyright (C)2009-2010 Mark Maglana |
||||
# Copyright (C)2009 Joe Heck, Nate Lowrie |
||||
# |
||||
# This program is free software; you can redistribute it and/or modify it under |
||||
# the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject Backlogs is a derivative work based on ChiliProject Backlogs. |
||||
# The copyright follows: |
||||
# Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj |
||||
# Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
FactoryBot.define do |
||||
factory :bcf_issue, class: ::Bcf::Issue do |
||||
after(:create) do |issue| |
||||
create(:bcf_viewpoint, issue: issue) |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,48 @@ |
||||
#-- copyright |
||||
# OpenProject Backlogs Plugin |
||||
# |
||||
# Copyright (C)2013-2014 the OpenProject Foundation (OPF) |
||||
# Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda |
||||
# Copyright (C)2010-2011 friflaj |
||||
# Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns |
||||
# Copyright (C)2009-2010 Mark Maglana |
||||
# Copyright (C)2009 Joe Heck, Nate Lowrie |
||||
# |
||||
# This program is free software; you can redistribute it and/or modify it under |
||||
# the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject Backlogs is a derivative work based on ChiliProject Backlogs. |
||||
# The copyright follows: |
||||
# Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj |
||||
# Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
FactoryBot.define do |
||||
factory :bcf_viewpoint_attachment, class: Attachment do |
||||
description "snapshot" |
||||
filename "snapshot.jpg" |
||||
content_type "image/jpeg" |
||||
author User.current |
||||
file do |
||||
OpenProject::Files.create_uploaded_file name: filename, |
||||
content_type: content_type, |
||||
binary: true |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,42 @@ |
||||
#-- copyright |
||||
# OpenProject Backlogs Plugin |
||||
# |
||||
# Copyright (C)2013-2014 the OpenProject Foundation (OPF) |
||||
# Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda |
||||
# Copyright (C)2010-2011 friflaj |
||||
# Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns |
||||
# Copyright (C)2009-2010 Mark Maglana |
||||
# Copyright (C)2009 Joe Heck, Nate Lowrie |
||||
# |
||||
# This program is free software; you can redistribute it and/or modify it under |
||||
# the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject Backlogs is a derivative work based on ChiliProject Backlogs. |
||||
# The copyright follows: |
||||
# Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj |
||||
# Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
FactoryBot.define do |
||||
factory :bcf_viewpoint, class: ::Bcf::Viewpoint do |
||||
after(:create) do |viewpoint| |
||||
create(:bcf_viewpoint_attachment, container: viewpoint) |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue