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

Fyr 22 => develop #1887

Merged
merged 9 commits into from
Feb 3, 2023
1 change: 1 addition & 0 deletions src/assets/css/style-override.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
border-radius: 5px;
width: 100%;
background: #fff;
border: 1px solid #ced4da;
}
.datetime-picker-main {
z-index: 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,10 @@ input.largerCheckbox {

<div class="row g-3 align-items-center w-100 mt-4">
<div class="col-lg-3 col-md-3 text-left">
<tool-tips infoMessage="Url of banner image (Maximum size 400kb)"></tool-tips><label for="logoUrl" class="col-form-label">Banner
URL<span style="color: red">*</span>: </label>
<tool-tips infoMessage="Banner image (Maximum size 400kb)"></tool-tips><label for="logoUrl" class="col-form-label">Banner<span style="color: red">*</span>: </label>
</div>
<div class="col-lg-9 col-md-9 px-0" style="display: flex;">
<input v-model="project.logoUrl" type="text" placeholder="of aspect ratio 16:9 or 4:3 (Maximum size 400kb)" id="logoUrl" :disabled="isDisabled"
<input v-model="project.logoUrl" type="text" placeholder="Image of aspect ratio 16:9 or 4:3 (Maximum size 400kb)" id="logoUrl" :disabled="true"
class="form-control w-100">
<input type="file" ref="file" accept="image/jpeg, image/png" hidden>

Expand Down Expand Up @@ -266,7 +265,6 @@ export default {
},
data() {
return {
isDisabled:false,
idx: null,
flash: null,
isCreate: true,
Expand Down Expand Up @@ -349,7 +347,6 @@ export default {
}
image.width=imageWidth
image.height=imageHeight
this.isDisabled=true
this.project.logoUrl=dataUrl

}
Expand Down
11 changes: 4 additions & 7 deletions src/components/participant/ActionInputs/InputDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
:time-picker="true"
:disabled="done"
:required="data.isManadatory"
></date-time-picker>
</div>
></date-time-picker>
</b-col>
</b-row>
<b-row v-if="!done">
Expand All @@ -52,7 +51,6 @@
</style>

<script>
import config from "../../../config.js";
import dayjs from "dayjs"
import eventBus from "../../../eventBus.js";
import { isDate } from "../../../mixins/fieldValidationMixin";
Expand Down Expand Up @@ -80,8 +78,8 @@ export default {
computed:{
buttonThemeCss() {
return {
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor
'--button-bg-color': this.themeData.buttonBGColor,
'--button-text-color': this.themeData.buttonTextColor,
}
}
},
Expand All @@ -94,8 +92,7 @@ computed:{
mounted() {
if(this.data.value !== "" && dayjs(this.data.value).format('YYYY-MM-DD')){
this.data.value = dayjs(this.data.value).format(
"YYYY-MM-DD HH:mm:ss"
);
"YYYY-MM-DD HH:mm:ss")
}
eventBus.$on(`disableInput${this.data._id}`, this.disableInput)
},
Expand Down
10 changes: 6 additions & 4 deletions src/views/admin/Events.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1038,14 +1038,14 @@ export default {
this.project.projectName + " copy " + Date.now();
this.project.slug = "";
this.project.investorsCount = 0;
let date = new Date()
let date = new Date(project.toDate)
date.setDate(date.getDate() + 1)
project.toDate = date.toISOString()
}
this.project.fromDate = dayjs(project.fromDate).format(
"YYYY-MM-DD hh:mm:ss"
"YYYY-MM-DD HH:mm:ss"
);
this.project.toDate = dayjs(project.toDate).format("YYYY-MM-DD hh:mm:ss");
this.project.toDate = dayjs(project.toDate).format("YYYY-MM-DD HH:mm:ss");

// CHECK IF TELEGRAM AND TWITTER EXISTS AND UPDATE THE DATA STRUCTURE
this.project.social = {
Expand Down Expand Up @@ -1358,7 +1358,8 @@ export default {
if (this.isProjectEditing) {
method = "PUT";
}
const toDate= this.project.toDate
const toDate= this.project.toDate
const fromDate = this.project.fromDate
this.project.toDate = new Date(this.project.toDate).toISOString();
this.project.fromDate = new Date(this.project.fromDate).toISOString();
this.project.themeColor = this.themeColor.trim().length
Expand All @@ -1381,6 +1382,7 @@ export default {
header: headers,
});
this.project.toDate=toDate;
this.project.fromDate = fromDate

/// Refreshing the temporary list other wise duplicate actions were showing
// see issue #1346 & #1389
Expand Down
12 changes: 10 additions & 2 deletions src/views/admin/Participants.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ import HfSearchBox from "../../components/elements/HfSearchBox.vue"
import HfPopUp from "../../components/elements/HfPopUp.vue"
import HfSelectDropDown from "../../components/elements/HfSelectDropDown.vue";
import HfPageMessage from '../../components/elements/HfPageMessage.vue';
import dayjs from "dayjs"
export default {
name: "Investor",
components: {
Expand Down Expand Up @@ -440,7 +441,6 @@ computed:{
this.$root.$emit('modal-show')
},
parseActionValue(action) {
console.log(action)
switch (action.type) {
case "DISCORD_JOIN":
case "TELEGRAM_JOIN":
Expand Down Expand Up @@ -489,7 +489,15 @@ computed:{
valueToShow[attr.fieldName] = attr.fieldValue
});
return JSON.stringify(valueToShow);
}
}
case "INPUT_DATE":{
let dateToConvert;
if(action.value !== "" && dayjs(action.value).format('YYYY-MM-DD'))
{
dateToConvert = dayjs(action.value).format("dddd MMMM-DD YYYY HH:mm")
}
return dateToConvert
}
default:
return action.value;
}
Expand Down
51 changes: 47 additions & 4 deletions src/views/admin/setting/OrgSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@
</div>
<div class="row g-3 align-items-center w-100 mt-4">
<div class="text-left col-lg-8 col-md-8 text-left">
<tool-tips infoMessage="Enter logo path"></tool-tips><label for="name"
class="col-form-label">Logo Path:
<tool-tips infoMessage="Logo (Maximum size 400kb)"></tool-tips><label for="name"
class="col-form-label">Logo:
</label>
</div>
<div class="col-lg-4 col-md-4 px-0">
<input type="text" placeholder="https://app.fyre.hypersign.id/img/Fyre_Small.e094f135.png" id="name" v-model="orgSetting.logoPath" class="form-control w-100" />
<div class="col-lg-4 col-md-4 px-0" style="display:flex;">
<input type="text" placeholder="Aspect ratio 16:9 or 4:3 (Maximum size 400kb)" id="name" :disabled="true" class="form-control w-100" />
<input type="file" ref="file" accept="image/jpeg, image/png" hidden>

<hf-buttons name="" @executeAction="fileUpload()"
customClass="btn button-theme slight-left-margin-5 " iconClass="fa fa-upload"></hf-buttons>
</div>
</div>
<div class="row g-3 align-items-center w-100 mt-4" style="float:right; padding-right: 1.5%">
Expand Down Expand Up @@ -224,6 +228,42 @@ export default {
}
},
methods: {
fileUpload() {
let fileInputElement = this.$refs.file
fileInputElement.click()
fileInputElement.addEventListener("change", (event) => {
let chosenFile
if(event.dataTransfer===undefined){
chosenFile= event.target.files[0];

}else{
chosenFile=event.dataTransfer.files[0]
}
// Do something with the chosen file
if (chosenFile.size>config.banner.bannersize){
return this.notifyErr(`File size should be smaller than ${config.banner.bannersize/1000}kb`)
}
const reader=new FileReader()
let dataUrl
reader.readAsDataURL(chosenFile)
reader.onload=e=>{
dataUrl=e.target.result
let image= new Image()
image.src=dataUrl
image.onload=()=>{
let imageHeight = image.naturalHeight;
let imageWidth = image.naturalWidth;
const aspect_ratio=imageWidth/imageHeight
if(aspect_ratio!==4/3 || aspect_ratio!==16/9){
this.notifyWarning(`Ideal banner aspect ratio sholud be 16:9 or 4:3 for better rendering`)
}
image.width=imageWidth
image.height=imageHeight
this.orgSetting.logoPath=dataUrl
}
}
});
},
checkIfValidHex(hex){

if(hex){
Expand Down Expand Up @@ -312,5 +352,8 @@ export default {
color: var(--button-text-color);
border: 0;
}
.slight-left-margin-5 {
margin-left: 5px;
}

</style>