-
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.
[Op#50737] Convert new storage page to primer design (#14053)
- Loading branch information
Showing
68 changed files
with
2,223 additions
and
455 deletions.
There are no files selected for viewing
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
58 changes: 58 additions & 0 deletions
58
frontend/src/stimulus/controllers/dynamic/storages/select-provider-form.controller.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,58 @@ | ||
/* | ||
* -- copyright | ||
* OpenProject is an open source project management software. | ||
* Copyright (C) 2023 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 { Controller } from '@hotwired/stimulus'; | ||
|
||
export default class SelectProviderFormController extends Controller { | ||
static targets = [ | ||
'providerForm', | ||
'providerSelect', | ||
]; | ||
|
||
declare readonly providerFormTarget:HTMLFormElement; | ||
declare readonly providerSelectTarget:HTMLSelectElement; | ||
|
||
connect():void { | ||
// On first load if providerTypeValue is already selected, show the provider form | ||
this.fetchProviderTypeForm(this.providerSelectTarget.value); | ||
} | ||
|
||
public showProviderForm(evt:Event):void { | ||
this.fetchProviderTypeForm((evt.target as HTMLSelectElement).value); | ||
} | ||
|
||
fetchProviderTypeForm(providerTypeValue:string):void { | ||
if (providerTypeValue === '') { | ||
return; | ||
} | ||
|
||
this.providerFormTarget.requestSubmit(); | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
...p/components/storages/admin/automatically_managed_project_folders_info_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,32 @@ | ||
<%= | ||
grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid| | ||
grid.with_area(:item, tag: :div, mr: 3) do | ||
concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-managed-project-folders-label')) { I18n.t('storages.file_storage_view.automatically_managed_folders') }) | ||
concat(automatically_managed_project_folders_status_label) | ||
end | ||
|
||
grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-automatically-managed-project-folders-description') do | ||
render(Primer::Beta::Truncate.new) { I18n.t('storages.page_titles.managed_project_folders.subtitle_short') } | ||
end | ||
|
||
if editable_storage? | ||
grid.with_area(:"icon-button", tag: :div, color: :muted) do | ||
flex_layout(justify_content: :flex_end) do |icons_container| | ||
icons_container.with_column do | ||
render( | ||
Primer::Beta::IconButton.new( | ||
icon: :pencil, | ||
tag: :a, | ||
href: edit_button_path, | ||
scheme: :invisible, | ||
aria: { label: I18n.t('storages.label_edit_storage_automatically_managed_folders') }, | ||
test_selector: 'storage-edit-automatically-managed-project-folders-button', | ||
data: { turbo_stream: true } | ||
) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
%> |
46 changes: 46 additions & 0 deletions
46
...ges/app/components/storages/admin/automatically_managed_project_folders_info_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,46 @@ | ||
# frozen_string_literal: true | ||
|
||
#-- copyright | ||
# OpenProject is an open source project management software. | ||
# Copyright (C) 2012-2023 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. | ||
#++ | ||
# | ||
module Storages::Admin | ||
class AutomaticallyManagedProjectFoldersInfoComponent < ApplicationComponent | ||
include OpPrimer::ComponentHelpers | ||
include StorageViewInformation | ||
|
||
alias_method :storage, :model | ||
|
||
def edit_button_path | ||
if storage.automatic_management_unspecified? | ||
new_admin_settings_storage_automatically_managed_project_folders_path(storage) | ||
else | ||
edit_admin_settings_storage_automatically_managed_project_folders_path(storage) | ||
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
43 changes: 38 additions & 5 deletions
43
modules/storages/app/components/storages/admin/forms/general_info_form_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
Oops, something went wrong.