NUDelta / dtr-web

Northwestern's Design, Technology, and Research (DTR) Program Website
http://dtr.northwestern.edu/
1 stars 0 forks source link

use images stored in airtable instead of cdn link #48

Closed kapil1garg closed 2 years ago

kapil1garg commented 2 years ago

Airtable should have enough storage space for us to allow people to upload profile/sig/proj images directly to airtable instead of to our bucket storage. Once the data is migrated, all references to images will need to change like the following example for a person's profile image:

let person = {
  name: 'Kapil Garg',
  title: 'Ph.D. Student',
  role: 'Ph.D. Student',
  status: 'Active',
  photo_url: 'https://delta-lab.nyc3.cdn.digitaloceanspaces.com/dtr/dtr-web/people/kapil-garg.png',
  photo_url_new: [
    {
      id: 'atts90Wpv8AteYs0w',
      width: 500,
      height: 500,
      url: 'https://dl.airtable.com/.attachments/5e35ed6be5bbfafdf42b277e6a8ce64e/bfc74cd4/kapil-garg_profile-pic.png',
      filename: 'kapil-garg_profile-pic.png',
      size: 613390,
      type: 'image/png',
      thumbnails: [Object]
    }
  ],
  bio: '...'
}

So, instead of using person.photo_url for the image, we instead would use person.photo_url_new[0].url (note that in production, the field will be called photo_url.