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

Custom authority connector for Airtable #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mMoliere
Copy link

Modified Airtable version of connector to enable custom URI in TEI Publisher

Modified Airtable version of connector to enable custom URI in TEI Publisher
return '';
}

export class Airtable extends Registry {
Copy link
Member

@wolfgangmm wolfgangmm Jun 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this class be named differently to avoid conflicts with the existing Airtable class? The tests fail due to this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could streamline this by making the ID to use configurable. I'll make a proposal tomorrow...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I would propose the following: instead of creating a new connector, change the existing airtable connector to accept an additional attribute use-as-key in the config element. Right now I can't test this myself, but I'd say the required changes would be:

  1. in line 35 add another variable this.idField = configElem.getAttribute('use-as-key');
  2. in line 101, change the id property to id: this.idField ? record.get(this.idField) : record.id,
  3. in line 120, we also need to take into account that the filterByFormula expression needs to be different, so replace with filterByFormula: this.idField ? ${this.idField}='${key}':RECORD_ID()='${key}'`
  4. then again in line 160 change the id property: id: this.idField ? record.get(this.idField) : record.id,

Could you try this and report if it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants