Hitesh Pattanayak 576c9f6b53
handles single & multiple values for metadata columns (#5121)
handles single & multiple values for metadata columns

Similar to `Hyperlink` and `Column` columns, `Metadata` column too is unrecognizable from GRAPH API response. Hence identifying from the field column names.

`Metadata` fields are like tags. A `Metadata` fields can be configured to hold multiple values/tags

**Original List with `Metadata` column (Department) with single value/tag**:
![Metadata-List](https://github.com/alcionai/corso/assets/48874082/0b913a2a-46d5-4d9c-83f9-69a5236b1024)

**Restored List with `Metadata` column with single value/tag**:
![Restored-Metadata-List](https://github.com/alcionai/corso/assets/48874082/9420012b-345c-4fac-90c3-c0d421b2edfb)

**Original List with `Metadata` column (Department) with multiple value/tag**:
![Metadata-List-Multi](https://github.com/alcionai/corso/assets/48874082/054ef4a1-c46e-48ba-b410-a95b540cde33)

**Restored List with `Metadata` column with multiple value/tag**:
![Restored-Multi-Metadata-List](https://github.com/alcionai/corso/assets/48874082/ef6c904b-e431-4a85-9ef2-f08bcf8e21e4)


#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)
#5084 
#5108 

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x]  Unit test
- [x] 💚 E2E
2024-01-30 06:35:33 +00:00

110 lines
2.9 KiB
Go

package api
import (
"github.com/alcionai/corso/src/internal/common/keys"
)
// Well knwon Folder Names
// Mail Definitions: https://docs.microsoft.com/en-us/graph/api/resources/mailfolder?view=graph-rest-1.0
const (
DefaultCalendar = "Calendar"
DefaultContacts = "Contacts"
MailInbox = "Inbox"
MsgFolderRoot = "msgfolderroot"
// Kiota JSON invalid JSON error message.
invalidJSON = "invalid json type"
)
// ************** Lists starts *****************
const (
AttachmentsColumnName = "Attachments"
EditColumnName = "Edit"
ContentTypeColumnName = "ContentType"
CreatedColumnName = "Created"
ModifiedColumnName = "Modified"
AuthorLookupIDColumnName = "AuthorLookupId"
EditorLookupIDColumnName = "EditorLookupId"
AppAuthorLookupIDColumnName = "AppAuthorLookupId"
TitleColumnName = "Title"
ContentTypeColumnDisplayName = "Content Type"
AddressKey = "address"
CoordinatesKey = "coordinates"
DisplayNameKey = "displayName"
LocationURIKey = "locationUri"
UniqueIDKey = "uniqueId"
// entries that are nested within a second layer
CityKey = "city"
CountryKey = "countryOrRegion"
PostalCodeKey = "postalCode"
StateKey = "state"
StreetKey = "street"
LatitudeKey = "latitude"
LongitudeKey = "longitude"
CountryOrRegionFN = "CountryOrRegion"
StateFN = "State"
CityFN = "City"
PostalCodeFN = "PostalCode"
StreetFN = "Street"
GeoLocFN = "GeoLoc"
DispNameFN = "DispName"
HyperlinkDescriptionKey = "Description"
HyperlinkURLKey = "Url"
LookupIDKey = "LookupId"
LookupValueKey = "LookupValue"
PersonEmailKey = "Email"
MetadataLabelKey = "Label"
MetadataTermGUIDKey = "TermGuid"
MetadataWssIDKey = "WssId"
LinkTitleFieldNamePart = "LinkTitle"
ChildCountFieldNamePart = "ChildCount"
LookupIDFieldNamePart = "LookupId"
ODataTypeFieldNamePart = "@odata.type"
ODataTypeFieldNameStringVal = "Collection(Edm.String)"
ODataTypeFieldNameIntVal = "Collection(Edm.Int32)"
ReadOnlyOrHiddenFieldNamePrefix = "_"
DescoratorFieldNamePrefix = "@"
WebTemplateExtensionsListTemplate = "webTemplateExtensionsList"
// This issue https://github.com/alcionai/corso/issues/4932
// tracks to backup/restore supportability of `documentLibrary` templated lists
DocumentLibraryListTemplate = "documentLibrary"
SharingLinksListTemplate = "sharingLinks"
AccessRequestsListTemplate = "accessRequest"
)
var addressFieldNames = []string{
AddressKey,
CoordinatesKey,
DisplayNameKey,
LocationURIKey,
UniqueIDKey,
}
var legacyColumns = keys.Set{
AttachmentsColumnName: {},
EditColumnName: {},
ContentTypeColumnDisplayName: {},
}
var SkipListTemplates = keys.Set{
WebTemplateExtensionsListTemplate: {},
DocumentLibraryListTemplate: {},
SharingLinksListTemplate: {},
AccessRequestsListTemplate: {},
}
// ************** Lists ends *****************