-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create FullView::CreateComponent for WorkPackages which is now routed…
… from rails instead of Angular
- Loading branch information
Showing
15 changed files
with
168 additions
and
49 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
app/components/work_packages/full_view/create_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<%= helpers.angular_component_tag "opce-wp-full-create", | ||
inputs: { | ||
type: @type, | ||
projectIdentifier: @project.present? ? @project.identifier : nil, | ||
routedFromAngular: false, | ||
} | ||
%> |
17 changes: 17 additions & 0 deletions
17
app/components/work_packages/full_view/create_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module WorkPackages | ||
module FullView | ||
class CreateComponent < ApplicationComponent | ||
include OpPrimer::ComponentHelpers | ||
include OpTurbo::Streamable | ||
|
||
def initialize(type:, project:) | ||
super | ||
|
||
@type = type | ||
@project = project | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<%#-- copyright | ||
OpenProject is an open source project management software. | ||
Copyright (C) the OpenProject GmbH | ||
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 COPYRIGHT and LICENSE files for more details. | ||
++#%> | ||
|
||
<% html_title(t('activerecord.attributes.project.work_packages')) -%> | ||
|
||
<% content_for :sidebar do %> | ||
<%= render partial: 'sidebar' %> | ||
<% end %> | ||
|
||
<% content_for :header_tags do %> | ||
<%= auto_discovery_link_tag(:atom, {query_id: query, format: 'atom', page: nil, key: User.current.rss_key}, title: t(:label_work_package_plural)) %> | ||
<%= auto_discovery_link_tag(:atom, {controller: '/journals', action: 'index', query_id: query, format: 'atom', page: nil, key: User.current.rss_key}, title: t(:label_changes_details)) %> | ||
<% end %> | ||
|
||
<% content_for :content_body do %> | ||
<%= render WorkPackages::FullView::CreateComponent.new(type: params[:type], | ||
project: @project) %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...d/src/app/features/work-packages/routing/wp-full-create/wp-full-create-entry.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//-- copyright | ||
// OpenProject is an open source project management software. | ||
// Copyright (C) the OpenProject GmbH | ||
// | ||
// 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 COPYRIGHT and LICENSE files for more details. | ||
//++ | ||
|
||
import { ChangeDetectionStrategy, Component, ElementRef, Input } from '@angular/core'; | ||
import { | ||
WorkPackageIsolatedQuerySpaceDirective, | ||
} from 'core-app/features/work-packages/directives/query-space/wp-isolated-query-space.directive'; | ||
import { populateInputsFromDataset } from 'core-app/shared/components/dataset-inputs'; | ||
|
||
/** | ||
* An entry component to be rendered by Rails which opens an isolated query space | ||
* for the work package split view | ||
*/ | ||
@Component({ | ||
hostDirectives: [WorkPackageIsolatedQuerySpaceDirective], | ||
template: ` | ||
<wp-new-full-view | ||
[stateParams]="{ type: type, parent_id: parentId, projectPath: projectIdentifier }" | ||
[routedFromAngular]="routedFromAngular" | ||
></wp-new-full-view> | ||
`, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class WorkPackageFullCreateEntryComponent { | ||
@Input() type:string; | ||
@Input() parentId?:string; | ||
@Input() projectIdentifier?:string; | ||
@Input() routedFromAngular:boolean; | ||
|
||
constructor(readonly elementRef:ElementRef) { | ||
populateInputsFromDataset(this); | ||
|
||
document.body.classList.add('router--work-packages-full-create'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters