Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP ui: migrate to react-formule #2878

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

WIP ui: migrate to react-formule #2878

wants to merge 13 commits into from

Conversation

miguelgrc
Copy link
Contributor

@miguelgrc miguelgrc commented Feb 22, 2024

DO NOT MERGE YET (testing in cap-dev)

This PR supersedes #2859

Closes #2688, #2891

@miguelgrc miguelgrc changed the title ui: migrate to react-formule WIP ui: migrate to react-formule Feb 22, 2024
@miguelgrc miguelgrc force-pushed the with-formule branch 3 times, most recently from 294a4c8 to de99133 Compare February 23, 2024 13:40
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.08%. Comparing base (5f2b9fd) to head (189f7e7).
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2878      +/-   ##
==========================================
+ Coverage   75.05%   75.08%   +0.02%     
==========================================
  Files         194      194              
  Lines        7983     7983              
==========================================
+ Hits         5992     5994       +2     
+ Misses       1991     1989       -2     

see 1 file with indirect coverage changes

@miguelgrc miguelgrc force-pushed the with-formule branch 8 times, most recently from 4732167 to f319487 Compare May 10, 2024 10:40
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
}

.__PublishedForm__ {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add in formule? is it needed with new updates on published perview?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact we shouldn't need this anymore since we will replace this view with the published version of fields (for TextArea it will just be a string instead of a disabled TextArea)


const CAPDeposit = ({ data }) => {
const [showModal, setShowModal] = useState(false);

console.log(JSON.stringify(data, null, 2));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

lang="json"
initialValue={JSON.stringify(data, null, 2)}
lint="json"
isEditable={false} // TODO: Change to !isEditable?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add issue for future fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, actually I'll just switch to a CodeViewer here instead since we don't need to edit

pathname.startsWith(CMS_NEW)
? schema.size == 0 && schemaInit()
: getSchema(schema_name, schema_version);
if (schema_name == "new") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add issue to handle this better in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done #2898

const CreateForm = ({ history }) => {
const onFinish = content => {
let { name, description } = content;
const config = { config: { fullname: name } };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add issue to fix structure of data (config, name, schema, etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added it to the same issue #2898

@@ -27,21 +27,7 @@ import {
} from "@ant-design/icons";

import { configSchema } from "../utils/schemaSettings";
import Form from "../../forms/Form";

// const initialStatePermissions = Map({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe leave as documentation

@@ -61,38 +60,42 @@ const Header = ({
const a = document.createElement("a");
const file = new Blob([fileData], { type: "text/json" });
a.href = URL.createObjectURL(file);
a.download = "fileName.json"; //TODO: Should be a proper name
a.download = `${config.toJS().name || "cap-schema"}-export-v${
config.toJS().version
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix since it appends undefined when version doesnt exist

import { schema, uiSchema } from "../utils";
import { DeleteOutlined } from "@ant-design/icons";
import { FormuleForm } from "react-formule";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should update schema/uiSchema to work in notification creation

  • update schema
  • check that pathSuggester field works

// review: { users: [], roles: [] },
// },
// });
import { FormuleForm } from "react-formule";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should update the getSchemaPermissions to return correct (empty?) value when schema is new

@pamfilos
Copy link
Collaborator

bump react-formule version

Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Signed-off-by: Miguel Garcia Garcia <miguel.garcia.garcia@cern.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui: update Form component "transformError" component
3 participants