Skip to content

Commit

Permalink
Merge branch 'release-2024-fall' into bugfix/FOUR-19681
Browse files Browse the repository at this point in the history
  • Loading branch information
CarliPinell authored Nov 1, 2024
2 parents dc2f509 + 7b5d5d7 commit 4d344c0
Show file tree
Hide file tree
Showing 26 changed files with 2,072 additions and 71 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@processmaker/screen-builder",
"version": "3.0.2",
"version": "3.0.3",
"scripts": {
"dev": "VITE_COVERAGE=true vite",
"build": "vite build",
Expand Down Expand Up @@ -57,7 +57,7 @@
"@fortawesome/fontawesome-free": "^5.6.1",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@panter/vue-i18next": "^0.15.2",
"@processmaker/vue-form-elements": "0.61.0",
"@processmaker/vue-form-elements": "0.61.1",
"@processmaker/vue-multiselect": "2.3.0",
"@storybook/addon-essentials": "^7.6.13",
"@storybook/addon-interactions": "^7.6.13",
Expand Down Expand Up @@ -116,7 +116,7 @@
},
"peerDependencies": {
"@panter/vue-i18next": "^0.15.0",
"@processmaker/vue-form-elements": "0.61.0",
"@processmaker/vue-form-elements": "0.61.1",
"i18next": "^15.0.8",
"vue": "^2.6.12",
"vuex": "^3.1.1"
Expand Down
6 changes: 4 additions & 2 deletions src/components/ScreenTemplateCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
<hr class="card-divider" />
<b-card-body class="p-1">
<div class="template-details">
<span class="template-name d-block pt-1">{{ template.name }}</span>
<span class="template-name d-block pt-1">{{
truncateText(template.name, 45)
}}</span>
<span class="template-description d-block">{{
truncateText(template.description, 100)
truncateText(template.description, 60)
}}</span>
</div>
<b-collapse v-model="isApplyOptionsActive">
Expand Down
26 changes: 26 additions & 0 deletions src/components/editor/loop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
class="mr-2 ml-1"
/>
{{ element.config.name || $t("Variable Name") }}
<b-badge
v-if="isInClipboard(items[index])"
data-cy="copied-badge"
class="m-2 custom-badge"
pill
>
<i class="far fa-check-circle"></i>
<span class="pl-2">{{ $t('Copied')}}</span>
</b-badge>
<div class="ml-auto">
<clipboard-button
:index="index"
Expand Down Expand Up @@ -91,6 +100,15 @@
class="mr-2 ml-1"
/>
{{ element.config.name || $t("Variable Name") }}
<b-badge
v-if="isInClipboard(items[index])"
data-cy="copied-badge"
class="m-2 custom-badge"
pill
>
<i class="far fa-check-circle"></i>
<span class="pl-2">{{ $t('Copied')}}</span>
</b-badge>
<div class="ml-auto">
<clipboard-button
:index="index"
Expand Down Expand Up @@ -334,4 +352,12 @@ export default {
box-shadow: 0 0 0 13px rgba(0, 0, 0, 0);
}
}
.custom-badge {
background-color: #D1F4D7 !important;
color: #06723A !important;
padding: 0.5rem 0.75rem;
border-radius: 8px;
font-weight: 500;
font-size: 14px;
}
</style>
26 changes: 26 additions & 0 deletions src/components/editor/multi-column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
class="mr-2 ml-1"
/>
{{ element.config.name || $t("Variable Name") }}
<b-badge
v-if="isInClipboard(element)"
data-cy="copied-badge"
class="m-2 custom-badge"
pill
>
<i class="far fa-check-circle"></i>
<span class="pl-2">{{ $t('Copied')}}</span>
</b-badge>
<div class="ml-auto">
<clipboard-button
:index="index"
Expand Down Expand Up @@ -108,6 +117,15 @@
class="mr-2 ml-1"
/>
{{ element.config.name || $t("Variable Name") }}
<b-badge
v-if="isInClipboard(element)"
data-cy="copied-badge"
class="m-2 custom-badge"
pill
>
<i class="far fa-check-circle"></i>
<span class="pl-2">{{ $t('Copied')}}</span>
</b-badge>
<div class="ml-auto">
<clipboard-button
:index="index"
Expand Down Expand Up @@ -375,4 +393,12 @@ export default {
box-shadow: 0 0 0 13px rgba(0, 0, 0, 0);
}
}
.custom-badge {
background-color: #D1F4D7 !important;
color: #06723A !important;
padding: 0.5rem 0.75rem;
border-radius: 8px;
font-weight: 500;
font-size: 14px;
}
</style>
3 changes: 3 additions & 0 deletions src/components/inspector/collection-data-source.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@
},
deep: true
},
dataSelectionOptions() {
this.singleField = null;
}
},
};
</script>
10 changes: 9 additions & 1 deletion src/components/inspector/collection-designer-mode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
],
};
},
mounted () {
this.callBuilder(this.designerOptions);
},
computed: {
options() {
return Object.fromEntries(
Expand All @@ -56,10 +59,15 @@
options: {
handler() {
this.$emit("input", this.options);
this.$root.$emit("style-mode", this.options.designerOptions);
this.callBuilder(this.options.designerOptions);
},
deep: true
},
},
methods: {
callBuilder(option) {
this.$root.$emit("style-mode", option);
}
}
};
</script>
2 changes: 1 addition & 1 deletion src/components/inspector/encrypted-config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div v-if="settings.encrypted">
<select-user-group
:key="componentKey"
:label="$t('Users/Groups to View')"
:label="$t('Users/Groups to View Encrypted Fields')"
v-model="settings.assignments"
:multiple="true"
@input="emitChanges"
Expand Down
32 changes: 31 additions & 1 deletion src/components/renderer/file-upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ export default {
this.removeDefaultClasses();
},
mounted() {
if (this.value) {
this.fetchFiles();
}
this.$root.$on('set-upload-data-name',
(recordList, index, id) => this.listenRecordList(recordList, index, id));
Expand Down Expand Up @@ -597,6 +601,10 @@ export default {
}
if (displayMessage.length > 0) {
const data = JSON.parse(displayMessage);
if (data.message) {
displayMessage = data.message;
}
window.ProcessMaker.alert(`${this.$t('File Upload Error:')} ${displayMessage}`, 'danger');
}
Expand Down Expand Up @@ -699,7 +707,29 @@ export default {
},
cfSkipFileUpload() {
this.$emit('cf-skip-file-upload');
}
},
async fetchFiles() {
const fileIds = Array.isArray(this.value) ? this.value : [this.value];
const fetchPromises = fileIds.map(async (file) => {
const id = file?.file ?? file;
const endpoint = `files/${id}`;
try {
const response = await ProcessMaker.apiClient.get(endpoint);
if (response?.data) {
const fileExists = this.files.some(existingFile => existingFile.id === response.data.id);
// Check if the file already exists in the list before adding it.
if (!fileExists) {
this.files.push(response.data);
}
}
} catch (error) {
console.error(`Failed to fetch file ${id}`, error);
}
});
return await Promise.all(fetchPromises);
},
},
};
</script>
Expand Down
9 changes: 5 additions & 4 deletions src/components/renderer/form-collection-record-control.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<script>
import VueFormRenderer from "../vue-form-renderer.vue";
import CollectionRecordsList from "../inspector/collection-records-list.vue";
import _ from 'lodash';
const globalObject = typeof window === "undefined" ? global : window;
Expand Down Expand Up @@ -179,12 +180,12 @@ export default {
this.selDisplayMode === "View" ? viewScreen : editScreen;
this.loadScreen(this.screenCollectionId);
//This section validates if Collection has draft data
if(this.taskDraft?.draft?.data == null || this.taskDraft.draft.data === '') {
this.localData = respData;
}else{
this.localData = this.taskDraft.draft.data;
this.localData = _.merge({}, respData, this.taskDraft.draft.data);
}
})
Expand Down Expand Up @@ -212,9 +213,9 @@ export default {
},
record(record) {
this.hasMustache = false;
if (record && !isNaN(record) && record > 0 && this.collection) {
if (record && !isNaN(record) && record > 0 && this.collection.collectionId) {
this.selRecordId = record;
this.loadRecordCollection(this.selCollectionId, record, this.collectionmode);
this.loadRecordCollection(this.collection.collectionId, record, this.selDisplayMode);
} else {
if (this.isMustache(record)) {
this.callbackRecord();
Expand Down
4 changes: 2 additions & 2 deletions src/components/renderer/form-collection-view-control.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ export default {
},
record(record) {
this.hasMustache = false;
if (record && !isNaN(record) && record > 0 && this.collection) {
if (record && !isNaN(record) && record > 0 && this.collection.collectionId) {
this.selRecordId = record;
this.loadRecordCollection(this.selCollectionId, record, this.collectionmode);
this.loadRecordCollection(this.collection.collectionId, record, this.collectionmode);
} else {
if (this.isMustache(record)) {
this.callbackRecord();
Expand Down
12 changes: 7 additions & 5 deletions src/components/renderer/form-masked-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<input
v-else
v-model="localValue"
v-bind="componentConfig"
v-bind="componentConfigEncField"
v-uni-id="name"
:name="name"
class="form-control"
Expand Down Expand Up @@ -231,6 +231,7 @@ export default {
labelBtn: '',
errorEncryptedField: '',
concealExecuted: false,
componentConfigEncField: null,
};
},
computed: {
Expand Down Expand Up @@ -289,17 +290,18 @@ export default {
* "encrypted" attribute is enabled
*/
if (this.encryptedConfig?.encrypted) {
this.componentConfigEncField = JSON.parse(JSON.stringify(this.componentConfig));
if (uuidValidate(this.localValue)) {
this.inputType = "password";
this.iconBtn = "fas fa-eye";
this.labelBtn = this.$t("Reveal");
this.concealExecuted = true;
this.componentConfig.readonly = true;
this.componentConfigEncField.readonly = true;
} else {
this.inputType = "text";
this.iconBtn = "fas fa-eye-slash";
this.labelBtn = this.$t("Conceal");
this.componentConfig.readonly = false;
this.componentConfigEncField.readonly = this.componentConfig.readonly;
}
} else {
this.inputType = this.dataType;
Expand Down Expand Up @@ -381,7 +383,7 @@ export default {
this.iconBtn = "fas fa-eye";
this.labelBtn = this.$t("Reveal");
this.concealExecuted = true;
this.componentConfig.readonly = true;
this.componentConfigEncField.readonly = true;
this.errorEncryptedField = "";
// Assign uuid from encrypted data
Expand All @@ -392,7 +394,7 @@ export default {
this.inputType = this.dataType;
this.iconBtn = "fas fa-eye-slash";
this.labelBtn = this.$t("Conceal");
this.componentConfig.readonly = false;
this.componentConfigEncField.readonly = this.componentConfig.readonly;
// Assign value decrypted
this.localValue = decryptedValue;
Expand Down
Loading

0 comments on commit 4d344c0

Please sign in to comment.