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

FOUR-15510: [Summer24] Actions By Email V2 #1618

Merged
merged 10 commits into from
Jul 11, 2024
1 change: 1 addition & 0 deletions src/components/accordions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default [
'initiallyChecked',
'screen',
'multipleUpload',
'linkUrl'
],
open: true,
},
Expand Down
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import FormListTable from "./renderer/form-list-table.vue";
import FormAnalyticsChart from "./renderer/form-analytics-chart.vue";
import accordions from "@/components/accordions";
import VariableNameGenerator from "@/components/VariableNameGenerator";
import { LinkButton } from "./renderer";
import "../assets/css/tabs.css";

const rendererComponents = {
Expand Down Expand Up @@ -161,6 +162,7 @@ export default {

Vue.use(Vuex);
Vue.component("FormListTable", FormListTable);
Vue.component("LinkButton", LinkButton);
const store = new Vuex.Store({
modules: {
globalErrorsModule,
Expand Down
1 change: 1 addition & 0 deletions src/components/renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export { default as FormListTable } from "./form-list-table.vue";
export { default as FormAnalyticsChart } from "./form-analytics-chart.vue";
export { default as FormRequests } from "./form-requests.vue";
export { default as FormTasks } from "./form-tasks.vue";
export { default as LinkButton } from "./link-button.vue";
30 changes: 30 additions & 0 deletions src/components/renderer/link-button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div class="form-group">
<a :class="classColor" :href="inputUrlLink"> {{ label }} </a>
</div>
</template>

<script>
export default {
props: [
"variant",
"label",
"event",
"eventData",
"name",
"fieldValue",
"value",
"inputUrlLink"
],
computed: {
classColor() {
return `text-${this.variant}`;
}
}
};
</script>
<style scoped>
a {
text-decoration: underline;
}
</style>
42 changes: 42 additions & 0 deletions src/form-builder-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
BWrapperComponent,
} from '@processmaker/vue-form-elements';
import { dataSourceValues } from '@/components/inspector/data-source-types';
import LinkButton from "./components/renderer/link-button.vue";

import {
bgcolorProperty,
Expand Down Expand Up @@ -990,5 +991,46 @@ export default [
}
]
}
},
{
editorComponent: LinkButton,
editorBinding: 'LinkButton',
rendererComponent: LinkButton,
rendererBinding: "LinkButton",

control: {
popoverContent: "Add an action to submit your form or update a field",
group: 'Content Fields',
order: 6.0,
label: "Link URL",
component: "LinkButton",
"editor-component": "LinkButton",
"editor-control": "LinkButton",
config: {
label: "New Link",
icon: "fas fa-link",
variant: "primary",
event: "link",
},
inspector: [
{
type: 'FormInput',
field: 'label',
config: {
label: 'Label',
helper: 'The label describes the button\'s text',
},
},
{
type: 'FormInput',
field: 'linkUrl',
config: {
label: 'Link URL',
helper: 'Type here the URL link. Mustache syntax is supported.',
},
},
buttonVariantStyleProperty
]
}
}
];
Loading