Skip to content

Commit db40b84

Browse files
committed
Merge branch '1' into 2
2 parents 9b5935f + f66f036 commit db40b84

File tree

4 files changed

+1794
-1646
lines changed

4 files changed

+1794
-1646
lines changed

client/dist/js/legacy.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/legacy/TestReactFormBuilder.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/* global window */
2-
import jQuery from 'jquery';
1+
/* global window, jQuery */
32
import React from 'react';
43
import { createRoot } from 'react-dom/client';
54
import { Provider } from 'react-redux';

code/Company.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
use SilverStripe\Forms\ReadonlyField;
1717
use SilverStripe\Forms\Validation\CompositeValidator;
1818
use SilverStripe\Forms\Validation\RequiredFieldsValidator;
19+
use SilverStripe\AssetAdmin\Controller\AssetAdmin;
20+
use SilverStripe\Assets\File;
21+
use SilverStripe\Forms\LiteralField;
1922

2023
/**
2124
*
@@ -98,12 +101,15 @@ class Company extends DataObject
98101
public function getCMSFields()
99102
{
100103
$this->beforeUpdateCMSFields(function ($fields) {
104+
$file = File::get()->first();
105+
$fileUrl = $file?->CMSEditLink() ?? AssetAdmin::singleton()->Link();
101106
$uploadField = UploadField::create('GroupPhotos');
102107
$uploadField->setAllowedFileCategories('image');
103108
$fields->addFieldsToTab('Root.Main', [
104109
ReadonlyField::create('IntentionallyEmpty'),
105110
ReadonlyField::create('ReadonlyWithValue', null, '<i>Read-only value</i>'),
106111
$uploadField,
112+
LiteralField::create('fileLink', '<a href="' . $fileUrl . '">behat link to file</a>'),
107113
]);
108114
});
109115
return parent::getCMSFields();

0 commit comments

Comments
 (0)