Skip to content

Commit

Permalink
Merge pull request #455 from lblod/lmb-182-can-modify-custom-field
Browse files Browse the repository at this point in the history
Lmb 182  | can modify custom field
  • Loading branch information
JonasVanHoof authored Jan 15, 2025
2 parents e7c6d95 + bc812b6 commit 14ba654
Show file tree
Hide file tree
Showing 14 changed files with 507 additions and 299 deletions.
20 changes: 18 additions & 2 deletions app/components/editable-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
@onSave={{@onSave}}
@formInitialized={{@formInitialized}}
@customHistoryMessage={{@customHistoryMessage}}
@buildMetaTtl={{@buildMetaTtl}}
@saveTitle={{@saveTitle}}
>
{{#if this.editableFormsEnabled}}
<GenerateCustomFieldButton
<AuButton
@skin="link"
@icon="plus"
{{on "click" (fn (mut this.showModal) true)}}
class="au-u-padding-left-none au-u-margin-bottom"
>
Voeg een veld toe
</AuButton>

{{yield}}

<RdfInputFields::CrudCustomFieldModal
@isCreating={{true}}
@showModal={{this.showModal}}
@onCloseModal={{this.onFormUpdate}}
@form={{this.currentForm}}
@onUpdate={{this.onFormUpdate}}
@field={{@field}}
/>
{{/if}}
{{yield}}
Expand Down
10 changes: 10 additions & 0 deletions app/components/editable-form.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Component from '@glimmer/component';

import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { service } from '@ember/service';

import { provide } from 'ember-provide-consume-context';

export default class EditableFormComponent extends Component {
Expand All @@ -12,6 +14,8 @@ export default class EditableFormComponent extends Component {
@service semanticFormRepository;
@service features;

@tracked showModal;

constructor() {
super(...arguments);
this.baseFormId = this.args.form.id;
Expand All @@ -27,6 +31,7 @@ export default class EditableFormComponent extends Component {
);
this.currentForm = form;
this.loading = false;
this.showModal = false;
}

get editableFormsEnabled() {
Expand All @@ -38,4 +43,9 @@ export default class EditableFormComponent extends Component {
onFormUpdate() {
this.updateForm();
}

@provide('form-definition')
get formDefinition() {
return this.currentForm;
}
}
91 changes: 0 additions & 91 deletions app/components/generate-custom-field-button.hbs

This file was deleted.

136 changes: 0 additions & 136 deletions app/components/generate-custom-field-button.js

This file was deleted.

Loading

0 comments on commit 14ba654

Please sign in to comment.